{"version":3,"file":"LAMBDA_Function.CbL2OJbo.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,EA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