{"version":3,"file":"RequestInviteForm.DAO8Y2-e.mjs","names":["useState","_Fragment","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","l","_e","p","c","init_jsx_runtime","ce","init_framer_motion_DhsWWWsN","motion","addPropertyControls","init_framer_BWFVvmND","ControlType","RequestAccessForm","props","currentPageUrl","setCurrentPageUrl","isLoading","setIsLoading","styles","event","formData","jsonData","destination","redirectUrl","url","separator","error","Spinner","ctaText","init_RequestInviteForm"],"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":"A,8PA8EA,SAAwBiB,EAAkB,EAAM,CAAC,GAAK,CAAC,UAAQ,eAAaC,EAAW,CAACC,EAAeC,GAAmBpB,EAAS,EAAE,EAAO,CAACqB,EAAUC,GAActB,EAAS,EAAK,EAAo6B,OAAl6BW,MAAc,CAACS,EAAkBjB,EAAO,SAAS,IAAI,CAAE,EAAE,CAAC,CAAC,EAA23B,gBAAMF,EAAU,CAAC,SAAS,CAAc,gBAAK,QAAQ,CAAC,SAASsB,CAAM,CAAC,EAAe,gBAAK,OAAO,CAAC,SAAS,KAA38B,IAAO,CAACC,EAAM,eAAe,EAAEF,EAAa,E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