try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`1f9d210b-e783-4a3e-87f5-5e08efb320be`,e._sentryDebugIdIdentifier=`sentry-dbid-1f9d210b-e783-4a3e-87f5-5e08efb320be`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Gl as r,Oi as i,Xm as a,_r as o,aa as s,ai as c,jg as l,ng as u,xi as d}from"./entry.client-mpghtlrl.js";import{nt as f,ut as p}from"./xds-react-components-ihgca01z.js";import{i as m,n as h,o as g,s as _}from"./accelerators-mediz1dj.js";import{o as v}from"./navigation-stack-h7n8tudn.js";import{n as y}from"./OSSNoticesSystem-peyrjave.js";var b=n(),x=e(l(),1),S=u(),C=[`w-full`,`w-[90%]`,`w-[75%]`,`w-full`,`w-[85%]`,`w-[60%]`,`w-full`,`w-[95%]`,`w-[70%]`,`w-[80%]`,`w-[55%]`],w=40,T=o(e=>{let n=(0,b.c)(23),{isLoading:r,isError:i,content:a,isNavigatingBack:o}=e,{t:s}=t(`NoticesPage`);if(r){let e;n[0]===s?e=n[1]:(e=s(`Loading third-party notices`,{shortKey:`notices_loading`}),n[0]=s,n[1]=e);let t=e,r;n[2]===t?r=n[3]:(r=Array.from({length:w},(e,n)=>(0,S.jsx)(d,{className:`h-text-line-body ${C[n%C.length]}`,label:n===0?t:void 0},n)),n[2]=t,n[3]=r);let i;return n[4]===r?i=n[5]:(i=(0,S.jsx)(p,{className:`h-screen overflow-y-auto`,scrollAxis:`vertical`,children:(0,S.jsx)(c,{className:`twscope ms-4 flex min-h-[100dvh] flex-col gap-2 overflow-hidden p-4`,children:r})}),n[4]=r,n[5]=i),i}if(i){let e;n[6]===s?e=n[7]:(e=s(`Unable to load third-party notices. Please try again later.`,{shortKey:`notices_error`}),n[6]=s,n[7]=e);let t=e,r;return n[8]===t?r=n[9]:(r=(0,S.jsx)(p,{className:`h-screen overflow-y-auto`,scrollAxis:`vertical`,children:(0,S.jsx)(`div`,{className:`twscope ms-4 p-4 type-body`,children:(0,S.jsx)(`p`,{children:t})})}),n[8]=t,n[9]=r),r}let l;n[10]===s?l=n[11]:(l=s(`Navigating back`,{shortKey:`notices_navigating_back`}),n[10]=s,n[11]=l);let u=l,m;n[12]===a?m=n[13]:(m=(0,S.jsx)(`pre`,{className:`twscope ms-4 whitespace-pre-wrap p-4 type-body`,children:a}),n[12]=a,n[13]=m);let h;n[14]!==o||n[15]!==m?(h=(0,S.jsx)(p,{className:`h-screen overflow-y-auto`,scrollAxis:`vertical`,"aria-hidden":o,children:m}),n[14]=o,n[15]=m,n[16]=h):h=n[16];let g;n[17]!==o||n[18]!==u?(g=o&&(0,S.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60`,children:(0,S.jsx)(`div`,{className:`w-icon-display-1`,children:(0,S.jsx)(f,{isIndeterminate:!0,"aria-label":u})})}),n[17]=o,n[18]=u,n[19]=g):g=n[19];let _;return n[20]!==h||n[21]!==g?(_=(0,S.jsxs)(S.Fragment,{children:[h,g]}),n[20]=h,n[21]=g,n[22]=_):_=n[22],_},e=>{let{navigateBack:t}=v(),[n,i]=(0,x.useState)(!1),o=(0,x.useCallback)(()=>(i(!0),t(),!0),[t]);g(m(`gamepad-back`,o)),_((0,x.useMemo)(()=>({trigger:{type:`keyboard`,key:r.TVRemoteBack,modifiers:[]},action:o,sound:`back`,isHidden:!0}),[o]));let{isLoading:c,isError:l,data:u}=a(s,e=>e.queries.webNotices.getOptions()),{isLoading:d,data:f}=a(s,e=>e.queries.nativeNotices.getOptions()),p=typeof u==`string`,h=l||!c&&!p,b=!c&&!h&&p?y(u,f??null):``,S=!c&&!d&&!h&&b.length===0;return{isLoading:c,isError:h||S,content:b,isNavigatingBack:n}}),E=i(()=>{let e=T.useComponent(),t=h.useComponent();return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(e,{}),(0,S.jsx)(`div`,{className:`z-shell-bottom pointer-events-none fixed inset-0 flex flex-col justify-end`,children:(0,S.jsx)(t,{})})]})},`NoticesPage`);export{E as t};