{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/1in8I30LHvlBadZiMmO7/Ol9V0ZwMMbhFnvYUr2Wp/EmailCaptureForm.js"],
  "sourcesContent": ["// Email capture form for HubSpot with redirect on success\n// Input and button are side by side on desktop, stacked on mobile\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * HubSpot Email Form\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function EmailCaptureForm(props){const{portalId,formId,redirectUrl,placeholder,buttonLabel,inputBackground,inputTextColor,buttonBackground,buttonTextColor,inputFont,buttonFont,inputBorderColor,inputBorderRadius,inputPadding,buttonBorderRadius,buttonPadding,style,variant=\"auto\"}=props;const[email,setEmail]=useState(\"\");const[submitting,setSubmitting]=useState(false);const[error,setError]=useState(\"\");async function handleSubmit(e){e.preventDefault();setError(\"\");startTransition(()=>setSubmitting(true));try{const res=await fetch(`https://api.hsforms.com/submissions/v3/integration/submit/${portalId}/${formId}`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({fields:[{name:\"email\",value:email}]})});if(res.ok){if(typeof window!==\"undefined\"){window.location.href=redirectUrl;}}else{setError(\"Submission failed. Please try again.\");}}catch{setError(\"Submission failed. Please try again.\");}finally{startTransition(()=>setSubmitting(false));}}// Determine flexDirection based on variant and window width\nlet flexDirection=\"row\";let gap=12;let alignItems=\"center\";if(variant===\"mobile\"){flexDirection=\"column\";gap=10;alignItems=\"stretch\";}else if(variant===\"auto\"){if(typeof window!==\"undefined\"&&window.innerWidth<=500){flexDirection=\"column\";gap=10;alignItems=\"stretch\";}}return /*#__PURE__*/_jsxs(\"form\",{className:\"framer-email-capture-form\",onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:flexDirection,gap,width:\"100%\",alignItems,...style},\"aria-label\":\"Email signup form\",autoComplete:\"off\",children:[variant===\"auto\"&&/*#__PURE__*/_jsx(\"style\",{children:`\n                    @media (max-width: 500px) {\n                        .framer-email-capture-form {\n                            flex-direction: column !important;\n                            gap: 10px !important;\n                            align-items: stretch !important;\n                        }\n                    }\n                `}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",value:email,onChange:e=>setEmail(e.target.value),placeholder:placeholder,style:{...inputFont,border:`1px solid ${inputBorderColor}`,borderRadius:inputBorderRadius,padding:inputPadding,background:inputBackground,color:inputTextColor,outline:\"none\",flex:1,minWidth:0,boxSizing:\"border-box\"},required:true,\"aria-label\":\"Email\",autoComplete:\"email\"}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{...buttonFont,background:buttonBackground,color:buttonTextColor,border:\"none\",borderRadius:buttonBorderRadius,padding:buttonPadding,cursor:submitting?\"not-allowed\":\"pointer\",whiteSpace:\"nowrap\",boxSizing:\"border-box\",opacity:submitting?.7:1},disabled:submitting,\"aria-label\":buttonLabel,children:submitting?\"Submitting...\":buttonLabel}),error&&/*#__PURE__*/_jsx(\"span\",{style:{color:\"#D32F2F\",marginLeft:8,fontSize:13},children:error})]});}addPropertyControls(EmailCaptureForm,{portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"24249649\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"be2c90e5-913e-4c43-89d3-013f68a54c2f\"},redirectUrl:{type:ControlType.String,title:\"Redirect URL\",defaultValue:\"https://framer.com/\"},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter your email\"},buttonLabel:{type:ControlType.String,title:\"Button Label\",defaultValue:\"Subscribe\"},inputBackground:{type:ControlType.Color,title:\"Input BG\",defaultValue:\"#fff\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:\"#222\"},buttonBackground:{type:ControlType.Color,title:\"Button BG\",defaultValue:\"#111\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#fff\"},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Medium\",fontSize:\"15px\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},inputBorderColor:{type:ControlType.Color,title:\"Input Border\",defaultValue:\"#CCCCCC\"},inputBorderRadius:{type:ControlType.Number,title:\"Input Radius\",defaultValue:8,min:0,max:32},inputPadding:{type:ControlType.String,title:\"Input Padding\",defaultValue:\"12px 16px\"},buttonBorderRadius:{type:ControlType.Number,title:\"Button Radius\",defaultValue:8,min:0,max:32},buttonPadding:{type:ControlType.String,title:\"Button Padding\",defaultValue:\"12px 24px\"},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"auto\",\"desktop\",\"mobile\"],optionTitles:[\"Auto (Responsive)\",\"Desktop (Horizontal)\",\"Mobile (Vertical)\"],defaultValue:\"auto\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmailCaptureForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmailCaptureForm.map"],
  "mappings": "qHAOkB,SAARA,EAAkCC,EAAM,CAAC,GAAK,CAAC,SAAAC,EAAS,OAAAC,EAAO,YAAAC,EAAY,YAAAC,EAAY,YAAAC,EAAY,gBAAAC,EAAgB,eAAAC,EAAe,iBAAAC,EAAiB,gBAAAC,EAAgB,UAAAC,EAAU,WAAAC,EAAW,iBAAAC,EAAiB,kBAAAC,EAAkB,aAAAC,EAAa,mBAAAC,EAAmB,cAAAC,EAAc,MAAAC,EAAM,QAAAC,EAAQ,MAAM,EAAElB,EAAW,CAACmB,EAAMC,CAAQ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Aa,CAAC,QAAQ,SAAS,SAAS,OAAO,cAAc,UAAU,WAAW,OAAO,CAAC,EAAE,WAAW,CAAC,KAAKA,EAAY,KAAK,MAAM,cAAc,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,QAAQ,WAAW,SAAS,OAAO,cAAc,UAAU,WAAW,KAAK,CAAC,EAAE,iBAAiB,CAAC,KAAKA,EAAY,MAAM,MAAM,eAAe,aAAa,SAAS,EAAE,kBAAkB,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,MAAM,gBAAgB,aAAa,WAAW,EAAE,mBAAmB,CAAC,KAAKA,EAAY,OAAO,MAAM,gBAAgB,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,cAAc,CAAC,KAAKA,EAAY,OAAO,MAAM,iBAAiB,aAAa,WAAW,EAAE,QAAQ,CAAC,KAAKA,EAAY,KAAK,MAAM,UAAU,QAAQ,CAAC,OAAO,UAAU,QAAQ,EAAE,aAAa,CAAC,oBAAoB,uBAAuB,mBAAmB,EAAE,aAAa,MAAM,CAAC,CAAC",
  "names": ["EmailCaptureForm", "props", "portalId", "formId", "redirectUrl", "placeholder", "buttonLabel", "inputBackground", "inputTextColor", "buttonBackground", "buttonTextColor", "inputFont", "buttonFont", "inputBorderColor", "inputBorderRadius", "inputPadding", "buttonBorderRadius", "buttonPadding", "style", "variant", "email", "setEmail", "ye", "submitting", "setSubmitting", "error", "setError", "handleSubmit", "e", "Z", "window", "flexDirection", "gap", "alignItems", "u", "p", "addPropertyControls", "ControlType"]
}
