"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[25091],{25091:function(e,t,n){n.r(t),n.d(t,{getTabsElement:function(){return h},selectedTabIndex:function(){return v},setTabs:function(){return f}}),n(44962),n(86584),n(78557),n(90076),n(83994),n(82367);var a,s,r,i=n(36300),d=n(34789),c=n(46782),o=n(44797),u=(n(79845),n(10353),document.querySelector(".skinHeader"));function l(){this.selectedIndex(this.readySelectedIndex),this.readySelectedIndex=null}function b(e){function t(e){if(i.Ay.parentWithTag(e,"input"))return!1;var t=e.classList;return!t||!t.contains("scrollX")&&!t.contains("animatedScrollX")}for(var n=e;null!=n;){if(!t(n))return!1;n=n.parentNode}return!0}function f(e,t,i,f,v,h,m){if(s||(s=u.querySelector(".headerTabs")),!e)return a&&(document.body.classList.remove("withSectionTabs"),s.innerHTML="",s.classList.add("hide"),a=null),{tabsContainer:s,replaced:!1};var y=s;if(a||y.classList.remove("hide"),a!==e){var p=0,x='<div is="emby-tabs"'+(null==t?"":' data-index="'+t+'"')+' class="tabs-viewmenubar"><div class="emby-tabs-slider" style="white-space:nowrap;">'+i().map((function(e){var t,n="emby-tab-button";return!1===e.enabled&&(n+=" hide"),e.cssClass&&(n+=" "+e.cssClass),t=e.href?'<a href="'+e.href+'" is="emby-linkbutton" class="'+n+'" data-index="'+p+'"><div class="emby-button-foreground">'+e.name+"</div></a>":'<button type="button" is="emby-button" class="'+n+'" data-index="'+p+'"><div class="emby-button-foreground">'+e.name+"</div></button>",p++,t})).join("")+"</div></div>";return y.innerHTML=x,window.CustomElements.upgradeSubtree(y),document.body.classList.add("withSectionTabs"),a=e,function(e,t){if(d.A.touch&&!c.A.modern){var a=function(n,a){b(a)&&e.contains(a)&&t.selectNext()},s=function(n,a){b(a)&&e.contains(a)&&t.selectPrevious()};n.e(19842).then(n.bind(n,19842)).then((function(t){var n=new(0,t.default)(e.parentNode.parentNode);o.A.on(n,"swipeleft",a),o.A.on(n,"swiperight",s),e.addEventListener("viewdestroy",(function(){n.destroy()}))}))}}(e,r=y.querySelector('[is="emby-tabs"]')),f&&r.addEventListener("beforetabchange",(function(e){var t=f();if(null!=e.detail.previousIndex){var n=t[e.detail.previousIndex];n&&n.classList.remove("is-active")}var a=t[e.detail.selectedTabIndex];a&&a.classList.add("is-active")})),v&&r.addEventListener("beforetabchange",v),h&&r.addEventListener("tabchange",h),!1!==m&&(r.selectedIndex?r.selectedIndex(t):(r.readySelectedIndex=t,r.addEventListener("ready",l))),{tabsContainer:y,tabs:r,replaced:!0}}return r.selectedIndex(t),{tabsContainer:y,tabs:r,replaced:!1}}function v(e){null!=e?r.selectedIndex(e):r.triggerTabChange()}function h(){return document.querySelector(".tabs-viewmenubar")}}}]);