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]=`e12e6c47-f281-4417-858d-89f8aff4d305`,e._sentryDebugIdIdentifier=`sentry-dbid-e12e6c47-f281-4417-858d-89f8aff4d305`)}catch{}import{Ag as e,Gu as t,Qh as n,cf as r,cm as i,gg as a,jm as o,lf as s,lm as c,rh as l,sf as u,sn as d,um as f,yf as p}from"./entry.client-mpghtlrl.js";var m=e(),h=()=>{let e=(0,m.c)(2),r=c(),i;e[0]===r.queries.UNSAFE_anonymousOnlyConfiguration?i=e[1]:(i=r.queries.UNSAFE_anonymousOnlyConfiguration.getOptions(`enableAuthTemporaryV2`),e[0]=r.queries.UNSAFE_anonymousOnlyConfiguration,e[1]=i);let{data:a}=n(i);return a?t.auth.msaV2:t.auth.msa},g=e=>{let t=(0,m.c)(7),r=h(),{pathname:i}=o(),a=c(),s;t[0]===a.queries.UNSAFE_anonymousOnlyConfiguration?s=t[1]:(s=a.queries.UNSAFE_anonymousOnlyConfiguration.getOptions(`auth.xbox.sandboxId`),t[0]=a.queries.UNSAFE_anonymousOnlyConfiguration,t[1]=s);let{data:l}=n(s),u;if(t[2]!==l||t[3]!==e||t[4]!==i||t[5]!==r.login){let n=p(l,`auth.xbox.sandboxId`)||void 0;u=r.login.$buildPath({searchParams:{returnUrl:e??i,sandboxId:n}}),t[2]=l,t[3]=e,t[4]=i,t[5]=r.login,t[6]=u}else u=t[6];return u},_=e=>{let n=(0,m.c)(13),c;n[0]===e?c=n[1]:(c=e===void 0?{}:e,n[0]=e,n[1]=c);let{innerLocation:p,returnUrl:h}=c,{trackEvent:_,location:v}=l(p),y=d(),{pathname:b}=o(),x=i(),S=f(),C;n[2]===x.queries.isSupportedTVBrowser?C=n[3]:(C=x.queries.isSupportedTVBrowser.getOptions(),n[2]=x.queries.isSupportedTVBrowser,n[3]=C);let{data:w}=a(C),T=w===void 0?!1:w,E=g(h??b),D;return n[4]!==T||n[5]!==v||n[6]!==E||n[7]!==_||n[8]!==y||n[9]!==h||n[10]!==b||n[11]!==S.mutations.startMsaSignInWithRedirect?(D=()=>{let e=T&&!0;_({name:u.AttemptToSignIn,subType:s.UserInitiated,location:v,targetAuthRoute:e?t.auth.deviceCode.$path():E.split(`?`)[0],authMethod:e?r.DeviceCode:r.Redirect},{deliveryMode:`immediate`}).finally(()=>{e?y(t.auth.deviceCode.$buildPath({searchParams:{returnUrl:h??b}})):S.mutations.startMsaSignInWithRedirect.execute({returnUrl:new URL(h??b,globalThis.location.origin)}).then(e=>{e&&y(e.pathname+e.search+e.hash)}).catch(e=>{console.error(`Sign-in failed`,e)})})},n[4]=T,n[5]=v,n[6]=E,n[7]=_,n[8]=y,n[9]=h,n[10]=b,n[11]=S.mutations.startMsaSignInWithRedirect,n[12]=D):D=n[12],D},v={supportsMultiUser:!1,supportsSignOut:!1,supportsDeviceCode:!1,supportsLightweightUsers:!1,isNative:!1},y=()=>{let e=(0,m.c)(2),t=f(),n;e[0]===t.queries.capabilities?n=e[1]:(n=t.queries.capabilities.getOptions(),e[0]=t.queries.capabilities,e[1]=n);let{data:r}=a(n);return r??v},b=e=>{let t=(0,m.c)(4),n=h(),{pathname:r}=o(),i;return t[0]!==e||t[1]!==r||t[2]!==n.logout?(i=n.logout.$buildPath({searchParams:{returnUrl:e??r}}),t[0]=e,t[1]=r,t[2]=n.logout,t[3]=i):i=t[3],i},x=e=>{let n=(0,m.c)(16),r;n[0]===e?r=n[1]:(r=e===void 0?{}:e,n[0]=e,n[1]=r);let{returnUrl:o}=r,s=d(),{supportsSignOut:c}=y(),l=f(),u=i(),p;n[2]===u.queries.isSupportedTVBrowser?p=n[3]:(p=u.queries.isSupportedTVBrowser.getOptions(),n[2]=u.queries.isSupportedTVBrowser,n[3]=p);let{data:h}=a(p),g=h===void 0?!1:h,_;n[4]===g?_=n[5]:(_=g?t.onboarding.$path():t.home.$path(),n[4]=g,n[5]=_);let v=_,x=b(o??v),S;n[6]!==o||n[7]!==v||n[8]!==l.mutations.startMsaSignOutWithRedirect||n[9]!==g||n[10]!==s?(S=()=>{let e=o??v;l.mutations.startMsaSignOutWithRedirect.execute({returnUrl:new URL(e,globalThis.location.origin)}).then(e=>{if(!e)return;let t=e.pathname+e.search+e.hash;if(g){globalThis.location.assign(t);return}s(t)}).catch(e=>{console.error(`Sign-out failed`,e)})},n[6]=o,n[7]=v,n[8]=l.mutations.startMsaSignOutWithRedirect,n[9]=g,n[10]=s,n[11]=S):S=n[11];let C=S,w;return n[12]!==C||n[13]!==x||n[14]!==c?(w={signOut:C,signOutUrl:x,supportsSignOut:c},n[12]=C,n[13]=x,n[14]=c,n[15]=w):w=n[15],w};export{_ as n,x as t};