1import{c as C,j as s,d as W,a as Y,X as gs,C as H}from"./index-CbtKD9GF.js";import{b as r,u as Ns,L as j}from"./vendor-gmoby7Lc.js";import{A as ts}from"./activity-ciIARPtP.js";import{R as ls}from"./refresh-cw-BVpv75up.js";import{P as R}from"./phone-CmQHw2C5.js";import{A as S}from"./arrow-right-CG5v7Ez_.js";import{U as ns}from"./users-B-7dCcKT.js";import{C as is}from"./chart-column-DTz6hlN3.js";import"./icons-BYq1EogD.js";const ys=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],fs=C("chart-pie",ys);const bs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],ws=C("clock-3",bs);const ks=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ss=C("credit-card",ks);const Cs=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],cs=C("list",Cs);const $s=[["path",{d:"m16 8 6-6",key:"oawc05"}],["path",{d:"M22 8V2h-6",key:"oqy2zc"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],As=C("phone-outgoing",$s);function zs(i=new Date){const n=i.getHours();return n>=5&&n<12?"Good morning":n>=12&&n<16?"Good afternoon":n>=16&&n<21?"Good evening":"Good night"}function rs(i=""){return String(i||"").replace(/[._-]+/g," ").replace(/\d+/g," ").replace(/\s+/g," ").trim()}function Ls(i={}){const n=rs(i.fullName||i.displayName||i.name||[i.firstName,i.lastName].filter(Boolean).join(" "));return n||rs(String(i.email||"").split("@")[0])||"there"}function Ms(){const[i,n]=r.useState(""),[u,d]=r.useState("");return r.useEffect(()=>{const o=()=>{n(zs());try{const $=JSON.parse(localStorage.getItem("user")||"{}");d(Ls($))}catch{d("there")}};o();const p=window.setInterval(o,60*1e3);return window.addEventListener("storage",o),window.addEventListener("auth-state-changed",o),()=>{window.clearInterval(p),window.removeEventListener("storage",o),window.removeEventListener("auth-state-changed",o)}},[]),s.jsx("div",{className:"dynamic-greeting",children:s.jsxs("h1",{children:[i,", ",u,"!"]})})}const J={overview:{},performance:{},dailyStats:[],recentCalls:[],assistantStats:[]};function Os(){const i=Ns(),[n,u]=r.useState(null),[d,o]=r.useState([]),[p,$]=r.useState("7d"),[A,ds]=r.useState(""),[V,F]=r.useState(()=>({checked:!1,show:!1})),[z,v]=r.useState(!0),[B,L]=r.useState(""),P=`dashboard_cache:${p}:${A||"all"}`;r.useEffect(()=>{let a=!1;const e=localStorage.getItem(P);if(e)try{const{analytics:t,assistants:l,ts:c}=JSON.parse(e);t&&Date.now()-c<300*1e3&&(u(t),o(l||[]),v(!1),a=!0)}catch{}a||(u(J),v(!1)),E({silent:!0})},[P]),r.useEffect(()=>{let a=!1;const e=sessionStorage.getItem("vagle_zero_credit_prompt_dismissed")==="1";return W.authedFetch(Y.getApiUrl("/api/credits/balance")).then(t=>t.ok?t.json():null).then(t=>{if(a||!t?.success)return;const l=Number(t.credits??t.balance??0),c=!!t.unlimitedCredits||!!t.isAdmin;F({checked:!0,show:!e&&!c&&l<=0})}).catch(()=>{a||F(t=>({...t,checked:!0}))}),()=>{a=!0}},[]);const E=async({silent:a=!1}={})=>{v(!0),L("");try{if(!localStorage.getItem("token")){L("Please log in again to load your dashboard."),v(!1);return}const t=new URLSearchParams({period:p});A&&t.append("assistantId",A);const[l,c]=await Promise.allSettled([W.authedFetch(Y.getApiUrl(`/api/analytics?${t}`)).then(G=>K(G,"analytics")),W.authedFetch(Y.getApiUrl("/api/assistants?summary=1")).then(G=>K(G,"assistants"))]);let x=null,k=null;const y=[];l.status==="fulfilled"&&l.value?.success?(x=l.value.analytics||J,u(x)):l.status==="rejected"?y.push(l.reason?.message||"Failed to load analytics."):y.push(l.value?.error||"Failed to load analytics."),c.status==="fulfilled"&&c.value?.success?(k=c.value.assistants||[],o(k)):c.status==="rejected"?y.push(c.reason?.message||"Failed to load assistants."):y.push(c.value?.error||"Failed to load assistants."),(x||k)&&localStorage.setItem(P,JSON.stringify({analytics:x||n||J,assistants:k||d,ts:Date.now()})),y.length&&!x&&!k&&L(y[0]||"Failed to load dashboard data.")}catch(e){console.error("Dashboard fetch error:",e),L(e.message||"Failed to load dashboard data.")}finally{v(!1)}},K=async(a,e)=>{let t=null;try{t=await a.json()}catch{}if(a.status===401)throw localStorage.removeItem("token"),window.dispatchEvent(new Event("auth-state-changed")),new Error("Your session expired. Please log in again.");if(!a.ok)throw new Error(t?.error||`Failed to load ${e}.`);return t},os=a=>a?`${Math.floor(a/60)}:${String(Math.floor(a%60)).padStart(2,"0")}`:"0:00",hs=a=>{if(!a)return"â";const e=Math.floor((Date.now()-new Date(a))/1e3);return e<60?"Just now":e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`},M=a=>`${Math.round(a||0)}ms`,ms=a=>{a=Math.max(0,Math.floor(a||0));const e=Math.floor(a/3600),t=Math.floor(a%3600/60),l=a%60;return e>0?`${e}h ${t}m ${l}s`:t>0?`${t}m ${l}s`:`${l}s`},xs=a=>{switch(a){case"completed":return"var(--accent-primary)";case"failed":return"#ff4757";case"active":return"#ffa502";default:return"var(--text-secondary)"}},m=n?.overview||{},_=n?.performance||{},U=n?.dailyStats||[],T=n?.recentCalls||[],q=n?.assistantStats||[],Q=Math.max(...U.map(a=>a.calls).concat([1])),js=()=>
1{sessionStorage.setItem("vagle_zero_credit_prompt_dismissed","1"),F({checked:!0,show:!1})},X={"24h":"the last 24 hours","7d":"the last 7 days","30d":"the last 30 days","90d":"the last 90 days",all:"all time"}[p]||"this period",f=m.completedCalls||0,h=m.failedCalls||0,b=m.activeCalls||0,w=m.totalCalls||f+h+b,g=a=>w>0?a/w*100:0,Z=g(f)*3.6,ss=Z+g(b)*3.6,us=ss+g(h)*3.6,D=Number(_.averageLatency||0),N=D===0?"neutral":D<=1800?"good":D<=3e3?"watch":"slow",ps={neutral:"Response health will appear after measured calls.",good:"Response times are in a healthy conversational range.",watch:"Response time is usable, with room to improve.",slow:"Response time needs attention for natural conversations."}[N],I=d[0]?.id||d[0]?._id||"",O=d.length>0,as=T.length>0,es=O?as?3:2:1,vs=[{step:1,title:"Create your assistant",description:"Set its voice, instructions and first message.",to:"/assistants",done:O,action:O?"Manage assistants":"Create assistant"},{step:2,title:"Make a test call",description:"Choose a number and hear the assistant in a real call.",to:I?`/make-call?assistantId=${encodeURIComponent(I)}`:"/make-call",done:as,action:"Make a call"},{step:3,title:"Review the result",description:"Open the transcript, tools, outcome and recording.",to:"/call-logs",done:!1,action:"Open call logs"}];return s.jsx("div",{className:"dashboard",children:s.jsxs("div",{className:"container",children:[s.jsxs("header",{className:"dash-header",children:[s.jsxs("div",{className:"dash-header-left",children:[s.jsxs("span",{className:"dash-eyebrow",children:[s.jsx(ts,{size:13})," Workspace overview"]}),s.jsx(Ms,{}),s.jsx("p",{children:"See what is working, where calls need attention, and what to do next."})]}),s.jsxs("div",{className:"dash-header-right",children:[s.jsxs("div",{className:"dash-filter",children:[s.jsx("label",{htmlFor:"dashboard-assistant",children:"Assistant"}),s.jsxs("select",{id:"dashboard-assistant",value:A,onChange:a=>ds(a.target.value),className:"dash-filter-select",children:[s.jsx("option",{value:"",children:"All assistants"}),d.map(a=>s.jsx("option",{value:a._id||a.id,children:a.name},a._id||a.id))]})]}),s.jsxs("div",{className:"dash-filter",children:[s.jsx("label",{htmlFor:"dashboard-period",children:"Time range"}),s.jsxs("select",{id:"dashboard-period",value:p,onChange:a=>$(a.target.value),className:"dash-filter-select",children:[s.jsx("option",{value:"24h",children:"Last 24 hours"}),s.jsx("option",{value:"7d",children:"Last 7 days"}),s.jsx("option",{value:"30d",children:"Last 30 days"}),s.jsx("option",{value:"90d",children:"Last 90 days"}),s.jsx("option",{value:"all",children:"All time"})]})]}),s.jsx("button",{type:"button",onClick:()=>E(),className:"dash-btn-icon",disabled:z,title:"Refresh dashboard","aria-label":z?"Refreshing dashboard":"Refresh dashboard",children:s.jsx(ls,{className:z?"loading-spinner":"",size:17})}),s.jsxs(j,{to:"/make-call",className:"dash-btn-primary",children:[s.jsx(R,{size:16})," Make a call"]}),s.jsxs(j,{to:"/call-logs",className:"dash-btn-secondary",children:[s.jsx(cs,{size:16})," View call logs"]})]})]}),B&&s.jsxs("div",{className:"dash-error",role:"alert",children:[s.jsx("span",{children:B}),s.jsx("button",{type:"button",onClick:()=>E(),children:"Try again"})]}),V.checked&&V.show&&s.jsxs("section",{className:"dash-credit-prompt",role:"dialog","aria-label":"Add credits to start calling",children:[s.jsx("button",{type:"button",className:"dash-credit-close",onClick:js,"aria-label":"Dismiss credit reminder",children:s.jsx(gs,{size:16})}),s.jsx("div",{className:"dash-credit-icon",children:s.jsx(Ss,{size:21})}),s.jsxs("div",{className:"dash-credit-copy",children:[s.jsx("span",{className:"dash-card-kicker",children:"Ready when you are"}),s.jsx("h2",{children:"Add credits to start calling"}),s.jsx("p",{children:"Your account has no calling credits. Choose a USD credit package when you are ready to place calls."})]}),s.jsxs("div",{className:"dash-credit-actions",children:[s.jsx("button",{type:"button",className:"dash-btn-primary",onClick:()=>i("/billing"),children:"View credit packages"}),s.jsx("button",{type:"button",className:"dash-credit-secondary",onClick:()=>i("/contact"),children:"Talk to us"})]})]}),s.jsxs("section",{className:"dash-journey","aria-labelledby":"journey-title","data-tour":"dashboard-journey",children:[s.jsxs("div",{className:"dash-journey-head",children:[s.jsxs("div",{children:[s.jsx("span",{className:"dash-card-kicker",children:"Simple path to your first result"}),s.jsx("h2",{id:"journey-title",children:"What to do next"})]}),s.jsxs("span",{className:"dash-journey-progress",children:["Step ",es," of 3"]})]}
1),s.jsx("div",{className:"dash-journey-grid",children:vs.map(a=>{const e=a.step===es;return s.jsxs(j,{to:a.to,className:`dash-journey-step ${a.done?"is-done":""} ${e?"is-active":""}`,"aria-current":e?"step":void 0,children:[s.jsx("span",{className:"dash-journey-number",children:a.done?s.jsx(H,{size:17}):a.step}),s.jsxs("span",{className:"dash-journey-copy",children:[s.jsx("strong",{children:a.title}),s.jsx("small",{children:a.description})]}),s.jsxs("span",{className:"dash-journey-action",children:[e?a.action:"Open"," ",s.jsx(S,{size:14})]})]},a.step)})})]}),z&&!n?s.jsxs("div",{className:"dash-loading",role:"status",children:[s.jsx(ls,{className:"loading-spinner",size:24}),s.jsx("p",{children:"Preparing your overview..."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("section",{className:"dash-stats","aria-label":"Business summary","data-tour":"dashboard-stats",children:[s.jsxs("article",{className:"dash-stat",children:[s.jsx("div",{className:"dash-stat-icon",children:s.jsx(R,{size:19})}),s.jsxs("div",{className:"dash-stat-body",children:[s.jsx("span",{className:"dash-stat-label",children:"Calls"}),s.jsx("strong",{className:"dash-stat-num",children:(m.totalCalls||0).toLocaleString()}),s.jsxs("span",{className:"dash-stat-note",children:["Across ",X]})]})]}),s.jsxs("article",{className:"dash-stat",children:[s.jsx("div",{className:"dash-stat-icon",children:s.jsx(H,{size:19})}),s.jsxs("div",{className:"dash-stat-body",children:[s.jsx("span",{className:"dash-stat-label",children:"Successful outcomes"}),s.jsxs("strong",{className:"dash-stat-num",children:[(m.successRate||0).toFixed(1),"%"]}),s.jsx("span",{className:"dash-stat-note",children:"Completed call rate"})]})]}),s.jsxs("article",{className:"dash-stat",children:[s.jsx("div",{className:"dash-stat-icon",children:s.jsx(ws,{size:19})}),s.jsxs("div",{className:"dash-stat-body",children:[s.jsx("span",{className:"dash-stat-label",children:"Minutes used"}),s.jsx("strong",{className:"dash-stat-num",children:(m.totalMinutes??Math.ceil((m.totalDuration||0)/60)).toLocaleString()}),s.jsx("span",{className:"dash-stat-note",children:"Conversation time"})]})]}),s.jsxs("article",{className:"dash-stat",children:[s.jsx("div",{className:"dash-stat-icon",children:s.jsx(ns,{size:19})}),s.jsxs("div",{className:"dash-stat-body",children:[s.jsx("span",{className:"dash-stat-label",children:"Assistants"}),s.jsx("strong",{className:"dash-stat-num",children:d.length}),s.jsx("span",{className:"dash-stat-note",children:"In your workspace"})]})]})]}),s.jsxs("section",{className:"dash-section dash-performance-section",children:[s.jsx("div",{className:"dash-section-head",children:s.jsxs("div",{children:[s.jsx("span",{className:"dash-card-kicker",children:"Call performance"}),s.jsx("h2",{children:"How your calls are moving"}),s.jsxs("p",{children:["A clear view of volume and outcomes across ",X,"."]})]})}),s.jsxs("div",{className:"dash-performance-layout",children:[s.jsxs("article",{className:"dash-insight-card dash-volume-card",children:[s.jsxs("div",{className:"dash-insight-head",children:[s.jsxs("div",{children:[s.jsx("span",{children:"Call activity"}),s.jsx("h3",{children:"Calls over time"})]}),s.jsx("div",{className:"dash-insight-icon",children:s.jsx(is,{size:18})})]}),U.length===0?s.jsxs("div",{className:"dash-empty dash-chart-empty",children:[s.jsx(is,{size:25}),s.jsx("p",{children:"Your call activity will appear here after the first call."})]}):s.jsx("div",{className:"dcv-chart","aria-label":"Daily call volume chart",children:s.jsx("div",{className:"dcv-bars",children:U.map((a,e)=>{const t=Q>0?Math.max(a.calls/Q*100,a.calls>0?8:0):0,l=new Date(a.date).toLocaleDateString("en-US",{month:"short",day:"numeric"});return s.jsxs("div",{className:"dcv-col",title:`${a.calls} call${a.calls===1?"":"s"} on ${l}`,children:[s.jsxs("div",{className:"dcv-bar-track",children:[s.jsx("div",{className:"dcv-bar-value",children:a.calls}),s.jsx("div",{className:"dcv-bar",style:{height:`${t}%`},children:s.jsx("span",{className:"dcv-bar-cap"})})]}),s.jsx("span",{className:"dcv-bar-label",children:l})]},e)})})})]}),s.jsxs("article",{className:"dash-insight-card dash-outcomes-card",children:[s.jsxs("div",{className:"dash-insight-head",children:[s.jsxs("div",{children:[s.jsx("span",{children:"Call outcomes"}),s.jsx("h3",{children:"Where calls landed"})]}),s.jsx("div",{className:"dash-insight-icon",children:s.jsx(fs,{size:18})})]}),s.jsxs("div",{className:"dash-outcome-overview",children:[s.jsx("div",{className:`dash-outcome-ring ${w===0?"empty":""}`,style:{"--completed-angle":`${Z}deg`,"--active-angle":`${ss}deg`,"--failed-angle":`${us}deg`},role:"img","aria-label":`${f} completed, ${b} in progress, ${h} need attention`,children:s.jsxs("div",{children:[s.jsx("strong",{children:w.toLocaleStr
1ing()}),s.jsx("span",{children:"Total calls"})]})}),s.jsxs("div",{className:"dash-outcome-list",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[s.jsx("i",{className:"completed"}),"Completed"]}),s.jsxs("strong",{children:[f.toLocaleString()," ",s.jsxs("small",{children:[g(f).toFixed(0),"%"]})]})]}),s.jsxs("div",{children:[s.jsxs("span",{children:[s.jsx("i",{className:"active"}),"In progress"]}),s.jsxs("strong",{children:[b.toLocaleString()," ",s.jsxs("small",{children:[g(b).toFixed(0),"%"]})]})]}),s.jsxs("div",{children:[s.jsxs("span",{children:[s.jsx("i",{className:"failed"}),"Needs attention"]}),s.jsxs("strong",{children:[h.toLocaleString()," ",s.jsxs("small",{children:[g(h).toFixed(0),"%"]})]})]})]})]}),s.jsxs("p",{className:`dash-outcome-note ${h>0?"attention":"good"}`,children:[s.jsx(H,{size:14}),w>0?h>0?`${h} call${h===1?"":"s"} may need your attention.`:"All tracked calls completed without a reported failure.":"Outcome insights will appear after your first call."]})]})]})]}),s.jsxs("div",{className:"dash-lower-grid",children:[s.jsxs("section",{className:"dash-card dash-recent-card","data-tour":"dashboard-recent-calls",children:[s.jsxs("div",{className:"dash-card-head",children:[s.jsxs("div",{children:[s.jsx("span",{className:"dash-card-kicker",children:"Recent activity"}),s.jsx("h2",{children:"Latest calls"})]}),s.jsxs(j,{to:"/call-logs",className:"dash-link",children:["See all calls ",s.jsx(S,{size:14})]})]}),T.length===0?s.jsxs("div",{className:"dash-empty",children:[s.jsx("div",{className:"dash-empty-icon",children:s.jsx(R,{size:22})}),s.jsx("h3",{children:"Your first call will appear here"}),s.jsx("p",{children:"Start a call to see its outcome, duration, and time in this overview."}),s.jsxs(j,{to:"/make-call",className:"dash-btn-primary small",children:[s.jsx(R,{size:14})," Start a call"]})]}):s.jsxs("div",{className:"dash-table",children:[s.jsxs("div",{className:"dash-table-head",children:[s.jsx("span",{children:"Assistant"}),s.jsx("span",{children:"Duration"}),s.jsx("span",{children:"Outcome"}),s.jsx("span",{children:"When"})]}),T.slice(0,6).map((a,e)=>{const t=d.find(x=>(x._id||x.id)===a.assistantId),l=a.assistantName||t?.name||"Deleted assistant",c=a.status?`${a.status.charAt(0).toUpperCase()}${a.status.slice(1)}`:"Unknown";return s.jsxs("div",{className:"dash-table-row",children:[s.jsx("span",{className:"dash-cell-name","data-label":"Assistant",children:l}),s.jsx("span",{className:"dash-cell-mono","data-label":"Duration",children:os(a.duration||0)}),s.jsx("span",{"data-label":"Outcome",children:s.jsx("span",{className:`dash-badge ${a.status||"unknown"}`,style:{color:xs(a.status)},children:c})}),s.jsx("span",{className:"dash-cell-muted","data-label":"When",children:hs(a.startTime)})]},a._id||a.callId||`call-${e}`)})]})]}),s.jsxs("aside",{className:"dash-side-rail",children:[s.jsxs("section",{className:"dash-card dash-health-section dash-health-compact",children:[s.jsxs("div",{className:"dash-card-head",children:[s.jsxs("div",{children:[s.jsx("span",{className:"dash-card-kicker",children:"Voice response health"}),s.jsx("h2",{children:"Conversation speed"})]}),s.jsx("span",{className:`dash-health-state ${N}`,children:N==="good"?"Healthy":N==="watch"?"Watch":N==="slow"?"Slow":"No data"})]}),s.jsxs("div",{className:"dash-health-summary",children:[s.jsx("strong",{children:M(D)}),s.jsx("span",{children:"Average response time"})]}),s.jsxs("div",{className:"dash-health-stages","aria-label":"Voice pipeline latency",children:[s.jsxs("div",{children:[s.jsx("span",{children:"Listen"}),s.jsx("strong",{children:M(_.averageSttLatency)})]}),s.jsxs("div",{children:[s.jsx("span",{children:"Think"}),s.jsx("strong",{children:M(_.averageLlmLatency)})]}),s.jsxs("div",{children:[s.jsx("span",{children:"Speak"}),s.jsx("strong",{children:M(_.averageTtsLatency)})]})]}),s.jsxs("p",{className:`dash-health-note ${N}`,children:[s.jsx(ts,{size:14}),ps]})]}),s.jsxs("section",{className:"dash-card dash-next-card",children:[s.jsx("div",{className:"dash-card-head",children:s.jsxs("div",{children:[s.jsx("span",{className:"dash-card-kicker",children:"Qu
1ick actions"}),s.jsx("h2",{children:"Keep work moving"})]})}),s.jsxs("nav",{className:"dash-actions","aria-label":"Dashboard shortcuts",children:[s.jsxs(j,{to:"/assistants",className:"dash-action",children:[s.jsx("div",{className:"dash-action-icon",children:s.jsx(ns,{size:17})}),s.jsxs("div",{children:[s.jsx("h3",{children:"1. Build your assistant"}),s.jsx("p",{children:"Set the voice and conversation instructions."})]}),s.jsx(S,{size:15,className:"dash-action-arrow"})]}),s.jsxs(j,{to:I?`/make-call?assistantId=${encodeURIComponent(I)}`:"/make-call",className:"dash-action",children:[s.jsx("div",{className:"dash-action-icon",children:s.jsx(As,{size:17})}),s.jsxs("div",{children:[s.jsx("h3",{children:"2. Make a test call"}),s.jsx("p",{children:"Test the assistant on a real phone call."})]}),s.jsx(S,{size:15,className:"dash-action-arrow"})]}),s.jsxs(j,{to:"/call-logs",className:"dash-action",children:[s.jsx("div",{className:"dash-action-icon",children:s.jsx(cs,{size:17})}),s.jsxs("div",{children:[s.jsx("h3",{children:"3. Review the result"}),s.jsx("p",{children:"See the transcript, tools and recording."})]}),s.jsx(S,{size:15,className:"dash-action-arrow"})]})]})]})]})]}),q.length>0&&s.jsxs("section",{className:"dash-section dash-assistant-section",children:[s.jsx("div",{className:"dash-section-head",children:s.jsxs("div",{children:[s.jsx("span",{className:"dash-card-kicker",children:"Assistant results"}),s.jsx("h2",{children:"Performance by assistant"}),s.jsx("p",{children:"Compare call volume, successful outcomes, and conversation time."})]})}),s.jsxs("div",{className:"dash-assistant-table",children:[s.jsxs("div",{className:"dash-assistant-table-head",children:[s.jsx("span",{children:"Assistant"}),s.jsx("span",{children:"Calls"}),s.jsx("span",{children:"Successful outcomes"}),s.jsx("span",{children:"Conversation time"})]}),q.map(a=>{const e=d.find(c=>(c._id||c.id)===a.assistantId),t=a.calls>0?a.completed/a.calls*100:0,l=a.assistantName||e?.name||"Deleted assistant";return s.jsxs("div",{className:"dash-assistant-row",children:[s.jsx("strong",{"data-label":"Assistant",children:l}),s.jsx("span",{"data-label":"Calls",children:a.calls}),s.jsxs("span",{className:"dash-success-rate","data-label":"Successful outcomes",children:[t.toFixed(1),"%"]}),s.jsx("span",{"data-label":"Conversation time",children:ms(a.duration)})]},a.assistantId)})]})]})]})]})})}export{Os 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.