{"version":3,"file":"CoreForm.DdAPIL5j.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/GAXiqErlCBxPu4tngLyN/dkJokayhsYrR0Csdj3I9/CoreForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const CHARCOAL=\"#2B2B2B\";const TEAL=\"#0AB6B0\";const GOLD=\"#E4C35C\";const RED=\"#D64545\";// Add/remove domains as you like\nconst PERSONAL_EMAIL_DOMAINS=new Set([\"gmail.com\",\"googlemail.com\",\"hotmail.com\",\"outlook.com\",\"live.com\",\"msn.com\",\"icloud.com\",\"me.com\",\"mac.com\",\"yahoo.com\",\"yahoo.co.uk\",\"aol.com\",\"proton.me\",\"protonmail.com\",\"gmx.com\",\"gmx.co.uk\",\"zoho.com\",\"mail.com\",\"btinternet.com\",\"sky.com\",\"sky.com\",\"virginmedia.com\",\"talktalk.net\"]);function isValidEmailFormat(email){return/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email.trim());}function isBusinessEmail(email){const trimmed=email.trim().toLowerCase();if(!isValidEmailFormat(trimmed))return false;const domain=trimmed.split(\"@\")[1]||\"\";if(!domain)return false;return!PERSONAL_EMAIL_DOMAINS.has(domain);}async function postWebhook(webhookUrl,payload){if(!webhookUrl)return;const res=await fetch(webhookUrl,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(payload)});if(!res.ok)throw new Error(`Webhook failed: ${res.status}`);}/**\n * Fires ONLY after confirmed successful submission.\n * Keep this the same event name if your GTM/Ads conversion is wired to it.\n */function trackLeadSubmittedSuccess(){const w=window;w.dataLayer=w.dataLayer||[];w.dataLayer.push({event:\"lead_submitted_success\",form_id:\"qwyk_simple_lead_form\",form_steps:1,lead_type:\"clarity_call\",form_version:\"v2_simple\"});}export default function SimpleLeadForm(props){const[fullName,setFullName]=React.useState(\"\");const[businessEmail,setBusinessEmail]=React.useState(\"\");const[businessPhone,setBusinessPhone]=React.useState(\"\")// optional\n;const[submitting,setSubmitting]=React.useState(false);const[submitted,setSubmitted]=React.useState(false);const[showErrors,setShowErrors]=React.useState(false);const[globalError,setGlobalError]=React.useState(null);const nameError=!fullName.trim()?\"Name is required.\":\"\";const emailError=!businessEmail.trim()?\"Business email is required.\":!isValidEmailFormat(businessEmail)?\"Enter a valid email address.\":!isBusinessEmail(businessEmail)?\"Please use a business email (e.g. name@company.com). Personal emails aren’t accepted.\":\"\";const canSubmit=!nameError&&!emailError;// ---------- styles ----------\nconst containerStyle={width:\"100%\",maxWidth:props.maxWidth||560,background:\"\",borderRadius:18,border:\"1px solid rgba(0,0,0,0.08)\",boxShadow:\"0 18px 55px rgba(0,0,0,0.10)\",padding:22,color:CHARCOAL,fontFamily:\"Inter, system-ui, sans-serif\"};const fieldGroup={display:\"grid\",gap:14};const labelRow={display:\"flex\",alignItems:\"baseline\",gap:6,marginBottom:6};const labelStyle={fontSize:12.5,fontWeight:600};const requiredStar={color:RED,fontWeight:700,fontSize:12.5};const optionalStyle={fontSize:11.5,color:\"rgba(43,43,43,0.55)\",fontWeight:500};const inputStyle={width:\"100%\",height:38,borderRadius:10,border:\"1px solid rgba(0,0,0,0.12)\",padding:\"0 12px\",fontSize:14,color:CHARCOAL};const errorText={marginTop:6,fontSize:12,color:RED};const hintText={marginTop:6,fontSize:12,color:\"rgba(43,43,43,0.6)\",lineHeight:1.4};const submitBtn={height:38,borderRadius:10,border:\"none\",background:GOLD,color:CHARCOAL,fontWeight:700,fontSize:13.5,padding:\"0 14px\",width:\"100%\",transition:\"filter 160ms ease, transform 120ms ease\",cursor:\"pointer\",marginTop:6};const successPill={color:TEAL,fontSize:12,fontWeight:700,marginBottom:10,textTransform:\"uppercase\",letterSpacing:.6};if(submitted){return /*#__PURE__*/_jsxs(\"div\",{style:{...containerStyle,textAlign:\"center\",padding:\"28px 24px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:successPill,children:\"Complete\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:20,fontWeight:700,marginBottom:8},children:props.successTitle}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:14,fontWeight:400,color:\"rgba(43,43,43,0.7)\",lineHeight:1.5,maxWidth:420,margin:\"0 auto\"},children:props.successMessage})]});}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:fieldGroup,children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsxs(\"div\",{style:labelRow,children:[/*#__PURE__*/_jsx(\"div\",{style:labelStyle,children:\"Name\"}),/*#__PURE__*/_jsx(\"div\",{style:requiredStar,children:\"*\"})]}),/*#__PURE__*/_jsx(\"input\",{style:inputStyle,value:fullName,onChange:e=>setFullName(e.target.value),placeholder:\"Full name\",autoComplete:\"name\"}),showErrors&&nameError&&/*#__PURE__*/_jsx(\"div\",{style:errorText,children:nameError})]}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsxs(\"div\",{style:labelRow,children:[/*#__PURE__*/_jsx(\"div\",{style:labelStyle,children:\"Business email\"}),/*#__PURE__*/_jsx(\"div\",{style:requiredStar,children:\"*\"})]}),/*#__PURE__*/_jsx(\"input\",{style:inputStyle,value:businessEmail,onChange:e=>setBusinessEmail(e.target.value),placeholder:\"name@company.com\",inputMode:\"email\",autoComplete:\"email\"}),showErrors&&emailError&&/*#__PURE__*/_jsx(\"div\",{style:errorText,children:emailError}),!showErrors&&/*#__PURE__*/_jsx(\"div\",{style:hintText})]}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsxs(\"div\",{style:labelRow,children:[/*#__PURE__*/_jsx(\"div\",{style:labelStyle,children:\"Business phone\"}),/*#__PURE__*/_jsx(\"div\",{style:optionalStyle,children:\"(optional)\"})]}),/*#__PURE__*/_jsx(\"input\",{style:inputStyle,value:businessPhone,onChange:e=>setBusinessPhone(e.target.value),placeholder:\"Phone number\",inputMode:\"tel\",autoComplete:\"tel\"})]}),globalError&&/*#__PURE__*/_jsx(\"div\",{style:errorText,children:globalError}),/*#__PURE__*/_jsx(\"button\",{style:{...submitBtn,opacity:submitting?.7:1,cursor:submitting?\"not-allowed\":\"pointer\"},disabled:submitting,onClick:async()=>{setShowErrors(true);if(!canSubmit||submitting)return;try{setGlobalError(null);setSubmitting(true);await postWebhook(props.webhookUrl,{fullName:fullName.trim(),businessEmail:businessEmail.trim(),businessPhone:businessPhone.trim()||\"\",submittedAt:new Date().toISOString(),source:props.sourceLabel||\"Qwyk - SimpleLeadForm\",formVersion:\"v2_simple\"});trackLeadSubmittedSuccess();setSubmitted(true);}catch(e){setGlobalError(\"Something went wrong. Please try again.\");}finally{setSubmitting(false);}},onMouseEnter:e=>{if(submitting)return;e.currentTarget.style.filter=\"brightness(0.96)\";},onMouseLeave:e=>{e.currentTarget.style.filter=\"brightness(1)\";e.currentTarget.style.transform=\"scale(1)\";},onMouseDown:e=>{if(submitting)return;e.currentTarget.style.transform=\"scale(0.98)\";},onMouseUp:e=>{e.currentTarget.style.transform=\"scale(1)\";},children:submitting?\"Submitting…\":props.buttonText})]})});}SimpleLeadForm.defaultProps={webhookUrl:\"https://hook.eu1.make.com/fd6uf6wvwrprkjoea4sl1w94tt6yqgps\",maxWidth:560,buttonText:\"Book Your Free Readiness Assessment\",successTitle:\"Thank you\",successMessage:\"Your details have been sent and a member of the Qwyk team will be in touch shortly.\",sourceLabel:\"Qwyk - SimpleLeadForm\"};addPropertyControls(SimpleLeadForm,{webhookUrl:{type:ControlType.String,defaultValue:SimpleLeadForm.defaultProps.webhookUrl},maxWidth:{type:ControlType.Number,defaultValue:560,min:320,max:900},buttonText:{type:ControlType.String,defaultValue:SimpleLeadForm.defaultProps.buttonText},successTitle:{type:ControlType.String,defaultValue:SimpleLeadForm.defaultProps.successTitle},successMessage:{type:ControlType.String,defaultValue:SimpleLeadForm.defaultProps.successMessage},sourceLabel:{type:ControlType.String,defaultValue:SimpleLeadForm.defaultProps.sourceLabel}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SimpleLeadForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CoreForm.map"],"mappings":"+LACyU,SAAS,EAAmB,EAAM,CAAC,MAAM,6BAA6B,KAAK,EAAM,MAAM,CAAC,CAAE,SAAS,EAAgB,EAAM,CAAC,IAAM,EAAQ,EAAM,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAmB,EAAQ,CAAC,MAAO,GAAM,IAAM,EAAO,EAAQ,MAAM,IAAI,CAAC,IAAI,GAA2B,OAApB,EAA0B,CAAC,EAAuB,IAAI,EAAO,CAA/C,GAAiD,eAAe,EAAY,EAAW,EAAQ,CAAC,GAAG,CAAC,EAAW,OAAO,IAAM,EAAI,MAAM,MAAM,EAAW,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,EAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAI,GAAG,MAAU,MAAM,mBAAmB,EAAI,SAAS,CAG33B,SAAS,GAA2B,CAAC,IAAM,EAAE,EAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,KAAK,CAAC,MAAM,yBAAyB,QAAQ,wBAAwB,WAAW,EAAE,UAAU,eAAe,aAAa,YAAY,CAAC,CAAE,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAe,GAAG,CAAM,CAAC,EAAc,GAAkBA,EAAe,GAAG,CAAM,CAAC,EAAc,GAAkBA,EAAe,GAAG,CAC9a,CAAC,EAAW,GAAeA,EAAe,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAe,GAAM,CAAM,CAAC,EAAW,GAAeA,EAAe,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAe,KAAK,CAAO,EAAW,EAAS,MAAM,CAAqB,GAApB,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