(()=>{function e(n){var s={},e="YYYY-MM-DD",t=moment().startOf("day").format(e),e=moment().subtract(3,"months").format(e);return _.forEach({alarmCountToday:{dateFrom:t,service:"c8yAlarms"},alarmCount3Months:{dateFrom:e,service:"c8yAlarms"},eventCountToday:{dateFrom:t,service:"c8yEvents"},eventCount3Months:{dateFrom:e,service:"c8yEvents"}},function(e,t){var r;e.name=t,n.register(t,[e.service,"config",(r=e,function(o,e){var a=_.merge({},r,e),c=new WeakMap,d=(s[a.name]=s[a.name]||{},s[a.name]),i=a.type||"";function t(e){d[e.id]=d[e.id]||{};var t=d[e.id],r=t[i],n=(r||(t[i]=o.createCounter({dateFrom:a.dateFrom,type:a.type,source:e.id}),(r=t[i]).removeFromCache=function(){return delete t[i]},r.devices=new Set,r.start()),c.get(e));return n||(n=new Set,c.set(e,n)),r.devices.has(e)||r.devices.add(e),n.has(r)||n.add(r),r.count}return t.detach=function(t){(c.get(t)||[]).forEach(function(e){e.devices.delete(t),e.devices.size||(e.removeFromCache(),e.stop())}),c.delete(t)},t})])}),{$get:r}}function r(){return{attach:function(){console.warn("method deprecated: please use the generic computed property api")}}}e.$inject=["c8yComputedPropertiesProvider"],angular.module("c8y.ui").provider("c8yCountersConfig",e)})();