define(["exports","./basetab.js","./../emby-apiclient/connectionmanager.js","./listcontroller.js"],function(_exports,_basetab,_connectionmanager,_listcontroller){function ItemsTab(view,params,options){_basetab.default.apply(this,arguments),_listcontroller.default.apply(this,arguments),this.view=view,(this.params=params).serverId&&(this.apiClient=_connectionmanager.default.getApiClient(params.serverId))}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(ItemsTab.prototype,_basetab.default.prototype),Object.assign(ItemsTab.prototype,_listcontroller.default.prototype),ItemsTab.prototype.onTemplateLoaded=function(){_basetab.default.prototype.onTemplateLoaded.apply(this,arguments);var params=this.params;this.initItemsContainer(),this.addFocusBehavior(this.itemsContainer),params.parentId&&!this.isGlobalQuery()&&this.itemsContainer.setAttribute("data-parentid",params.parentId),this.initButtons()},ItemsTab.prototype.getSettingsKey=function(){return this.params.parentId+"-1"},ItemsTab.prototype.isRecursiveQuery=function(){return!0},ItemsTab.prototype.onResume=function(options){_basetab.default.prototype.onResume.apply(this,arguments),_listcontroller.default.prototype.resume.apply(this,arguments),options&&options.refresh&&this.updateSortText(),this.supportsAlphaPicker()&&this.initAlphaPicker();var alphaNumericShortcuts=this.alphaNumericShortcuts,instance=(alphaNumericShortcuts&&alphaNumericShortcuts.resume(),this),autoFocus=options.autoFocus;return this.itemsContainer.resume(options).then(function(result){autoFocus&&instance.autoFocus()})},ItemsTab.prototype.loadItemsTemplate=function(){var promise=require(["text!modules/tabbedview/itemstab.template.html"]);return"y"===this.scrollDirection()?promise:promise.then(function(responses){return function(html){return Emby.importModule("./modules/tabbedview/viewhelper.js").then(function(viewHelper){return viewHelper.convertTemplateToHorizontal(html)})}(responses[0]).then(function(html){return responses[0]=html,responses})})},ItemsTab.prototype.getFocusContainerElement=function(){var scroller=this.scroller;if(scroller===this.view){scroller=null==scroller?void 0:scroller.querySelector(".scrollSlider");if(scroller)return scroller}return _basetab.default.prototype.getFocusContainerElement.apply(this,arguments)},ItemsTab.prototype.supportsAlphaPicker=function(){return!1},ItemsTab.prototype.refresh=function(options){var instance=this,autoFocus=options.autoFocus;this.itemsContainer.refreshItems(options).then(function(result){autoFocus&&instance.autoFocus()})},ItemsTab.prototype.onPause=function(){_basetab.default.prototype.onPause.apply(this,arguments),_listcontroller.default.prototype.pause.apply(this,arguments)},ItemsTab.prototype.destroy=function(){_basetab.default.prototype.destroy.apply(this,arguments),_listcontroller.default.prototype.destroy.apply(this,arguments),this.options=null};_exports.default=ItemsTab});