import{d as z,b6 as S,lB as T,r as b,lC as o,j as r,B,T as g}from"./index-aa25c5ff.js";import{c as F,b as u,l as U,u as y}from"./index.esm-a7f661dc.js";import{T as L}from"./index-1b842ccf.js";import{o as N}from"./yup-72cc4918.js";import{T as q}from"./TopComponent-093835c5.js";import"./TableRow-ee82d902.js";import"./useMediaQuery-5832b4d6.js";import"./TableContainer-150455ba.js";import"./TableHead-7918647e.js";import"./Grow-53c7e965.js";import"./TablePagination-7f533723.js";import"./Select-b8388c2f.js";import"./index-e5978b8b.js";import"./KeyboardArrowRight-207c2b3b.js";import"./LastPage-cc741249.js";import"./Toolbar-aae1a453.js";import"./MenuItem-6f39aa2e.js";import"./dividerClasses-ce522944.js";import"./listItemTextClasses-88140258.js";import"./listItemIconClasses-31a870c1.js";import"./GenericThumbnailView-e0343bac.js";import"./index-d4b36417.js";import"./createClass-d1bae5ec.js";import"./popper-f3391c26.js";import"./InputAdornment-1e7eea92.js";import"./TextField-55b66d20.js";import"./isMuiElement-1b254892.js";import"./ScrollableList-9498bc37.js";import"./CircularProgress-d6cfca6d.js";import"./componentStyles-e32842f3.js";import"./PageBreadCrumb-6e4973c8.js";import"./PageMetaData-ba7cb151.js";import"./TextArea-d1a16eb1.js";import"./Grid2-d00e0f6a.js";import"./Badge-9e87965d.js";import"./FilterFilled-8e291e82.js";import"./AntdIcon-b92b7162.js";import"./objectSpread2-f5b2f6aa.js";import"./FilterOutlined-7f40b65c.js";const ve=()=>{const a=z(),c=S(),{loggedUsers:{list:d,pageParams:t,loading:h,count:l,selectedData:A},system:{userAccessList:E}}=T(),x=[{title:"S.No"},{title:"UserName"},{title:"Full Name"},{title:"Email"},{title:"Phone"},{title:"Group",width:100}];function f(e,s,p,n,i,m){return{index:e,username:s,fullname:p,email:n,phone:i,group:m}}const P=d.map((e,s)=>{var i;const p=(t.page-1)*t.page_size+(s+1),n=(i=e==null?void 0:e.groups)==null?void 0:i.map(m=>m).join(", ");return f(p,e.username||"",e.full_name||"",e.email||"",e.phone||"",n||"")}),C=({search:e})=>{a(o({...t,search:e||"",page:1,page_size:10}))},_=(e,s)=>{a(o({...t,search:"",page:s+1}))},j=e=>{a(o({...t,search:"",page:1,page_size:parseInt(e.target.value)}))};b.useEffect(()=>{a(o({...t,search:"",page:1,page_size:10})),c.setTitle("Logged Users"),c.setSubtitle("Settings")},[]);const v=F().shape({newPassword:u().min(8,"Password must be at least 8 characters long").required("New Password is required"),confirmPassword:u().oneOf([U("newPassword"),""],"Passwords must match").required("Confirm Password is required")});y({resolver:N(v)});const w=e=>{const s=e.target.value;a(o({...t,search:s||"",page:1,page_size:10}))};return r.jsxs(r.Fragment,{children:[r.jsx(q,{permissionPreFix:"core_users",permissionPostFix:"current_logged_users",navigateLink:"/pages/settings/manage-users/0",showAddButton:!1,showFilterButton:!1,addButtonName:"Add User",handleSearch:C,handleInputChange:w,children:r.jsxs(B,{sx:{display:"flex",gap:2},children:[r.jsx(g,{variant:"h4",children:" Count"}),r.jsx(g,{variant:"subtitle1",color:"primary",children:l})]})}),r.jsx(L,{count:l,columns:x,rows:P,loading:h,page:t.page,pageSize:t.page_size,handleChangePage:_,handleChangeRowsPerPage:j})]})};export{ve as default};
