define(["exports","./../modules/tabbedview/tabbedview.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-apiclient/connectionmanager.js","./../modules/maintabsmanager.js"],function(_exports,_tabbedview,_embyScroller,_embyButton,_connectionmanager,_maintabsmanager){function HomeView(view,params){_tabbedview.default.apply(this,arguments),this.selectedItemInfoElement=view.querySelector(".selectedItemInfoInner"),this.enableBackMenu=!0}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(HomeView.prototype,_tabbedview.default.prototype),HomeView.prototype.getTabs=function(){var items=this.item.UserViews;return function(instance){if(!instance.tabsCreated){instance.tabsCreated=!0;for(var html="",items=instance.item.UserViews,i=0,length=items.length;i<length;i++)switch(items[i].CollectionType){case"livetv":case"music":case"audiobooks":case"movies":case"tvshows":html+='<div style="overflow:hidden;" class="tabContent tabContent-positioned home-horiz-tabContent flex focuscontainer-x" data-index="'+i+'" data-swapnode="sectionstab"></div>';break;default:html+='<div style="overflow:hidden;" class="tabContent tabContent-positioned home-horiz-tabContent flex focuscontainer-x" data-index="'+i+'" data-swapnode="itemstab"></div>'}instance.view.insertAdjacentHTML("afterbegin",html)}}(this),items.map(function(i){return{name:i.Name,id:i.Id+"_"+(i.CollectionType||"")}})},HomeView.prototype.getAutoBackdropItemTypes=function(){return["Movie","Series","Game","Book"]},HomeView.prototype.fetchItem=function(){var apiClient=_connectionmanager.default.currentApiClient();return apiClient.getUserViews({},apiClient.getCurrentUserId()).then(function(result){return{UserViews:result.Items||result}})},HomeView.prototype.setTitle=function(){},HomeView.prototype.loadTabController=function(id){switch(id.split("_")[1]){case"movies":return Emby.importModule("./videos/moviesuggestions.js");case"music":case"audiobooks":return Emby.importModule("./music/suggestions.js");case"tvshows":return Emby.importModule("./tv/suggestions.js");case"livetv":return Emby.importModule("./livetv/suggestions.js");default:return Emby.importModule("./modules/tabbedview/folderstab.js")}},HomeView.prototype.getTabControllerParams=function(id){var params=_tabbedview.default.prototype.getTabControllerParams.apply(this,arguments);return id=id.split("_")[0],params.parentId=id,params},HomeView.prototype.getTabControllerOptions=function(id){var _this$item,options=_tabbedview.default.prototype.getTabControllerOptions.apply(this,arguments);return id=id.split("_")[0],options.item=null==(_this$item=this.item)?void 0:_this$item.UserViews.filter(function(i){return i.Id===id})[0],options.addCategories=!0,options},HomeView.prototype.supportsHorizontalTabScroll=function(){return!0},HomeView.prototype.tabScrollDirection=function(){return"x"},HomeView.prototype.onWindowInputCommand=function(e){"home"===e.detail.command?(_maintabsmanager.default.selectedTabIndex(0),e.preventDefault()):_tabbedview.default.prototype.onWindowInputCommand.apply(this,arguments)};_exports.default=HomeView});