"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5948],{88085:function(e,a,n){n.r(a),n.d(a,{default:function(){return d}}),n(5769),n(63238),n(61418),n(17460),n(14078),n(52077),n(911),n(55849),n(69217),n(23938),n(98010);var t=n(56705),i=n(3319),l=n(44614),r=n(61097);function s(e,a,n){var t="",i=e.externalUrl?e.externalUrl:"#!/addplugin.html?name="+encodeURIComponent(e.name)+"&guid="+e.guid;a.context&&(i+="&context="+a.context);var s=e.externalUrl?' target="_blank"':"";t+="<div class='card backdropCard'>",t+='<div class="cardBox visualCardBox">',t+='<div class="cardScalable visualCardBox-cardScalable">',t+='<div class="cardPadder cardPadder-backdrop"></div>',t+='<div class="cardContent">',t+='<a class="cardImageContainer" is="emby-linkbutton" style="margin:0;padding:0" href="'.concat(i,'" ').concat(s,">"),e.imageUrl?t+='<img src="'.concat(e.imageUrl,'" style="width:100%" />'):(t+='<div class="cardImage flex align-items-center justify-content-center '.concat(r.getDefaultBackgroundClass(),'">'),t+='<span class="cardImageIcon material-icons extension" aria-hidden="true"></span>',t+="</div>"),t+="</a>",t+="</div>",t+="</div>",t+='<div class="cardFooter">',t+="<div class='cardText'>",t+=e.name,t+="</div>";var c=n.filter((function(a){return a.Id==e.guid}))[0];return t+="<div class='cardText cardText-secondary'>",t+=c?l.ZP.translate("LabelVersionInstalled",c.Version):"&nbsp;",t+="</div>",t+="</div>",(t+="</div>")+"</div>"}function c(){return[{href:"#!/installedplugins.html",name:l.ZP.translate("TabMyPlugins")},{href:"#!/availableplugins.html",name:l.ZP.translate("TabCatalog")},{href:"#!/repositories.html",name:l.ZP.translate("TabRepositories")}]}function d(e){e.addEventListener("viewshow",(function(){i.Z.setTabs("plugins",1,c),function(e){t.ZP.show();var a=ApiClient.getAvailablePlugins(),n=ApiClient.getInstalledPlugins();Promise.all([a,n]).then((function(a){!function(e){var a=e.availablePlugins,n=e.installedPlugins;a.forEach((function(e,a,n){e.category=e.category||"General",e.categoryDisplayName=function(e){return"Channel"===(e=e.replace(" ",""))?e="Channels":"Theme"===e?e="Themes":"LiveTV"===e?e="LiveTV":"ScreenSaver"===e&&(e="HeaderScreenSavers"),l.ZP.translate(e)}(e.category),n[a]=e})),a.sort((function(e,a){return e.category>a.category?1:a.category>e.category?-1:e.name>a.name?1:a.name>e.name?-1:0}));for(var i=null,r="",c=0;c<a.length;c++){var d=a[c],o=d.categoryDisplayName;o!=i&&(i&&(r+="</div>",r+="</div>"),r+='<div class="verticalSection">',r+='<h2 class="sectionTitle sectionTitle-cards">'+o+"</h2>",r+='<div class="itemsContainer vertical-wrap">',i=o),r+=s(d,e,n)}r+="</div>",r+="</div>",!a.length&&e.noItemsElement&&e.noItemsElement.classList.remove("hide"),e.catalogElement.innerHTML=r,t.ZP.hide()}({catalogElement:e.querySelector("#pluginTiles"),noItemsElement:e.querySelector("#noPlugins"),availablePlugins:a[0],installedPlugins:a[1]})}))}(this)}))}n(46650),n(78066),n(45368),n(20716)}}]);