1import{c as z,j as e,r as g,U as y,K as D,x as H,h as x,i as o,k as m,m as h,aa as v,ab as b,ac as C,B as T,L as w,A as k,J as c,P as I,ae as X}from"./index-DLd_kDlx.js";import{C as K}from"./ClientBusinessGate-CKL9R3zX.js";import{n as V}from"./businessManagement-BTTXtuIj.js";import{T as P,a as A,b as j,c as r,d as S,e as i}from"./table-BOJIo-OD.js";import{T as L,a as q,b as U,c as M}from"./tabs-DKw2ItQa.js";import{L as F}from"./loader-circle-D2miE2xB.js";import{T as B}from"./trending-up-BU4cR3Ys.js";import{K as G}from"./key-round-B79BulHq.js";import{U as J}from"./user-check-DxoAQXwU.js";import"./timer-CZhDpZys.js";import"./briefcase-business-CphIeAJd.js";import"./index-lTaZyIGy.js";import"./index-Deh-4PO1.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const O=z("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),xe=()=>e.jsx(K,{children:({business:d,overview:n})=>e.jsx(Q,{businessId:d.id,overview:n})}),Q=({businessId:d,overview:n})=>{const[t,E]=g.useState(null),[$,N]=g.useState(!0);g.useEffect(()=>{(async()=>{try{N(!0),E(await V(d))}catch(l){X({title:"Unable to load analytics",description:l instanceof Error?l.message:"Please try again.",variant:"destructive"})}finally{N(!1)}})()},[d]);const f=(t==null?void 0:t.pods)||[],u=(t==null?void 0:t.participants)||[],_=(t==null?void 0:t.overdue_sprints)||[],p=(t==null?void 0:t.tech_leads)||[],a=t==null?void 0:t.metrics;return $?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(F,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-2xl font-bold",children:"Pod Analytics"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Scoped analytics for your business pods and participants."})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-5",children:[["Assigned Pods",(a==null?void 0:a.assigned_pods)||(n==null?void 0:n.pods)||0,y],["Total Participants",(a==null?void 0:a.total_participants)||(n==null?void 0:n.participants)||0,y],["Active",(a==null?void 0:a.active_participants)||0,D],["Inactive",(a==null?void 0:a.inactive_participants)||0,O],["Completed Pods",(a==null?void 0:a.completed_pods)||0,H],["Pod Progress",`${(a==null?void 0:a.average_pod_progress)||0}%`,B],["Access Codes",(a==null?void 0:a.active_access_codes)||(n==null?void 0:n.access_codes)||0,G]].map(([s,l,R])=>e.jsxs(x,{children:[e.jsxs(o,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(m,{className:"text-sm",children:s}),e.jsx(R,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(h,{children:e.jsx("div",{className:"text-2xl font-bold",children:l})})]},s))}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_1fr]",children:[e.jsxs(x,{children:[e.jsxs(o,{className:"flex flex-row items-center justify-between",children:[e.jsxs(m,{className:"flex items-center gap-2",children:["Overdue Sprints",e.jsxs(v,{children:[e.jsx(b,{asChild:!0,children:e.jsx("span",{className:"cursor-help text-sm text-muted-foreground",children:"?"})}),e.jsx(C,{className:"max-w-xs",children:"Sprints whose end date has passed and are not marked completed."})]})]}),e.jsx(T,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:e.jsxs(w,{to:"/client/pods",children:["View more",e.jsx(k,{className:"h-4 w-4"})]})})]}),e.jsx(h,{className:"space-y-3",children:_.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No overdue sprints."}):_.slice(0,3).map(s=>e.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-medium",children:s.name||`Sprint ${s.sprint_number}`}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.pod_name," - due ",new Date(s.end_date).toLocaleDateString()]})]}),e.jsx(c,{variant:"destructive",className:"shrink-0 capitalize",children:s.status.replace(/_/g," ")})]},s.id))})]}),e.jsxs(x,{children:[e.jsxs(o,{className:"flex flex-row items-center justify-between",children:[e.jsx(m,{children:"Pod Progress"}),e.jsx(T,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:e.jsxs(w,{to:"/client/pods",children:["View more",e.jsx(k,{className:"h-4 w-4"})]})})]}),e.jsx(h,{className:"space-y-4",children:f.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No pod activity yet."}):f.slice(0,3).map(s=>e.jsxs("div",{className:"space-y-2 rounded-lg border p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.pod_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.active_members," active, ",s.inactive_members," inactive members"]})]}),e.jsx(c,{variant:"outline",className:"capitalize",children:s.status})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(I,{value:s.progress,className:"h-2"}),e.jsxs("span",{className:"w-10 text-right text-xs font-medium",children:[s.progress,"%"]})]})]},s.id))})]})]}),e.jsxs(x,{children:[e.jsx(o,{children:e.jsxs(m,{className:"flex items-center gap-2",children:["Users",e.jsxs(v,{children:[e.jsx(b,{asChild:!0,children:e.jsx("span",{className:"cursor-help text-sm text-muted-foreground",children:"?"})}),e.jsx(C,{className:"max-w-xs",children:"Switch between Xtern participants and tech leads assigned to your business pods."})]})]})}),e.jsx(h,{children:e.jsxs(L,{defaultValue:"xterns",className:"w-full",children:[e.jsxs(q,{children:[e.jsxs(U,{value:"xterns",children:["Xterns (",u.length,")"]}),e.jsxs(U,{value:"techleads",children:["Tech Leads (",p.length,")"]})]}),e.jsx(M,{value:"xterns",className:"mt-4",children:u.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No Xterns have joined assigned pods yet."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(P,{children:[e.jsx(A,{children:e.jsxs(j,{children:[e.jsx(r,{children:"Xtern"}),e.jsx(r,{children:"Pod Assigned"}),e.jsx(r,{className:"text-right",children:"Signal"}),e.jsx(r,{className:"text-right",children:"Technical"}),e.jsx(r,{className:"text-right",children:"Engagement"}),e.jsx(r,{className:"text-right",children:"Collaboration"}),e.jsx(r,{className:"text-right",children:"Tickets"}),e.jsx(r,{children:"Status"})]})}),e.jsx(S,{children:u.map(s=>e.jsxs(j,{children:[e.jsx(i,{children:e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.full_name}),s.email&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s.email})]})}),e.jsx(i,{children:e.jsx("div",{className:"flex max-w-56 flex-wrap gap-1",children:s.pods.map(l=>e.jsx(c,{variant:"outline",children:l.pod_name},l.pod_id))})}),e.jsx(i,{className:"text-right font-medium",children:Math.round(s.signal_score||0)}),e.jsx(i,{className:"text-right",children:Math.round(s.technical_score||0)}),e.jsx(i,{className:"text-right",children:Math.round(s.engagement_score||0)}),e.jsx(i,{className:"text-right",children:Math.round(s.collaboration_score||0)}),e.jsxs(i,{className:"text-right",children:[s.completed_tickets,"/",s.assigned_tickets,e.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",children:["(",s.completion_rate,"%)"]})]}),e.jsx(i,{children:e.jsx(c,{variant:s.is_active_in_sprint?"secondary":"outline",children:s.is_active_in_sprint?"Active":"Inactive"})})]}
6,s.user_id))})]})})}),e.jsx(M,{value:"techleads",className:"mt-4",children:p.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No tech leads are assigned to these pods yet."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(P,{children:[e.jsx(A,{children:e.jsxs(j,{children:[e.jsx(r,{children:"Tech Lead"}),e.jsx(r,{children:"Assigned Pods"}),e.jsx(r,{children:"Expertise"}),e.jsx(r,{className:"text-right",children:"Rating"})]})}),e.jsx(S,{children:p.map(s=>e.jsxs(j,{children:[e.jsx(i,{children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(J,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.full_name}),s.email&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s.email})]})]})}),e.jsx(i,{children:e.jsx("div",{className:"flex max-w-72 flex-wrap gap-1",children:s.pods.map(l=>e.jsx(c,{variant:"outline",children:l.pod_name},`${s.id}-${l.pod_id}`))})}),e.jsx(i,{children:e.jsx("div",{className:"flex max-w-72 flex-wrap gap-1",children:s.expertise_areas.length===0?e.jsx("span",{className:"text-xs text-muted-foreground",children:"No expertise listed"}):s.expertise_areas.slice(0,4).map(l=>e.jsx(c,{variant:"secondary",children:l},`${s.id}-${l}`))})}),e.jsxs(i,{className:"text-right",children:[Number(s.rating||0).toFixed(1),e.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",children:["(",s.total_reviews||0,")"]})]})]},s.id))})]})})})]})})]})]})};export{xe 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.