(()=>{function e(a,c,n,r,u){var e=_.debounce(function(){var e=u.get(c.path())||{},e=e.data?n.invoke(e.data):{};a.breadcrumbs=[],o(0,(e=>((e=r.when(e).then(t))._path=c.path(),e))(e))},10);function t(e){return _.union(e,u.getLiveBreadcrumbs())}function o(e,t){t.then(function(e){var n,r;c.path()===t._path&&((n=u.getPreferredBreadcrumb())&&e.length&&(r=e[0][e[0].length-2],_.find([r],n)||(e=_.sortBy(e,function(e){return!_.find([e[e.length-2]],n)}))),a.breadcrumbs=e)})}a.$on("$routeChangeSuccess",e),u.$on("breadcrumbs",o),u.$on("preferredBreadcrumbChanged",e),u.$on("update",e)}e.$inject=["$scope","$location","$injector","$q","c8yBreadcrumbs"],angular.module("c8y.ui").component("c8yUiBreadcrumbs",{templateUrl:":::PLUGIN_PATH:::/ui/navigation/breadcrumbs.html",controller:e})})();