define(["modules/ui/module"],function(a){"use strict";a.registerDirective("smartTreeviewContent",["$compile",function(){return{restrict:"E",link:function(a,b){function c(){d.find(">i").toggleClass("fa-plus-circle",!a.item.expanded).toggleClass("fa-minus-circle",!!a.item.expanded)}var d=$(a.item.content);a.item.children&&a.item.children.length&&(d.on("click",function(){a.$apply(function(){a.item.expanded=!a.item.expanded,c()})}),c()),b.replaceWith(d)}}}]),a.registerDirective("smartTreeview",["$compile","$sce",function(a){return{restrict:"A",scope:{items:"="},template:'<li ng-class="{parent_li: item.children.length}" ng-repeat="item in items" role="treeitem"><smart-treeview-content></smart-treeview-content><ul ng-if="item.children.length" smart-treeview ng-show="item.expanded"  items="item.children" role="group" class="smart-treeview-group" ></ul></li>',compile:function(b){var c,d=b.contents().remove();return{post:function(b,e){c||(c=a(d)),c(b,function(a){e.append(a)})}}}}}])});