import{a as p}from"./chunk-UVKRZB2Z.js";import{a as m}from"./chunk-NHAEOK7K.js";import{m as o}from"./chunk-A7R3CFJO.js";import{x as n}from"./chunk-OIJW4GMG.js";import{J as s,_ as r,ca as a,ia as c}from"./chunk-3FIHWXA5.js";import{a as h}from"./chunk-K4ALXBGI.js";var f=(()=>{class e{constructor(t,i){this._http=t,this._store=i}get(){return this._http.post("/api/characteristic/all",{},{headers:m}).pipe(r(t=>{this._store.dispatch(new p({characteristics:[...t]}))}))}getById(t){return this._http.get(`/api/characteristic/${t}`)}create(t){return this._http.post("/api/characteristic",h({},t))}edit(t,i){return this._http.put(`/api/characteristic/${i}`,h({},t))}delete(t){return this._http.delete(`/api/characteristic/${t}`)}static{this.\u0275fac=function(i){return new(i||e)(c(n),c(o))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac})}}return e})();var w=(()=>{class e{constructor(t,i){this._characteristicService=t,this._store=i}get(){return this._characteristicService.get().pipe(s(1),r(t=>{this._store.dispatch(new p({characteristics:[...t.sort((i,u)=>u.id-i.id)]}))}))}create(t){return this._characteristicService.create(t).pipe(r(()=>this.get().subscribe()),s(1))}edit(t,i){return this._characteristicService.edit(t,i).pipe(r(()=>this.get().subscribe()),s(1))}delete(t){return this._characteristicService.delete(t).pipe(r(()=>this.get().subscribe()),s(1))}static{this.\u0275fac=function(i){return new(i||e)(c(f),c(o))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac})}}return e})();export{f as a,w as b};
