"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[42462],{11873:function(e,n,t){t.r(n),t.d(n,{default:function(){return c}}),t.dn(c),t(44962),t(78557),t(90076),t(95021),t(83994),t(93062),t(82367);var a=t(8566),r=t(5898),i=t(67430),o=t(90381),s=t(89100);function l(e,n){switch(a.Ay.hide(),n.State){case i.KN.SignedIn:var t=n.ApiClient;s.Ay.onServerChanged(t.getCurrentUserId(),t.accessToken(),t),s.Ay.navigate("home");break;case i.KN.ServerSignIn:n.SystemInfo.StartupWizardCompleted?s.Ay.navigate("login?serverid="+n.Servers[0].Id,!1,"none"):s.Ay.navigate("/wizard/start");break;case i.KN.ServerSelection:s.Ay.navigate("selectserver",!1,"none");break;case i.KN.ServerUpdateNeeded:s.Ay.alert({message:r.Ay.translate("ServerUpdateNeeded",'<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')});break;case i.KN.Unavailable:s.Ay.alert({message:r.Ay.translate("MessageUnableToConnectToServer"),title:r.Ay.translate("HeaderConnectionFailure")})}}function c(e){e.querySelector(".addServerForm").addEventListener("submit",(function(n){return function(e){a.Ay.show();var n=e.querySelector("#txtServerHost").value.replace(/\/+$/,"");i.tF.connectToAddress(n,{enableAutoLogin:o.A.enableAutoLogin()}).then((function(e){l(0,e)}),(function(){l(0,{State:i.KN.Unavailable})}))}(e),n.preventDefault(),!1})),e.querySelector(".btnCancel").addEventListener("click",(function(){Promise.resolve().then(t.bind(t,70267)).then((function(e){e.appRouter.back()}))})),Promise.resolve().then(t.bind(t,84069)).then((function(n){n.default.autoFocus(e)}))}t(10353)}}]);