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]=`80f6da99-ac84-4627-90e8-953f23e2369d`,e._sentryDebugIdIdentifier=`sentry-dbid-80f6da99-ac84-4627-90e8-953f23e2369d`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Gu as r,Kf as i,Qm as a,Yh as o,Zm as s,Zt as c,_r as l,hh as u,ng as d,oh as f,pi as p,qf as m,sn as h,tg as g,xr as _}from"./entry.client-mpghtlrl.js";import{A as v,O as y,k as b}from"./xds-react-components-ihgca01z.js";import{r as x}from"./stream-gate-hooks-bpatbpk5.js";import{t as S}from"./usePlanPickerProps-ovsyok80.js";import{n as C}from"./DialogShell-ga7ic6wy.js";import{t as w}from"./PostStreamUpsell-frbpu6bq.js";var T=e(p(),1),E=n(),D=d(),O=l(e=>{let n=(0,E.c)(32),{primaryProductId:r,sessionType:i,handlePlayAgainPress:a,handleGetGamePassPress:o,handleSeeGameDetailsPress:s}=e,{t:c}=t(`FresnoPostStreamUpsellDialog`),l=w.useComponent(),u;n[0]===c?u=n[1]:(u=c(`Your 1 hour session has ended`,{shortKey:`dialog_title_fresno`}),n[0]=c,n[1]=u);let d=u,f;n[2]!==i||n[3]!==c?(f=i===`FreeToPlay`?c(`Get unlimited cloud gaming and shorter wait times with XBOX Game Pass`,{shortKey:`dialog_subtitle_f2p`}):c(`Get unlimited cloud gaming and shorter wait times with XBOX Game Pass`,{shortKey:`dialog_subtitle_fresno`}),n[2]=i,n[3]=c,n[4]=f):f=n[4];let p=f,m;n[5]===c?m=n[6]:(m=c(`Play again`,{shortKey:`play_again_fresno_post_stream`}),n[5]=c,n[6]=m);let h=m,g=`max-w-[var(--V21E)] !self-stretch flex items-center justify-center`,x;n[7]!==i||n[8]!==h||n[9]!==c||n[10]!==a?(x=i===`Fresno`?(0,D.jsxs)(y,{as:`button`,kind:`brand`,className:`max-w-[var(--V21E)] !self-stretch`,onPress:a,children:[(0,D.jsx)(b,{children:h}),(0,D.jsx)(v,{children:c(`Stream with new`,{shortKey:`play_again_substring_fresno`})})]},`playAgain`):(0,D.jsx)(_,{as:`button`,kind:`brand`,className:`max-w-[var(--V21E)] !self-stretch`,onPress:a,children:h},`playAgain`),n[7]=i,n[8]=h,n[9]=c,n[10]=a,n[11]=x):x=n[11];let S;n[12]===c?S=n[13]:(S=c(`Join Game Pass`,{shortKey:`game_pass_join_6d77d2`}),n[12]=c,n[13]=S);let C;n[14]!==o||n[15]!==S?(C=(0,D.jsx)(_,{as:`button`,kind:`standard`,className:g,onPress:o,children:S},`getGamePass`),n[14]=o,n[15]=S,n[16]=C):C=n[16];let T;n[17]===c?T=n[18]:(T=c(`See Game Details`,{shortKey:`see_game_details_16739a`}),n[17]=c,n[18]=T);let O;n[19]!==s||n[20]!==T?(O=(0,D.jsx)(_,{as:`button`,className:g,kind:`standard`,onPress:s,children:T},`seeGameDetails`),n[19]=s,n[20]=T,n[21]=O):O=n[21];let k;n[22]!==x||n[23]!==C||n[24]!==O?(k=[x,C,O],n[22]=x,n[23]=C,n[24]=O,n[25]=k):k=n[25];let A=k,j;return n[26]!==l||n[27]!==d||n[28]!==p||n[29]!==r||n[30]!==A?(j=(0,D.jsx)(l,{title:d,description:p,primaryProductId:r,actionButtons:A,variant:`game-background`}),n[26]=l,n[27]=d,n[28]=p,n[29]=r,n[30]=A,n[31]=j):j=n[31],j},({productId:e,sessionType:t})=>{if(!e)throw new i(`productId`,m.Missing);let{dialog:{mutations:n,keys:l},gameStream:d}=s(),p=h(),{mutate:_}=o(n.goBack.getOptions()),v=c({location:`FresnoPostStreamUpsell`}),{trackUserAction:y}=a(),b=x(e,`FresnoPostStreamUpsell`),C=g(),{mutate:w}=o({...d.mutations.restartIfActive.getOptions(),onError:()=>{p(r.home.$path(),{replace:!0})}}),T=S(e);return{primaryProductId:e,sessionType:t,handlePlayAgainPress:()=>{y(f.PressStreamButton,{productId:e},u.Press,{location:t===`Fresno`?`FresnoPostStreamUpsell.PlayAgain`:`F2PPostStreamUpsell.PlayAgain`}),C.getQueryData(d.queries.instance.getOptions().queryKey)==null?(_(),b()):w()},handleSeeGameDetailsPress:()=>{_(),p(r.products.byProductId.$buildPath({params:{productId:e}}))},handleGetGamePassPress:()=>{_(),v({key:l.subscriptionPlanPicker.fullPath,props:T})}}}),k=(0,T.default)(`bg-container-backgrounds-elevation-background-level-2`,`h-full`,`w-full`),A=e=>{let t=(0,E.c)(8),{productId:n,sessionType:r,onClose:i}=e,a=O.useComponent(),o=C.useComponent(),s;t[0]!==a||t[1]!==n||t[2]!==r?(s=(0,D.jsx)(a,{productId:n,sessionType:r}),t[0]=a,t[1]=n,t[2]=r,t[3]=s):s=t[3];let c;return t[4]!==o||t[5]!==i||t[6]!==s?(c=(0,D.jsx)(o,{className:k,dismissable:!0,dimBackground:!0,autoHeight:!1,onWillClose:i,children:s}),t[4]=o,t[5]=i,t[6]=s,t[7]=c):c=t[7],c};export{A as FresnoPostStreamDialog,A as default};