{"version":3,"file":"DelayedNav.D6k1cYpc.mjs","names":["withDelayedNav","TARGET_PATH","DELAY"],"sources":["https:/framerusercontent.com/modules/Aq8OvxLBwmjLgPixQz5M/UpE345JfCXtJpkMt8Uyr/DelayedNav.js","https:/framerusercontent.com/modules/O3WhwOZVoU6RYNq9GPHS/k66WEWlgwMyNNgz6aySD/DelayedNav.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";// Configuration\nconst DELAY=1500;const TARGET_PATH=\"/weddinginvitation\";export function withDelayedNav(Component){return props=>{// This effect runs when the component mounts on the page\nuseEffect(()=>{const handlePageShow=event=>{// 'persisted' is true if the page is loaded from the mobile cache (back button)\nif(event.persisted){window.location.reload();}};window.addEventListener(\"pageshow\",handlePageShow);// Cleanup the listener when the component is destroyed\nreturn()=>window.removeEventListener(\"pageshow\",handlePageShow);},[]);return /*#__PURE__*/_jsx(Component,{...props,onClick:async event=>{// 1. Triggers the Framer Variant change (Open & Opacity 0)\nif(props.onClick)props.onClick(event);// 2. Delayed navigation\nsetTimeout(()=>{window.location.pathname=TARGET_PATH;},DELAY);}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDelayedNav\":{\"type\":\"reactHoc\",\"name\":\"withDelayedNav\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DelayedNav.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";// Configuration\nconst DELAY=1500;const TARGET_PATH=\"/invitation\";export function withDelayedNav(Component){return props=>{// This effect runs when the component mounts on the page\nuseEffect(()=>{const handlePageShow=event=>{// 'persisted' is true if the page is loaded from the mobile cache (back button)\nif(event.persisted){window.location.reload();}};window.addEventListener(\"pageshow\",handlePageShow);// Cleanup the listener when the component is destroyed\nreturn()=>window.removeEventListener(\"pageshow\",handlePageShow);},[]);return /*#__PURE__*/_jsx(Component,{...props,onClick:async event=>{// 1. Triggers the Framer Variant change (Open & Opacity 0)\nif(props.onClick)props.onClick(event);// 2. Delayed navigation\nsetTimeout(()=>{window.location.pathname=TARGET_PATH;},DELAY);}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDelayedNav\":{\"type\":\"reactHoc\",\"name\":\"withDelayedNav\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DelayedNav.map"],"mappings":"2HACwD,SAAgBA,EAAe,EAAU,CAAC,MAAO,KACzG,MAAc,CAAC,IAAM,EAAe,GAAO,CACxC,EAAM,WAAW,EAAO,SAAS,QAAQ,EAC5C,OADgD,EAAO,iBAAiB,WAAW,EAAe,KACxF,EAAO,oBAAoB,WAAW,EAAe,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,KAAM,IAAO,CACrI,EAAM,SAAQ,EAAM,QAAQ,EAAM,CACrC,eAAe,CAAC,EAAO,SAAS,SAASC,GAAcC,EAAM,EAAG,CAAC,2BANtB,IAA6B,CAClEA,EAAM,KAAWD,EAAY,wBCAc,SAAgB,EAAe,EAAU,CAAC,MAAO,KAClG,MAAc,CAAC,IAAM,EAAe,GAAO,CACxC,EAAM,WAAW,EAAO,SAAS,QAAQ,EAC5C,OADgD,EAAO,iBAAiB,WAAW,EAAe,KACxF,EAAO,oBAAoB,WAAW,EAAe,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,KAAM,IAAO,CACrI,EAAM,SAAQ,EAAM,QAAQ,EAAM,CACrC,eAAe,CAAC,EAAO,SAAS,SAAS,GAAc,EAAM,EAAG,CAAC,2BANtB,IAA6B,CAClE,EAAM,KAAW,EAAY"}