angular.module("c8y.ui").provider("c8ySearch",function(){var a=[],c=/\{\{search\}\}/;function n(){return a}return{add:function(n){a.push(n),a.sort(function(n,r){n=n.priority||0;return(r.priority||0)-n})},$get:["$location","$route","c8yAlert",function(i,o,e){return{list:n,search:function(n){var r,t;n&&((r=(r=(t=a[1<arguments.length&&void 0!==arguments[1]?arguments[1]:0]).invalidSearchTermWarningFn)&&r(n))?e.warning(r):(r=(n=_.isFunction(t.path)?t.path(n):(r=t.path,t=n,r.replace(c,window.encodeURIComponent(t))))===window.location.hash.substr(1),i.url(n),r&&o.reload()))}}}]}});