"use strict";(self.webpackChunkpterodactyl_panel=self.webpackChunkpterodactyl_panel||[]).push([[568],{5568(e,t,n){n.r(t),n.d(t,{default:()=>k});var a=n(4859),o=n(7810),r=n(9748),l=n(6015),i=n(6454),s=n(713),m=n(5161),d=n(9385),c=n(8332),u=n(7952),p=n(4768);const k=()=>{const[e,t]=(0,o.useState)(!1),[n,a]=(0,o.useState)(!1),i=r.P.useStoreState(e=>e.server.data.uuid),s=r.P.useStoreState(e=>e.status.value),{clearFlashes:k,clearAndAddHttpError:w}=(0,m.A)(),{connected:v,instance:E}=r.P.useStoreState(e=>e.socket);(0,o.useEffect)(()=>{if(!v||!E||"running"===s)return;const e=["(gsl token expired)","(account not found)"],n=n=>{e.some(e=>n.toLowerCase().includes(e))&&t(!0)};return E.addListener(d.y.CONSOLE_OUTPUT,n),()=>{E.removeListener(d.y.CONSOLE_OUTPUT,n)}},[v,E,s]);return(0,o.useEffect)(()=>{k("feature:gslToken")},[]),o.createElement(p.l1,{onSubmit:e=>{a(!0),k("feature:gslToken"),(0,u.A)(i,"STEAM_ACC",e.gslToken).then(()=>{E&&E.send(d.T.SET_STATE,"restart"),a(!1),t(!1)}).catch(e=>{console.error(e),w({key:"feature:gslToken",error:e})}).then(()=>a(!1))},initialValues:{gslToken:""}},o.createElement(l.A,{visible:e,onDismissed:()=>t(!1),closeOnBackground:!1,showSpinnerOverlay:n},o.createElement(y,{key:"feature:gslToken"}),o.createElement(p.lV,null,o.createElement(g,null,"Invalid GSL token!"),o.createElement(S,null,"It seems like your Gameserver Login Token (GSL token) is invalid or has expired."),o.createElement(T,null,"You can either generate a new one and enter it below or leave the field blank to remove it completely."),o.createElement(h,null,o.createElement(c.A,{name:"gslToken",label:"GSL Token",description:"Visit https://steamcommunity.com/dev/managegameservers to generate a token.",autoFocus:!0})),o.createElement(f,null,o.createElement(_,{type:"submit"},"Update GSL Token")))))};var y=(0,a.Ay)(s.A).withConfig({displayName:"GSLTokenModalFeature___StyledFlashMessageRender",componentId:"sc-1r409kx-0"})({marginBottom:"1rem"}),g=(0,a.Ay)("h2").withConfig({displayName:"GSLTokenModalFeature___StyledH",componentId:"sc-1r409kx-1"})({fontSize:"1.5rem",lineHeight:"2rem",marginBottom:"1rem","--tw-text-opacity":"1",color:"hsla(214, 15%, 91%, var(--tw-text-opacity))"}),S=(0,a.Ay)("p").withConfig({displayName:"GSLTokenModalFeature___StyledP",componentId:"sc-1r409kx-2"})({marginTop:"1rem"}),T=(0,a.Ay)("p").withConfig({displayName:"GSLTokenModalFeature___StyledP2",componentId:"sc-1r409kx-3"})({marginTop:"1rem"}),h=(0,a.Ay)("div").withConfig({displayName:"GSLTokenModalFeature___StyledDiv",componentId:"sc-1r409kx-4"})({alignItems:"center",marginTop:"1rem","@media (min-width: 640px)":{display:"flex"}}),f=(0,a.Ay)("div").withConfig({displayName:"GSLTokenModalFeature___StyledDiv2",componentId:"sc-1r409kx-5"})({marginTop:"2rem",alignItems:"center",justifyContent:"flex-end","@media (min-width: 640px)":{display:"flex"}}),_=(0,a.Ay)(i.Ay).withConfig({displayName:"GSLTokenModalFeature___StyledButton",componentId:"sc-1r409kx-6"})({marginTop:"1rem",width:"100%","@media (min-width: 640px)":{marginTop:"0px",marginLeft:"1rem",width:"auto"}})}}]);