import{a as u}from"./chunk-BF44ZR3M.js";import{a as n}from"./chunk-PDYJ5OYY.js";import{d as o,i as l}from"./chunk-Z2AWIQRI.js";import{L as p,ia as s,na as a}from"./chunk-C2QKZJOP.js";import{a as c}from"./chunk-B7YGBANW.js";var m=(function(e){return e[e.None=0]="None",e[e.RongtaRLS1000=1]="RongtaRLS1000",e[e.MassaK=2]="MassaK",e})(m||{}),h=(function(e){return e[e.Ethernet=0]="Ethernet",e[e.SerialPort=1]="SerialPort",e})(h||{});var d=(()=>{let r=class r{constructor(t){this._http=t,this.apiUrl=u.apiURL}getAll(){let t=new o().append(n.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales`,{headers:t})}add(t){return this._http.post(`${this.apiUrl}/api/scales`,t)}edit(t,i){return this._http.put(`${this.apiUrl}/api/scales/${t}`,i)}delete(t){return this._http.delete(`${this.apiUrl}/api/scales/${t}`)}getById(t){let i=new o().append(n.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales/${t}`,{headers:i})}getWeightScale(t){let i=new o().append(n.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales/${t}/weight`,{headers:i})}uploadPLU(t,i){return this._http.post(`${this.apiUrl}/api/scales/${t}/upload-plu`,c({},i))}};r.\u0275fac=function(i){return new(i||r)(a(l))},r.\u0275prov=s({token:r,factory:r.\u0275fac});let e=r;return e})();var R=(()=>{let r=class r{constructor(t){this._scalesServiceApi=t}getScales(){return this._scalesServiceApi.getAll().pipe(p(1))}uploadPlu(t,i){return this._scalesServiceApi.uploadPLU(t,i).pipe(p(1))}add(t){return this._scalesServiceApi.add(t).pipe(p(1))}edit(t,i){return this._scalesServiceApi.edit(t,i).pipe(p(1))}delete(t){return this._scalesServiceApi.delete(t).pipe(p(1))}getById(t){return this._scalesServiceApi.getById(t).pipe(p(1))}getWeightScale(t){return this._scalesServiceApi.getWeightScale(t).pipe(p(1))}convertScaleFormToScaleRequest(t){return{name:t.name,model:t.model,type:t.type,ethernetScale:t.type===h.Ethernet?{ipAddress:t.ipAddress,port:t.port}:null,serialPortScale:t.type===h.SerialPort?{portName:t.portName,baudRate:t.baudRate}:null}}};r.\u0275fac=function(i){return new(i||r)(a(d))},r.\u0275prov=s({token:r,factory:r.\u0275fac});let e=r;return e})();export{m as a,h as b,d as c,R as d};
//# sourceMappingURL=chunk-TNR6J5OJ.js.map
