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){this.supportsViewSettings=!1,this.enableTotalRecordCountDisplay=!1,this.enableAlphaNumericShortcuts=!1,_itemstab.default.apply(this,arguments)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(InstalledPluginsTab.prototype,_itemstab.default.prototype),InstalledPluginsTab.prototype.onTemplateLoaded=function(){_itemstab.default.prototype.onTemplateLoaded.apply(this,arguments),this.itemsContainer.setAttribute("data-monitor","Plugins")},InstalledPluginsTab.prototype.onResume=function(options){_itemstab.default.prototype.onResume.apply(this,arguments)},InstalledPluginsTab.prototype.loadTemplate=function(){return this.loadItemsTemplate()},InstalledPluginsTab.prototype.getItems=function(query){var apiClient=this.getApiClient();return apiClient.getInstalledPlugins().then(function(plugins){return apiClient.getConfigurationPages({EnableInUserMenu:!1}).then(function(configPages){for(var serverId=apiClient.serverId(),i=0,length=plugins.length;i<length;i++)!function(plugin,serverId,pluginConfigurationPages){plugin.ServerId=serverId,plugin.Type="Plugin",plugin.PrimaryImageAspectRatio=16/9,serverId=pluginConfigurationPages.filter(function(pluginConfigurationPage){return pluginConfigurationPage.PluginId===plugin.Id})[0],plugin.ConfigPageUrl=serverId?serverId.Href||_pluginmanager.default.getConfigurationPageUrl(serverId.Name):null}(plugins[i],serverId,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,options.draggableXActions=!0,options.playQueueIndicator=!1,_layoutmanager.default.tv&&(options.action="menu"),options},InstalledPluginsTab.prototype.getItemTypes=function(){return["Plugin"]};_exports.default=InstalledPluginsTab});