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]=`9476258e-2930-41f0-902f-1e5f8c26e897`,e._sentryDebugIdIdentifier=`sentry-dbid-9476258e-2930-41f0-902f-1e5f8c26e897`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Gm as r,Gu as i,Hm as a,Ot as o,Qm as s,Yh as c,Zm as l,_r as u,ei as d,jg as f,ng as p,sn as m,xr as h}from"./entry.client-mpghtlrl.js";import{n as g}from"./responsive-toolkit-jup4yedr.js";import{en as _}from"./workspace-leaf-files-oergw4h0.js";import{t as v}from"./usePlanPickerProps-ovsyok80.js";import{t as y}from"./PostStreamUpsell-frbpu6bq.js";import{n as b,t as x}from"./TrialsEndedDialog-jq2hlwk0.js";import{n as S,t as C}from"./useAutoFocusOnNavigation-jozowuvg.js";var w=e(f(),1),T=n(),E=p(),D=e=>{let t=(0,T.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,E.jsx)(d,{size:`title4`,icon:(0,E.jsx)(o,{}),className:`text-noninteractive-content-primary-content`,"aria-hidden":`true`},`TrialLocked`),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,E.jsxs)(`div`,{className:`flex items-center gap-internal-icon-and-text-gap-regular rounded-regular border-item-visible-container-default-border-rest bg-container-backgrounds-overlay-scrim-dense p-internal-container-padding-borderless-tight`,children:[r,(0,E.jsx)(`span`,{className:`text-noninteractive-content-primary-content type-label`,children:n})]}),t[1]=n,t[2]=i),i},O=e=>{let n=(0,T.c)(37),{primaryProductId:r,isFullySignedIn:i,onGetGamePassPress:o,onUpgradeAccountPress:s,onOtherWaysToPlayPress:c}=e,l=y.useComponent(),{t:u}=t(`TrialsEndedDialog`),{locTrialEnded:d}=a(),f;n[0]===u?f=n[1]:(f=u(`Keep playing with Game Pass`,{shortKey:`keep_playing_title`}),n[0]=u,n[1]=f);let p=f,m;n[2]===u?m=n[3]:(m=u(`Get unlimited cloud gaming and access to hundreds of games`,{shortKey:`keep_playing_description`}),n[2]=u,n[3]=m);let g=m,_;n[4]===d?_=n[5]:(_=d(),n[4]=d,n[5]=_);let v=_,b;n[6]===u?b=n[7]:(b=u(`Get Game Pass`,{shortKey:`get_game_pass_button`}),n[6]=u,n[7]=b);let x=b,S;n[8]===u?S=n[9]:(S=u(`Skip for now`,{shortKey:`skip_for_now_button`}),n[8]=u,n[9]=S);let C=S,w;n[10]===u?w=n[11]:(w=u(`Other ways to play`,{shortKey:`other_ways_to_play_button`}),n[10]=u,n[11]=w);let O=w,k,A;n[12]!==o||n[13]!==x?(A=(0,E.jsx)(h,{"data-auto-focus":!0,className:`max-w-[var(--V21E)]`,as:`button`,kind:`brand`,onPress:o,children:x},`getGamePass`),n[12]=o,n[13]=x,n[14]=A):A=n[14];let j;if(n[15]!==A||n[16]!==i||n[17]!==c||n[18]!==O||n[19]!==s||n[20]!==C){if(j=[A],i){let e;n[22]!==c||n[23]!==O?(e=(0,E.jsx)(h,{className:`max-w-[var(--V21E)]`,as:`button`,kind:`standard`,onPress:c,children:O},`otherWaysToPlay`),n[22]=c,n[23]=O,n[24]=e):e=n[24],j.push(e)}else{let e;n[25]!==s||n[26]!==C?(e=(0,E.jsx)(h,{className:`max-w-[var(--V21E)]`,as:`button`,kind:`standard`,onPress:s,children:C},`skipForNow`),n[25]=s,n[26]=C,n[27]=e):e=n[27],j.push(e)}n[15]=A,n[16]=i,n[17]=c,n[18]=O,n[19]=s,n[20]=C,n[21]=j}else j=n[21];k=j;let M=k,N;n[28]===v?N=n[29]:(N=(0,E.jsx)(D,{label:v}),n[28]=v,n[29]=N);let P;return n[30]!==l||n[31]!==r||n[32]!==p||n[33]!==g||n[34]!==M||n[35]!==N?(P=(0,E.jsx)(l,{variant:`single-tile`,primaryProductId:r,title:p,description:g,actionButtons:M,primaryTileOverlay:N}),n[30]=l,n[31]=r,n[32]=p,n[33]=g,n[34]=M,n[35]=N,n[36]=P):P=n[36],P},k=u(O,()=>{let e=(0,w.useContext)(x),t=S(),n=m(),{trackUserAction:a}=s(),{dialog:o}=l(),{mutate:u}=c(o.mutations.open.getOptions()),{isFullySignedIn:d}=r(),f=e?.productId??``,p=v(f),h=o.keys.subscriptionPlanPicker.fullPath;return{primaryProductId:f,isFullySignedIn:d,onGetGamePassPress:(0,w.useCallback)(()=>{a(`KeepPlayingUpsellInteraction`,{type:`GetGamePass`,productId:f},`Press`,{location:`KeepPlayingUpsellPage`}),e?.complete(_.OpenedPlanPicker),u({key:h,props:p})},[u,e,p,a,f,h]),onUpgradeAccountPress:(0,w.useCallback)(()=>{a(`KeepPlayingUpsellInteraction`,{type:`UpgradeAccount`,productId:f},`Press`,{location:`KeepPlayingUpsellPage`}),t(b.upgradeAccount)},[t,a,f]),onOtherWaysToPlayPress:(0,w.useCallback)(()=>{a(`KeepPlayingUpsellInteraction`,{type:`OtherWaysToPlay`,productId:f},`Press`,{location:`KeepPlayingUpsellPage`}),e?.complete(_.NavigatedToPDP),n(i.products.byProductId.$buildPath({params:{productId:f}}))},[e,n,f,a])}}),A=()=>{let e=(0,T.c)(5),t=k.useComponent(),n=g();C();let r,i;e[0]===n?(r=e[1],i=e[2]):(r=()=>{n?.()},i=[n],e[0]=n,e[1]=r,e[2]=i),(0,w.useEffect)(r,i);let a;return e[3]===t?a=e[4]:(a=(0,E.jsx)(t,{}),e[3]=t,e[4]=a),a};export{A as KeepPlayingUpsellPage,k as KeepPlayingUpsellPageConnection,O as PureKeepPlayingUpsellPage};