(self.webpackChunk=self.webpackChunk||[]).push([[5051],{68993:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return c}}),t(63238),t(61418),t(5769);var a=t(67469),r=t(6594),i=t(53754),l=(t(78066),t(76543)),o=t(53913);function s(e,n){switch(r.ZP.hide(),n.State){case"SignedIn":var t=n.ApiClient;l.ZP.onServerChanged(t.getCurrentUserId(),t.accessToken(),t),l.ZP.navigate("home.html");break;case"ServerSignIn":l.ZP.navigate("login.html?serverid="+n.Servers[0].Id,!1,"none");break;case"ServerSelection":l.ZP.navigate("selectserver.html",!1,"none");break;case"ServerUpdateNeeded":l.ZP.alert({message:i.ZP.translate("ServerUpdateNeeded",'<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')});break;case"Unavailable":l.ZP.alert({message:i.ZP.translate("MessageUnableToConnectToServer"),title:i.ZP.translate("HeaderConnectionFailure")})}}function c(e,n){e.querySelector(".addServerForm").addEventListener("submit",(function(n){return function(e){r.ZP.show();var n=e.querySelector("#txtServerHost").value;o.ZP.connectToAddress(n,{enableAutoLogin:a.Z.enableAutoLogin()}).then((function(e){s(0,e)}),(function(){s(0,{State:"Unavailable"})}))}(e),n.preventDefault(),!1})),e.querySelector(".btnCancel").addEventListener("click",(function(){Promise.resolve().then(t.bind(t,6383)).then((function(e){e.default.back()}))})),Promise.resolve().then(t.bind(t,6610)).then((function(n){n.default.autoFocus(e)}))}}}]);