(()=>{function e(r,s){return{restrict:"A",link:function(e,f,n){var i,o=$(r);function t(){i=f.offset().top-$("#header-bar").height()}function c(){r.pageYOffset>i?f.addClass("affix"):f.removeClass("affix")}n.c8yAffix&&!s(n.c8yAffix)(e)||(o.on("resize",t),o.on("scroll",c),e.$on("$routeChangeSuccess",function(){setTimeout(function(){t(),c()},500)}),e.$on("$destroy",function(){o.off("resize",t),o.off("scroll",c)}),t())}}}e.$inject=["$window","$parse"],angular.module("c8y.ui").directive("c8yAffix",e)})();