(()=>{function n(n,e,o,t){var r=this,i={};function a(){_.forEach(i,function(n){return n.children(":not(.no-remove)").remove()})}function c(n){_.forEach(n,function(n){var e=n.getAttribute("action-bar-position"),o=i[e];if(!o)throw new Error("Container ".concat(e," not defined for action bar element"));"right"===e?o.find(".more-wrapper").before(n):o.append(n)}),s()}function f(n){_.forEach(n,function(n){return $(n).remove()}),s()}function s(){e(function(){r.hasMore=!!i.more.children().length})}function l(){return _.some(t.elements,function(n){return"none"!==$(n).css("display")&&!!_.trim($(n).html())})}_.assign(r,{barSets:t.barSets,$postLink:function(){_.assign(i,{left:o.find(".navbar-left"),right:o.find(".navbar-right"),more:o.find(".dropdown-menu-right")}),t.onClean(a),c(t.onAdd(c)),t.onRemove(f),t.isVisible=l},isVisible:l}),n.$watch(l,function(n){n?o.removeClass("hidden"):o.addClass("hidden")})}n.$inject=["$scope","$timeout","$element","c8yActionBar"],angular.module("c8y.ui").component("c8yUiActionBar",{templateUrl:":::PLUGIN_PATH:::/ui/header/action-bar.html",controllerAs:"vm",controller:n})})();