import{st as e}from"./index-DPe2hEjt.js";var t=`/api/usermanagement`;const n={list:async t=>(await e.get(`/api/users/groups/`,{params:t})).data,get:async t=>(await e.get(`/api/users/groups/${t}/`)).data,create:async t=>(await e.post(`/api/users/groups/`,t)).data,update:async(t,n)=>(await e.patch(`/api/users/groups/${t}/`,n)).data,delete:async t=>(await e.delete(`/api/users/groups/${t}/`)).data,getPermissions:async t=>(await e.get(`/api/users/groups/${t}/permissions/`)).data,updatePermissions:async(t,n,r=!0)=>(await e.post(`/api/users/groups/${t}/permissions/`,{permission_ids:n,granted:r})).data,setPermissions:async(t,n)=>(await e.post(`/api/users/groups/${t}/set_permissions/`,{permission_ids:n})).data},r={list:async n=>(await e.get(`${t}/list/`,{params:n})).data,get:async n=>(await e.get(`${t}/${n}/`)).data,create:async n=>{let{profilepicture:r,...i}=n;if(r){let n=new FormData;return Object.entries(i).forEach(([e,t])=>{t!=null&&(Array.isArray(t)?t.forEach(t=>n.append(e,String(t))):n.append(e,String(t)))}),n.append(`profilepicture`,r),(await e.post(`${t}/create/`,n)).data}return(await e.post(`${t}/create/`,i)).data},update:async(n,r)=>{let{profilepicture:i,...a}=r;if(i){let r=new FormData;return Object.entries(a).forEach(([e,t])=>{if(t!=null)if(Array.isArray(t)){if(t.length===0)return;t.forEach(t=>r.append(e,String(t)))}else typeof t==`boolean`?r.append(e,t?`true`:`false`):r.append(e,String(t))}),r.append(`profilepicture`,i),(await e.patch(`${t}/${n}/`,r)).data}return(await e.patch(`${t}/${n}/`,a)).data},uploadProfilePicture:async(n,r)=>{let i=new FormData;return i.append(`profilepicture`,r),(await e.patch(`${t}/${n}/`,i)).data},removeProfilePicture:async n=>(await e.patch(`${t}/${n}/`,{profilepicture:null})).data,delete:async n=>(await e.delete(`${t}/${n}/`)).data||{},mini:async()=>(await e.get(`${t}/mini/users/`)).data};export{r as n,n as t};