{"version":3,"file":"ErrorHandlers.BqNWAvsN.mjs","names":["useState","p","_Fragment"],"sources":["https:/framerusercontent.com/modules/xsPY2UcGWFvuxt8gq4e2/YY7LNLY0ORGJeIkgEqCg/ErrorHandlers.js"],"sourcesContent":["/**\n * ErrorHandlers.tsx\n * Reusable error handling utilities for form submissions.\n * Provides a wrapper pattern that displays error messages beneath buttons.\n */import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState}from\"react\";/**\n * Higher-order component that wraps a button with error display capability.\n * The error message floats beneath the button without affecting its layout.\n *\n * @param Component - The component to wrap\n * @param propsFactory - Function that receives props, setError, clearError and returns modified props\n * @returns A function component (explicitly typed to avoid ComponentType callable issues)\n */export function withErrorDisplay(Component,propsFactory){return props=>{const[error,setError]=useState(\"\");const[errorPosition,setErrorPosition]=useState(null);const clearError=()=>setError(\"\");// Wrap the propsFactory to capture button position on click\nconst wrappedPropsFactory=(p,setErr,clearErr)=>{const modifiedProps=propsFactory(p,setErr,clearErr);const originalOnClick=modifiedProps.onClick;return{...modifiedProps,onClick:e=>{// Capture button position for error display\nconst button=e.currentTarget;const rect=button.getBoundingClientRect();setErrorPosition({top:rect.bottom+8,left:rect.left+rect.width/2});// Call the original onClick\nif(originalOnClick){originalOnClick(e);}}};};const modifiedProps=wrappedPropsFactory(props,setError,clearError);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...modifiedProps}),error&&errorPosition&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:errorPosition.top,left:errorPosition.left,transform:\"translateX(-50%)\",color:\"rgb(255, 93, 89)\",fontFamily:\"Inter, sans-serif\",fontSize:\"14px\",fontStyle:\"italic\",textAlign:\"center\",whiteSpace:\"nowrap\",pointerEvents:\"none\",zIndex:9999},children:error})]});};}/**\n * Validates that all provided values are non-empty strings.\n * @param values - Array of string values to validate\n * @returns true if all values are non-empty, false otherwise\n */export function validateAllFilled(values){return values.every(v=>v&&v.trim().length>0);}/**\n * Validates email format.\n * @param email - Email string to validate\n * @returns true if email contains @ symbol, false otherwise\n */export function validateEmail(email){return email.includes(\"@\");}/**\n * MCP COMPATIBILITY FOOTER. DO NOT MODIFY.\n * FEROX SYSTEMS 2025\n *\n * The Framer MCP can only see files that export an override. This dummy\n * override makes this file visible and editable to the MCP.\n *\n * Does nothing; just returns the component unchanged.\n * @framerDisableUnlink\n */export function withMcp(Component){return Component;}\nexport const __FramerMetadata__ = {\"exports\":{\"withErrorDisplay\":{\"type\":\"reactComponent\",\"name\":\"withErrorDisplay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"validateAllFilled\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMcp\":{\"type\":\"reactHoc\",\"name\":\"withMcp\",\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"validateEmail\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ErrorHandlers.map"],"mappings":"gIAWG,SAAgB,EAAiB,EAAU,EAAa,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAc,GAAkBA,EAAS,KAAK,CAGlD,OAAoB,EAAME,EAAU,CAAC,SAAS,CAAc,EAAK,EAAU,CAAC,KAFjK,EAAE,EAAO,IAAW,CAAC,IAAM,EAAc,EAAaD,EAAE,EAAO,EAAS,CAAO,EAAgB,EAAc,QAAQ,MAAM,CAAC,GAAG,EAAc,QAAQ,GAAG,CACtJ,IAAM,EAAtB,EAAE,cAAgC,uBAAuB,CAAC,EAAiB,CAAC,IAAI,EAAK,OAAO,EAAE,KAAK,EAAK,KAAK,EAAK,MAAM,EAAE,CAAC,CACrI,GAAiB,EAAgB,EAAE,EAAI,GAA2C,EAAM,MAH6F,EAAS,GAAG,CAGrF,CAA8F,CAAC,CAAC,GAAO,GAA4B,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,QAAQ,IAAI,EAAc,IAAI,KAAK,EAAc,KAAK,UAAU,mBAAmB,MAAM,mBAAmB,WAAW,oBAAoB,SAAS,OAAO,UAAU,SAAS,UAAU,SAAS,WAAW,SAAS,cAAc,OAAO,OAAO,KAAK,CAAC,SAAS,EAAM,CAAC,CAAC,CAAC,CAAC,EAIrhB,SAAgB,EAAkB,EAAO,CAAC,OAAO,EAAO,MAAM,GAAG,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,CAItF,SAAgB,EAAc,EAAM,CAAC,OAAO,EAAM,SAAS,IAAI,kBAlBgB,IAA4B"}