1import{u as f,j as e,A as d,m as p}from"./vendor-motion-hRg_q8lq.js";import{r as i,i as v}from"./vendor-react-E98sgxjj.js";import{u as m,aD as x,H as y}from"./index-BKzE8EQ8.js";import{du as b,dv as h}from"./vendor-fa-Bn2dnpnC.js";import{u as g}from"./useFocusTrap-BzqZufCW.js";import{S as u,u as j,i as w,a as E,r as S,b as k}from"./useStorefrontGame-yNzC8ieg.js";import"./vendor-query-bOUN_gKe.js";import"./useLocaleNavigate-BNriJdRU.js";import"./GameGrid-DDIfZYbN.js";import"./GameRow-BewUztqS.js";import"./MediaImage-DKgx-nW4.js";import"./MediaVideo-CBR0-TKg.js";import"./useIsStaff-DZf24Ivp.js";import"./usePlayingNow-D0BSBy1C.js";import"./playingNowApi-CB_pr25U.js";import"./DesktopGamePanel-BehZ5Jia.js";import"./CommentsView-BDfWyss4.js";import"./AuthShell-DPeun0C_.js";import"./AuthPanel-B4zt6SJ5.js";import"./pendingReferral-B4JPXhl_.js";import"./exploreHandoff-RQymaHkp.js";import"./LaunchPromoClips-eRoWsyBt.js";import"./useReleases-n_bF3yQQ.js";import"./tabBarStore-624ukDKJ.js";import"./playIntent-BFBGkqRe.js";function A(n){const a=document.querySelectorAll('[role="dialog"], [aria-modal="true"]');return Array.from(a).some(o=>o!==n&&!n?.contains(o))}function L({slug:n}){const{t:a}=m(["revamp","game","releases","comments"]),{data:o,isLoading:l,isPlaceholderData:s,error:r,refetch:t}=j(n);return l?e.jsx(u,{}):r||!o?!o&&r&&!w(r)?e.jsxs("div",{className:"page-container flex flex-col items-center pt-32 pb-24 text-center",children:[e.jsx("p",{className:"text-base text-muted-foreground",children:a("revamp:storefront.loadFailed")}),e.jsx("button",{type:"button",onClick:()=>void t(),className:"mt-4 inline-flex h-12 cursor-pointer items-center rounded-[10px] bg-pill px-7 text-base text-foreground transition-colors hover:bg-foreground
1/10",children:a("revamp:storefront.retry")})]}):e.jsx(E,{removal:S(r),mode:"overlay"}):e.jsxs(e.Fragment,{children:[e.jsx(y,{children:e.jsx("title",{children:`${o.name} | Tesana`})}),e.jsx(k,{game:o,mode:"overlay",bodyPending:s},o.id)]})}function Z({slug:n}){const{t:a}=m("revamp"),o=f(),l=x(),s=i.useRef(null),r=n!==null;return g(s,r),i.useEffect(()=>{if(!r)return;const{body:t}=document,c=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=c}},[r]),i.useEffect(()=>{if(!r)return;const t=document.activeElement instanceof HTMLElement?document.activeElement:null;return s.current?.focus({preventScroll:!0}),()=>{t?.isConnected&&t.focus({preventScroll:!0})}},[r]),i.useLayoutEffect(()=>{const t=s.current;!n||!t||(t.scrollTo?.({top:0}),t.contains(document.activeElement)||t.focus({preventScroll:!0}))},[n]),i.useEffect(()=>{if(!r)return;const t=c=>{c.key!=="Escape"||c.defaultPrevented||A(s.current)||(c.preventDefault(),l())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[r,l]),typeof document>"u"?null:v.createPortal(e.jsx(d,{children:n&&e.jsxs(p.div,{ref:s,role:"dialog","aria-modal":"true","aria-label":a("storefront.overlayLabel"),tabIndex:-1,initial:o?{opacity:0}:{opacity:0,scale:.97,y:12},animate:{opacity:1,scale:1,y:0},exit:o?{opacity:0}:{opacity:0,scale:.97,y:12},transition:{duration:o?.12:.3,ease:[.16,1,.3,1]},className:"fixed inset-0 z-[60] overflow-x-hidden overflow-y-auto overscroll-contain bg-background text-foreground outline-none pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]","data-storefront-overlay":n,children:[e.jsx(i.Suspense,{fallback:e.jsx(u,{}),children:e.jsx(L,{slug:n})}),e.jsx("button",{type:"button",onClick:l,"aria-label":a("storefront.close"),title:a("storefront.close"),className:"fixed top-[max(12px,env(safe-area-inset-top))] right-[max(12px,env(safe-area-inset-right))] z-20 flex size-10 cursor-pointer items-center justify-center rounded-full bg-white text-[#161616] shadow-[0_2px_12px_rgba(0,0,0,0.25)] transition-transform hover:scale-105 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white motion-reduce:transition-none md:top-6 md:right-6","data-storefront-close":"",children:e.jsx(b,{icon:h,className:"text-lg"})})]},"storefront-overlay")}),document.body)}export{Z as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.