{"version":3,"file":"FormProvider.aGoOFKQa.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/9peh0BPYse6b5BLNLUp2/nfrSGfQwttt24FvIECT3/FormProvider.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Import Color\n// --- Raw SVG Smiley Icon String (with fill=\"currentColor\") ---\n// Added fill=\"currentColor\" to the root <svg> tag\nconst rawSmileySvg=`<svg height=\"16\" viewBox=\"0 0 512.001 512\" width=\"16\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\"><path d=\"m437.019531 74.980469c-48.351562-48.351563-112.640625-74.980469-181.019531-74.980469-53.925781 0-105.515625 16.582031-149.191406 47.957031-4.484375 3.222657-5.511719 9.472657-2.289063 13.957031 3.222657 4.484376 9.46875 5.511719 13.957031 2.289063 40.253907-28.917969 87.808594-44.203125 137.523438-44.203125 130.132812 0 236 105.871094 236 236 0 49.714844-15.285156 97.269531-44.199219 137.523438-3.222656 4.484374-2.199219 10.734374 2.285157 13.957031 1.765624 1.269531 3.804687 1.878906 5.828124 1.878906 3.109376 0 6.175782-1.449219 8.128907-4.167969 31.375-43.675781 47.957031-95.265625 47.957031-149.191406 0-68.378906-26.628906-132.667969-74.980469-181.019531zm0 0\"/><path d=\"m393.519531 447.804688c-40.25 28.914062-87.800781 44.195312-137.519531 44.195312-130.128906 0-236-105.867188-236-236 0-49.714844 15.28125-97.269531 44.195312-137.519531 3.222657-4.484375 2.199219-10.730469-2.285156-13.953125s-10.734375-2.199219-13.957031 2.285156c-31.371094 43.671875-47.953125 95.257812-47.953125 149.1875 0 68.382812 26.628906 132.667969 74.980469 181.019531 48.351562 48.351563 112.640625 74.980469 181.019531 74.980469 53.929688 0 105.519531-16.582031 149.1875-47.953125 4.484375-3.222656 5.507812-9.472656 2.285156-13.957031s-9.46875-5.507813-13.953125-2.285156zm0 0\"/><path d=\"m175 251.585938c22.429688 0 40-27.675782 40-63 0-35.328126-17.570312-63-40-63s-40 27.671874-40 63c0 35.324218 17.570312 63 40 63zm0-106c9.25 0 20 18.78125 20 43 0 24.214843-10.75 43-20 43s-20-18.785157-20-43c0-24.21875 10.75-43 20-43zm0 0\"/><path d=\"m377 188.585938c0-35.328126-17.570312-63-40-63s-40 27.671874-40 63c0 35.324218 17.570312 63 40 63s40-27.675782 40-63zm-60 0c0-24.21875 10.75-43 20-43s20 18.78125 20 43c0 24.214843-10.75 43-20 43s-20-18.785157-20-43zm0 0\"/><path d=\"m435.480469 293.738281-14.144531-3.789062s-.003907 0-.007813-.003907c-.003906 0-.007813 0-.007813 0l-14.144531-3.789062c-5.339843-1.433594-10.820312 1.734375-12.25 7.070312-1.429687 5.332032 1.738281 10.816407 7.070313 12.246094l4.191406 1.125c-21.554688 64-81.941406 107.882813-150.1875 107.882813s-128.632812-43.882813-150.1875-107.882813l4.1875-1.125c5.335938-1.429687 8.5-6.914062 7.074219-12.246094-1.429688-5.335937-6.914063-8.503906-12.25-7.070312l-14.144531 3.789062c-.003907 0-.007813 0-.007813 0-.003906.003907-.007813.003907-.011719.003907l-14.144531 3.789062c-5.332031 1.433594-8.5 6.914063-7.070313 12.25 1.199219 4.464844 5.238282 7.414063 9.652344 7.414063.855469 0 1.730469-.113282 2.597656-.34375l4.773438-1.28125c23.921875 72.730468 92.246094 122.703125 169.53125 122.703125 77.28125 0 145.609375-49.972657 169.53125-122.703125l4.773438 1.28125c.867187.230468 1.738281.34375 2.59375.34375 4.414062 0 8.457031-2.949219 9.652343-7.414063 1.433594-5.335937-1.734375-10.816406-7.070312-12.25zm0 0\"/><path d=\"m82.042969 92.054688c2.707031 0 5.40625-1.09375 7.378906-3.246094 3.734375-4.070313 3.457031-10.394532-.613281-14.128906-4.070313-3.730469-10.398438-3.453126-14.128906.617187l-.003907.003906c-3.734375 4.070313-3.453125 10.394531.617188 14.125 1.917969 1.761719 4.335937 2.628907 6.75 2.628907zm0 0\"/><path d=\"m422.578125 423.191406-.007813.007813c-3.730468 4.070312-3.453124 10.394531.617188 14.125 1.921875 1.757812 4.339844 2.628906 6.753906 2.628906 2.707032 0 5.40625-1.09375 7.378906-3.246094 3.730469-4.070312 3.457032-10.394531-.613281-14.128906-4.074219-3.734375-10.398437-3.457031-14.128906.613281zm0 0\"/></svg>`;// --- URL-Encode the raw SVG ---\n// This makes it safe to use directly in a CSS url()\nconst encodedSmileySvg=encodeURIComponent(rawSmileySvg);// Your Framer Code Component\nexport function LemonSqueezySubscribe(props){const{buttonText,successButtonText,errorButtonText,placeholderText,layoutDirection,// Destructure color props\ninputTextColor,inputBorderColor,inputIconColor,buttonBgColor,buttonTextColor,successButtonBgColor,errorButtonBgColor,// ---\nstyle}=props;// State for the email input\nconst[email,setEmail]=useState(\"\");// State for the submission status\nconst[status,setStatus]=useState(\"idle\");// Your specific Lemon Squeezy subscription endpoint\nconst formActionURL=\"https://sinuslabs.lemonsqueezy.com/email-subscribe/external\";// --- Event Handler for Form Submission (Unchanged) ---\nconst handleSubmit=async event=>{event.preventDefault();setStatus(\"submitting\");const formData=new URLSearchParams;formData.append(\"email\",email);formData.append(\"confirm_email\",\"\");try{const response=await fetch(formActionURL,{method:\"POST\",headers:{\"Content-Type\":\"application/x-www-form-urlencoded\"},body:formData.toString()});if(response.ok){setStatus(\"success\");// setEmail(\"\"); // Optionally clear field\n}else{console.error(\"Submission failed:\",response.status,response.statusText);setStatus(\"error\");}}catch(error){console.error(\"Submission error:\",error);setStatus(\"error\");}};// --- Styles ---\nconst baseFormStyle={display:\"flex\",gap:\"10px\",width:\"100%\",height:\"auto\",padding:\"10px\",boxSizing:\"border-box\",...style};// --- Updated Input Style (using direct, encoded SVG) ---\nconst baseInputStyle={border:\"none\",borderBottom:`1px solid ${inputBorderColor}`,borderRadius:\"0px\",backgroundColor:\"transparent\",paddingTop:\"10px\",paddingBottom:\"10px\",paddingRight:\"10px\",paddingLeft:\"30px\",fontSize:\"16px\",fontFamily:\"'Overused Grotesk', sans-serif\",color:inputTextColor,boxSizing:\"border-box\",outline:\"none\",// Use the direct, URL-encoded SVG string\nbackgroundImage:`url(\"data:image/svg+xml,${encodedSmileySvg}\")`,// Set the color for the SVG icon (which uses fill=\"currentColor\")\n// Apply inputIconColor to the 'color' property for the SVG to inherit\ncolor:inputIconColor,backgroundRepeat:\"no-repeat\",backgroundPosition:\"left center\",backgroundSize:\"16px 16px\",opacity:status===\"submitting\"||status===\"success\"?.6:1};// Ensure typed text uses inputTextColor (overrides icon color inheritance for text)\n// This is crucial because we set 'color' to inputIconColor above for the SVG\nbaseInputStyle.color=inputTextColor;// --- Updated Button Style (Unchanged logic, uses props) ---\nconst baseButtonStyle={padding:\"16px 20px\",fontSize:\"16px\",fontWeight:500,borderRadius:\"0px\",border:\"none\",backgroundColor:buttonBgColor,color:buttonTextColor,cursor:\"pointer\",boxSizing:\"border-box\",textAlign:\"center\",fontFamily:\"'Overused Grotesk', sans-serif\",flexShrink:0,transition:\"background-color 0.2s ease, opacity 0.2s ease\"};// --- Dynamic Styles based on Layout and Status ---\nlet formStyle={...baseFormStyle};let inputStyle={...baseInputStyle};let buttonStyle={...baseButtonStyle};// Layout adjustments (Unchanged)\nif(layoutDirection===\"Stacked\"){formStyle={...formStyle,flexDirection:\"column\",gap:\"20px\"};inputStyle={...inputStyle,width:\"100%\"};buttonStyle={...buttonStyle,width:\"100%\"};}else{formStyle={...formStyle,flexDirection:\"row\",alignItems:\"flex-end\",gap:\"10px\"};inputStyle={...inputStyle,flexGrow:1,width:\"auto\"};buttonStyle={...buttonStyle,width:\"auto\"};}// Status adjustments for Button (Unchanged logic, uses props)\nlet currentButtonText=buttonText;if(status===\"submitting\"){currentButtonText=\"Subscribing...\";buttonStyle={...buttonStyle,cursor:\"wait\",opacity:.7};}else if(status===\"success\"){currentButtonText=successButtonText;buttonStyle={...buttonStyle,backgroundColor:successButtonBgColor,cursor:\"default\"};}else if(status===\"error\"){currentButtonText=errorButtonText;buttonStyle={...buttonStyle,backgroundColor:errorButtonBgColor};}// Honeypot field styles (Unchanged)\nconst honeypotStyle={position:\"absolute\",left:\"-5000px\",top:\"-5000px\",opacity:0,pointerEvents:\"none\"};return /*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:formStyle,name:\"lemonsqueezy-subscribe-form\",children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",placeholder:placeholderText,value:email,onChange:e=>setEmail(e.target.value),required:true,disabled:status===\"submitting\"||status===\"success\",// Apply final style, ensuring text color overrides icon color for text\nstyle:{...inputStyle,color:inputTextColor},\"aria-label\":\"Email Address\"}),/*#__PURE__*/_jsxs(\"div\",{style:honeypotStyle,\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"label\",{htmlFor:\"confirm_email_hp_ls\",children:\"Please leave this field blank\"}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"confirm_email\",id:\"confirm_email_hp_ls\",tabIndex:-1,autoComplete:\"off\",style:{width:\"100%\"}})]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:status===\"submitting\"||status===\"success\",style:buttonStyle,children:currentButtonText})]});}// --- Framer Property Controls (Unchanged) ---\nLemonSqueezySubscribe.defaultProps={buttonText:\"Subscribe to the Newsletter\",successButtonText:\"Thank you!\",errorButtonText:\"Something went wrong\",placeholderText:\"Email\",layoutDirection:\"Stacked\",// Default Colors\ninputTextColor:\"#000000\",inputBorderColor:\"#000000\",inputIconColor:\"#000000\",buttonBgColor:\"#212121\",buttonTextColor:\"#FFFFFF\",successButtonBgColor:\"#4CAF50\",errorButtonBgColor:\"#F44336\"};addPropertyControls(LemonSqueezySubscribe,{// Input Color Controls\ninputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:LemonSqueezySubscribe.defaultProps.inputTextColor},inputBorderColor:{type:ControlType.Color,title:\"Input Border\",defaultValue:LemonSqueezySubscribe.defaultProps.inputBorderColor},inputIconColor:{type:ControlType.Color,title:\"Input Icon\",defaultValue:LemonSqueezySubscribe.defaultProps.inputIconColor},// Button Color Controls\nbuttonBgColor:{type:ControlType.Color,title:\"Button BG\",defaultValue:LemonSqueezySubscribe.defaultProps.buttonBgColor},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:LemonSqueezySubscribe.defaultProps.buttonTextColor},successButtonBgColor:{type:ControlType.Color,title:\"Success BG\",defaultValue:LemonSqueezySubscribe.defaultProps.successButtonBgColor},errorButtonBgColor:{type:ControlType.Color,title:\"Error BG\",defaultValue:LemonSqueezySubscribe.defaultProps.errorButtonBgColor},// Existing Controls\nbuttonText:{type:ControlType.String,title:\"Button Label\",defaultValue:LemonSqueezySubscribe.defaultProps.buttonText},successButtonText:{type:ControlType.String,title:\"Success Label\",defaultValue:LemonSqueezySubscribe.defaultProps.successButtonText},errorButtonText:{type:ControlType.String,title:\"Error Label\",defaultValue:LemonSqueezySubscribe.defaultProps.errorButtonText},placeholderText:{type:ControlType.String,title:\"Placeholder\",defaultValue:LemonSqueezySubscribe.defaultProps.placeholderText},layoutDirection:{type:ControlType.Enum,title:\"Layout\",options:[\"Stacked\",\"Row\"],defaultValue:LemonSqueezySubscribe.defaultProps.layoutDirection,displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"LemonSqueezySubscribe\":{\"type\":\"reactComponent\",\"name\":\"LemonSqueezySubscribe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormProvider.map"],"mappings":"iLAMA,SAAgB,EAAsB,EAAM,CAAC,GAAK,CAAC,aAAW,oBAAkB,kBAAgB,kBAAgB,kBAChH,iBAAe,mBAAiB,iBAAe,gBAAc,kBAAgB,uBAAqB,qBAClG,SAAO,EACF,CAAC,EAAM,GAAUA,EAAS,GAAG,CAC7B,CAAC,EAAO,GAAWA,EAAS,OAAO,CAElC,EAAa,KAAM,IAAO,CAAC,EAAM,gBAAgB,CAAC,EAAU,aAAa,CAAC,IAAM,EA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