{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/rn0jFvAMM0MMocswi7Pw/F4AUbBj6FCe9plbO7ww8/Email_validator.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Regex to match common free email providers\nconst freeEmailRegex=/@(gmail|yahoo|outlook|hotmail|aol|icloud|Zoho)\\.com$/i;export function withWorkEmailValidation(Component){return props=>{const{value=\"\",onChange,style,...rest}=props;const[error,setError]=useState(null);const handleChange=event=>{const newValue=event.target.value;const isFreeEmail=freeEmailRegex.test(newValue);// Update error state based on the email validation\nif(isFreeEmail){setError(\"Please use your work email address\");}else{setError(null);}// Trigger onChange if the email is not from a free provider\nif(onChange){onChange({...event,target:{...event.target,value:newValue}});}};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\"},children:[/*#__PURE__*/_jsx(Component,{...rest,value:value,onChange:handleChange,style:{...style,borderColor:error?\"red\":\"black\",width:\"100%\"}}),error&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"white\",marginTop:\"4px\",fontSize:\"12px\"},children:error})]});};}// Adding property controls for customization\naddPropertyControls(withWorkEmailValidation,{value:{type:ControlType.String,title:\"Email\",placeholder:\"Enter your work email\"},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter your work email\"},errorColor:{type:ControlType.Color,title:\"Error Color\",defaultValue:\"#ff0000\"},validColor:{type:ControlType.Color,title:\"Valid Border Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"withWorkEmailValidation\":{\"type\":\"reactHoc\",\"name\":\"withWorkEmailValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Email_validator.map"],
  "mappings": "uGACA,IAAMA,EAAe,wDAA+D,SAASC,EAAwBC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAAC,MAAAC,EAAM,GAAG,SAAAC,EAAS,MAAAC,EAAM,GAAGC,CAAI,EAAEJ,EAAW,CAACK,EAAMC,CAAQ,EAAEC,EAAS,IAAI,EAElJ,OAAoBC,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,MAAM,EAAE,SAAS,CAAcC,EAAKV,EAAU,CAAC,GAAGK,EAAK,MAAMH,EAAM,SAFsDS,GAAO,CAAC,IAAMC,EAASD,EAAM,OAAO,MAAYE,EAAYf,EAAe,KAAKc,CAAQ,EAC5TL,EAAbM,EAAsB,qCAAqD,IAAjB,EAC1DV,GAAUA,EAAS,CAAC,GAAGQ,EAAM,OAAO,CAAC,GAAGA,EAAM,OAAO,MAAMC,CAAQ,CAAC,CAAC,CAAG,EAAyI,MAAM,CAAC,GAAGR,EAAM,YAAYE,EAAM,MAAM,QAAQ,MAAM,MAAM,CAAC,CAAC,EAAEA,GAAoBI,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,QAAQ,UAAU,MAAM,SAAS,MAAM,EAAE,SAASJ,CAAK,CAAC,CAAC,CAAC,CAAC,CAAE,CAAE,CAChYQ,EAAoBf,EAAwB,CAAC,MAAM,CAAC,KAAKgB,EAAY,OAAO,MAAM,QAAQ,YAAY,uBAAuB,EAAE,YAAY,CAAC,KAAKA,EAAY,OAAO,MAAM,cAAc,aAAa,uBAAuB,EAAE,WAAW,CAAC,KAAKA,EAAY,MAAM,MAAM,cAAc,aAAa,SAAS,EAAE,WAAW,CAAC,KAAKA,EAAY,MAAM,MAAM,qBAAqB,aAAa,SAAS,CAAC,CAAC",
  "names": ["freeEmailRegex", "withWorkEmailValidation", "Component", "props", "value", "onChange", "style", "rest", "error", "setError", "ye", "u", "p", "event", "newValue", "isFreeEmail", "addPropertyControls", "ControlType"]
}
