import{b as i,c as d,a as l}from"./vendor-redux-a1f00e6b.js";import{o as r,b as c,bD as m,F as p}from"./index-c62ac197.js";const n="menuList",t=i(n+"/getPermissions",async()=>{const s=await r(),e={data:s.data.$values,total:s.data.$values.length};return console.log("MenuData",e),e}),o=i(n+"/getMenuPermissions",async s=>{const e=await c(s.roleId,"default"),a={data:e.data.$values,total:e.data.$values.length};return console.log("menuList - getMenuPermissions",a),a}),P=async s=>(await m(s)).success,g={loading:!1,menus:[],deleteConfirmation:!1,selectedMenu:"",menuPermissions:[]},u=d({name:`${n}/state`,initialState:g,reducers:{updateMenu:(s,e)=>{s.menus=e.payload},toggleDeleteConfirmation:(s,e)=>{s.deleteConfirmation=e.payload},setSelectedMenu:(s,e)=>{s.selectedMenu=e.payload},getMenusList:(s,e)=>{s.menus=e.payload},getMenuPermissionList:(s,e)=>{s.menuPermissions=e.payload}},extraReducers:s=>{s.addCase(t.fulfilled,(e,a)=>{e.menus=a.payload.data??[],e.loading=!1}).addCase(t.pending,e=>{e.loading=!0}).addCase(o.fulfilled,(e,a)=>{e.menuPermissions=a.payload.data??[],e.loading=!1}).addCase(o.pending,e=>{e.loading=!0})}}),{updateMenu:C,toggleDeleteConfirmation:S,setSelectedMenu:L,getMenusList:D}=u.actions,M=u.reducer,b=l({data:M}),$=p;export{P as a,o as b,t as g,b as r,L as s,S as t,$ as u};
