1import{r as b,c as w,d as y,j as e,L as v,ar as T,as as S,at as k,au as M,av as o,e as t,i as l,F as L,f as i,h as n,g as m,T as C,O as B,Q as u,U as d,V as F,W as x,B as p}from"./index-DQ05VIVn.js";import{d as H}from"./dispo-telemetry.functions-B8pR6V3J.js";import{A as W}from"./arrow-left-BvdcUGag.js";import{T as q}from"./timer-DC6B466x.js";function c(s){return s==null?"â":s<1e3?`${s} ms`:`${(s/1e3).toFixed(s<1e4?2:1)} s`}function f(s){return s==null?"secondary":s<=1200?"default":s<=3e3?"secondary":"destructive"}function g({rows:s,firstHeader:h}){return s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No saves recorded in this window yet."}):e.jsxs(C,{children:[e.jsx(B,{children:e.jsxs(u,{children:[e.jsx(d,{children:h}),e.jsx(d,{className:"text-right",children:"Saves"}),e.jsx(d,{className:"text-right",children:"Median"}),e.jsx(d,{className:"text-right",children:"Slowest 5%"}),e.jsx(d,{className:"text-right",children:"Worst"}),e.jsx(d,{className:"text-right",children:"Failed"})]})}),e.jsx(F,{children:s.map(a=>e.jsxs(u,{children:[e.jsx(x,{className:"font-medium",children:a.label}),e.jsx(x,{className:"text-right",children:a.samples}),e.jsx(x,{className:"text-right",children:e.jsx(p,{variant:f(a.medianMs),children:c(a.medianMs)})}),e.jsx(x,{className:"text-right",children:c(a.p95Ms)}),e.jsx(x,{className:"text-right",children:e.jsx(p,{variant:f(a.worstMs),children:c(a.worstMs)})}),e.jsx(x,{className:"text-right",children:a.failures})]},a.key))})]})}function E(){const[s,h]=b.useState("14"),a=w(H),{data:r,isLoading:N,error:j}=y({queryKey:["dispo-latency",s],queryFn:()=>a({data:{days:Number(s)}})});return e.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs(v,{to:"/admin",className:"mb-2 inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(W,{className:"h-3.5 w-3.5"})," Admin"]}),e.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-semibold",children:[e.jsx(q,{className:"h-5 w-5"})," Disposition save speed"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"How long a rep waits after clicking an outcome â typical (median) and worst case, split by workspace and browser."})]}),e.jsxs(T,{value:s,onValueChange:h,children:[e.jsx(S,{className:"w-40",children:e.jsx(k,{})}),e.jsxs(M,{children:[e.jsx(o,{value:"1",children:"Last 24 hours"}),e.jsx(o,{value:"7",children:"Last 7 days"}),e.jsx(o,{value:"14",children:"Last 14 days"}),e.jsx(o,{value:"30",children:"Last 30 days"})]})]})]}),j&&e.jsx(t,{children:e.jsx(l,{className:"p-4 text-sm text-destructive",children:j.message})}),N&&e.jsx(L,{className:"h-40 w-full"}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-4",children:[e.jsxs(t,{children:[e.jsx(i,{className:"pb-2",children:e.jsx(n,{children:"Typical wait"})}),e.jsx(l,{className:"text-2xl font-semibold",children:c(r.overall.medianMs)})]}),e.jsxs(t,{children:[e.jsx(i,{className:"pb-2",children:e.jsx(n,{children:"Worst wait"})}),e.jsx(l,{className:"text-2xl font-semibold",children:c(r.overall.worstMs)})]}),e.jsxs(t,{children:[e.jsx(i,{className:"pb-2",children:e.jsx(n,{children:"Saves measured"})}),e.jsx(l,{className:"text-2xl font-semibold",children:r.total})]}),e.jsxs(t,{children:[e.jsx(i,{className:"pb-2",children:e.jsx(n,{children:"Recordings left queued"})}),e.jsxs(l,{className:"text-2xl font-semibold",children:[Math.round(r.uploadTail.queuedShare*100),"%"]})]})]}),e.jsxs(t,{children:[e.jsxs(i,{children:[e.jsx(m,{className:"text-base",children:"By workspace"}),e.jsx(n,{children:"Slowest workspaces first."})]}),e.jsx(l,{children:e.jsx(g,{rows:r.byWorkspace,firstHeader:"Workspace"})})]}),e.jsxs(t,{children:[e.jsxs(i,{children:[e.jsx(m,{className:"text-base",children:"By browser"}),e.jsx(n,{children:"Same numbers, grouped by the browser the rep was using."})]}),e.jsx(l,{children:e.jsx(g,{rows:r.byBrowser,firstHeader:"Browser"})})]}),e.jsxs(t,{children:[e.jsxs(i,{children:[e.jsx(m,{className:"text-base",children:"Recording upload tail"}),e.jsx(n,{children:"This never blocks the rep â it runs in the background â but a long tail means bad connections."})]}),e.jsxs(l,{className:"text-sm text-muted-foreground",children:["Typical upload ",c(r.uploadTail.medianMs)," · worst ",c(r.uploadTail.worstMs)]})]})]})]})}export{E as component};
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.