{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/vbPn1QlJifKPNkl1zOFV/alN2SGgxYAGfIqx0dzoM/InputValidation.js", "ssg:https://framerusercontent.com/modules/HeGwlNDWX5Z4DTImB0XA/q44s5QfUsg4Lw4IfrsiY/ScrollToTop.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";// Validation functions mapping\nconst validationFunctions={email:{regex:/^[^@\\s]+@[^@\\s]+\\.[^@\\s]{2,63}$/,errorMessage:\"Invalid email address.\"}};// Override function\nexport function withValidation(Component){return({validationType=\"email\",...props})=>{const[value,setValue]=useState(\"\");const[isValid,setIsValid]=useState(true);// Handle input changes\nconst handleInputChange=e=>{const newValue=e.target.value;setValue(newValue);// Validate input using the selected validation type\nconst validation=validationFunctions[validationType];setIsValid(validation.regex.test(newValue));};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\"},children:[/*#__PURE__*/_jsx(Component,{...props,value:value,onChange:handleInputChange,style:{...props.style,width:\"100%\",boxSizing:\"border-box\",borderColor:isValid?\"#FF7500\":\"red\"}}),!isValid&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",color:\"red\",fontSize:\"12px\",top:\"100%\",left:0,marginTop:\"4px\"},children:validationFunctions[validationType].errorMessage})]});};}// Property controls\nimport{addPropertyControls,ControlType}from\"framer\";addPropertyControls(withValidation,{validationType:{type:ControlType.Enum,options:[\"email\"],optionTitles:[\"Email\"],title:\"Validation Type\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"withValidation\":{\"type\":\"reactHoc\",\"name\":\"withValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./InputValidation.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function withScrollToBodyOnSuccess(Component){return props=>{useEffect(()=>{console.log(\"Setting up MutationObserver to detect specific DOM changes\");// Create a mutation observer to detect only specific changes in the component\nconst observer=new MutationObserver(mutationsList=>{let shouldScroll=false;// Check each mutation to determine if a relevant change occurred\nmutationsList.forEach(mutation=>{if(mutation.type===\"attributes\"&&mutation.attributeName===\"data-framer-name\"){// Check if the attribute change indicates a switch to \"Success\" variant\nconst targetElement=mutation.target;// Log the new value of the attribute for debugging\nconsole.log(\"Attribute change detected on:\",targetElement);console.log(\"New value of data-framer-name:\",targetElement.getAttribute(\"data-framer-name\"));if(targetElement.getAttribute(\"data-framer-name\")===\"Success\"){shouldScroll=true;}}});if(shouldScroll){console.log(\"Detected change to Success variant, scrolling to top of body\");// Scroll the <body> element directly\ndocument.body.scrollTo({top:0,behavior:\"smooth\"});console.log(\"Scrolled <body> to top\");// Scroll the entire page (HTML root element)\ndocument.documentElement.scrollTo({top:0,behavior:\"smooth\"});console.log(\"Scrolled <html> to top\");}});// Observe changes in the entire document body, but limit it to attribute changes\nobserver.observe(document.body,{attributes:true,subtree:true});// Cleanup the observer when the component unmounts\nreturn()=>{console.log(\"Cleaning up MutationObserver\");observer.disconnect();};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withScrollToBodyOnSuccess\":{\"type\":\"reactHoc\",\"name\":\"withScrollToBodyOnSuccess\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTop.map"],
  "mappings": "4EACA,IAAMA,EAAoB,CAAC,MAAM,CAAC,MAAM,kCAAkC,aAAa,wBAAwB,CAAC,EACzG,SAASC,EAAeC,EAAU,CAAC,MAAM,CAAC,CAAC,eAAAC,EAAe,QAAQ,GAAGC,CAAK,IAAI,CAAC,GAAK,CAACC,EAAMC,CAAQ,EAAEC,EAAS,EAAE,EAAO,CAACC,EAAQC,CAAU,EAAEF,EAAS,EAAI,EAE7D,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM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I,EAAE,SAAS,QAAQ,CAAC,EAAE,QAAQ,IAAI,wBAAwB,EAAG,CAAC,EACrG,OAAAF,EAAS,QAAQ,SAAS,KAAK,CAAC,WAAW,GAAK,QAAQ,EAAI,CAAC,EACvD,IAAI,CAAC,QAAQ,IAAI,8BAA8B,EAAEA,EAAS,WAAW,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsBK,EAAKR,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAI",
  "names": ["validationFunctions", "withValidation", "Component", "validationType", "props", "value", "setValue", "ye", "isValid", "setIsValid", "p", "e", "newValue", "validation", "addPropertyControls", "ControlType", "withScrollToBodyOnSuccess", "Component", "props", "ue", "observer", "mutationsList", "shouldScroll", "mutation", "targetElement", "p"]
}
