{"version":3,"file":"FastFormStacked.Bk7fbExP.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/nB0LrBdaPVA9pZDMcwGj/TiIblxLPCUJz57YdGSxq/FastFormStacked.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";export default function FastForm(props){const{portalId,formGuid,routerId,buttonColor,buttonTextColor,buttonFont,buttonBorderColor,inputBackgroundColor,inputTextColor,inputBorderColor}=props;const[email,setEmail]=useState(\"\");const[isSubmitting,setIsSubmitting]=useState(false);const[isSuccess,setIsSuccess]=useState(false);const[urlParams,setUrlParams]=useState({});const[heroInstance,setHeroInstance]=useState(null);const getHubSpotCookie=()=>{if(typeof document===\"undefined\")return undefined;const value=`; ${document.cookie}`;const parts=value.split(`; hubspotutk=`);if(parts.length===2)return parts.pop().split(\";\").shift();return undefined;};useEffect(()=>{if(typeof window!==\"undefined\"&&RenderTarget.current()!==RenderTarget.canvas){const params=new URLSearchParams(window.location.search);setUrlParams({utm_campaign:params.get(\"utm_campaign\")||\"\",utm_content:params.get(\"utm_content\")||\"\",utm_medium:params.get(\"utm_medium\")||\"\",utm_source:params.get(\"utm_source\")||\"\",utm_term:params.get(\"utm_term\")||\"\",gclid:params.get(\"gclid\")||\"\",li_fat_id:params.get(\"li_fat_id\")||\"\"});const rhScript=document.createElement(\"script\");rhScript.src=\"https://app.revenuehero.io/scheduler.min.js\";rhScript.onload=()=>{const hero=new window.RevenueHero({routerId:routerId});setHeroInstance(hero);};document.body.appendChild(rhScript);return()=>{if(document.body.contains(rhScript)){document.body.removeChild(rhScript);}};}},[routerId]);const handleSubmit=async e=>{e.preventDefault();if(RenderTarget.current()!==RenderTarget.canvas){setIsSubmitting(true);const url=`https://api-na2.hsforms.com/submissions/v3/integration/submit/${portalId}/${formGuid}`;const fields=[{name:\"email\",value:email}];Object.keys(urlParams).forEach(key=>{if(urlParams[key])fields.push({name:key,value:urlParams[key]});});const data={fields:fields,context:{pageUri:window.location.href,pageName:document.title,hutk:getHubSpotCookie()}};try{const response=await fetch(url,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(data)});if(!response.ok)throw new Error(\"HubSpot API rejected\");setIsSuccess(true);if(heroInstance){const rhData={email:email,...urlParams};heroInstance.submit(rhData).then(sessionData=>{heroInstance.dialog.open(sessionData);}).catch(err=>{console.error(\"RH Error:\",err);});}}catch(error){console.error(\"Submission Error:\",error);alert(\"Something went wrong. Please try again.\");}finally{setIsSubmitting(false);}}};if(isSuccess){return /*#__PURE__*/_jsx(\"div\",{style:styles.container,children:/*#__PURE__*/_jsx(\"h3\",{style:styles.successText,children:\"Thanks! Loading calendar...\"})});}return /*#__PURE__*/_jsxs(\"div\",{style:styles.container,children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .custom-form-input::placeholder {\n                    color: ${inputTextColor};\n                    opacity: 0.4; \n                }\n                .custom-form-input:focus {\n                    border-color: ${buttonColor} !important;\n                    box-shadow: 0 0 0 2px ${buttonColor}33;\n                }\n            `}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:styles.form,id:\"custom-hubspot-form\",children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",id:\"email\",name:\"email\",className:\"custom-form-input\",placeholder:\"Work Email\",value:email,onChange:e=>setEmail(e.target.value),style:{...styles.input,backgroundColor:inputBackgroundColor,color:inputTextColor,border:`1px solid ${inputBorderColor}`},required:true}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",id:\"submitButton\",disabled:isSubmitting,style:{...styles.button,backgroundColor:buttonColor,color:buttonTextColor,fontFamily:buttonFont,border:`1px solid ${buttonBorderColor}`,opacity:isSubmitting?.7:1},children:isSubmitting?\"Submitting...\":\"Open calendar\"})]})]});}FastForm.defaultProps={portalId:\"244075991\",formGuid:\"887b0e06-9c7e-4fb1-bf38-36676a53f625\",routerId:\"5723\",// Matched the vibrant green from the screenshot\nbuttonColor:\"#1CC974\",buttonTextColor:\"#FFFFFF\",buttonFont:\"inherit\",buttonBorderColor:\"#1CC974\",// Matched the light theme container\ninputBackgroundColor:\"#FFFFFF\",inputTextColor:\"#111827\",inputBorderColor:\"#E5E7EB\"};addPropertyControls(FastForm,{portalId:{type:ControlType.String,title:\"Portal ID\"},formGuid:{type:ControlType.String,title:\"Form GUID\"},routerId:{type:ControlType.String,title:\"RH Router ID\"},buttonColor:{type:ControlType.Color,title:\"Button Fill\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\"},buttonBorderColor:{type:ControlType.Color,title:\"Button Border\"},buttonFont:{type:ControlType.String,title:\"Button Font\"},inputBackgroundColor:{type:ControlType.Color,title:\"Input Fill\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\"},inputBorderColor:{type:ControlType.Color,title:\"Input Border\"}});const styles={container:{width:\"100%\",maxWidth:\"480px\",margin:\"0 auto\",display:\"flex\",flexDirection:\"column\",boxSizing:\"border-box\",fontFamily:\"inherit\"},form:{display:\"flex\",flexDirection:\"column\",alignItems:\"stretch\",gap:\"12px\",width:\"100%\"},input:{padding:\"14px 16px\",borderRadius:\"8px\",fontSize:\"15px\",outline:\"none\",boxSizing:\"border-box\",fontFamily:\"inherit\",transition:\"border-color 0.2s ease, box-shadow 0.2s ease\"},button:{padding:\"14px 24px\",borderRadius:\"8px\",fontSize:\"14px\",fontWeight:\"600\",letterSpacing:\"0.5px\",cursor:\"pointer\",whiteSpace:\"nowrap\",boxSizing:\"border-box\",transition:\"transform 0.1s ease, opacity 0.2s ease, filter 0.2s ease\"},successText:{margin:0,fontSize:\"16px\",fontWeight:\"500\",color:\"#111827\",textAlign:\"center\",fontFamily:\"inherit\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FastForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FastFormStacked.map"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