{"version":3,"file":"ImmersionShell.W2VHUZIa.mjs","names":["React.useState","React.useRef","React.useCallback","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","ne","p","init_jsx_runtime","ce","init_framer_BL70qLPA","RenderTarget","useSceneExperience","phase","setPhase","preview","timer","exit","el","root","io","ImmersionShell","paused","setPaused","key","onExit","hide","host","label","children","quiet","onResume","init_ImmersionShell"],"sources":["https:/framerusercontent.com/modules/GrleJmGfl0UksgI7SQ7I/r7teD0gpdPf8D3tbBtfz/ImmersionShell.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{RenderTarget}from\"framer\";export function useSceneExperience(root,preview=false){const[phase,setPhase]=React.useState(preview?\"game\":\"idle\"),timer=React.useRef(0);const exit=React.useCallback(()=>{clearTimeout(timer.current);setPhase(\"idle\");},[]);const enter=()=>{clearTimeout(timer.current);setPhase(\"launch\");timer.current=window.setTimeout(()=>setPhase(\"game\"),matchMedia(\"(prefers-reduced-motion:reduce)\").matches?0:460);};React.useEffect(()=>{if(preview)setPhase(\"game\");else if(RenderTarget.current()===RenderTarget.canvas)setPhase(\"idle\");},[preview]);React.useEffect(()=>{const el=root.current;if(!el)return;const io=new IntersectionObserver(([e])=>{if(!e.isIntersecting)exit();},{threshold:0});io.observe(el);return()=>{io.disconnect();clearTimeout(timer.current);};},[exit]);return{phase,enter,exit};}export default function ImmersionShell({children,onExit,label=\"\",onResume,quiet=false}){const[paused,setPaused]=React.useState(false),root=React.useRef(null);React.useEffect(()=>{const key=e=>{if(e.key===\"Escape\"){e.preventDefault();e.stopPropagation();onExit();}},hide=()=>{if(document.hidden)setPaused(true);};window.addEventListener(\"keydown\",key,true);document.addEventListener(\"visibilitychange\",hide);const host=root.current?.closest(\"#western,#crossing,#frontier,#noir,#records,#sticker-sheet,#dominion\");const io=new IntersectionObserver(([e])=>{if(!e.isIntersecting)onExit();},{threshold:0});if(host)io.observe(host);return()=>{window.removeEventListener(\"keydown\",key,true);document.removeEventListener(\"visibilitychange\",hide);io.disconnect();};},[onExit]);return /*#__PURE__*/_jsxs(\"div\",{ref:root,className:\"zn-immersion-shell\",\"data-zn-interactive\":true,\"data-game-paused\":paused,role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":label||\"Immersive scene\",children:[/*#__PURE__*/_jsx(\"style\",{children:`.zn-immersion-shell{position:absolute;inset:0;z-index:250;background:#050505;color:#eee9dd;overflow:hidden;animation:ziOpen .46s ease both;font-family:monospace;isolation:isolate}.zn-immersion-shell *{box-sizing:border-box}.zn-immersion-shell .zi-exit{position:absolute;z-index:20;right:20px;top:max(18px,env(safe-area-inset-top,0px));background:#080808db;border:1px solid #ded2b470;color:#eee9dd;padding:12px 15px;font:10px monospace;cursor:pointer}.zn-immersion-shell .zi-label{position:absolute;z-index:15;left:20px;top:23px;font:10px monospace;letter-spacing:.12em;max-width:55%}.zn-immersion-shell .zi-pause{position:absolute;inset:0;z-index:30;background:#000d;display:grid;place-content:center;gap:22px;text-align:center}.zn-immersion-shell .zi-pause button{padding:15px;color:#eee9dd;border:1px solid #c4ac7f;background:#17130c;cursor:pointer}.zn-immersion-shell button:focus-visible{outline:2px solid #eee9dd;outline-offset:3px}@keyframes ziOpen{from{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.zn-immersion-shell{animation:none!important}.zn-immersion-shell *{scroll-behavior:auto}}`}),children,!quiet&&/*#__PURE__*/_jsx(\"span\",{className:\"zi-label\",children:label}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"zi-exit\",onClick:onExit,children:\"EXIT \\xd7\"}),paused&&/*#__PURE__*/_jsxs(\"div\",{className:\"zi-pause\",role:\"status\",children:[\"PAUSED\",/*#__PURE__*/_jsx(\"button\",{onClick:()=>{setPaused(false);onResume?.();},children:\"RESUME\"})]})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"useSceneExperience\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"ImmersionShell\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImmersionShell.map"],"mappings":"A,8MAAsH,SAAgBe,EAAmB,EAAK,EAAQ,GAAM,CAAC,GAAK,CAACC,EAAMC,GAAUjB,EAAekB,EAAQ,OAAO,MAAM,EAAEC,EAAMlB,EAAa,CAAC,EAAQmB,EAAKlB,MAAsB,CAAC,aAAaiB,EAAM,OAAO,EAAEF,EAAS,MAAM,CAAE,EAAE,CAAC,CAAC,EAA4hB,OAAtWL,MAAoB,CAAIM,EAAQD,EAAS,MAAM,EAAUH,EAAa,QAAQ,IAAIA,EAAa,QAAOG,EAAS,MAAM,CAAE,EAAE,CAACC,CAAO,CAAC,EAAEN,MAAoB,CAAC,IAAMS,EAAGC,EAAK,QAAQ,GAAG,CAACD,EAAG,OAAO,IAAME,EAAG,IAAI,sBAAsB,CAAC,KAAK,CAAK,EAAE,gBAAeH,EAAK,CAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAiB,OAAfG,EAAG,QAAQF,CAAE,MAAY,CAACE,EAAG,WAAW,EAAE,aAAaJ,EAAM,OAAO,CAAE,CAAE,EAAE,CAACC,CAAI,CAAC,EAAQ,CAAC,QAAM,UAAvhB,CAAC,aAAaD,EAAM,OAAO,EAAEF,EAAS,QAAQ,EAAE,EAAM,QAAQb,EAAO,eAAea,EAAS,MAAM,EAAE,WAAW,iCAAiC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAE,EAA2X,MAAI,CAAE,CAAC,SAAwBO,EAAe,CAAC,WAAS,SAAO,QAAM,GAAG,WAAS,QAAM,IAAO,CAAC,GAAK,CAACC,EAAOC,GAAW1B,EAAe,EAAK,EAAEsB,EAAKrB,EAAa,IAAI,EAAomB,OAAlmBW,MAAoB,CAAC,IAAMe,EAAI,GAAG,CAAI,EAAE,MAAM,WAAU,EAAE,eAAe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