PageSourceSearch

https://xterns.ai/assets/SuperAdminMetricDetail-Bwe-MULn.js

js xterns.ai collected 2026-10-05 13:23:39 UTC 22,160 bytes, 8 lines download raw bytes

1import{M as ee,s as w,r as I,j as e,N as se,O as te,Q as ae,V as re,a8 as ne,u as oe,B as U,h as B,m as H,I as ie,J as E}from"./index-DLd_kDlx.js";import{T as le,a as ce,b as q,d as de,e as l,c as m}from"./table-BOJIo-OD.js";import{S as W}from"./SuperAdminLayout-BsUvQU2j.js";import{S as X,a as G,b as J,c as Q,d as M}from"./select-RSrodAEw.js";import{L as z}from"./loader-circle-D2miE2xB.js";import{R as me,T as ue}from"./generateCategoricalChart-ByDL-d9M.js";import{L as he,a as Z}from"./LineChart-BqKg5nac.js";import{C as pe}from"./CartesianGrid-ChidKd9i.js";import{X as xe,Y as _e}from"./YAxis-BtEb5zMI.js";import{A as fe}from"./arrow-left-BXtn7MCa.js";import{D as ge}from"./download-Cr0jatld.js";import"./NotificationIcon-C1wwYnH5.js";import"./popover-BMD5FOmU.js";import"./scroll-area-BXTuUF24.js";import"./index-Deh-4PO1.js";import"./index-BdQq_4o_.js";import"./NotificationItem-Dc2WXW-y.js";import"./formatDistanceToNow-57P64IbE.js";import"./en-US-9SRVm7yB.js";import"./differenceInCalendarMonths-BA0TPVs2.js";import"./endOfDay-DkR3ZXc8.js";import"./endOfMonth-CYn6pTOm.js";import"./message-square-CtxeCfRz.js";import"./trophy-DBX-jNOC.js";import"./triangle-alert-Chqk_WK7.js";import"./dropdown-menu-DSd1c3Vk.js";import"./index-lTaZyIGy.js";import"./chevron-right-CD1gvy-q.js";import"./crown-hzm_bRIt.js";import"./user-check-DxoAQXwU.js";import"./star-BH1OFEcs.js";import"./globe-C057RQ73.js";import"./timer-CZhDpZys.js";import"./briefcase-business-CphIeAJd.js";import"./key-round-B79BulHq.js";import"./search-DFH5eAlA.js";import"./chevron-down-DpJJsCer.js";import"./chevron-up-M4SAwIjf.js";import"./findIndex-Cos7Fxsp.js";import"./tiny-invariant-CopsF_GD.js";const je=({metricType:p,searchTerm:y="",userTypeFilter:S="all",statusFilter:N="all",podFilter:D="all",page:R=1,pageSize:A=20})=>{const k=(R-1)*A,{data:v,isLoading:T,error:P}=ee({queryKey:["super-admin-metric-detail",p,y,S,N,D,R],queryFn:async()=>{switch(p){case"onboarding":return V();case"assessment":return b();case"pod-participation":return f();case"score-growth":return $();case"engagement":return F();default:throw new Error("Invalid metric type")}},enabled:!!p}),V=async()=>{let d=[],g=0;if(S==="all"||S==="xtern"){let r=w.from("xtern_assessments").select("user_id, assessment_completed, completed_at",{count:"exact"});N==="completed"?r=r.eq("assessment_completed",!0):N==="pending"&&(r=r.eq("assessment_completed",!1));const{data:c,error:u,count:_}=await r.range(k,k+A-1).order("completed_at",{ascending:!1,nullsFirst:!1});if(u)throw u;const n=(c||[]).map(a=>a.user_id).filter(Boolean);let x=[];if(n.length>0){const{data:a,error:t}=await w.from("xterns_profiles").select("user_id, email, full_name, created_at").in("user_id",n);if(t)throw t;x=a||[]}const s=new Map(x.map(a=>[a.user_id,a]));let o=(c||[]).map(a=>{const t=s.get(a.user_id);return{id:a.user_id,email:(t==null?void 0:t.email)||"N/A",full_name:(t==null?void 0:t.full_name)||"N/A",user_type:"xtern",onboarded:a.assessment_completed,onboarded_date:a.completed_at||(t==null?void 0:t.created_at)}});if(y){const a=y.toLowerCase();o=o.filter(t=>{var h,j;return((h=t.email)==null?void 0:h.toLowerCase().includes(a))||((j=t.full_name)==null?void 0:j.toLowerCase().includes(a))})}d.push(...o),g+=_||0}if(S==="all"||S==="tech_lead"){let r=w.from("tech_lead_assessments").select("user_id, assessment_completed, completed_at",{count:"exact"});N==="completed"?r=r.eq("assessment_completed",!0):N==="pending"&&(r=r.eq("assessment_completed",!1));const{data:c,error:u,count:_}=await r.range(k,k+A-1).order("completed_at",{ascending:!1,nullsFirst:!1});if(u)throw u;const n=(c||[]).map(a=>a.user_id).filter(Boolean);let x=[];if(n.length>0){const{data:a,error:t}=await w.from("profiles").select("id, full_name").in("id",n);if(t)throw t;x=a||[]}const s=new Map(x.map(a=>[a.id,a]));let o=(c||[]).map(a=>{const t=s.get(a.user_id);return{id:a.user_id,email:(t==null?void 0:t.full_name)||"N/A",full_name:(t==null?void 0:t.full_name)||"N/A",user_type:"tech_lead",onboarded:a.assessment_completed,onboarded_date:a.completed_at}});if(y){const a=y.toLowerCase();o=o.filter(t=>{var h;
1return(h=t.full_name)==null?void 0:h.toLowerCase().includes(a)})}d.push(...o),g+=_||0}return{items:d,totalCount:g}},b=async()=>{let d=[];if(S==="all"||S==="xtern"){const{data:r}=await w.from("xtern_tech_assessments").select("id, user_id").eq("assessment_type","onboarding");if(r&&r.length>0){const c=r.map(n=>n.id),u=new Map(r.map(n=>[n.id,n.user_id])),{data:_}=await w.from("xtern_tech_assessment_attempts").select("id, tech_assessment_id, score_percentage, passed, tech_stacks_tested, completed_at, attempt_number").in("tech_assessment_id",c).not("completed_at","is",null).order("completed_at",{ascending:!1});if(_&&_.length>0){const n=[...new Set(r.map(o=>o.user_id))],{data:x}=await w.from("xterns_profiles").select("user_id, email, full_name").in("user_id",n),s=new Map((x==null?void 0:x.map(o=>[o.user_id,o]))||[]);for(const o of _){const a=u.get(o.tech_assessment_id),t=a?s.get(a):null;if(!t)continue;const h=o.passed??o.score_percentage>=40;if(N==="passed"&&!h||N==="failed"&&h)continue;let j="Various";if(o.tech_stacks_tested)try{const C=typeof o.tech_stacks_tested=="string"?JSON.parse(o.tech_stacks_tested):o.tech_stacks_tested;Array.isArray(C)&&(j=C.map(i=>i.name||i).join(", ")||"Various")}catch{j="Various"}d.push({id:o.id,email:t.email,full_name:t.full_name||t.email,user_type:"xtern",tech_stacks:j,score:o.score_percentage,passed:h,attempt_number:o.attempt_number||1,attempt_date:o.completed_at})}}}}if(S==="all"||S==="tech_lead"){const{data:r}=await w.from("tech_lead_tech_assessments").select("id, user_id, selected_tech_stacks");if(r&&r.length>0){const c=r.map(x=>x.id),u=new Map(r.map(x=>[x.id,x.user_id])),_=new Map(r.map(x=>[x.id,x.selected_tech_stacks])),{data:n}=await w.from("tech_lead_tech_assessment_attempts").select("id, tech_assessment_id, score_percentage, passed, completed_at, attempt_number").in("tech_assessment_id",c).not("completed_at","is",null).order("completed_at",{ascending:!1});if(n&&n.length>0){const x=[...new Set(r.map(a=>a.user_id).filter(Boolean))],{data:s}=await w.from("profiles").select("id, full_name").in("id",x),o=new Map((s==null?void 0:s.map(a=>[a.id,a]))||[]);for(const a of n){const t=u.get(a.tech_assessment_id),h=t?o.get(t):null;if(!h)continue;const j=h.full_name||"Unknown",C=a.passed??a.score_percentage>=40;if(N==="passed"&&!C||N==="failed"&&C)continue;let i="Various";const O=_.get(a.tech_assessment_id);if(O)try{const K=typeof O=="string"?JSON.parse(O):O;Array.isArray(K)&&(i=K.map(Y=>Y.name||Y).join(", ")||"Various")}catch{i="Various"}d.push({id:a.id,email:j,full_name:j,user_type:"tech_lead",tech_stacks:i,score:a.score_percentage,passed:C,attempt_number:a.attempt_number||1,attempt_date:a.completed_at})}}}}if(y){const r=y.toLowerCase();d=d.filter(c=>{var u,_;return((u=c.email)==null?void 0:u.toLowerCase().includes(r))||((_=c.full_name)==null?void 0:_.toLowerCase().includes(r))})}return d.sort((r,c)=>new Date(c.attempt_date).getTime()-new Date(r.attempt_date).getTime()),{items:d.slice(k,k+A),totalCount:d.length}},f=async()=>{const{data:d,error:g}=await w.from("pod_members").select(`
2        id,
3        user_id,
4        role,
5        status,
6        joined_at,
7        pods!inner(pod_name)
8      `).order("joined_at",{ascending:!1});if(g)throw g;if(!d||d.length===0)return{items:[],totalCount:0};const r=[...new Set(d.map(t=>t.user_id))],{data:c,error:u}=await w.from("public_profiles_v").select("id, full_name, user_type").in("id",r);if(u)throw u;const _=new Map((c||[]).map(t=>[t.id,t]));let n=d.map(t=>{var j;const h=_.get(t.user_id);return{id:t.id,user_id:t.user_id,email:(h==null?void 0:h.full_name)||"N/A",full_name:(h==null?void 0:h.full_name)||"N/A",user_type:(h==null?void 0:h.user_type)||"unknown",pod_name:((j=t.pods)==null?void 0:j.pod_name)||"N/A",role:t.role,status:t.status,joined_at:t.joined_at}});const x=[...new Set(n.map(t=>t.pod_name).filter(t=>t&&t!=="N/A"))].sort(),s=n.filter(t=>t.status==="active").length,o=n.length;if(S!=="all"&&(n=n.filter(t=>t.user_type===S)),D!=="all"&&(n=n.filter(t=>t.pod_name===D)),N!=="all"&&(n=n.filter(t=>t.status===N)),y){const t=y.toLowerCase();n=n.filter(h=>{var j,C;return((j=h.full_name)==null?void 0:j.toLowerCase().includes(t))||((C=h.email)==null?void 0:C.toLowerCase().includes(t))})}return{items:n.slice(k,k+A),totalCount:n.length,podNames:x,activeCount:s,totalMemberCount:o}},$=async()=>{try{const{data:d,error:g}=await w.functions.invoke("fetch-dareyscore-analytics",{body:{action:"scores-bulk",page:Math.floor(k/A)+1,pageSize:A,search:y||void 0}});if(g)throw g;if(d!=null&&d.error)throw new Error(d.error);const r=(d.users||[]).map(c=>{var u;return{id:c.platform_user_id||c.email,email:c.email,full_name:((u=c.email)==null?void 0:u.split("@")[0])||"Unknown",current_score:c.current_score??0,previous_score:c.previous_period_score??0,growth_percent:c.growth_percent??0}});return{items:r,totalCount:d.total_count||r.length}}catch(d){return console.warn("[useSuperAdminMetricDetail] Signal Score API unavailable for score-growth, table will be empty:",d),{items:[],totalCount:0}}},F=async()=>{let d=w.from("xterns_profiles").select("user_id, email, full_name",{count:"exact"});y&&(d=d.or(`full_name.ilike.%${y}%,email.ilike.%${y}%`));const{data:g,error:r,count:c}=await d.order("full_name",{ascending:!0}).range(k,k+A-1);if(r)throw r;if(!g||g.length===0)return{items:[],totalCount:c||0};const u=g.map(i=>
8i.user_id),[_,n,x,s]=await Promise.all([w.from("pod_members").select("user_id, status").in("user_id",u),w.from("meeting_attendance").select("user_id").in("user_id",u).eq("attended",!0),w.from("task_comments").select("author_id").in("author_id",u),w.from("roadmap_stories").select("assignee_id").in("assignee_id",u).eq("status","done")]),o=new Map,a=new Map;for(const i of _.data||[])o.set(i.user_id,(o.get(i.user_id)||0)+1),i.status==="active"&&a.set(i.user_id,!0);const t=new Map;for(const i of n.data||[])i.user_id&&t.set(i.user_id,(t.get(i.user_id)||0)+1);const h=new Map;for(const i of x.data||[])h.set(i.author_id,(h.get(i.author_id)||0)+1);const j=new Map;for(const i of s.data||[])i.assignee_id&&j.set(i.assignee_id,(j.get(i.assignee_id)||0)+1);let C=g.map(i=>{const O=a.get(i.user_id)||!1;return{id:i.user_id,email:i.email,full_name:i.full_name,pods_count:o.get(i.user_id)||0,comments_count:h.get(i.user_id)||0,stories_completed:j.get(i.user_id)||0,meetings_joined:t.get(i.user_id)||0,is_active:O}});return N==="active"?C=C.filter(i=>i.is_active):N==="inactive"&&(C=C.filter(i=>!i.is_active)),{items:C,totalCount:N==="all"?c||0:C.length}};return{data:v,isLoading:T,error:P,summary:(()=>{if(!v)return null;switch(p){case"onboarding":const d=v.items.filter(s=>s.user_type==="xtern"&&s.onboarded).length,g=v.items.filter(s=>s.user_type==="tech_lead"&&s.onboarded).length;return`${d} Xterns onboarded • ${g} Tech Leads onboarded`;case"assessment":const r=v.items.filter(s=>s.passed).length,c=v.items.length,u=c>0?(r/c*100).toFixed(0):0;return`${r}/${c} passed (${u}% pass rate)`;case"pod-participation":const _=v.activeCount??0,n=v.totalMemberCount??0;return`${_} active, ${n-_} inactive out of ${n} pod members`;case"score-growth":return`${v.items.filter(s=>s.growth_percent>0).length} learners showing growth`;case"engagement":return null;default:return null}})(),podNames:v==null?void 0:v.podNames}},we=({open:p,onClose:y,name:S,email:N,platformUserId:D})=>{const[R,A]=I.useState([]),[k,v]=I.useState(!1),[T,P]=I.useState(null);I.useEffect(()=>{if(!p||!D)return;(async()=>{v(!0),P(null);try{const{data:f,error:$}=await w.functions.invoke("fetch-dareyscore-analytics",{body:{action:"score-history",platformUserId:D,months:6}});if($)throw $;if(f!=null&&f.error)throw new Error(f.error);const F=(f==null?void 0:f.scores)||[];A([...F].reverse())}catch(f){console.error("[XternScoreHistoryModal] Error:",f),P((f==null?void 0:f.message)||"Failed to load score history")}finally{v(!1)}})()},[p,D]);const V=b=>new Date(b).toLocaleDateString("en-US",{month:"short",day:"numeric"});return e.jsx(se,{open:p,onOpenChange:b=>!b&&y(),children:e.jsxs(te,{className:"sm:max-w-2xl",children:[e.jsxs(ae,{children:[e.jsxs(re,{className:"text-lg",children:["Score History — ",S]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),e.jsx("div",{className:"h-72 mt-4",children:k?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(z,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):T?e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive",children:T}):R.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No score history available"}):e.jsx(me,{width:"100%",height:"100%",children:e.jsxs(he,{data:R,margin:{top:5,right:20,bottom:5,left:0},children:[e.jsx(pe,{strokeDasharray:"3 3",className:"stroke-border"}),e.jsx(xe,{dataKey:"date",tickFormatter:V,className:"text-xs fill-muted-foreground"}),e.jsx(_e,{className:"text-xs fill-muted-foreground"}),e.jsx(ue,{contentStyle:{borderRadius:8,fontSize:13},labelFormatter:V,formatter:(b,f)=>f==="score"?[b.toFixed(1),"Score"]:f==="change"?[b!=null?`${b>=0?"+":""}${b.toFixed(1)}`:"—","Change"]:[b,f]}),e.jsx(Z,{type:"monotone",dataKey:"score",className:"stroke-primary",strokeWidth:2,dot:{r:3},activeDot:{r:5}}),e.jsx(Z,{type:"monotone",dataKey:"change",className:"stroke-accent",strokeWidth:1,strokeDasharray:"4 2",dot:!1})]})})})]})})},ye={onboarding:{title:"Onboarding Details",description:"Track user onboarding completion status"},assessment:{title:"Assessment Results",description:"View assessment performance and pass rates"},"pod-participation":{title:"Pod Participation",description:"Monitor pod membership and activity"}
8,"score-growth":{title:"Signal Score Growth",description:"Track learner score progression over time"},engagement:{title:"Engagement Activity",description:"Monitor weekly user engagement metrics"}},ls=()=>{const{metricType:p}=ne(),y=oe(),[S,N]=I.useState(""),[D,R]=I.useState("all"),[A,k]=I.useState("all"),[v,T]=I.useState("all"),[P,V]=I.useState(1),[b,f]=I.useState(null),$=20,F=p?ye[p]:null,{data:L,isLoading:d,error:g,summary:r,podNames:c}=je({metricType:p||"",searchTerm:S,userTypeFilter:D,statusFilter:A,podFilter:v,page:P,pageSize:$});if(!F)return e.jsx(W,{children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx("h2",{className:"text-xl font-semibold text-destructive",children:"Invalid Metric Type"}),e.jsx(U,{onClick:()=>y("/super-admin/dashboard"),className:"mt-4",children:"Back to Dashboard"})]})});const u=s=>s?new Date(s).toLocaleDateString():"N/A",_=Math.ceil(((L==null?void 0:L.totalCount)||0)/$),n=()=>{switch(p){case"onboarding":return e.jsxs(e.Fragment,{children:[e.jsx(m,{children:"Name"}),e.jsx(m,{children:"Email"}),e.jsx(m,{children:"User Type"}),e.jsx(m,{children:"Onboarded"}),e.jsx(m,{children:"Date"})]});case"assessment":return e.jsxs(e.Fragment,{children:[e.jsx(m,{children:"Name"}),e.jsx(m,{children:"Email"}),e.jsx(m,{children:"User Type"}),e.jsx(m,{children:"Tech Stacks"}),e.jsx(m,{children:"Score"}),e.jsx(m,{children:"Status"}),e.jsx(m,{children:"Attempt #"}),e.jsx(m,{children:"Date"})]});case"pod-participation":return e.jsxs(e.Fragment,{children:[e.jsx(m,{children:"Name"}),e.jsx(m,{children:"Email"}),e.jsx(m,{children:"User Type"}),e.jsx(m,{children:"Pod Name"}),e.jsx(m,{children:"Role"}),e.jsx(m,{children:"Status"}),e.jsx(m,{children:"Joined"})]});case"score-growth":return e.jsxs(e.Fragment,{children:[e.jsx(m,{children:"Name"}),e.jsx(m,{children:"Email"}),e.jsx(m,{children:"Current Score"}),e.jsx(m,{children:"Previous Score"}),e.jsx(m,{children:"Growth"}),e.jsx(m,{children:"Trend"})]});case"engagement":return e.jsxs(e.Fragment,{children:[e.jsx(m,{children:"Name"}),e.jsx(m,{children:"Email"}),e.jsx(m,{children:"No. of Pods"}),e.jsx(m,{children:"Comments"}),e.jsx(m,{children:"Stories"}),e.jsx(m,{children:"Meetings Joined"}),e.jsx(m,{children:"Status"})]});default:return null}},x=s=>{var o,a,t;switch(p){case"onboarding":return e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"font-medium",children:s.full_name||"N/A"}),e.jsx(l,{children:s.email}),e.jsx(l,{children:e.jsx(E,{variant:"outline",children:s.user_type})}),e.jsx(l,{children:e.jsx(E,{className:s.onboarded?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800",children:s.onboarded?"✓ Yes":"✗ No"})}),e.jsx(l,{children:u(s.onboarded_date)})]});case"assessment":return e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"font-medium",children:s.full_name||"N/A"}),e.jsx(l,{children:s.email}),e.jsx(l,{children:e.jsx(E,{variant:"outline",children:s.user_type})}),e.jsx(l,{className:"text-sm",children:s.tech_stacks||"N/A"}),e.jsx(l,{children:s.score!=null?`${s.score.toFixed(2)}%`:"N/A"}),e.jsx(l,{children:e.jsx(E,{className:s.passed?"bg-green-100 text-green-800":"bg-red-100 text-red-800",children:s.passed?"Passed":"Failed"})}),e.jsx(l,{children:e.jsx(E,{variant:"secondary",children:s.attempt_number||1})}),e.jsx(l,{children:u(s.attempt_date)})]});case"pod-participation":return e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"font-medium",children:s.full_name||"N/A"}),e.jsx(l,{children:s.email}),e.jsx(l,{children:e.jsx(E,{variant:"outline",children:s.user_type})}),e.jsx(l,{children:s.pod_name||"N/A"}),e.jsx(l,{children:e.jsx(E,{variant:"secondary",children:s.role})}),e.jsx(l,{children:e.jsx(E,{className:s.status==="active"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800",children:s.status})}),e.jsx(l,{children:u(s.joined_at)})]});case"score-growth":return e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"font-medium",children:s.full_name||"N/A"}),e.jsx(l,{children:s.email}),e.jsx(l,{children:((o=s.current_score)==null?void 0:o.toFixed(1))||0}),e.jsx(l,{children:((a=s.previous_score)==null?void 0:a.toFixed(1))||0}),e.jsx(l,{children:e.jsxs(E,{className:s.growth_percent>=0?"bg-green-100 text-green-800":"bg-red-100 text-red-800",children:[s.growth_percent>=0?"+":"",((t=s.growth_percent)==null?void 0:t.toFixed(1))||0,"%"]})}),e.jsx(l,{className:"text-xl cursor-pointer hover:text-primary transition-colors",onClick:()=>f({id:s.id,name:s.full_name||s.email,email:s.email}),title:"View score history",children:s.growth_percent>0?"↑":s.growth_percent<0?"↓":"→"})]});case"engagement":return e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"font-medium",children:s.full_name||"N/A"}),e.jsx(l,{children:s.email}),e.jsx(l,{children:s.pods_count||0}),e.jsx(l,{children:s.comments_count||0}),e.jsx(l,{children:s.stories_completed||0}
8),e.jsx(l,{children:s.meetings_joined||0}),e.jsx(l,{children:e.jsx(E,{className:s.is_active?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800",children:s.is_active?"Active":"Inactive"})})]});default:return null}};return e.jsx(W,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>y("/super-admin/dashboard"),children:[e.jsx(fe,{className:"h-4 w-4 mr-2"}),"Back to Dashboard"]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:F.title}),e.jsx("p",{className:"text-muted-foreground mt-1",children:F.description})]}),e.jsxs(U,{variant:"outline",size:"sm",children:[e.jsx(ge,{className:"h-4 w-4 mr-2"}),"Export CSV"]})]})]}),r&&e.jsx(B,{children:e.jsx(H,{className:"pt-6",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:r})})}),e.jsx(B,{children:e.jsx(H,{className:"pt-6",children:e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(ie,{placeholder:"Search by name or email...",value:S,onChange:s=>N(s.target.value),className:"max-w-sm"}),p!=="score-growth"&&p!=="engagement"&&e.jsxs(X,{value:D,onValueChange:R,children:[e.jsx(G,{className:"w-48",children:e.jsx(J,{placeholder:"User Type"})}),e.jsxs(Q,{children:[e.jsx(M,{value:"all",children:"All Types"}),e.jsx(M,{value:"xtern",children:"Xtern"}),e.jsx(M,{value:"tech_lead",children:"Tech Lead"})]})]}),p==="pod-participation"&&c&&c.length>0&&e.jsxs(X,{value:v,onValueChange:T,children:[e.jsx(G,{className:"w-48",children:e.jsx(J,{placeholder:"Filter by Pod"})}),e.jsxs(Q,{children:[e.jsx(M,{value:"all",children:"All Pods"}),c.map(s=>e.jsx(M,{value:s,children:s},s))]})]}),(p==="onboarding"||p==="assessment"||p==="engagement"||p==="pod-participation")&&e.jsxs(X,{value:A,onValueChange:k,children:[e.jsx(G,{className:"w-48",children:e.jsx(J,{placeholder:"Status"})}),e.jsxs(Q,{children:[e.jsx(M,{value:"all",children:"All Status"}),p==="onboarding"&&e.jsxs(e.Fragment,{children:[e.jsx(M,{value:"completed",children:"Completed"}),e.jsx(M,{value:"pending",children:"Pending"})]}),p==="assessment"&&e.jsxs(e.Fragment,{children:[e.jsx(M,{value:"passed",children:"Passed"}),e.jsx(M,{value:"failed",children:"Failed"})]}),(p==="engagement"||p==="pod-participation")&&e.jsxs(e.Fragment,{children:[e.jsx(M,{value:"active",children:"Active"}),e.jsx(M,{value:"inactive",children:"Inactive"})]})]})]})]})})}),e.jsx(B,{children:e.jsx(H,{children:e.jsxs(le,{children:[e.jsx(ce,{children:e.jsx(q,{children:n()})}),e.jsx(de,{children:d?e.jsx(q,{children:e.jsx(l,{colSpan:7,className:"text-center py-12",children:e.jsx(z,{className:"h-6 w-6 animate-spin mx-auto"})})}):g?e.jsx(q,{children:e.jsx(l,{colSpan:7,className:"text-center py-12 text-destructive",children:"Failed to load data"})}):(L==null?void 0:L.items.length)===0?e.jsx(q,{children:e.jsx(l,{colSpan:7,className:"text-center py-12 text-muted-foreground",children:"No data found"})}):L==null?void 0:L.items.map((s,o)=>e.jsx(q,{children:x(s)},s.id||o))})]})})}),_>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(U,{variant:"outline",size:"sm",onClick:()=>V(s=>Math.max(1,s-1)),disabled:P===1,children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",P," of ",_]}),e.jsx(U,{variant:"outline",size:"sm",onClick:()=>V(s=>Math.min(_,s+1)),disabled:P===_,children:"Next"})]}),p==="score-growth"&&b&&e.jsx(we,{open:!!b,onClose:()=>f(null),name:b.name,email:b.email,platformUserId:b.id})]})})};export{ls 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.