{"version":3,"file":"EmailValidation.roAc4gZE.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx","__esmMin","init_npm_react_18_3_1","oe","init_jsx_runtime","c","init_framer_BkYB2Gqq","DataObserverContext","getBusinessEmailError","trimmed","value","emailPattern","parts","domain","blockedDomains","businessEmailOnly","input","event","error","withbusinessEmailOnly","C","props","init_EmailValidation"],"sources":["https:/framerusercontent.com/modules/4q0liSkEFTWB641LbWEn/eNUreGPIW4BW1sbG6afa/EmailValidation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Free / personal email domains to block\nconst blockedDomains=[\"gmail.com\",\"yahoo.com\",\"hotmail.com\",\"outlook.com\",\"icloud.com\",\"aol.com\",\"protonmail.com\",\"live.com\",\"inbox.lt\",\"mail.ru\"];// Basic but safe email validation:\n// - something before @\n// - something after @\n// - at least one \".\" in the domain part\n// - at least 2 characters after the last \".\"\nconst emailPattern=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;function getBusinessEmailError(value){const trimmed=value.trim().toLowerCase();if(!trimmed)return\"\"// empty value -> let \"required\" handle it\n;// 1) Check general email format (catches \"@gmail\", \"name@\", \"name@gmai\", etc.)\nif(!emailPattern.test(trimmed)){return\"Please enter a valid email address.\";}// 2) Extract domain part after \"@\"\nconst parts=trimmed.split(\"@\");if(parts.length!==2){return\"Please enter a valid email address.\";}const domain=parts[1];// 3) Block free / personal domains\nif(blockedDomains.includes(domain)){return\"Please use a business email address (no Gmail, Yahoo, etc.).\";}// No error -> valid business email\nreturn\"\";}export function businessEmailOnly(){return{onChange(event){const input=event.target;const value=input.value;const error=getBusinessEmailError(value);// Set or clear the custom error message\ninput.setCustomValidity(error);// If you want to show the browser tooltip immediately while typing,\n// uncomment this:\n// if (error) {\n//     input.reportValidity()\n// }\n}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withbusinessEmailOnly(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...businessEmailOnly(props)});};}withbusinessEmailOnly.displayName=\"businessEmailOnly\";\nexport const __FramerMetadata__ = {\"exports\":{\"withbusinessEmailOnly\":{\"type\":\"reactHoc\",\"name\":\"withbusinessEmailOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"businessEmailOnly\":{\"type\":\"override\",\"name\":\"businessEmailOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmailValidation.map"],"mappings":"A,mKAMmD,SAASS,EAAsB,EAAM,CAAC,IAAMC,EAAQC,EAAM,KAAK,CAAC,CAAC,YAAY,EAAE,GAAG,CAACD,EAAQ,MAAM,GAEpJ,GAAG,CAACE,EAAa,KAAKF,CAAO,EAAG,MAAM,sCACtC,IAAMG,EAAMH,EAAQ,MAAM,GAAG,EAAE,GAAGG,EAAM,SAAS,EAAG,MAAM,sCAAuC,IAAMC,EAAOD,EAAM,GAEpH,OADGE,EAAe,SAASD,CAAM,EAAS,+DACpC,EAAG,CAAC,SAAgBE,GAAmB,CAAC,MAAM,CAAC,SAAS,EAAM,CAAC,IAAMC,EAAMC,EAAM,OAAaP,EAAMM,EAAM,MAAYE,EAAMV,EAAsBE,CAAK,EAC7JM,EAAM,kBAAkBE,CAAK,CAK7B,CAAC,CAAE,CAAoJ,SAAgBC,EAAsB,EAAE,CAAC,MAAO,KAAQhB,EAA+BJ,CAAuC,EAASC,EAAKoB,EAAE,CAAC,GAAGC,EAAM,GAAGN,EAAkBM,CAAK,CAAC,CAAC,EAAI,C,kDAhBzU,EAAe,CAAC,YAAY,YAAY,cAAc,cAAc,aAAa,UAAU,iBAAiB,WAAW,WAAW,SAAS,EAK3I,EAAa,gCAW6T,EAAsB,YAAY,mB"}