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]=`39615f1f-57c2-4cfc-a527-247b0e4112ba`,e._sentryDebugIdIdentifier=`sentry-dbid-39615f1f-57c2-4cfc-a527-247b0e4112ba`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{T as t}from"./vendor-misc-dys7qi6h.js";import{$m as n,Ag as r,Gu as i,Lm as a,Oi as o,P as s,Qh as c,Yh as l,Zm as u,_r as d,jg as f,jm as p,ng as m,pr as h,sn as g}from"./entry.client-mpghtlrl.js";import{s as _}from"./navigation-stack-h7n8tudn.js";var v=r(),y=e(f(),1),b=m(),x={entries:[],defaultEntry:{size:{width:230,height:230},imageType:`jpg`}},S=2e3,C=d(e=>{let t=(0,v.c)(23),{displayName:r,nextOnboardingFlowUrl:i,isPending:a}=e,{t:o}=n(`WelcomePage`),c=g(),{clear:l}=_(),u,d;t[0]!==a||t[1]!==i||t[2]!==l||t[3]!==c?(u=()=>{if(a||!i)return;let e=setTimeout(()=>{l(),c(i,{replace:!0})},S);return()=>{clearTimeout(e)}},d=[a,c,l,i],t[0]=a,t[1]=i,t[2]=l,t[3]=c,t[4]=u,t[5]=d):(u=t[4],d=t[5]),(0,y.useEffect)(u,d);let f;t[6]!==r||t[7]!==o?(f=o(`Welcome, {name}`,{values:{name:r},shortKey:`welcome_greeting`}),t[6]=r,t[7]=o,t[8]=f):f=t[8];let p=f,m;t[9]===o?m=t[10]:(m=o(`You're all set!`,{shortKey:`welcome_all_set`}),t[9]=o,t[10]=m);let C=m;if(a){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{className:`h-screen w-full bg-container-backgrounds-elevation-background-level-1`,children:(0,b.jsx)(`div`,{className:`flex size-full items-center justify-center`})}),t[11]=e):e=t[11],e}let w=`${p}. ${C}`,T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,b.jsx)(s,{gamerpicImageConstraints:x,kind:`visual`,"aria-hidden":!0}),t[12]=T):T=t[12];let E;t[13]===p?E=t[14]:(E=(0,b.jsx)(`h1`,{className:`text-center text-noninteractive-content-primary-content type-display1`,children:p}),t[13]=p,t[14]=E);let D;t[15]===C?D=t[16]:(D=(0,b.jsx)(`p`,{className:`text-center text-noninteractive-content-primary-content type-body`,children:C}),t[15]=C,t[16]=D);let O;t[17]!==E||t[18]!==D?(O=(0,b.jsxs)(`div`,{className:`flex flex-col items-center gap-layout-vertical-title-and-row-regular`,children:[E,D]}),t[17]=E,t[18]=D,t[19]=O):O=t[19];let k;return t[20]!==w||t[21]!==O?(k=(0,b.jsx)(h,{className:`h-screen w-full bg-container-backgrounds-elevation-background-level-1 pb-layout-horizontal-margin pe-layout-horizontal-margin ps-layout-horizontal-margin pt-layout-horizontal-margin`,children:(0,b.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-layout-vertical-related-content-in-a-section-loose`,role:`status`,"aria-live":`polite`,"aria-label":w,children:[T,O]})}),t[20]=w,t[21]=O,t[22]=k):k=t[22],k},()=>{let{t:e}=n(`WelcomePage`),{authentication:r,onboarding:a,settings:o}=u(),{pathname:s}=p(),[{redirectUri:d}]=t(i.onboarding.welcome),{data:f,isPending:m}=c(r.queries.userInfo.getActiveUserQuery().getOptions()),{data:h,isPending:g}=c(a.queries.onboardingNavigation.getOptions({pathname:s,redirectUri:d})),{mutate:_}=l(o.mutations.setHasCompletedTVOnboardingSetting.getOptions());(0,y.useEffect)(()=>{_({settingValue:!0})},[_]);let v=m||g;return{displayName:f?.fullName||f?.gamertag.base||f?.gamertag.legacyGamertag||e(`Player`,{shortKey:`welcome_player_fallback`}),nextOnboardingFlowUrl:h?.nextOnboardingFlowUrl||h?.finalDestinationUrl||i.home.$path(),isPending:v}}),w=a(o(()=>(0,b.jsx)(C.useComponent(),{}),`WelcomePage`));export{w as default};