{"version":3,"file":"LAMBDA_Function.BLOYecik.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/bNwpx3ZkNRCxiPaKstPA/D2KWq6Bs4gFtQbXoKcZA/LAMBDA_Function.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState}from\"react\";export function withFormSubmit(Component){return props=>{const[isSubmitting,setIsSubmitting]=useState(false);const[message,setMessage]=useState(\"\");const handleSubmit=async event=>{event.preventDefault();setIsSubmitting(true);setMessage(\"\");const form=event.target;const formData=new FormData(form);// Log the current origin for debugging\nconsole.log(\"Current origin:\",window.location.origin);console.log(\"Current hostname:\",window.location.hostname);try{const response=await fetch(\"https://forms.api.contio.ai/\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\",origin:\"https://contio.ai\"},body:JSON.stringify({email:formData.get(\"email\"),name:formData.get(\"name\"),company:formData.get(\"company\"),industry_name:formData.get(\"industry\"),job_role_name:formData.get(\"role\"),context:`Attendance: ${formData.get(\"attendance\")}`,source_name:\"Framer Website Form\"})});// Log response details for debugging\nconsole.log(\"Response status:\",response.status);console.log(\"Response headers:\",[...response.headers.entries()]);if(response.ok){setMessage(\"Thank you! Your submission was successful.\");form.reset();}else{const data=await response.json();console.error(\"Error response:\",data);setMessage(data.error||\"Something went wrong. Please try again.\");}}catch(error){console.error(\"Network error:\",error);setMessage(\"Network error. Please check your connection and try again.\");}finally{setIsSubmitting(false);}};return /*#__PURE__*/_jsx(Component,{...props,onSubmit:handleSubmit,style:{...props.style,pointerEvents:isSubmitting?\"none\":\"auto\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFormSubmit\":{\"type\":\"reactHoc\",\"name\":\"withFormSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LAMBDA_Function.map"],"mappings":"gIAAuE,SAAgB,EAAe,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAa,GAAiBA,EAAS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