import{d as z,b6 as S,lC as T,r as b,lD as o,j as r,B as F,T as g}from"./index-5ae5cc5e.js";import{c as U,b as u,l as y,u as B}from"./index.esm-bd37e938.js";import{T as L}from"./index-7d0c783f.js";import{o as N}from"./yup-86a48159.js";import{T as q}from"./TopComponent-48cfd5d1.js";import"./TableRow-fbdd6d52.js";import"./useMediaQuery-8780c1c1.js";import"./TableContainer-ed67fdcd.js";import"./TableHead-15aac70d.js";import"./Grow-d70e9b6d.js";import"./TablePagination-63129eb6.js";import"./Select-6f375e89.js";import"./index-e5978b8b.js";import"./KeyboardArrowRight-8e772e39.js";import"./LastPage-aa82a010.js";import"./Toolbar-0ec32807.js";import"./MenuItem-dc2bf765.js";import"./dividerClasses-ea2ed133.js";import"./listItemTextClasses-2547faff.js";import"./listItemIconClasses-20c36342.js";import"./GenericThumbnailView-fac7773c.js";import"./index-125b1c7e.js";import"./createClass-227e27b6.js";import"./popper-f3391c26.js";import"./InputAdornment-c8af61f0.js";import"./TextField-013fef4f.js";import"./isMuiElement-c29cfc23.js";import"./ScrollableList-2ee889f8.js";import"./CircularProgress-672898c5.js";import"./componentStyles-7d84c389.js";import"./PageBreadCrumb-02ea77d2.js";import"./PageMetaData-8ba89049.js";import"./TextArea-20f097f8.js";import"./Grid2-48c222cb.js";import"./Badge-936004f7.js";import"./FilterFilled-40058e95.js";import"./AntdIcon-b932f733.js";import"./objectSpread2-13a56fdb.js";import"./FilterOutlined-1e3588e9.js";const ve=()=>{const a=z(),c=S(),{loggedUsers:{list:d,pageParams:t,loading:h,count:l,selectedData:A},system:{userAccessList:D}}=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=U().shape({newPassword:u().min(8,"Password must be at least 8 characters long").required("New Password is required"),confirmPassword:u().oneOf([y("newPassword"),""],"Passwords must match").required("Confirm Password is required")});B({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(F,{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};
