{"version":3,"file":"WithError.DPmaMFDw.mjs","names":["errorShown","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/NAfdvZ8XCvYmwG60mj0O/ko9XseiInQ5xAUpG5aqY/WithError.js"],"sourcesContent":["import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function errorShown(Component){return props=>{const[errorShown,setErrorShown]=useState(false);const[errorText,setErrorText]=useState(\"\");useEffect(()=>{const handleEvent=event=>{console.log(\"Got error event\");setErrorShown(true);setErrorText(event.error);};window.addEventListener(\"jaikError\",handleEvent);return()=>{window.removeEventListener(\"jaikError\",handleEvent);};},[]);const newProps={...props,text:errorText};return errorShown?/*#__PURE__*/_jsx(Component,{...newProps}):/*#__PURE__*/_jsx(_Fragment,{});};}\nexport const __FramerMetadata__ = {\"exports\":{\"errorShown\":{\"type\":\"reactHoc\",\"name\":\"errorShown\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithError.map"],"mappings":"oIAAuG,SAAgB,EAAW,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAACA,EAAW,GAAeC,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAG,CAAC,MAAc,CAAC,IAAM,EAAY,GAAO,CAAC,QAAQ,IAAI,kBAAkB,CAAC,EAAc,GAAK,CAAC,EAAa,EAAM,MAAM,EAAoD,OAAjD,EAAO,iBAAiB,YAAY,EAAY,KAAW,CAAC,EAAO,oBAAoB,YAAY,EAAY,GAAK,EAAE,CAAC,CAAC,IAAM,EAAS,CAAC,GAAG,EAAM,KAAK,EAAU,CAAC,OAAOD,EAAwB,EAAK,EAAU,CAAC,GAAG,EAAS,CAAC,CAAc,EAAKE,EAAU,EAAE,CAAC,uBAA3iB,IAAsC"}