{"version":3,"file":"RequestInviteForm.CoLUIKSa.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/lpcJM0s9P40ce7luSOCK/VUQMA16inWJ8NxJTz3mU/RequestInviteForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// ─── Spinner ─────────────────────────────────────────────────────────────────\nconst Spinner=()=>/*#__PURE__*/_jsx(motion.div,{animate:{rotate:360},transition:{duration:.7,repeat:Infinity,ease:\"linear\"},style:{width:20,height:20,borderRadius:\"50%\",border:\"4px solid #fb923c\",borderTop:\"4px solid #9a3412\"}});// ─── Styles ──────────────────────────────────────────────────────────────────\nconst styles=`\n    .form-wrapper {\n        position: relative;\n        width: 100%;\n    }\n\n    .input-group {\n        display: flex;\n        flex-direction: row;\n        align-items: center;\n        gap: 8px;\n    }\n\n    .input-field {\n        flex-grow: 1;\n        min-width: 280px;\n        padding: 14px 24px;\n        font-size: 20px;\n        font-family: 'Be Vietnam Pro', sans-serif;\n        color: #0c0a09;\n        background: #ffffff;\n        border: 1px solid #d6d3d1;\n        border-radius: 50px;\n        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);\n    }\n\n    .submit-button {\n        min-width: 210px;\n        height: 56px;\n        padding: 16px 20px;\n        display: inline-flex;\n        align-items: center;\n        justify-content: center;\n        font-size: 20px;\n        font-family: 'Be Vietnam Pro', sans-serif;\n        font-weight: 600;\n        line-height: 1;\n        white-space: nowrap;\n        color: rgb(255, 255, 255);\n        background-color: rgb(199, 83, 0);\n        border: 1px solid rgb(199, 83, 0);\n        border-radius: 50px;\n        cursor: pointer;\n        transition: all 150ms cubic-bezier(0.42, 0, 0.58, 1);\n        box-shadow:\n            rgba(0, 0, 0, 0.18) 0px 0.6px 1.56px -1.25px,\n            rgba(0, 0, 0, 0.16) 0px 2.29px 5.95px -2.5px,\n            rgba(0, 0, 0, 0.063) 0px 10px 26px -3.75px;\n    }\n\n    .submit-button:hover {\n        background-color: rgb(222, 93, 0);\n        border-color: rgb(222, 93, 0);\n    }\n\n    .submit-button:active {\n        background-color: rgb(241, 100, 0);\n        border-color: rgb(241, 100, 0);\n    }\n\n    .submit-button:disabled {\n        cursor: not-allowed;\n        opacity: 0.8;\n    }\n\n    @media (max-width: 640px) {\n        .input-group {\n            flex-direction: column;\n            align-items: stretch;\n        }\n\n        .submit-button {\n            width: 100%;\n        }\n    }\n`;// ─── Component ───────────────────────────────────────────────────────────────\nexport default function RequestAccessForm(props){const{ctaText,redirectUrl}=props;const[currentPageUrl,setCurrentPageUrl]=useState(\"\");const[isLoading,setIsLoading]=useState(false);useEffect(()=>{setCurrentPageUrl(window.location.href);},[]);const handleSubmit=async event=>{event.preventDefault();setIsLoading(true);const formData=new FormData(event.currentTarget);const jsonData=Object.fromEntries(formData.entries());try{await fetch(\"https://submit-form.com/mzBXg9Vbh\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\",Accept:\"application/json\"},body:JSON.stringify(jsonData)});let destination=redirectUrl;if(typeof jsonData.email===\"string\"&&jsonData.email){try{const url=new URL(redirectUrl);url.searchParams.set(\"email\",jsonData.email);destination=url.toString();}catch(error){const separator=redirectUrl.includes(\"?\")?\"&\":\"?\";destination=`${redirectUrl}${separator}email=${encodeURIComponent(jsonData.email)}`;}}window.location.href=destination;}catch(error){console.error(\"Error submitting form:\",error);alert(\"Hm... that didn't work. Please try one more time.\");}finally{setIsLoading(false);}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:styles}),/*#__PURE__*/_jsx(\"form\",{onSubmit:handleSubmit,className:\"form-wrapper\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"input-group\",children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",placeholder:\"Your work email\",className:\"input-field\",required:true}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"pageUrl\",value:currentPageUrl}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",className:\"submit-button\",disabled:isLoading,children:isLoading?/*#__PURE__*/_jsx(Spinner,{}):ctaText})]})})]});}// ─── Property Controls ───────────────────────────────────────────────────────\naddPropertyControls(RequestAccessForm,{ctaText:{type:ControlType.String,title:\"CTA Text\",defaultValue:\"Submit\",description:\"Text displayed on the submit button\"},redirectUrl:{type:ControlType.String,title:\"Redirect URL\",defaultValue:\"https://my.folio.co/signup\",description:\"Where to send the user after successful submission\"},appendEmail:{type:ControlType.Boolean,title:\"Append Email\",defaultValue:false,description:\"Append the submitted email to the redirect URL as an `email` query param (for prefilling the destination).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RequestAccessForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RequestInviteForm.map"],"mappings":"8PA8EA,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,UAAQ,eAAa,EAAW,CAAC,EAAe,GAAmBA,EAAS,EAAE,EAAO,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAo6B,OAAl6B,MAAc,CAAC,EAAkB,EAAO,SAAS,IAAI,CAAE,EAAE,CAAC,CAAC,EAA23B,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,SAAS,CAAM,CAAC,EAAe,EAAK,OAAO,CAAC,SAAS,KAA38B,IAAO,CAAC,EAAM,eAAe,EAAE,EAAa,EAAI,EAAE,IAAM,EAAS,IAAI,SAAS,EAAM,aAAa,EAAQ,EAAS,OAAO,YAAY,EAAS,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,MAAM,oCAAoC,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,OAAO,kBAAkB,EAAE,KAAK,KAAK,UAAU,CAAQ,CAAC,CAAC,EAAE,IAAI,EAAY,EAAY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