{"version":3,"file":"CodeOverride.DzqqdWf3.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/GVYeRXPXeHmtHJ2I9kuU/07OMi6WZHTktI2yP0tJv/CodeOverride.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{Data}from\"framer\";// Shared state so button and red error text element can sync\nconst store=Data({error:null,startTime:Date.now()});export function ValidateForm(){useEffect(()=>{store.startTime=Date.now();},[]);const blockedDomains=[\"mailinator.com\",\"guerrillamail.com\",\"10minutemail.com\",\"tempmail.com\",\"yopmail.com\",\"dispostable.com\",\"fakeinbox.com\"];const spamKeywords=[\"crypto\",\"loan\",\"investment\",\"porn\",\"click here\",\"money transfer\",\"viagra\"];const isMostlyEnglish=text=>{const englishLetters=text.match(/[a-zA-Z]/g)?.length||0;const nonEnglish=text.match(/[^\\x00-\\x7F]/g)?.length||0;return englishLetters>=nonEnglish*3;};const looksLikeGibberish=text=>{const noSpaces=text.replace(/\\s+/g,\"\");const consonantClusters=text.match(/[^aeiou]{6,}/gi);const hashy=/[0-9]{3,}|[a-zA-Z0-9]{8,}/.test(noSpaces);const repetitive=/(.)\\1{4,}/.test(noSpaces);return consonantClusters||hashy||repetitive;};const highlightField=(field,hasError)=>{};const handleSubmit=event=>{const target=event.target.closest(\"button[data-reset='button']\");if(!target)return;event.preventDefault();event.stopPropagation();const form=target.closest(\"form\");const emailField=form.querySelector(\"input[type='email']\");const nameField=form.querySelector(\"input[name='name']\");const messageField=form.querySelector(\"textarea\");const honey=form.querySelector(\"input[name='website']\")?.value||\"\";// reset highlights\nhighlightField(emailField,false);highlightField(nameField,false);highlightField(messageField,false);store.error=null;const email=emailField?.value.trim()||\"\";const name=nameField?.value.trim()||\"\";const message=messageField?.value.trim()||\"\";const emailDomain=email.split(\"@\")[1]?.toLowerCase();if(honey!==\"\"){console.log(\"🧠 Honeypot triggered — spam bot detected.\");return;}// ⛔ Validations with single global message\nif(!email||!emailDomain){console.log(\"Please enter a valid email address.\");alert(\"Please enter a valid email address.\");highlightField(emailField,true);store.error=\"Please enter a valid email address.\";return;}if(Date.now()-store.startTime<2500){console.log(\"❌ Too fast — likely bot.\");alert(\"Validation failed\");store.error=\"Please wait a moment before submitting.\";return;}if(blockedDomains.some(d=>emailDomain?.includes(d))){console.log(\"❌ Temporary or fake email detected.\");alert(\"Please enter a valid email address.\");highlightField(emailField,true);store.error=\"Temporary or disposable emails are not allowed.\";return;}if(looksLikeGibberish(message)){alert(\"Please enter a valid message\");highlightField(messageField,true);store.error=\"Message looks invalid or auto-generated.\";return;}if(!isMostlyEnglish(message)){alert(\"Please enter a valid message\");highlightField(messageField,true);store.error=\"Please write your message in English.\";return;}// ✅ Passed all\nstore.error=null;highlightField(emailField,false);highlightField(nameField,false);highlightField(messageField,false);console.log(\"✅ Passed all validations — submitting form...\");// Trigger Framer form submission\nconst realSubmit=form.querySelector('[type=\"submit\"], [data-framer-submit]');if(realSubmit)realSubmit.click();else form.submit();};return{onClick:handleSubmit};}// 🧾 Single red error text above button\nexport function ShowError(){return{text:store.error||\"\",opacity:store.error?1:0};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withValidateForm(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ValidateForm(props)});};}withValidateForm.displayName=\"ValidateForm\";export function withShowError(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ShowError(props)});};}withShowError.displayName=\"ShowError\";\nexport const __FramerMetadata__ = {\"exports\":{\"ShowError\":{\"type\":\"override\",\"name\":\"ShowError\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ValidateForm\":{\"type\":\"override\",\"name\":\"ValidateForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowError\":{\"type\":\"reactHoc\",\"name\":\"withShowError\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withValidateForm\":{\"type\":\"reactHoc\",\"name\":\"withValidateForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CodeOverride.map"],"mappings":"mQACoD,SAAgB,GAAc,CAAC,MAAc,CAAC,EAAM,UAAU,KAAK,KAAK,EAAG,EAAE,CAAC,CAAC,IAAM,EAAe,CAAC,iBAAiB,oBAAoB,mBAAmB,eAAe,cAAc,kBAAkB,gBAAgB,CAAuG,EAAgB,GAAM,CAAC,IAAM,EAAe,EAAK,MAAM,YAAY,EAAE,QAAQ,EAAQ,EAAW,EAAK,MAAM,gBAAgB,EAAE,QAAQ,EAAE,OAAO,GAAgB,EAAW,GAAU,EAAmB,GAAM,CAAC,IAAM,EAAS,EAAK,QAAQ,OAAO,GAAG,CAAO,EAAkB,EAAK,MAAM,iBAAiB,CAAO,EAAM,4BAA4B,KAAK,EAAS,CAAO,EAAW,YAAY,KAAK,EAAS,CAAC,OAAO,GAAmB,GAAO,GAIjqB,MAAM,CAAC,QAJouB,GAAO,CAAC,IAAM,EAAO,EAAM,OAAO,QAAQ,8BAA8B,CAAC,GAAG,CAAC,EAAO,OAAO,EAAM,gBAAgB,CAAC,EAAM,iBAAiB,CAAC,IAAM,EAAK,EAAO,QAAQ,OAAO,CAAO,EAAW,EAAK,cAAc,sBAAsB,CAAO,EAAU,EAAK,cAAc,qBAAqB,CAAO,EAAa,EAAK,cAAc,WAAW,CAAO,EAAM,EAAK,cAAc,wBAAwB,EAAE,OAAO,GAC5pC,EAAM,MAAM,KAAK,IAAM,EAAM,GAAY,MAAM,MAAM,EAAE,GAAc,GAAW,MAAM,MAAM,CAAK,IAAM,EAAQ,GAAc,MAAM,MAAM,EAAE,GAAS,EAAY,EAAM,MAAM,IAAI,CAAC,IAAI,aAAa,CAAC,GAAG,IAAQ,GAAG,CAAC,QAAQ,IAAI,6CAA6C,CAAC,OAChX,GAAG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