{"version":3,"file":"Timer.DX5REEBN.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/thp4OkDOoDb3ODSQpjx0/yRHvcRGPBJyyFPCzll4Z/Timer.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{useState,useEffect}from\"react\";// --- Shared, in-memory signals. Reset automatically on every real page load. ---\nlet dismissed=false;let deadline=0// timestamp when the popup should reveal; 0 = not set yet\n;const closeListeners=new Set;function cancel(){dismissed=true;}function broadcastClose(){closeListeners.forEach(fn=>fn());}// Apply to the pop-up element.\nexport function withDelayedReveal(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[open,setOpen]=useState(false);useEffect(()=>{// Set the deadline once per page load. Survives re-mounts,\n// so opening the native overlay can't restart the countdown.\nif(deadline===0){deadline=Date.now()+3e4;}const remaining=Math.max(0,deadline-Date.now());const timer=setTimeout(()=>{if(!dismissed)setOpen(true);},remaining);const onClose=()=>setOpen(false);closeListeners.add(onClose);return()=>{clearTimeout(timer);closeListeners.delete(onClose);};},[]);// Lock page scroll only while the pop-up is on screen.\nuseEffect(()=>{if(!open)return;if(typeof document===\"undefined\")return;const previous=document.body.style.overflow;document.body.style.overflow=\"hidden\";return()=>{document.body.style.overflow=previous;};},[open]);if(!open){return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,display:\"none\"}});}return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,position:\"fixed\",top:0,left:0,right:0,height:\"100dvh\",zIndex:9999}});});}// Apply to the button that cancels the pop-up (before it opens).\n// Uses onPointerDown so the native overlay's click handler can't swallow it.\nexport function withCancelReveal(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onPointerDown:event=>{cancel();props.onPointerDown?.(event);}});});}// Apply to the element that closes the pop-up (after it opens).\nexport function withCloseOverlay(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onClick:event=>{broadcastClose();props.onClick?.(event);}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCancelReveal\":{\"type\":\"reactHoc\",\"name\":\"withCancelReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseOverlay\":{\"type\":\"reactHoc\",\"name\":\"withCloseOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDelayedReveal\":{\"type\":\"reactHoc\",\"name\":\"withDelayedReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Timer.map"],"mappings":"gIAE8B,SAAS,GAAQ,CAAC,EAAU,EAAK,CAAC,SAAS,GAAgB,CAAC,EAAe,QAAQ,GAAI,EAAG,CAAC,CAAE,CAC3H,SAAgB,EAAkB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAK,GAASA,EAAS,EAAK,EAGkM,OAHhM,MAAc,CAEzI,IAAW,IAAG,EAAS,KAAK,IAAI,EAAE,KAAK,IAAM,EAAU,KAAK,IAAI,EAAE,EAAS,KAAK,IAAI,CAAC,EAAQ,EAAM,eAAe,CAAK,GAAU,EAAQ,EAAI,CAAE,EAAE,CAAS,EAAQ,MAAY,EAAQ,EAAK,EAA8B,OAA5B,EAAe,IAAI,CAAO,MAAY,CAAC,aAAa,CAAK,EAAE,EAAe,OAAO,CAAO,CAAE,CAAE,EAAE,CAAC,CAAC,EAChS,MAAc,CAAiB,GAAb,CAAC,GAAe,OAAO,SAAW,IAAY,OAAO,IAAM,EAAS,SAAS,KAAK,MAAM,SAA+C,MAAtC,UAAS,KAAK,MAAM,SAAS,aAAmB,CAAC,SAAS,KAAK,MAAM,SAAS,CAAS,CAAE,EAAE,CAAC,CAAI,CAAC,EAAM,EAAwH,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,MAAM,CAAC,GAAG,EAAM,MAAM,SAAS,QAAQ,IAAI,EAAE,KAAK,E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