{"version":3,"file":"CustomForm.v6fAkaMf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Z7YloXiGodh2j9LSufkn/IjFJLOP6UD7Z5Y9jt6Fo/CustomForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function SignupForm(props){const[formData,setFormData]=useState({name:\"\",email:\"\",password:\"\",utmSource:props.UTMCode});const handleInputChange=event=>{const{name,value}=event.target;setFormData({...formData,[name]:value});};const handleSubmit=async event=>{event.preventDefault();try{const response=await fetch(\"https://api.brain.fm/v2/auth/email-signup\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(formData)});const token=await response.json();if(response.ok){setToken(token.result,formData.utmSource);}else{console.error(\"Signup failed\",token);}}catch(error){console.error(\"Error:\",error);}};const setToken=(token,utmSource,options={})=>{const expiration=new Date;expiration.setFullYear(2030);const domain=\"brain.fm\";document.cookie=`token=${token}; expires=${expiration.toUTCString()}; domain=${domain}`;try{document.cookie=`expires=${expiration.toUTCString()}; domain=${domain}`;}catch(error){console.error(\"setToken(): could not set device id\",{reason:error});}window.location.href=\"https://my.brain.fm/welcome?extended_promo=30&utm_medium=lp&utm_source=\"+utmSource;};const getDeviceId=()=>{// Implementation for getting device ID\n};return /*#__PURE__*/_jsxs(\"div\",{className:\"container\",children:[/*#__PURE__*/_jsx(\"h1\",{children:\"Get Started for FREE\"}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,children:[/*#__PURE__*/_jsxs(\"div\",{className:\"input-wrapper\",children:[/*#__PURE__*/_jsxs(\"div\",{className:\"form-group\",children:[/*#__PURE__*/_jsx(\"label\",{className:formData.name.length>0?\"filled\":\"\",htmlFor:\"name\",children:\"First Name\"}),/*#__PURE__*/_jsx(\"input\",{type:\"text\",id:\"name\",name:\"name\",value:formData.name,onChange:handleInputChange,placeholder:\"First Name\"})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"form-group\",children:[/*#__PURE__*/_jsx(\"label\",{className:formData.email.length>0?\"filled\":\"\",htmlFor:\"email\",children:\"Email\"}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",id:\"email\",name:\"email\",className:\"email\",value:formData.email,onChange:handleInputChange,placeholder:\"Email\"})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"form-group\",children:[/*#__PURE__*/_jsx(\"label\",{className:formData.password.length>0?\"filled\":\"\",htmlFor:\"password\",children:\"Password\"}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",id:\"password\",name:\"password\",value:formData.password,onChange:handleInputChange,placeholder:\"Password\"})]})]}),/*#__PURE__*/_jsx(motion.button,{type:\"submit\",className:\"submit-button\",whileHover:{scale:1.05},whileTap:{scale:.95},children:\"Start Listening\"})]}),/*#__PURE__*/_jsx(\"style\",{jsx:true,children:`\n                .container {\n                    // display: flex;\n                    flex-direction: column;\n                    align-items: center;\n                    justify-content: center;\n                    color: #fff;\n                    font-family: Arial, sans-serif;\n                    padding: 40px;\n                    border-radius: 10px;\n                }\n\n                h1 {\n                    margin-bottom: 20px;\n                    text-align:center;\n                }\n\n                .form-group {\n                    text-align: left;\n                    position:relative;\n                }\n\n                .input-wrapper {\n                    margin-bottom:20px;\n                    overflow:hidden;\n                    border-radius:8px;\n                }\n\n                .form-group label {\n                    position:absolute;\n                    top:8px;\n                    left:10px;\n                    display: none;\n                    margin-bottom: 5px;\n                    color: #aaa;\n                }\n                .form-group label.filled {\n                    display:block;\n                }\n\n                .form-group input {\n                    width: 100%;\n                    padding: 30px 10px 20px 10px;\n                    border: none;\n                    background-color: #272329;\n                    color: #fff;\n                    font-size: 16px;\n                    outline:none;\n                }\n                .form-group input.email {\n                    border-top:1px solid black;                    \n                    border-bottom:1px solid black;\n                }\n\n                .form-group input::placeholder {\n                    color: #888;\n                }\n\n                .submit-button {\n                    width: 100%;\n                    padding: 15px;\n                    border: none;\n                    border-radius: 30px;\n                    background: #FFF;\n                    text-transform:uppercase;\n                    color: #000;\n                    font-weight:bold;\n                    font-size: 14px;\n                    cursor: pointer;\n                    letter-spacing:1px;\n                }\n\n                .submit-button:hover {\n\n                }\n            `})]});}addPropertyControls(SignupForm,{UTMCode:{title:\"UTM Code\",type:ControlType.String,defaultValue:\"Type...\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SignupForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomForm.map"],"mappings":"iYAA2K,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,CAAC,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,EAAM,QAAQ,CAAC,CAAO,EAAkB,GAAO,CAAC,GAAK,CAAC,OAAK,SAAO,EAAM,OAAO,EAAY,CAAC,GAAG,GAAU,GAAM,EAAM,CAAC,EAAS,EAAa,KAAM,IAAO,CAAC,EAAM,gBAAgB,CAAC,GAAG,CAAC,IAAM,EAAS,MAAM,MAAM,4CAA4C,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,EAAS,CAAC,CAAC,CAAO,EAAM,MAAM,EAAS,MAAM,CAAI,EAAS,GAAI,EAAS,EAAM,OAAO,EAAS,UAAU,CAAO,QAAQ,MAAM,gBAAgB,EAAM,OAAS,EAAM,CAAC,QAAQ,MAAM,SAAS,EAAM,GAAU,GAAU,EAAM,EAAU,EAAQ,EAAE,GAAG,CAAC,IAAM,EAAW,IAAI,KAAK,EAAW,YAAY,KAAK,CAAC,IAAM,EAAO,WAAW,SAAS,OAAO,SAAS,EAAM,YAAY,EAAW,aAAa,CAAC,WAAW,IAAS,GAAG,CAAC,SAAS,OAAO,WAAW,EAAW,aAAa,CAAC,WAAW,UAAgB,EAAM,CAAC,QAAQ,MAAM,sCAAsC,CAAC,OA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