import{b as g}from"./chunk-YYVE3SN6.js";import{a as l}from"./chunk-ZTKV4AIV.js";import{h as c}from"./chunk-73IMXZSJ.js";import{aa as s,ca as i,ha as a,i as u,na as h,u as o}from"./chunk-FWZCAEAJ.js";var S=(()=>{let e=class e{constructor(){this.url="/config/product",this.httpClient=h(c),this.selectedEventService=h(g),this.triggerGet$=new u(!0)}getAll$(){return this.triggerGet$.pipe(s(()=>this.selectedEventService.selectedIdNotNull$),s(t=>this.httpClient.get(this.url,{params:{eventId:t}})),o(t=>t.sort((r,n)=>(r.position??1e5)-(n.position??1e5))))}getByParent$(t){return this.triggerGet$.pipe(s(()=>this.httpClient.get(this.url,{params:{groupId:t}})),o(r=>r.sort((n,$)=>(n.position??1e5)-($.position??1e5))))}getSingle$(t){return this.httpClient.get(`${this.url}/${l(t)}`)}create$(t){return this.httpClient.post(this.url,t).pipe(i(()=>this.triggerGet$.next(!0)))}update$(t){return this.httpClient.put(this.url,t).pipe(i(()=>this.triggerGet$.next(!0)))}delete$(t){return this.httpClient.delete(`${this.url}/${l(t)}`).pipe(i(()=>this.triggerGet$.next(!0)))}order$(t,r){return this.httpClient.patch(`${this.url}/order`,r,{params:{groupId:t}}).pipe(i(()=>this.triggerGet$.next(!0)))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"});let p=e;return p})();export{S as a};
