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