try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="c3198052-d6a6-41f1-a837-eafdac18ffd8",e._sentryDebugIdIdentifier="sentry-dbid-c3198052-d6a6-41f1-a837-eafdac18ffd8")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5308],{36134:(e,a,r)=>{r.d(a,{X:()=>t});let t=e=>{let[a,r]=e.split("@");if(!a||!r)return e;let t=r.split(".");if(t.length<2)return e;let s=t[0],n=t.slice(1).join(".");return s&&n?"".concat(a.charAt(0).toUpperCase()+a.slice(1),"@").concat(s.charAt(0).toUpperCase()+s.slice(1),".").concat(n):e}},39087:(e,a,r)=>{r.d(a,{Z:()=>s});var t=r(24507);let s=(0,t.createServerReference)("40d202e80d0f9ee58d3426e110cdb23ad9b6938aef",t.callServer,void 0,t.findSourceMapURL,"sendEmail")},44301:(e,a,r)=>{r.d(a,{config:()=>i}),r(45592);var t=r(43998);r(25583),r(32655);let s=t.Ik({NEXT_PUBLIC_SITE_DOMAIN:t.Yj().min(1,"NEXT_PUBLIC_SITE_DOMAIN is required"),NEXT_PUBLIC_SITE_URL:t.Yj().regex(/^https?:\/\/.+/i,"NEXT_PUBLIC_SITE_URL must be a valid URL"),NEXT_PUBLIC_WELCOME_PAGE_URL:t.Yj().regex(/^https?:\/\/.+/i,"NEXT_PUBLIC_WELCOME_PAGE_URL must be a valid URL"),NEXT_PUBLIC_CONVERTKIT_FORM_URL:t.Yj().regex(/^https?:\/\/.+/i,"NEXT_PUBLIC_CONVERTKIT_FORM_URL must be a valid URL"),NEXT_PUBLIC_CONVERTKIT_FORM_ID:t.Yj().min(1,"NEXT_PUBLIC_CONVERTKIT_FORM_ID is required"),NEXT_PUBLIC_WORDPRESS_URL:t.Yj().regex(/^https?:\/\/.+/i,"NEXT_PUBLIC_WORDPRESS_URL must be a valid URL"),NEXT_PUBLIC_RESOURCES_BASE_URL:t.Yj().regex(/^https?:\/\/.+/i,"NEXT_PUBLIC_RESOURCES_BASE_URL must be a valid URL"),NEXT_PUBLIC_CONTACT_EMAIL:t.Yj().regex(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,"NEXT_PUBLIC_CONTACT_EMAIL must be a valid email"),NEXT_PUBLIC_ANALYTICS_CONSENT_ENABLED:t.Yj().optional().transform(e=>"true"===e),NEXT_PUBLIC_ANALYTICS_CONSENT_BANNER_ENABLED:t.Yj().optional().transform(e=>"true"===e)});t.Ik({...s.shape,CONTACT_EMAIL:t.Yj().regex(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,"CONTACT_EMAIL must be a valid email"),EMAIL_FROM_ADDRESS:t.Yj().regex(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,"EMAIL_FROM_ADDRESS must be a valid email"),EMAIL_TO_ADDRESS:t.Yj().regex(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,"EMAIL_TO_ADDRESS must be a valid email"),EMAIL_SUBJECT_PREFIX:t.Yj().min(1,"EMAIL_SUBJECT_PREFIX is required"),RESEND_API:t.Yj().min(1,"RESEND_API is required")});let n=null,i=new Proxy({},{get:(e,a)=>(n||(n=function(){var e,a;{let r=s.parse({NEXT_PUBLIC_SITE_DOMAIN:"luca-dellanna.com",NEXT_PUBLIC_SITE_URL:"https://luca-dellanna.com",NEXT_PUBLIC_WELCOME_PAGE_URL:"https://luca-dellanna.com/welcome",NEXT_PUBLIC_CONVERTKIT_FORM_URL:"https://app.convertkit.com/forms/1862996/subscriptions",NEXT_PUBLIC_CONVERTKIT_FORM_ID:"1862996",NEXT_PUBLIC_WORDPRESS_URL:"https://luca-dellanna.com",NEXT_PUBLIC_RESOURCES_BASE_URL:"https://luca-dellanna.com/wp-content/uploads",NEXT_PUBLIC_CONTACT_EMAIL:"Luca@Luca-Dellanna.com",NEXT_PUBLIC_ANALYTICS_CONSENT_ENABLED:"false",NEXT_PUBLIC_ANALYTICS_CONSENT_BANNER_ENABLED:"false"});return{site:{domain:r.NEXT_PUBLIC_SITE_DOMAIN,url:r.NEXT_PUBLIC_SITE_URL,welcomePage:r.NEXT_PUBLIC_WELCOME_PAGE_URL},convertkit:{formUrl:r.NEXT_PUBLIC_CONVERTKIT_FORM_URL,formId:r.NEXT_PUBLIC_CONVERTKIT_FORM_ID},resources:{wordpressUrl:r.NEXT_PUBLIC_WORDPRESS_URL,baseUrl:r.NEXT_PUBLIC_RESOURCES_BASE_URL},contactEmail:r.NEXT_PUBLIC_CONTACT_EMAIL,analytics:{consentEnabled:null!=(e=r.NEXT_PUBLIC_ANALYTICS_CONSENT_ENABLED)&&e,consentBannerEnabled:null!=(a=r.NEXT_PUBLIC_ANALYTICS_CONSENT_BANNER_ENABLED)&&a}}}}()),n[a])})},45308:(e,a,r)=>{r.r(a),r.d(a,{default:()=>L});var t=r(65183),s=r(24375),n=r(50849),i=r(85386),l=r(92382);function o(e){let{label:a,id:r,type:s="text",placeholder:n,required:i=!1,disabled:o=!1,register:c,error:d,rows:m=4,className:u="",helperText:_,leftContent:E,rightContent:g}=e,N=(0,l.QP)("w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-focus focus:border-focus resize-vertical transition-colors duration-200",d?"border-error":"border-gray-300",E&&"pl-10",g&&"pr-10",u),p=d?"".concat(r,"-error"):void 0,h=_?"".concat(r,"-helper"):void 0;return(0,t.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[a&&(0,t.jsxs)("label",{htmlFor:r,className:"text-sm font-medium text-gray-700",children:[a," ",i&&(0,t.jsx)("span",{className:"text-error","aria-hidden":"true",children:"*"})]}),(0,t.jsxs)("div",{className:"relative w-full",children:[E&&(0,t.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:E}),"textarea"===s?(0,t.jsx)("textarea",{id:r,rows:m,...c,className:N,placeholder:n,"aria-describedby":p||h,"aria-invalid":!!d,disabled:o,"aria-required":i}):(0,t.jsx)("input",{id:r,type:s,...c,className:N,placeholder:n,"aria-describedby":p||h,"aria-invalid":!!d,disabled:o,"aria-required":i}),g&&(0,t.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:g})]}),_&&!d&&(0,t.jsx)("p",{id:h,className:"text-sm text-gray-500",children:_}),d&&(0,t.jsx)("p",{id:p,className:"text-error text-sm",role:"alert",children:d.message})]})}var c=r(44301),d=r(45592),m=r(39087),u=r(56275),_=r(9613),E=r(17212),g=r(39998),N=r(36134),p=r(43998);let h=p.Yj().min(1,"Email is required").regex(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,"Please enter a valid email address").max(254,"Email must be 254 characters or less"),x=p.Yj().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[a-zA-Z\s\-']+$/,"Name can only contain letters, spaces, hyphens, and apostrophes"),I=p.Yj().min(1,"Message is required").max(2e3,"Message must be 2000 characters or less").regex(/^[\s\S]*$/,"Message contains invalid characters"),f=p.ai().min(1,"Rating is required").max(5,"Rating must be between 1 and 5"),C=p.Ik({name:x,email:h,message:I});function L(e){let{title:a,description:r}=e,[l,p]=(0,s.useState)("idle"),{sendEvent:h}=(0,u.s)(),{handleAsyncError:x}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{componentName:a,operationName:r,onError:t,rethrow:n=!1}=e;return{handleAsyncError:(0,s.useCallback)(async(e,s)=>{try{return await e()}catch(i){let e;if(e=(0,d.A)(i)?i:i instanceof Error?i.message.includes("fetch")||i.message.includes("network")?(0,d.tS)("Network connection failed. Please check your internet connection and try again.",{originalError:i.message,...s}):i.message.includes("validation")||i.message.includes("invalid")?(0,d.UL)(i.message,{originalError:i.message,...s}):i.message.includes("server")||i.message.includes("500")?(0,d.ic)("Server error occurred. Please try again later.",{originalError:i.message,...s}):(0,d.go)("An error occurred while processing your request. Please try again.",{originalError:i.message,...s}):(0,d.go)("An unexpected error occurred. Please try again.",{originalError:String(i),...s}),(0,d.A)(e)&&e.isUserFriendly||_.Cp(e,{extra:{componentName:a,operationName:r,context:s,originalError:i},tags:{location:a||"unknown",operation:r||"unknown",errorType:e.name}}),t&&t(e),console.error("Error in ".concat(a||"component"," during ").concat(r||"operation",":"),e),n)throw e;return null}},[a,r,t,n])}}({componentName:"ContactForm",operationName:"form_submission"}),{register:I,handleSubmit:f,reset:L,formState:{errors:T,isSubmitting:b}}=(0,E.mN)({resolver:(0,g.u)(C),mode:"onSubmit",defaultValues:{name:"",email:"",message:""}}),y=(0,s.useCallback)(async e=>{p("idle");let a="success"===await x(async()=>{let a=await (0,m.Z)(e);if("success"!==a)throw(0,d.ic)("Unexpected response from email service");return a},{formData:{name:e.name,email:e.email}});p(a?"success":"error"),a&&L(),h({name:"contact_form_submitted",params:{success:a,form_name:e.name,form_email:e.email}})},[h,x,L]);return"success"===l?(0,t.jsx)(i.m,{maxWidth:"2xl",padding:"none",className:"my-8",children:(0,t.jsxs)("div",{className:"px-4 py-3 rounded-lg bg-success-light border border-green-400",role:"alert","aria-live":"polite",children:[(0,t.jsx)("strong",{className:"font-bold",children:"Thank you!"})," ",(0,t.jsx)("span",{className:"block sm:inline",children:"Your message has been sent successfully. I'll get back to you soon."})]})}):(0,t.jsx)(i.m,{maxWidth:"2xl",padding:"none",className:"my-8",children:(0,t.jsxs)("form",{onSubmit:f(y),className:"p-8 border border-black rounded-lg shadow-lg bg-white","data-component":"ContactForm","aria-label":"Contact form",children:[a&&(0,t.jsx)("h2",{className:"text-2xl font-bold mb-4",children:a}),r&&(0,t.jsx)("p",{className:"text-muted mb-6",children:r}),(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsx)(o,{label:"Name",id:"name",type:"text",placeholder:"Your name (and organization, optionally)",required:!0,register:I("name"),error:T.name,disabled:b}),(0,t.jsx)(o,{label:"Email",id:"email",type:"email",placeholder:"your.email@example.com",required:!0,register:I("email"),error:T.email,disabled:b}),(0,t.jsx)(o,{label:"How can I help you?",id:"message",type:"textarea",placeholder:"Tell me about your project, question, or how I can help...",required:!0,register:I("message"),error:T.message,disabled:b,rows:4}),(0,t.jsx)(n.$,{type:"submit",variant:"primary",size:"lg",loading:b,disabled:b,className:"w-full sm:w-auto","aria-describedby":b?"submitting-status":void 0,children:b?"Submitting...":"Submit"}),b&&(0,t.jsx)("div",{id:"submitting-status",className:"sr-only","aria-live":"polite",children:"Submitting contact form..."}),"error"===l&&(0,t.jsxs)("p",{className:"text-red-600",role:"alert","aria-live":"polite",children:["There was an error submitting the form. Please try emailing"," ",(0,t.jsx)("a",{href:"mailto:".concat(c.config.contactEmail),"aria-label":"Email Luca directly",className:"text-primary hover:underline",children:(0,N.X)(c.config.contactEmail)})," ","directly."]})]})]})})}p.Ik({email:h,source:p.Yj().max(100,"Source must be 100 characters or less").optional(),tags:p.YO(p.Yj().max(50)).max(10,"Maximum 10 tags allowed").optional().default([])}),p.Ik({name:x,email:h,rating:f,comment:p.Yj().min(10,"Comment must be at least 10 characters").max(1e3,"Comment must be 1000 characters or less").regex(/^[\s\S]*$/,"Comment contains invalid characters"),referrals:p.PV([p.Yj(),p.Yj(),p.Yj()]),category:p.k5(["book","course","consulting","coaching","general"]).optional(),allowPublicUse:p.zM().optional().default(!1)})},45592:(e,a,r)=>{r.d(a,{A:()=>_,Qk:()=>E,UL:()=>l,go:()=>d,ic:()=>c,rD:()=>u,tS:()=>o});class t extends Error{constructor(e,a){super(e),this.code="VALIDATION_ERROR",this.isUserFriendly=!0,this.name="ValidationError",this.context=a}}class s extends Error{constructor(e,a){super(e),this.code="NETWORK_ERROR",this.isUserFriendly=!0,this.name="NetworkError",this.context=a}}class n extends Error{constructor(e,a){super(e),this.code="SERVER_ERROR",this.isUserFriendly=!1,this.name="ServerError",this.context=a}}class i extends Error{constructor(e,a){super(e),this.code="USER_ACTION_ERROR",this.isUserFriendly=!0,this.name="UserActionError",this.context=a}}let l=(e,a)=>new t(e,a),o=(e,a)=>new s(e,a),c=(e,a)=>new n(e,a),d=(e,a)=>new i(e,a);class m extends Error{constructor(e,a){super(e),this.code="CONFIGURATION_ERROR",this.isUserFriendly=!1,this.name="ConfigurationError",this.context=a}}let u=(e,a)=>new m(e,a),_=e=>e instanceof Error&&"code"in e&&"isUserFriendly"in e,E=e=>_(e)&&e.isUserFriendly?e.message:e instanceof Error?"Something went wrong. Please try again.":"An unexpected error occurred. Please try again."},56275:(e,a,r)=>{r.d(a,{s:()=>d});let t={writeKey:"KSnFXeF49Irg6ghnCPMa7Y3ZQsYiw6wQ"};var s=r(24375),n=r(44301),i=r(23177),l=r(28681);let o={gaId:"G-MQGC7LJZ33",isProduction:!0};function c(){return o.isProduction&&!!o.gaId&&(!n.config.analytics.consentEnabled||"true"===localStorage.getItem("analytics-consent"))}function d(){let e=(0,l.usePathname)();(0,s.useEffect)(()=>{if(e)try{c()&&(0,i.sendGAEvent)({event:"page_view",page_location:window.location.origin+e,page_title:document.title,page_path:e})}catch(e){console.error("Failed to send automatic page view to Google Analytics:",e)}},[e]);let a=(0,s.useCallback)(e=>{let{name:a,params:r,category:s,action:n,label:l,value:o}=e;try{if(c()){let e={event:a};if(s&&(e.event_category=s),n&&(e.event_action=n),l&&(e.event_label=l),o&&(e.value=o),r)for(let a in r)e[a]=r[a];(0,i.sendGAEvent)(e)}}catch(e){console.error("Failed to send Google Analytics event:",e)}(e=>{let{event:a,properties:r}=e;if(t.writeKey&&window.analytics)try{window.analytics.track(a,r)}catch(e){console.error("Failed to track Segment event:",e)}})({event:a,properties:r})},[]),r=(0,s.useCallback)(e=>{let{userId:a,traits:r}=e;(e=>{let{userId:a,traits:r}=e;if(t.writeKey&&window.analytics)try{window.analytics.identify(a,r)}catch(e){console.error("Failed to identify Segment user:",e)}})({userId:a,traits:r})},[]),n=(0,s.useCallback)((e,a)=>{try{c()&&(0,i.sendGAEvent)({event:"page_view",page_location:e||window.location.href,page_title:a||document.title,page_path:e?new URL(e).pathname:window.location.pathname})}catch(e){console.error("Failed to send page view to Google Analytics:",e)}if(t.writeKey&&window.analytics)try{window.analytics.page()}catch(e){console.error("Failed to track Segment page:",e)}},[]);return{sendEvent:a,identifyUser:r,trackPage:n,setConsent:(0,s.useCallback)(e=>{localStorage.setItem("analytics-consent",e.toString())},[]),getConsent:(0,s.useCallback)(()=>"true"===localStorage.getItem("analytics-consent"),[])}}},85386:(e,a,r)=>{r.d(a,{m:()=>l});var t=r(65183);r(24375);var s=r(92382);let n={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl",full:"max-w-full",none:""},i={none:"",sm:"px-4",md:"px-6",lg:"px-8",xl:"px-12"};function l(e){let{children:a,className:r,as:l="div",maxWidth:o="lg",padding:c="md",centered:d=!0,fluid:m=!1}=e,u=(0,s.QP)("w-full",!m&&"none"!==o&&n[o],!m&&d&&"mx-auto",i[c],r);return(0,t.jsx)(l,{className:u,children:a})}}}]);