define(["layout/module"],function(a){"use strict";a.registerDirective("stateBreadcrumbs",["$rootScope","$state",function(a,b){return{restrict:"E",replace:!0,template:'<ol class="breadcrumb"><li>Home</li></ol>',link:function(c,d){function e(a){var b="<li>Home</li>";angular.forEach(a,function(a){b+="<li>"+a+"</li>"}),d.html(b)}function f(a,c){var d=b.get(a);d&&d.data&&d.data.title&&-1==c.indexOf(d.data.title)&&c.unshift(d.data.title);var e=a.replace(/.?\w+$/,"");return e?f(e,c):c}function g(a){var b;b=a.data&&a.data.breadcrumbs?a.data.breadcrumbs:f(a.name,[]),e(b)}g(b.current),a.$on("$stateChangeStart",function(a,b){g(b)})}}}])});