define(["tabbedView","require","globalize","userSettings","emby-itemscontainer","emby-tabs","emby-button","emby-scroller"],function(TabbedView,require,globalize,userSettings){"use strict";function getDefaultTabIndex(folderId){switch(userSettings.get("landing-"+folderId)){case"games":return 1;case"genres":return 2;case"folders":return 3;default:return 0}}function getTabs(){return[{name:globalize.translate("sharedcomponents#Systems")},{name:globalize.translate("sharedcomponents#Games")},{name:globalize.translate("sharedcomponents#Genres")},{name:globalize.translate("sharedcomponents#Folders")}]}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function getTabController(index){if(null==index)throw new Error("index cannot be null");var depends=[];switch(index){case 0:depends.push("./gamesystems");break;case 1:depends.push("./gamestab");break;case 2:depends.push("./genres");break;case 3:depends.push("foldersTab")}var instance=this;return getRequirePromise(depends).then(function(controllerFactory){var controller=instance.tabControllers[index];if(!controller){controller=new controllerFactory(instance.view.querySelector(".tabContent[data-index='"+index+"']"),instance.params),instance.tabControllers[index]=controller}return controller})}function GamesView(view,params){TabbedView.call(this,view,params)}return Object.assign(GamesView.prototype,TabbedView.prototype),GamesView.prototype.getTabs=getTabs,GamesView.prototype.getDefaultTabIndex=getDefaultTabIndex,GamesView.prototype.getTabController=getTabController,GamesView});