import{g as U}from"./chunk-V64RF3DS.js";import{$b as c,C as y,_b as g,fd as j,rd as I}from"./chunk-ATD4AEXQ.js";import{J as p,Kc as C,Tc as n,Ua as E,_c as L,ca as s,da as R,fa as o,g as h,o as d,r as S,u as v}from"./chunk-BXH3QC5E.js";var l=(()=>{class r{http;static properties;static infinityConfigFilePath="assets/general/config/infinityConfig.json";constructor(t){this.http=t}load(){return h(this,null,function*(){return new Promise(t=>{v(this.http.get(r.infinityConfigFilePath)).then(e=>{r.properties=e,console.log("InfinityConfig file loaded successfully!"),t()}).catch(()=>{t()})})})}static \u0275fac=function(e){return new(e||r)(o(n))};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var x=(()=>{class r{static \u0275fac=function(e){return new(e||r)};static \u0275mod=E({type:r});static \u0275inj=R({imports:[C]})}return r})();var a=class{http;constructor(i){this.http=i}formatErrors(i){return i.length===0?d:S(()=>new Error(i))}get(i,t){return this.http.get(`${this.getURL(i)}${i}`,{params:t}).pipe(p(e=>this.formatErrors(e.message)))}head(i,t){return this.http.head(`${this.getURL(i)}${i}`,{params:t}).pipe(p(e=>this.formatErrors(e.message)))}put(i,t){return this.http.put(`${this.getURL(i)}${i}`,JSON.stringify(t)).pipe(p(e=>this.formatErrors(e.message)))}post(i,t,e){return this.http.post(`${this.getURL(i)}${i}`,JSON.stringify(t),{params:e}).pipe(p(m=>this.formatErrors(m.message)))}patch(i,t,e){return this.http.patch(`${this.getURL(i)}${i}`,JSON.stringify(t),{params:e}).pipe(p(m=>this.formatErrors(m.message)))}delete(i,t){return this.http.delete(`${this.getURL(i)}${i}`,{params:t}).pipe(p(e=>this.formatErrors(e.message)))}};var M=(()=>{class r extends a{logger;translateService;toastMessageService;constructor(t,e,m,w){super(t),this.logger=e,this.translateService=m,this.toastMessageService=w}getURL(){let t=c.getLpsUrl();if(c.isNullOrUndefined(t)){let e=this.translateService.instant("MSG_ERROR_NO_LOCAL_PRINT_SERVER",{workstationCode:g.getWorkstation().code,workstationDescription:g.getWorkstation().description});throw this.toastMessageService.showToastPanel(j.getErrorDefaultConfig().withMessage(e)),this.logger.error(e),new Error(e)}return t}static \u0275fac=function(e){return new(e||r)(o(n),o(U),o(L),o(I))};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var H=(()=>{class r extends a{constructor(t){super(t)}getURL(){return""}getBaseURL(){return y.PERIPHERAL_AGENT}static \u0275fac=function(e){return new(e||r)(o(n))};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var $="/client",N=(()=>{class r extends a{constructor(t){super(t)}getURL(t){return c.isNullOrUndefined(l.properties)?null:l.properties.appServerRestOrigin+(c.isAuthenticationRequest(t)||c.isVersionCheckRequest(t)?"":$)}static \u0275fac=function(e){return new(e||r)(o(n))};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{M as a,H as b,l as c,N as d,x as e};
