import{a}from"./chunk-A36A3X5V.js";import{K as t,fa as n,ka as c,q as s}from"./chunk-PVUKHE45.js";var R=(()=>{let r=class r{constructor(e){this._roleServiceApi=e}getRoles(e){return this._roleServiceApi.getRoles(e).pipe(t(1))}getRolesForDropdown(){return this._roleServiceApi.getRoles({take:50,orderBy:"id",skip:0,criteria:null,isAscending:!0}).pipe(s(e=>e.data),t(1))}createRole(e){return this._roleServiceApi.createRole(this._toRequestForm(e)).pipe(t(1))}getRoleById(e){return this._roleServiceApi.getRoleById(e).pipe(t(1))}updateRoleById(e,i){return this._roleServiceApi.updateRoleById(this._toRequestForm(e),i).pipe(t(1))}removeRoleById(e){return this._roleServiceApi.removeRoleById(e).pipe(t(1))}_toRequestForm(e){return{nameKk:e.name,nameRu:e.name,permissions:e.groups.reduce((i,l)=>[...i,...l.permissions.filter(p=>p.checked).map(p=>p.id)],[])}}};r.\u0275fac=function(i){return new(i||r)(c(a))},r.\u0275prov=n({token:r,factory:r.\u0275fac});let o=r;return o})();export{R as a};
//# sourceMappingURL=chunk-SR6EQQOF.js.map
