define(["exports","./../modules/tabbedview/itemstab.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/common/pluginmanager.js","./../modules/layoutmanager.js"],function(_exports,_itemstab,_embyButton,_embyScroller,_pluginmanager,_layoutmanager){function sortPlugins(plugin1,plugin2){return plugin1.Name>plugin2.Name?1:-1}function InstalledPluginsTab(view,params){view.classList.add("withTabs"),view.setAttribute("style","padding-top:0!important;"),params.serverId=ApiClient.serverId(),this.supportsViewSettings=!1,this.enableTotalRecordCountDisplay=!1,this.enableAlphaNumericShortcuts=!1,_itemstab.default.call(this,view,params)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,InstalledPluginsTab.prototype.onTemplateLoaded=function(){_itemstab.default.prototype.InstalledPluginsTab.apply(this,arguments),this.itemsContainer.setAttribute("data-monitor","Plugins")},Object.assign(InstalledPluginsTab.prototype,_itemstab.default.prototype),InstalledPluginsTab.prototype.onResume=function(options){_itemstab.default.prototype.onResume.apply(this,arguments)},InstalledPluginsTab.prototype.loadTemplate=function(){return this.loadItemsTemplate()},InstalledPluginsTab.prototype.getItems=function(query){return ApiClient.getInstalledPlugins().then(function(plugins){return ApiClient.getConfigurationPages({EnableInUserMenu:!1}).then(function(configPages){for(var i=0,length=plugins.length;i<length;i++)!function(plugin,pluginConfigurationPages){plugin.ServerId=ApiClient.serverId(),plugin.Type="Plugin",plugin.PrimaryImageAspectRatio=16/9,pluginConfigurationPages=pluginConfigurationPages.filter(function(pluginConfigurationPage){return pluginConfigurationPage.PluginId===plugin.Id})[0],plugin.ConfigPageUrl=pluginConfigurationPages?pluginConfigurationPages.Href||_pluginmanager.default.getConfigurationPageUrl(pluginConfigurationPages.Name):null}(plugins[i],configPages);var totalRecordCount=(plugins=plugins.sort(sortPlugins)).length;return query&&(query.StartIndex&&(plugins=plugins.slice(query.StartIndex)),null!=query.Limit)&&query.Limit<plugins.length&&(plugins.length=query.Limit),{Items:plugins,TotalRecordCount:totalRecordCount}})})},InstalledPluginsTab.prototype.getSettingsKey=function(){return"plugins"},InstalledPluginsTab.prototype.setTitle=function(){},InstalledPluginsTab.prototype.getBaseListRendererOptions=function(){var options=_itemstab.default.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,_layoutmanager.default.tv&&(options.action="menu"),options},InstalledPluginsTab.prototype.getItemTypes=function(){return["Plugin"]},_exports.default=InstalledPluginsTab});