define(["libraryMenu","cardStyle"],function(libraryMenu){"use strict";function getCardHtml(item){var html="";return html+="<div class='card squareCard'>",html+='<div class="cardBox">',html+='<div class="cardScalable defaultCardBackground defaultCardBackground0">',html+='<div class="cardPadder cardPadder-square"></div>',html+='<a class="cardContent cardImageContainer cardContent-shadow" is="emby-linkbutton" href="'+item.href+'">',html+='<i class="cardImageIcon md-icon">'+item.icon+"</i>",html+="</a>",html+="</div>",html+='<div class="cardFooter">',html+="<div class='cardText cardTextCentered'>",html+=item.name,html+="</div>",html+="</div>",html+="</div>",html+="</div>"}function renderItems(view){libraryMenu.getToolsMenuLinks(ApiClient).then(function(entries){for(var html="",sectionOpen=!1,itemsOpen=!1,i=0,length=entries.length;i<length;i++){var entry=entries[i];sectionOpen&&entry.name&&!entry.href&&(itemsOpen&&(html+="</div>",itemsOpen=!1),html+="</div>",sectionOpen=!1),sectionOpen||!entry.name&&!entry.href||(html+='<div class="verticalSection">',sectionOpen=!0),entry.href?(itemsOpen||(itemsOpen=!0,html+='<div class="itemsContainer vertical-wrap">'),html+=getCardHtml(entry)):entry.name&&(html+='<h2 class="sectionTitle sectionTitle-cards">',html+=entry.name,html+="</h2>")}itemsOpen&&(html+="</div>"),sectionOpen&&(html+="</div>"),view.querySelector(".links").innerHTML=html})}return function(view,params){renderItems(view),view.addEventListener("viewshow",function(){Emby.Page.setTitle(null)})}});