"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[87094],{93348:function(e,t,r){r.r(t),r.d(t,{default:function(){return l}}),r(44962),r(78557),r(90076),r(83994),r(82367);var s=r(22622),n=(r(10353),r(46782)),c=r(89100);function l(e,t){e.querySelector(".btnLogout").addEventListener("click",(function(){c.default.logout()})),e.querySelector(".selectServer").addEventListener("click",(function(){c.default.selectServer()})),e.querySelector(".clientSettings").addEventListener("click",(function(){window.NativeShell.openClientSettings()})),e.querySelector(".exitApp").addEventListener("click",(function(){s.g.exit()})),e.addEventListener("viewshow",(function(){var l=t.userId||c.default.getCurrentUserId(),i=this;i.querySelector(".lnkUserProfile").setAttribute("href","#/userprofile.html?userId="+l),i.querySelector(".lnkDisplayPreferences").setAttribute("href","#/mypreferencesdisplay.html?userId="+l),i.querySelector(".lnkHomePreferences").setAttribute("href","#/mypreferenceshome.html?userId="+l),i.querySelector(".lnkPlaybackPreferences").setAttribute("href","#/mypreferencesplayback.html?userId="+l),i.querySelector(".lnkSubtitlePreferences").setAttribute("href","#/mypreferencessubtitles.html?userId="+l),i.querySelector(".lnkQuickConnectPreferences").setAttribute("href","#/quickconnect?userId="+l),i.querySelector(".lnkControlsPreferences").setAttribute("href","#/mypreferencescontrols.html?userId="+l);var u=s.g.supports("clientsettings");i.querySelector(".clientSettings").classList.toggle("hide",!u);var o=s.g.supports("exitmenu");i.querySelector(".exitApp").classList.toggle("hide",!o);var d=s.g.supports("multiserver");i.querySelector(".selectServer").classList.toggle("hide",!d),i.querySelector(".lnkControlsPreferences").classList.toggle("hide",n.A.mobile),ApiClient.getQuickConnect("Enabled").then((function(e){!0===e&&i.querySelector(".lnkQuickConnectPreferences").classList.remove("hide")})).catch((function(){console.debug("Failed to get QuickConnect status")})),ApiClient.getUser(l).then((function(e){i.querySelector(".headerUsername").innerText=e.Name,e.Policy.IsAdministrator&&!n.A.tv&&i.querySelector(".adminSection").classList.remove("hide")})),t.userId&&t.userId!==c.default.getCurrentUserId&&(i.querySelector(".userSection").classList.add("hide"),i.querySelector(".adminSection").classList.add("hide"),i.querySelector(".lnkControlsPreferences").classList.add("hide")),Promise.resolve().then(r.bind(r,84069)).then((function(t){t.default.autoFocus(e)}))}))}}}]);