import{rb as p}from"./chunk-YSQLW2JA.js";import{rc as T}from"./chunk-NVJ2ZZFT.js";import{Ac as f,Dc as o,Pd as h,Qf as D,Sc as l,cd as u,ea as c}from"./chunk-SKPDQO4E.js";var A=function(n,t,e,r){var s=arguments.length,a=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var m=n.length-1;m>=0;m--)(S=n[m])&&(a=(s<3?S(a):s>3?S(t,e,a):S(t,e))||a);return s>3&&a&&Object.defineProperty(t,e,a),a},i=288,_=class extends l{interactionService;settingsService;sessionService;translate;translated;constructor(t,e,r,s){super(t,r),this.interactionService=t,this.settingsService=e,this.sessionService=r,this.translate=s,this.init()}resetStoredData(){super.resetStoredData()}init(){this.translate.get(["PACS.AUTOSHIFT_PREVIOUS_DAY","PACS.AUTOSHIFT_PREVIOUS_DAY_SHORTEN","PACS.AUTOSHIFT_NEXT_DAY","PACS.AUTOSHIFT_NEXT_DAY_SHORTEN"]).subscribe(t=>{this.translated=t})}threeDaysFormatHour(t,e="hh:mm"){let r=t%i;return f.fromObject({minutes:r*5}).toFormat(e)}threeDaysFormatTime(t,e=!1,r="hh:mm"){let s="";return t<i?s=this.translated[e?"PACS.AUTOSHIFT_PREVIOUS_DAY_SHORTEN":"PACS.AUTOSHIFT_PREVIOUS_DAY"]:t>i*2&&(s=this.translated[e?"PACS.AUTOSHIFT_NEXT_DAY_SHORTEN":"PACS.AUTOSHIFT_NEXT_DAY"]),s+" "+this.threeDaysFormatHour(t,r)}threeDaysGetRangePoint(t){let e=t.days||0,r=t.hours||0,s=t.minutes||0;return(e+1)*i+r*12+Math.floor(s/5)}threeDaysGetRangePointData(t){let e=0;t<i?e=-1:t>=i&&t<i*2?e=0:t>=i*2&&t<i*3?e=1:e=2;let r=t%i,s=f.fromObject({minutes:r*5}).shiftTo("hours","minutes").toObject();return T.getCopyModel({days:e,hours:s.hours,minutes:s.minutes})}threeDaysGetRangeDates(t,e){let r=o.fromJSDate(t).startOf("day").minus({days:1});return[r.plus({minutes:e[0]*5}).toJSDate(),r.plus({minutes:e[1]*5}).toJSDate()]}threeDaysGetRangeSteps(t,e){let r=o.fromJSDate(t).startOf("day").minus({days:1});return[Math.ceil(o.fromJSDate(e[0]).diff(r,["minutes"]).toObject().minutes/5),Math.ceil(o.fromJSDate(e[1]).diff(r,["minutes"]).toObject().minutes/5)]}static ctorParameters=()=>[{type:D},{type:p},{type:h},{type:u}]};_=A([c({providedIn:"root"})],_);export{i as a,_ as b};
