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]=`a8b8ccc2-bb48-45c3-a9d5-6b0cb94cb8e3`,e._sentryDebugIdIdentifier=`sentry-dbid-a8b8ccc2-bb48-45c3-a9d5-6b0cb94cb8e3`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Hm as r,Oi as i,Qh as a,Um as o,Yh as s,Zm as c,_r as l,jg as u,ng as d,op as f,pi as p}from"./entry.client-mpghtlrl.js";import{n as m}from"./auth-hooks-dkb6uyrd.js";import{$t as h}from"./workspace-leaf-files-oergw4h0.js";import{n as g}from"./DialogShellContext-grfsno45.js";import{t as _}from"./useEmitGameStreamDialogEvent-m3jw3fvd.js";import{t as v}from"./useGameStreamProps-wkghqjeq.js";import{t as y}from"./useGameStreamDialogContext-orgnly77.js";import{t as b}from"./PureInStreamConfirmationDialog-k0il2d8x.js";var x=e(u(),1),S=n(),C=e=>{let n=(0,S.c)(10),{t:r}=t(`SignInRequiredDialog`),i;if(n[0]!==r||n[1]!==e){i=Symbol.for(`react.early_return_sentinel`);bb0:{let t=r(`This will link your latest saved game progress to a new account. Any unsaved progress may be lost. Using an existing account will not link your progress.`,{shortKey:`sign_in_required_dialog_saved_progress_note`});if(!e||e===h.Default){let e;n[3]===r?e=n[4]:(e=r(`Sign in to unlock this feature`,{shortKey:`sign_in_required_dialog_title`}),n[3]=r,n[4]=e);let a=e,o=r(`You need to sign in for further access. {savedProgressNote}`,{shortKey:`sign_in_required_dialog_description`,values:{savedProgressNote:t}}),s;n[5]!==a||n[6]!==o?(s={title:a,description:o},n[5]=a,n[6]=o,n[7]=s):s=n[7],i=s;break bb0}let a;n[8]===r?a=n[9]:(a=r(`Sign in required`,{shortKey:`xbox_account_required_dialog_title`}),n[8]=r,n[9]=a);let o=a;switch(e){case h.StoreProductPage:case h.StoreAssociatedProducts:i={title:o,description:r(`You need to sign in to view this information. {savedProgressNote}`,{shortKey:`xbox_account_required_product_page_or_associated_products_description`,values:{savedProgressNote:t}})};break bb0;case h.StorePurchase:i={title:o,description:r(`You need to sign in to buy or download. {savedProgressNote}`,{shortKey:`xbox_account_required_purchase_description`,values:{savedProgressNote:t}})};break bb0;case h.StoreRedeemToken:i={title:o,description:r(`You need to sign in to redeem your code. {savedProgressNote}`,{shortKey:`xbox_account_required_redeem_code_description`,values:{savedProgressNote:t}})};break bb0;case h.BillingSwitch:i={title:o,description:r(`You need to sign in to change payment options. {savedProgressNote}`,{shortKey:`xbox_account_required_billing_switch_description`,values:{savedProgressNote:t}})};break bb0;default:throw Error(`Unhandled scenario type: ${e}`)}}n[0]=r,n[1]=e,n[2]=i}else i=n[2];if(i!==Symbol.for(`react.early_return_sentinel`))return i},w=(0,e(p(),1).default)(`w-template-overlays-modal-size-small-width-compact`,`max-h-[90dvh]`,`sm-25:w-template-overlays-modal-size-medium-width-centered`,`xsl-10:w-template-overlays-modal-size-small-width-expanded`,`rounded-lg bg-container-backgrounds-elevation-background-level-2`),T=d(),E=e=>{let t=(0,S.c)(23),{onSignIn:n,onCancel:i,scenario:a}=e,{locSignInOrSignUp:o,locNeverMind:s}=r(),{title:c,description:l}=C(a),{onClose:u}=g(),{setDialogShellProps:d}=y(),f;t[0]===u?f=t[1]:(f=()=>{u(`closeButton`)},t[0]=u,t[1]=f);let p=f,m,h;t[2]!==c||t[3]!==l||t[4]!==i||t[5]!==d?(m=()=>{d({accessibleTitle:c,accessibleDescription:l,dismissable:!0,className:w,autoHeight:!0,onWillClose:i})},h=[l,c,i,d],t[2]=c,t[3]=l,t[4]=i,t[5]=d,t[6]=m,t[7]=h):(m=t[6],h=t[7]),(0,x.useEffect)(m,h);let _;t[8]===o?_=t[9]:(_=o(),t[8]=o,t[9]=_);let v;t[10]!==n||t[11]!==_?(v={onPress:n,label:_,kind:`brand`,as:`button`},t[10]=n,t[11]=_,t[12]=v):v=t[12];let E;t[13]===s?E=t[14]:(E=s(),t[13]=s,t[14]=E);let D;t[15]!==p||t[16]!==E?(D={onPress:p,label:E,as:`button`},t[15]=p,t[16]=E,t[17]=D):D=t[17];let O;return t[18]!==c||t[19]!==l||t[20]!==v||t[21]!==D?(O=(0,T.jsx)(b,{locTitle:c,locDescription:l,illustration:`unauthenticated`,button1Props:v,button2Props:D,showClose:!0,stackButtons:!0}),t[18]=c,t[19]=l,t[20]=v,t[21]=D,t[22]=O):O=t[22],O},D=l(E,()=>{let e=_(f.dialog.gameStream.signInRequired.fullPath,`cancel`),t=o().getLogger(`SignInRequiredDialog`),{returnUrl:n,scenario:r}=v(`signInRequired`)||{},{gameStream:i}=c(),{data:l}=a(i.queries.instance.getOptions()),{mutateAsync:u}=s(i.mutations.unblockNavigation),d=m({returnUrl:n});return{onSignIn:(0,x.useCallback)(async()=>{await u(),l||t.debug(`No game stream instance to shutdown`),l?.shutdownSession({reason:`SigningIn`,skipFeedback:!0}),d()},[l,t,d,u]),onCancel:e,scenario:r}}),O=i(()=>(0,T.jsx)(D.useComponent(),{}),`SignInRequiredDialog`);export{E as PureSignInRequiredDialog,O as SignInRequiredDialog,O as default,D as SignInRequiredDialogConnection};