1import{o as xe}from"./rolldown-runtime-ChpBd9eV.js";import{a as he,n as ge}from"./vendor-react-DcWoBPJp.js";import{At as v,Bo as je,Ho as $,Ii as R,Jt as T,Ks as K,Ls as J,Ws as pe,Yi as ye,_i as ue,_n as we,cs as z,ds as Ne,er as fe,g as w,ir as ve,jn as B,li as be,mi as ke,mr as Pe,pi as Ce,rs as W,sn as Le,ui as Y,vo as G,xr as Ae}from"./vendor-ui-hcrcJjHJ.js";import{m as Q,p as V}from"./vendor-utils-aQqLnmvG.js";import{f as De,u as Se}from"./chunk-QUQL4437-DKXSrjJr.js";import{d as Ue,f as Fe,m as n}from"./index-CL2aAkkR.js";import{a as b,n as k,o as X,t as P}from"./Card-DIl7dpPH.js";import"./Card-Ca1N5Y9h.js";import{t as C}from"./Input-CdbxVNBC.js";import"./Input-SP1-zVGg.js";import{t as N}from"./Label-iZ6a4SYZ.js";import"./Label-B6SqbI5g.js";import{n as $e}from"./passwordValidation-BOY4dEnH.js";import{t as x}from"./Badge-8-nCtEoo.js";import"./Badge-Dyl1iSmB.js";import{t as d}from"./Skeleton-DGtyUQyZ.js";import"./Skeleton-CeUr0eZQ.js";import{a as Re,i as Te,n as ze,o as Be,r as Ve,t as qe}from"./Dialog-CaTPFm51.js";import{n as L,s as Z}from"./clients-CToOwoSi.js";import"./clients-C2Ce9H9I.js";var c=xe(he(),1),e=ge(),Ie=({tag:h,className:p="",onClick:s})=>(0,e.jsxs)(x,{variant:"outline",className:`cursor-pointer ${p}`,onClick:s,children:["#",h]}),ns=()=>{const{personId:h}=De(),p=Se(),[s,ee]=(0,c.useState)(null),[i,u]=(0,c.useState)(null),[se,q]=(0,c.useState)(!0),[y,o]=(0,c.useState)(!1),[A,l]=(0,c.useState)(null),[I,M]=(0,c.useState)(!1),[ae,D]=(0,c.useState)(!1),[re,S]=(0,c.useState)(!1),[t,g]=(0,c.useState)({password:"",confirmPassword:""}),[m,U]=(0,c.useState)({minLength:!1,isValid:!1});(0,c.useEffect)(()=>{h&&E()},[h]);const F=a=>{const r={minLength:a.length>=8,isValid:$e(a).valid};return U(r),r},_=a=>{g({...t,password:a}),F(a)},E=async()=>{if(h)try{q(!0),ee(await Z.getPerson(h)),l(null),await te(h)}catch(a){l(a.response?.data?.error||a.message||"Failed to fetch person details"),console.error("Error fetching person:",a)}finally{q(!1)}},te=async a=>{try{o(!0);const r=await L.listUsers({personId:a});u(r.users.length>0?r.users[0]:null)}catch{u(null)}finally{o(!1)}},ie=async()=>{if(!s||!t.password)return;const a=F(t.password);if(!a.isValid){let r=`Password does not meet requirements: 2`;a.minLength||(r+=`⢠Must be at least 8 characters long 3`),l(r.trim());return}if(t.password!==t.confirmPassword){l("Passwords do not match");return}try{o(!0),l(null);const r={username:s.email,email:s.email,displayName:s.name,password:t.password,personId:s.id,roles:[s.role]};u(await L.createUser(r)),D(!1),g({password:"",confirmPassword:""}),U({minLength:!1,isValid:!1})}catch(r){const j=r.response?.data?.error||r.message||"";j.includes("password")&&j.includes("characters")||j.includes("validation")?l("Password must be at least 8 characters long."):l("Failed to create user account. Please check your requirements and try again.")}finally{o(!1)}},le=async()=>{if(!i||!t.password)return;const a=F(t.password);if(!a.isValid){let r=`Password does not meet requirements: 4`;a.minLength||(r+=`⢠Must be at least 8 characters long 5`),l(r.trim());return}if(t.password!==t.confirmPassword){l("Passwords do not match");return}try{o(!0),l(null),u(await L.updateUser(i.id,{password:t.password})),S(!1),g({password:"",confirmPassword:""}),U({minLength:!1,isValid:!1})}catch(r){const j=r.response?.data?.error||r.message||"";j.includes("password")&&j.includes("characters")||j.includes("validation")?l("Password must be at least 8 characters long."):l("Failed to reset password. Please check your requirements and try again.")}finally{o(!1)}},ne=async()=>{if(!(!i||!window.confirm(`Are you sure you want to delete the user account "${i.username}"? This will remove login access.`)))try{o(!0),l(null),await L.deleteUser(i.id),u(null)}catch(a){l(a.response?.data?.error||a.message||"Failed to delete user account")}finally{o(!1)}},[de,f]=(0,c.useState)(!1),ce=async()=>{if(s)try{M(!0),await Z.deletePerson(s.id),p("/core/people")}catch(a){l(a.response?.data?.error||a.message||"Failed to delete person"),M(!1)}},H=()=>{E()},oe=a=>{switch(a){case"active":return{variant:"success",text:"Active",icon:je,color:"from-emerald-500 to-green-600"};case"inactive":return{variant:"warning",text:"Inactive",icon:$,color:"from-gray-500 to-slate-600"};
5case"pending":return{variant:"default",text:"Pending",icon:G,color:"from-amber-400 to-orange-500"};case"archived":return{variant:"outline",text:"Archived",icon:pe,color:"from-red-500 to-rose-600"};default:return{variant:"default",text:a,icon:$,color:"from-gray-500 to-slate-600"}}};if(se)return(0,e.jsx)("div",{className:"h-full overflow-auto",children:(0,e.jsxs)("div",{className:"container mx-auto p-6 space-y-6",children:[(0,e.jsx)("div",{className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-2xl p-8 shadow-sm border border-white/20 dark:border-gray-700/20",children:(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(d,{className:"h-10 w-32"}),(0,e.jsx)(d,{className:"h-10 w-48"})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(d,{className:"h-10 w-24"}),(0,e.jsx)(d,{className:"h-10 w-24"})]})]})}),(0,e.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,e.jsx)("div",{className:"lg:col-span-2",children:(0,e.jsxs)(P,{children:[(0,e.jsx)(b,{children:(0,e.jsx)(d,{className:"h-8 w-3/4"})}),(0,e.jsx)(k,{children:(0,e.jsx)(d,{className:"h-96 w-full"})})]})}),(0,e.jsx)("div",{children:(0,e.jsxs)(P,{children:[(0,e.jsx)(b,{children:(0,e.jsx)(d,{className:"h-6 w-40"})}),(0,e.jsxs)(k,{className:"space-y-4",children:[(0,e.jsx)(d,{className:"h-16 w-full"}),(0,e.jsx)(d,{className:"h-16 w-full"}),(0,e.jsx)(d,{className:"h-16 w-full"})]})]})})]})]})});if(A||!s)return(0,e.jsx)("div",{className:"h-full overflow-auto",children:(0,e.jsxs)("div",{className:"container mx-auto p-6 space-y-6",children:[(0,e.jsx)(w.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-2xl p-8 shadow-sm border border-white/20 dark:border-gray-700/20",children:(0,e.jsx)("div",{className:"flex items-center gap-4",children:(0,e.jsxs)(n,{variant:"ghost",onClick:()=>p("/core/people"),className:"gap-2",children:[(0,e.jsx)(J,{className:"h-4 w-4"}),"Back to People"]})})}),(0,e.jsx)(w.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:(0,e.jsxs)(Ue,{className:"border-red-200 bg-red-50 dark:bg-red-950/50 dark:border-red-800",children:[(0,e.jsx)($,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,e.jsxs)(Fe,{className:"text-red-800 dark:text-red-300",children:[A?`Failed to load person: ${A}`:"Person not found",(0,e.jsx)(n,{variant:"link",size:"sm",onClick:H,className:"ml-2 h-auto p-0 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:"Try again"})]})]})})]})});const O=oe(s.status),me=O.icon;return(0,e.jsx)("div",{className:"h-full overflow-auto",children:(0,e.jsxs)("div",{className:"container mx-auto p-6 space-y-8",children:[(0,e.jsx)(w.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"mb-2",children:(0,e.jsxs)("div",{className:"flex items-start justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)("div",{className:"p-3 bg-gradient-to-br from-indigo-500 to-purple-600 rounded shadow-lg",children:(0,e.jsx)(v,{className:"h-6 w-6 text-white"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-4xl font-bold bg-gradient-to-r from-gray-900 to-gray-700 dark:from-gray-100 dark:to-gray-300 bg-clip-text text-transparent",children:"Person Details"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"View and manage person information, credentials, and system access"})]})]}),(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsxs)(n,{variant:"outline",onClick:()=>p("/core/people"),size:"sm",className:"py-3 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 shadow-sm",children:[(0,e.jsx)(J,{className:"h-4 w-4 mr-2"}),"Back to People"]}),(0,e.jsxs)(n,{variant:"outline",size:"sm",onClick:H,className:"py-3 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 shadow-sm",children:[(0,e.jsx)(ve,{className:"h-4 w-4 mr-2"}),"Refresh"]}),(0,e.jsxs)(n,{onClick:()=>p(`/core/people/${s.id}/edit`),size:"sm",className:"py-3 bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 text-white shadow-lg hover:shadow-xl transition-all duration-200",children:[(0,e.jsx)(we,{className:"h-4 w-4 mr-2"}),"Edit"]}),(0,e.jsxs)(n,{variant:"destructive",size:"sm",onClick:()=>f(!0),className:"py-3",children:[(0,e.jsx)(T,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})}),(0,e.jsx)(w.div,{initial:{opacity:0,y:20}
5,animate:{opacity:1,y:0},transition:{delay:.1},className:"relative overflow-hidden border-0 bg-gradient-to-br from-blue-500 via-indigo-500 to-purple-500 text-white shadow-2xl hover:shadow-blue-500/25 transition-all duration-300 transform hover:scale-105 rounded-xl p-6",children:(0,e.jsx)("div",{className:"pb-3 relative z-10",children:(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)("div",{className:"w-16 h-16 bg-white/20 rounded-xl flex items-center justify-center",children:(0,e.jsx)(v,{className:"h-8 w-8 text-white"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-3xl font-bold text-white drop-shadow-lg mb-1",children:s.name}),s.title&&(0,e.jsx)("div",{className:"text-lg text-white/90 font-medium",children:s.title}),(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,e.jsxs)(x,{className:"bg-white/20 text-white border-white/30 hover:bg-white/30",children:[(0,e.jsx)(me,{className:"w-3 h-3 mr-1"}),O.text]}),(0,e.jsxs)(x,{className:"bg-white/20 text-white border-white/30 hover:bg-white/30",children:[(0,e.jsx)(B,{className:"w-3 h-3 mr-1"}),s.role]})]})]})]}),(0,e.jsxs)("div",{className:"text-right",children:[(0,e.jsx)("div",{className:"text-lg font-semibold text-white/90 mb-1",children:"Contact"}),(0,e.jsx)("div",{className:"text-white/80 text-sm",children:s.email}),s.phone&&(0,e.jsx)("div",{className:"text-white/80 text-sm",children:s.phone})]})]})})}),(0,e.jsx)(w.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"flex-1 min-h-0 bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-[10px] shadow-sm border border-white/20 dark:border-gray-700/20",children:(0,e.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,e.jsx)("div",{className:"lg:col-span-2 space-y-6",children:(0,e.jsxs)(P,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700",children:[(0,e.jsxs)(b,{children:[(0,e.jsx)(X,{className:"text-2xl bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent",children:s.name}),s.title&&(0,e.jsx)("p",{className:"text-gray-600 dark:text-gray-400 mt-2",children:s.title})]}),(0,e.jsxs)(k,{className:"space-y-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2",children:[(0,e.jsx)(Y,{className:"h-5 w-5 text-blue-600"}),"Contact Information"]}),(0,e.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(Y,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Email"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.email})]})]}),s.phone&&(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(Ae,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Phone"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.phone})]})]}),s.location&&(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(be,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Location"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.location})]})]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2",children:[(0,e.jsx)(z,{className:"h-5 w-5 text-blue-600"}),"Organization"]}),(0,e.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(z,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Department"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.department||"Not specified"})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(B,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Role"}),(0,e.jsx)(x,{variant:"outline",className:"capitalize",children:s.role})]})]}),s.manager&&(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(Ne,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Manager"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.manager})]})]})]})]}),s.tags&&s.tags.length>0&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2",children:[(0,e.jsx)(Le,{className:"h-5 w-5 text-blue-600"}),"Tags"]}),(0,e.jsx)("div",{className:"flex flex-wrap gap-2",children:s.tags.map((a,r)=>
5(0,e.jsx)(Ie,{tag:a,size:"md"},r))})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-2",children:[(0,e.jsx)(R,{className:"h-5 w-5 text-blue-600"}),"Login Credentials"]}),i?(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)(n,{variant:"secondary",size:"sm",onClick:()=>S(!0),disabled:y,children:[(0,e.jsx)(fe,{className:"h-4 w-4 mr-1"}),"Reset Password"]}),(0,e.jsxs)(n,{variant:"destructive",size:"sm",onClick:ne,disabled:y,children:[(0,e.jsx)(T,{className:"h-4 w-4 mr-1"}),"Remove Access"]})]}):(0,e.jsxs)(n,{variant:"primary",size:"sm",onClick:()=>D(!0),disabled:y,children:[(0,e.jsx)(Pe,{className:"h-4 w-4 mr-1"}),"Create Login"]})]}),y?(0,e.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:[(0,e.jsx)(d,{className:"h-4 w-32 mb-2"}),(0,e.jsx)(d,{className:"h-4 w-48"})]}):i?(0,e.jsx)("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4",children:(0,e.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(R,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Username"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:i.username})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(Ce,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Status"}),(0,e.jsx)(x,{variant:i.status==="active"?"success":"warning",children:i.status})]})]}),i.lastLoginAt&&(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(K,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Last Login"}),(0,e.jsxs)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:[V(new Date(i.lastLoginAt))," ago"]})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(W,{className:"h-5 w-5 text-gray-400"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Account Created"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:Q(new Date(i.createdAt),"PPP")})]})]})]})}):(0,e.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-8 text-center",children:[(0,e.jsx)(ke,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),(0,e.jsx)("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"No Login Access"}),(0,e.jsx)("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:"This person doesn't have login credentials yet. Create a user account to enable system access."})]}),ae&&(0,e.jsxs)("div",{className:"mt-4 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg p-6",children:[(0,e.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"Create Login Account"}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[(0,e.jsx)(N,{className:"text-sm text-gray-600 dark:text-gray-400",children:"Username (Email)"}),(0,e.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100 mt-1",children:s.email}),(0,e.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"The person's email will be used as the username for login"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(N,{htmlFor:"password",children:"Password"}),(0,e.jsx)(C,{id:"password",type:"password",autoComplete:"new-password",value:t.password,onChange:a=>_(a.target.value),placeholder:"Enter password",className:"mt-1"}),(0,e.jsxs)("div",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:[(0,e.jsx)("p",{className:"font-medium mb-1",children:"Password requirements:"}),(0,e.jsx)("ul",{className:"space-y-1",children:(0,e.jsxs)("li",{className:`flex items-center gap-2 ${m.minLength?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"}`,children:[(0,e.jsx)("span",{className:`w-4 h-4 rounded-full flex items-center justify-center text-xs ${m.minLength?"bg-green-100 text-green-600":"bg-gray-100 text-gray-400"}`,children:m.minLength?"â":"â¢"}),"At least ",8," characters"]})})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(N,{htmlFor:"confirmPassword",children:"Confirm Password"}),(0,e.jsx)(C,{id:"confirmPassword",type:"password",value:t.confirmPassword,onChange:a=>g({...t,confirmPassword:a.target.value}),placeholder:"Confirm password",className:"mt-1"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(n,{variant:"primary",onClick:ie,disabled:y||!t.password||!m.isValid,children:"Create Account"}),(0,e.jsx)(n,{variant:"secondary",onClick:()=>{D(!1),g({password:"",confirmPassword:""})},children:"Cancel"})]})]})]}),re&&(0,e.jsxs)("div",{className:"mt-4 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg p-6",children:[(0,e.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:"Reset Password"}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(N,{htmlFor:"newPassword",children:"New Password"}),(0,e.jsx)(C,{id:"newPassword",type:"password",autoComplete:"new-password",value:t.password,onChange:a=>_(a.target.value),placeholder:"Enter new password",className:"mt-1"}),(0,e.jsxs)("div",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:[(0,e.jsx)("p",{className:"font-medium mb-1",children:"Password requirements:"}),(0,e.jsx)("ul",{className:"space-y-1",children:(0,e.jsxs)("li",{className:`flex items-center gap-2 ${m.minLength?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"}`,children:[(0,e.jsx)("span",{className:`w-4 h-4 rounded-full flex items-center justify-center text-xs ${m.minLength?"bg-green-100 text-green-600":"bg-gray-100 text-gray-400"}`,children:m.minLength?"â":"â¢"}),"At least ",8," characters"]})})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(N,{htmlFor:"confirmNewPassword",children:"Confirm New Password"}),(0,e.jsx)(C,{id:"confirmNewPassword",type:"password",value:t.confirmPassword,onChange:a=>g({...t,confirmPassword:a.target.value}),placeholder:"Confirm new password",className:"mt-1"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(n,{variant:"primary",onClick:le,disabled:y||!t.password||!m.isValid,children:"Reset Password"}),(0,e.jsx)(n,{variant:"secondary",onClick:()=>{S(!1),g({password:"",confirmPassword:""})},children:"Cancel"})]})]})]})]})]})]})}),(0,e.jsx)("div",{className:"space-y-6",children:(0,e.jsxs)(P,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700",children:[(0,e.jsx)(b,{children:(0,e.jsxs)(X,{className:"flex items-center gap-2",children:[(0,e.jsx)(v,{className:"h-5 w-5 text-blue-600"}),"Person Information"]})}),(0,e.jsxs)(k,{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(ye,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Person ID"})]}),(0,e.jsx)("p",{className:"font-mono text-xs bg-gray-100 dark:bg-gray-800 p-2 rounded",children:s.id})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(B,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Role"})]}),(0,e.jsx)(x,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300 dark:bg-blue-950 dar
5k:text-blue-300 dark:border-blue-700",children:s.role})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(z,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Department"})]}),(0,e.jsx)("p",{className:"text-sm",children:s.department||"Not specified"})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(v,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Identity"})]}),(0,e.jsx)("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-3 font-mono text-sm",children:(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Type:"}),(0,e.jsx)("span",{className:"text-gray-900 dark:text-gray-100",children:"human"})]}),(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Name:"}),(0,e.jsx)("span",{className:"text-gray-900 dark:text-gray-100",children:s.name})]})]})})]}),i&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(R,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Account Status"})]}),(0,e.jsx)(x,{variant:i.status==="active"?"success":"warning",children:i.status})]}),(0,e.jsxs)("div",{className:"border-t pt-4 space-y-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(W,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Created"})]}),(0,e.jsx)("p",{className:"text-sm",children:s.createdAt?Q(new Date(s.createdAt),"PPP"):"Unknown"})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(G,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Last Updated"})]}),(0,e.jsx)("p",{className:"text-sm",children:s.updatedAt?V(new Date(s.updatedAt))+" ago":"Never"})]}),i?.lastLoginAt&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,e.jsx)(K,{className:"h-4 w-4"}),(0,e.jsx)("span",{children:"Last Login"})]}),(0,e.jsxs)("p",{className:"text-sm",children:[V(new Date(i.lastLoginAt))," ago"]})]})]})]})]})})]})}),(0,e.jsx)(qe,{open:de,onOpenChange:f,children:(0,e.jsxs)(ze,{children:[(0,e.jsxs)(Re,{children:[(0,e.jsx)(Be,{children:"Delete Person"}),(0,e.jsx)(Ve,{children:"Are you sure you want to delete this person? This action cannot be undone."})]}),(0,e.jsx)("div",{className:"py-4",children:(0,e.jsxs)("div",{className:"bg-gray-100 dark:bg-gray-800 p-4 rounded-lg",children:[(0,e.jsx)("p",{className:"font-medium text-lg",children:s.name}),s.email&&(0,e.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:s.email}),(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,e.jsx)(x,{variant:"outline",className:"text-xs",children:s.role}),s.department&&(0,e.jsxs)("span",{className:"text-xs text-gray-500",children:["⢠",s.department]})]})]})}),(0,e.jsxs)(Te,{children:[(0,e.jsx)(n,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),(0,e.jsx)(n,{variant:"destructive",onClick:()=>{ce(),f(!1)},disabled:I,children:I?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ue,{className:"h-4 w-4 mr-2 animate-spin"}),"Deleting..."]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(T,{className:"h-4 w-4 mr-2"}),"Delete Person"]})})]})]})})]})})};export{ns as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.