angular.module("c8y.core").factory("c8ySimulator",["$http","c8yBase","gettext",function(a,n,e){var o="simulator/templates",c="simulator/configurations",t="".concat(o,"/sensors"),u={headers:n.contentHeaders("simulator","simulator")},l={headers:n.contentHeaders("template","template")};return{list:function(){var e=n.url(c);return a.get(e,{params:{pageSize:2e3}}).then(n.getResData)},changeState:function(e,t){var e=e.id||e,e=n.url("".concat(c,"/").concat(e)),t={state:t},r=_.cloneDeep(u);return a.put(e,t,r)},deleteSimulator:function(e){var e=e.id||e,e=n.url("".concat(c,"/").concat(e)),t=_.cloneDeep(u);return a.delete(e,t)},createSimulator:function(e){var t=n.url(c),e=_.cloneDeep(e),r=_.cloneDeep(u);return a.post(t,e,r)},createTemplate:function(e){var t=n.url(o),e=_.cloneDeep(e),r=_.cloneDeep(l);return a.post(t,e,r)},getSensors:function(){var e=n.url(t);return a.get(e).then(n.getResData)},STATES:{NEW:e("NEW"),RUNNING:e("RUNNING"),PAUSED:e("PAUSED")}}}]);