angular.module("controls").directive("kkDashboard",["core","utils","state","modal","packageManager","$timeout",function(e,r,t,a,o,n){return{restrict:"E",scope:{},templateUrl:e.adminURL+"js/controls/dashboard.html.js?"+(new Date).getTime(),replace:!0,link:function(i,s,d){i.core=e,i.utils=r,i.state=t,i.packageManager=o,i.view={type:"installed",filter:"all"},i.storePagination={},i.dropPagination={},i.search="",i.sidebarWidth=t.sidebar.width||320,i.filterTemplates=function(e){var r={};for(var t in e){var a=e[t];a&&a.hidden||(r[t]=a)}return r},i.showPackageManager=function(e,r){a.show("PackageManagerModal",null,{overviewMode:null,mode:e||"overview",package:r||null})},i.showSettings=function(){a.show("SettingsModal",(function(){}))},i.getUpgradesCount=function(){return Object.keys(e.packages.upgradeable).length},i.hasValidLicense=function(r){return e.dropLicenses[r]&&e.dropLicenses[r].isValid||!1},i.getLicenceTypeName=function(){return{kk_dropper_bronze:"Bronze",kk_dropper_silber:"Silber",kk_dropper_gold:"Gold",kk_dropper_super:"Dev",kk_dropper_exs:"Ulitmate"}[e.dropperLicense.item]};var positionDashboardArrow=function(){var e=$("#edit-windows"),r=$("#drop-select .dashboard-arrow"),t=$("#topbar .dashboard-toggle");if(!r.length||!t.length)return setTimeout(positionDashboardArrow,300);var a=t.offset().left+t.outerWidth(!1)/2,o=e.offset().left;r.css("left",Math.floor(a-o)+"px")},measureSidebarWidth=function(){var e=$(".sidebar-wrapper");i.sidebarWidth=e.length?e.outerWidth(!1):t.sidebar.width};i.$watch("state.dashboardOpen",(function(){measureSidebarWidth(),t.dashboardOpen?($(s).removeClass("select-offscreen"),$("html").css("overflow","hidden"),positionDashboardArrow()):($("html").css("overflow",""),$(s).addClass("select-offscreen"))})),$(window).resize((function(){n((function(){positionDashboardArrow(),measureSidebarWidth()}))})),positionDashboardArrow(),measureSidebarWidth()}}}]);