import{F as c,Ga as d,Rh as u,Th as f}from"./chunk-ET7TRALE.js";import{f as l}from"./chunk-D3M7YSQR.js";import{ra as o,wa as n}from"./chunk-ZY2UEPJ6.js";import{o as r}from"./chunk-EMXRSGQS.js";var m=(()=>{let e=class e{};e.CREATE="projector_countdown.create",e.UPDATE="projector_countdown.update",e.DELETE="projector_countdown.delete";let s=e;return s})();var v=(()=>{let e=class e extends c{constructor(t,i){super(t,u),this.serverTime=i,this.getTitle=a=>a.description?`${a.title} (${a.description})`:a.title,this.getVerboseName=(a=!1)=>this.translate.instant(a?"Countdowns":"Countdown")}create(t){return r(this,null,function*(){return yield this.sendActionToBackend(m.CREATE,t)})}update(t,i){return r(this,null,function*(){let a={id:i.id,title:t.title,description:t.description,default_time:t.default_time,countdown_time:t.countdown_time,running:t.running};return yield this.sendActionToBackend(m.UPDATE,a)})}delete(...t){return r(this,null,function*(){let i=t.map(a=>({id:a.id}));return yield this.sendBulkActionToBackend(m.DELETE,i)})}start(t){return r(this,null,function*(){let i=this.serverTime.getServertime()/1e3+t.countdown_time;yield this.update({running:!0,countdown_time:i},t)})}stop(t){return r(this,null,function*(){yield this.update({running:!1,countdown_time:t.default_time},t)})}pause(t){return r(this,null,function*(){let i=t.countdown_time-this.serverTime.getServertime()/1e3;yield this.update({running:!1,countdown_time:i},t)})}};e.\u0275fac=function(i){return new(i||e)(n(d),n(l))},e.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"});let s=e;return s})();var p=(()=>{let e=class e{};e.CREATE="projector_message.create",e.UPDATE="projector_message.update",e.DELETE="projector_message.delete";let s=e;return s})();var x=(()=>{let e=class e extends c{constructor(t){super(t,f),this.getTitle=()=>this.getVerboseName(),this.getVerboseName=(i=!1)=>this.translate.instant(i?"Messages":"Message")}create(t){return r(this,null,function*(){return yield this.sendActionToBackend(p.CREATE,t)})}update(t,i){return r(this,null,function*(){let a={id:i.id,message:t.message};return yield this.sendActionToBackend(p.UPDATE,a)})}delete(...t){return r(this,null,function*(){let i=t.map(a=>({id:a.id}));return yield this.sendBulkActionToBackend(p.DELETE,i)})}};e.\u0275fac=function(i){return new(i||e)(n(d))},e.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"});let s=e;return s})();export{v as a,x as b};
