{"version":3,"file":"GSWMjcg0N.dSeqrO2V.mjs","names":["useState","useId","useCallback"],"sources":["https:/framerusercontent.com/modules/LsOS7otIwlj1YlGYyCCB/MLYSAWODugGbYE1B7HU5/AlveosSubscribe.js","https:/framerusercontent.com/modules/ckB2tIE449gOJUrSNjWv/fJjOEpnNNZ3mpr1vmjae/GSWMjcg0N.js"],"sourcesContent":["/**\n * AlveosSubscribe\n *\n * Inline email signup that submits DIRECTLY to the Alveos Mailchimp audience\n * via JSONP (same endpoint and list as AlveosWaitlistModal), so every\n * subscriber lands in Mailchimp automatically with double opt-in intact.\n * Replaces the native Framer forms, which either had no working submit\n * button or captured into Framer's forms inbox instead of Mailchimp.\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback,useId}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const MC_POST_URL=\"https://alveoslabs.us7.list-manage.com/subscribe/post-json\";const MC_U=\"d1dd15072f0041bd5c2730222\";const MC_ID=\"aee3424951\";const MC_F_ID=\"00b447e4f0\";const MC_HONEYPOT=\"b_\"+MC_U+\"_\"+MC_ID;let jsonpCounter=0;function submitViaJsonp(email){return new Promise((resolve,reject)=>{if(typeof document===\"undefined\"){reject(new Error(\"Not in a browser\"));return;}const cbName=\"__mc_sub_cb_\"+Date.now()+\"_\"+jsonpCounter++;const timeout=window.setTimeout(()=>{cleanup();reject(new Error(\"Request timed out\"));},1e4);function cleanup(){clearTimeout(timeout);delete window[cbName];script.remove();}window[cbName]=data=>{cleanup();resolve(data);};const params=new URLSearchParams({u:MC_U,id:MC_ID,f_id:MC_F_ID,EMAIL:email,[MC_HONEYPOT]:\"\",c:cbName});const script=document.createElement(\"script\");script.src=MC_POST_URL+\"?\"+params.toString();script.onerror=()=>{cleanup();reject(new Error(\"Network error\"));};document.body.appendChild(script);});}const EMAIL_RE=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;/**\n * @framerIntrinsicWidth 460\n * @framerIntrinsicHeight 52\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function AlveosSubscribe(props){const{placeholder=\"Your email\",buttonLabel=\"Subscribe\",successMessage=\"Almost there. Check your inbox to confirm.\",inputFill=\"#FFFFFF\",inputBorder=\"rgba(0, 0, 0, 0.15)\",inputTextColor=\"#000000\",placeholderColor=\"rgba(0, 0, 0, 0.4)\",buttonFill=\"#111111\",buttonTextColor=\"#FFFFFF\",successColor=\"#3D7A52\",errorColor=\"#D64545\",radius=999,font,style}=props;const[email,setEmail]=useState(\"\");const[phase,setPhase]=useState(\"idle\");const[errorMsg,setErrorMsg]=useState(\"\");const reactId=useId();const inputClass=\"alveos-sub-\"+reactId.replace(/[^a-zA-Z0-9_-]/g,\"\");const handleSubmit=useCallback(async e=>{e.preventDefault();e.stopPropagation();const trimmed=email.trim();if(!EMAIL_RE.test(trimmed)){setPhase(\"error\");setErrorMsg(\"Please enter a valid email address.\");return;}setPhase(\"submitting\");try{const res=await submitViaJsonp(trimmed);if(res.result===\"success\"){setPhase(\"success\");}else{const msg=(res.msg||\"\").replace(/<a[^>]*>.*?<\\/a>/gi,\"\").trim();if(/already subscribed/i.test(msg)){setPhase(\"success\");}else{setPhase(\"error\");setErrorMsg(msg||\"Something went wrong. Please try again.\");}}}catch{setPhase(\"error\");setErrorMsg(\"Network error. Please try again.\");}},[email]);const submitting=phase===\"submitting\";if(phase===\"success\"){return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"flex\",alignItems:\"center\",gap:8,padding:\"12px 4px\",color:successColor,...font},role:\"status\",children:[/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 13l4 4L19 7\"})}),/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:600},children:successMessage})]});}return /*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,noValidate:true,style:{...style,position:\"relative\",display:\"flex\",flexWrap:\"wrap\",alignItems:\"center\",gap:8},children:[/*#__PURE__*/_jsx(\"style\",{children:\".\"+inputClass+\"::placeholder { color: \"+placeholderColor+\"; opacity: 1; }\"}),/*#__PURE__*/_jsx(\"input\",{className:inputClass,type:\"email\",name:\"EMAIL\",autoComplete:\"email\",placeholder:placeholder,required:true,value:email,disabled:submitting,onChange:e=>{setEmail(e.target.value);if(phase===\"error\")setPhase(\"idle\");},\"aria-label\":\"Email address\",style:{flex:\"1 1 180px\",minWidth:0,boxSizing:\"border-box\",padding:\"14px 20px\",borderRadius:radius,border:\"1px solid \"+inputBorder,background:inputFill,color:inputTextColor,outline:\"none\",fontFamily:\"inherit\",...font}}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:submitting,style:{padding:\"14px 24px\",borderRadius:radius,border:\"none\",background:buttonFill,color:buttonTextColor,cursor:submitting?\"wait\":\"pointer\",opacity:submitting?.6:1,whiteSpace:\"nowrap\",fontFamily:\"inherit\",...font,fontWeight:600},children:submitting?\"Sending…\":buttonLabel}),phase===\"error\"&&errorMsg?/*#__PURE__*/_jsx(\"p\",{style:{flexBasis:\"100%\",margin:0,color:errorColor,fontSize:13,lineHeight:1.4,...font},role:\"alert\",children:errorMsg}):null,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:-5e3,top:0},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",name:MC_HONEYPOT,tabIndex:-1,value:\"\",readOnly:true})})]});}addPropertyControls(AlveosSubscribe,{placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Your email\"},buttonLabel:{type:ControlType.String,title:\"Button label\",defaultValue:\"Subscribe\"},successMessage:{type:ControlType.String,title:\"Success message\",defaultValue:\"Almost there. Check your inbox to confirm.\"},inputFill:{type:ControlType.Color,title:\"Input fill\",defaultValue:\"#FFFFFF\"},inputBorder:{type:ControlType.Color,title:\"Input border\",defaultValue:\"rgba(0, 0, 0, 0.15)\"},inputTextColor:{type:ControlType.Color,title:\"Input text\",defaultValue:\"#000000\"},placeholderColor:{type:ControlType.Color,title:\"Placeholder\",defaultValue:\"rgba(0, 0, 0, 0.4)\"},buttonFill:{type:ControlType.Color,title:\"Button fill\",defaultValue:\"#111111\"},buttonTextColor:{type:ControlType.Color,title:\"Button text\",defaultValue:\"#FFFFFF\"},successColor:{type:ControlType.Color,title:\"Success color\",defaultValue:\"#3D7A52\"},errorColor:{type:ControlType.Color,title:\"Error color\",defaultValue:\"#D64545\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:999,min:0,max:999},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",lineHeight:\"1.2em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AlveosSubscribe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"52\",\"framerIntrinsicWidth\":\"460\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AlveosSubscribe.map","// Generated by Framer (41620b1)\nimport{fontStore}from\"framer\";fontStore.loadFonts([]);export const fonts=[{explicitInter:true,fonts:[]}];export const css=[\".framer-Gtk63 .framer-styles-preset-1ooxd49 { box-shadow: 0px 0.6021873017743928px 2.0474368260329356px -0.8333333333333333px rgba(0, 0, 0, 0.13), 0px 2.288533303243457px 7.781013231027754px -1.6666666666666665px rgba(0, 0, 0, 0.13), 0px 10px 34px -2.5px rgba(0, 0, 0, 0.13); }\"];export const className=\"framer-Gtk63\";\nexport const __FramerMetadata__ = {\"exports\":{\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fon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