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]=`c6aac8cb-8646-413d-8cfd-289ace2bd049`,e._sentryDebugIdIdentifier=`sentry-dbid-c6aac8cb-8646-413d-8cfd-289ace2bd049`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Hm as r,Oi as i,Um as a,Yh as o,Zm as s,_r as c,it as l,jg as u,ng as d,qh as f,xr as p,yt as m,zn as h}from"./entry.client-mpghtlrl.js";import{pt as g}from"./xds-react-components-ihgca01z.js";import{t as _}from"./DialogShell-ga7ic6wy.js";var v=n(),y=e(u(),1),b=d(),x=c(i(({onLaunchOnConsole:e})=>{let{t:n}=t(`RemotePlay`),{locGetHelp:i,locLaunchOnConsole:a}=r();return(0,b.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,b.jsx)(_.NavigationHeader,{title:{title:{text:n(`Remote features must be enabled`,{shortKey:`remoteplay_features_enabled_remote_5700b7`}),sizeClassName:`type-title2`}},showClose:!0}),(0,b.jsxs)(_.ScrollContainer,{className:`px-template-overlays-modal-container-padding-regular flex flex-col items-start gap-[24px] self-stretch pt-0`,scrollAxis:`vertical`,scrollAlignment:`align-to-next`,exitDirections:[`up`],children:[(0,b.jsxs)(`div`,{className:`flex flex-col items-start gap-[8px] self-stretch`,children:[(0,b.jsx)(`p`,{className:`text-noninteractive-content-secondary-content type-body`,children:(0,b.jsx)(l,{text:`On your console, open <Bold>Settings > Devices & connections > Remote features</Bold> and select the checkbox to enable remote features.`,namespace:`RemotePlay`,comment:`Text inside <Bold> will be made strong (bolded).`,shortKey:`remoteplay_manual_instructions`,components:{Bold:(0,b.jsx)(`strong`,{})}})}),(0,b.jsxs)(`div`,{className:`flex w-full items-center gap-4`,children:[(0,b.jsx)(g,{variant:`subtle`,className:`flex flex-[1_0_0] items-start`}),(0,b.jsx)(`span`,{className:`uppercase text-noninteractive-content-secondary-content type-body`,children:n(`Or`,{shortKey:`remoteplay_or_a03`})}),(0,b.jsx)(g,{variant:`subtle`,className:`flex flex-[1_0_0] items-start`})]}),(0,b.jsx)(`p`,{className:`text-center text-noninteractive-content-secondary-content type-body`,children:n(`Sign in to your console and use the button below to automatically launch the remote features setup flow.`,{shortKey:`remoteplay_automatically_features_642ffe`})})]}),(0,b.jsxs)(`div`,{className:m(`flex-col gap-layout-vertical-title-and-row-regular`,`flex items-center self-stretch`,`lg-10:(flex-row gap-layout-horizontal-gutter)`,`xsl-10:(flex-row gap-layout-horizontal-gutter)`),children:[(0,b.jsx)(p,{as:`button`,kind:`brand`,size:`standard`,onPress:e,className:`w-full min-w-component-action-text-standard-min-width flex-1 content-center items-center`,children:a()}),(0,b.jsx)(p,{as:`a`,kind:`standard`,size:`standard`,href:h,target:`_blank`,rel:`noopener noreferrer`,className:`w-full min-w-component-action-text-standard-min-width flex-1 content-center items-center`,children:i()})]})]})]})},`ConnectConsole`),()=>{let{dialog:e,remotePlay:n,toasts:r}=s(),{mutateAsync:i}=o(e.mutations.goBack.getOptions()),{mutateAsync:c}=o(n.mutations.enableRemotePlay.getActiveUserMutation().getOptions()),l=a().getLogger(`ConnectConsole`),[u,d]=(0,y.useState)(!1),{mutateAsync:p}=o(r.mutations.showStandardToast.getOptions()),{t:m}=t(`RemotePlay`),h=(0,y.useCallback)(async()=>{await i()},[i]);return{isLoading:u,onLaunchOnConsole:(0,y.useCallback)(()=>{(async()=>{d(!0);try{await c(),await h()}catch(e){let t=f(e);l.error(`Error setting up remote play: ${t.message}`),await p({content:m(`We're having trouble completing your request, please try again.`,{shortKey:`remoteplay_completing_trouble_reque_79315f`}),level:`error`,namespace:`RemotePlay`})}finally{d(!1)}})().catch(e=>{l.error(`Unhandled error in onLaunchOnConsole: ${f(e).message}`)})},[c,l,h,p,m])}}),S=()=>{let e=(0,v.c)(2),t=x.useComponent(),n;return e[0]===t?n=e[1]:(n=(0,b.jsx)(_,{dismissable:!0,dimBackground:!0,className:`modal-floating modal-medium bg-container-backgrounds-elevation-background-level-4 shadow-l4`,autoHeight:!0,children:(0,b.jsx)(t,{})}),e[0]=t,e[1]=n),n};export{S as ConnectConsoleDialog,S as default};