import{b as c,c as d,a as D}from"./vendor-redux-a1f00e6b.js";import{a as p}from"./RoleService-7008da2c.js";import{F as f}from"./index-c62ac197.js";const i="roleList",r=c(i+"/getRoles",async a=>{var o,l,s;const e={fromDate:(o=a.filterData)==null?void 0:o.fromDate,searchString:(l=a.filterData)==null?void 0:l.searchText,toDate:(s=a.filterData)==null?void 0:s.toDate,SortBy:"",SortDirection:"",SearchByParamValue:"",SearchByParam:""},t=await p(e);return{data:t.data.$values,total:t.data.$values.length}}),u={total:0,pageIndex:1,pageSize:10,query:"",sort:{order:"",key:""}},g={loading:!1,deleteConfirmation:!1,selectedRole:"",roleList:[],tableData:u,filterData:{tenantId:"",searchText:"",fromDate:"",toDate:"",dateRange:[null,null]}},n=d({name:`${i}/state`,initialState:g,reducers:{updateRoleList:(a,e)=>{a.roleList=e.payload},setTableData:(a,e)=>{a.tableData=e.payload},setFilterData:(a,e)=>{a.filterData=e.payload},toggleDeleteConfirmation:(a,e)=>{a.deleteConfirmation=e.payload},setSelectedRole:(a,e)=>{a.selectedRole=e.payload},getRolesList:(a,e)=>{a.roleList=e.payload}},extraReducers:a=>{a.addCase(r.fulfilled,(e,t)=>{e.roleList=t.payload.data,e.tableData.total=t.payload.total,e.loading=!1}).addCase(r.pending,e=>{e.loading=!0})}}),{updateRoleList:b,toggleDeleteConfirmation:h,setTableData:C,setFilterData:T,setSelectedRole:x}=n.actions,m=n.reducer,A=D({data:m}),B=f;export{x as a,r as g,A as r,T as s,h as t,B as u};
