chordia-ui 3.9.1 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PerformancePanel.cjs.js +1 -1
- package/dist/PerformancePanel.cjs.js.map +1 -1
- package/dist/PerformancePanel.es.js +959 -767
- package/dist/PerformancePanel.es.js.map +1 -1
- package/dist/SupervisorSelect.cjs.js +2 -0
- package/dist/SupervisorSelect.cjs.js.map +1 -0
- package/dist/SupervisorSelect.es.js +352 -0
- package/dist/SupervisorSelect.es.js.map +1 -0
- package/dist/components/Signals.cjs.js +1 -1
- package/dist/components/Signals.cjs.js.map +1 -1
- package/dist/components/Signals.es.js +273 -318
- package/dist/components/Signals.es.js.map +1 -1
- package/dist/components/performance.cjs.js +1 -1
- package/dist/components/performance.cjs.js.map +1 -1
- package/dist/components/performance.es.js +116 -349
- package/dist/components/performance.es.js.map +1 -1
- package/dist/components/reports.cjs.js +2 -2
- package/dist/components/reports.cjs.js.map +1 -1
- package/dist/components/reports.es.js +122 -141
- package/dist/components/reports.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +1 -1
- package/src/components/Signals/SignalDetailsPage.jsx +2 -29
- package/src/components/Signals/SignalsListPage.jsx +2 -24
- package/src/components/performance/PerformanceDetailsPage.jsx +168 -72
- package/src/components/performance/PerformancePanel.jsx +42 -45
- package/src/components/performance/index.js +27 -0
- package/src/components/performance/performanceApiMap.js +133 -0
- package/src/components/performance/performanceMetrics.js +63 -0
- package/src/components/performance/performanceRangeFormat.js +92 -0
- package/src/components/performance/performanceSparkline.js +52 -0
- package/src/components/reports/ReportsList.jsx +2 -25
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),k=require("react"),Ye=require("react-dom"),u=require("lucide-react"),Pe=require("./DataTable2.cjs.js"),n={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",neutralBorder:"var(--neutral-250)",neutral800:"var(--neutral-800)",neutral600:"var(--neutral-600)",neutral450:"var(--neutral-450)",neutral400:"var(--neutral-400)",neutral300:"var(--neutral-300)",neutral150:"var(--neutral-150)",neutral100:"var(--neutral-100)",beige:"var(--surface-warm-40)",shadowCard:"var(--shadow-card)",railCompliance:"var(--rail-compliance)",accentYellow:"var(--accent-yellow)"},Z="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",C="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function Ce(t){if(!t)return"";const l={month:"2-digit",day:"2-digit",year:"numeric"};if(t instanceof Date)return Number.isNaN(t.getTime())?"":t.toLocaleDateString("en-US",l);const r=String(t).trim(),s=r.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);if(s)return new Date(Number(s[1]),Number(s[2])-1,Number(s[3])).toLocaleDateString("en-US",l);const o=new Date(r);return Number.isNaN(o.getTime())?r:o.toLocaleDateString("en-US",l)}const Xe="M1.00049 13.5213C7.85975 11.7032 8.88149 4.73912 13.7838 4.73912C19.8344 4.73912 23.6237 17.166 29.1281 17.166C34.5998 17.166 37.4149 4.88121 43.4004 8.61051C47.9764 11.4616 50.6186 1.00024 50.6186 1.00024",Ge="M1.00049 16.692C8.88149 15.6975 8.88149 7.79403 13.7838 7.79403C19.8344 7.79403 23.6237 21.4034 29.1281 21.4034C34.5998 21.4034 37.4149 8.93821 43.4004 12.7223C47.9764 15.6152 50.6186 5.00024 50.6186 5.00024V36.0002C50.6186 36.0002 10.8223 36.0002 1.00049 36.0002C1.00049 28.8653 1.00049 19.4871 1.00049 16.692Z";function Ve(t,l=52,r=36){if(!Array.isArray(t))return null;const s=t.map(w=>Number(w)).filter(w=>Number.isFinite(w));if(s.length<2)return null;const o=Math.min(...s),a=Math.max(...s),d=4,c=a-o||1,D=r-d*2-4,f=w=>(s.length===1?0:w/(s.length-1)*(l-2))+1,g=w=>d+(1-(w-o)/c)*D;let m="";for(let w=0;w<s.length;w++)m+=`${w===0?"M":"L"}${f(w).toFixed(2)},${g(s[w]).toFixed(2)}`;const j=f(s.length-1),z=f(0),R=`${m} L${j.toFixed(2)},${r} L${z.toFixed(2)},${r} Z`;return{line:m,area:R}}function Ke({trend:t="up",points:l,width:r=49.618,height:s=35}){const o=k.useId(),a=Ve(l),d=a?a.line:Xe,c=a?a.area:Ge;return e.jsxs("svg",{width:r,height:s,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:!a&&t==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${o}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:n.ink}),e.jsx("stop",{offset:"1",stopColor:n.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:c,fill:`url(#spark-${o})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d,stroke:n.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:!a&&t==="down"?"2 4":void 0})]})}function me({value:t,label:l,sub:r,trend:s="up",points:o}){return e.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:16,minWidth:0},children:[e.jsx(Ke,{trend:s,points:o}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[e.jsx("div",{style:{fontFamily:Z,fontSize:28,fontWeight:400,lineHeight:"1.2",color:n.muted,letterSpacing:"-0.01em",whiteSpace:"nowrap"},children:t}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("span",{style:{fontFamily:C,fontSize:13,color:n.ink,lineHeight:"1.2"},children:l}),e.jsx("span",{style:{fontFamily:C,fontSize:13,color:n.neutral600,lineHeight:"1.2"},children:r})]})]})]})}function qe({label:t,active:l=!1,onClick:r}){return e.jsx("button",{type:"button",onClick:r,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:l?"none":`1px solid ${n.borderSubtle}`,background:l?n.black:n.white,color:l?n.white:n.black,fontFamily:C,fontSize:14,cursor:"pointer"},children:t})}function oe({yLabels:t,xLabels:l=[],points:r,highlightIndex:s}){const[o,a]=k.useState(null),d=460,c=110,D=Array.isArray(r)&&r.length>0,f=k.useId(),g=6,m=Array.isArray(l)?l:[],j=m.length<=g?m:Array.from({length:g},(p,y)=>m[Math.round(y*(m.length-1)/(g-1))]),z=Math.max(2,j.length||g),R=Array.from({length:z},(p,y)=>y/(z-1)*d);if(!D)return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{width:24,flexShrink:0}}),e.jsx("div",{style:{flex:1,position:"relative",minWidth:0},children:e.jsx("svg",{width:"100%",height:c+14,viewBox:`0 0 ${d} ${c+14}`,preserveAspectRatio:"none",children:R.map((p,y)=>e.jsx("line",{x1:p,y1:"0",x2:p,y2:c,stroke:n.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${y}`))})})]});const w=Array.isArray(r[0])?r:r.map((p,y)=>[y,p]),V=w.map(([,p])=>p),T=Math.min(...V),O=Math.max(...V),E=O===T?Math.max(Math.abs(O)*.1,1):(O-T)*.1,U=T-E,N=O+E,K=N-U||1,h=p=>(N-p)/K*c,b=w.map(([p,y])=>[p,h(y)]),$=t&&t.length?t:Array.from({length:5},(p,y)=>{const W=N-y/4*(N-U),P=Math.abs(W),I=P>=100?0:P>=10?1:2;return W.toFixed(I)}),H=b[0][0],_=b[b.length-1][0]-H||1,Q=8,te=Math.max(1,d-Q*2),X=p=>Q+(p-H)/_*te,ie=p=>{const y=Number(p);if(!Number.isFinite(y))return String(p??"");const W=Math.abs(y),P=W>=100?0:W>=10?1:2;return y.toFixed(P)},q=b.map(([p,y],W)=>`${W===0?"M":"L"}${X(p)},${y}`).join(" "),B=`${q} L${X(b[b.length-1][0])},${c} L${X(b[0][0])},${c} Z`,ne=s??b.length-1;return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"14px 0",fontFamily:C,fontSize:10,color:n.neutral800,flexShrink:0},children:$.map(p=>e.jsx("span",{children:p},p))}),e.jsxs("div",{style:{flex:1,position:"relative",minWidth:0},children:[o&&e.jsxs("div",{style:{position:"absolute",left:`${o.xPct}%`,top:`${o.yPct}%`,transform:"translate(-50%, calc(-100% - 10px))",pointerEvents:"none",zIndex:2,background:n.black,color:n.white,borderRadius:6,minWidth:60,padding:"8px 10px",boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontFamily:C,fontSize:11,lineHeight:1.25,whiteSpace:"nowrap",textAlign:"left"},children:[e.jsx("div",{children:o.label}),e.jsx("div",{style:{fontWeight:600},children:o.value}),e.jsx("div",{style:{position:"absolute",left:"50%",bottom:-5,width:10,height:10,background:n.black,transform:"translateX(-50%) rotate(45deg)",borderRadius:2}})]}),e.jsxs("svg",{width:"100%",height:c+14,viewBox:`0 0 ${d} ${c+14}`,preserveAspectRatio:"none",onMouseLeave:()=>a(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`area-${f}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:n.black,stopOpacity:.08}}),e.jsx("stop",{offset:"100%",style:{stopColor:n.black,stopOpacity:0}})]})}),R.map((p,y)=>e.jsx("line",{x1:p,y1:"0",x2:p,y2:c,stroke:n.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${y}`)),e.jsx("path",{d:B,fill:`url(#area-${f})`}),e.jsx("path",{d:q,stroke:n.black,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),b.map(([p,y],W)=>{const P=W===ne;return e.jsx("circle",{cx:X(p),cy:y,r:P?4:3,fill:P?n.black:n.white,stroke:n.black,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke",onMouseEnter:()=>{var I;a({xPct:X(p)/d*100,yPct:y/(c+28)*100,label:m[W]||`Point ${W+1}`,value:ie((I=w[W])==null?void 0:I[1])})}},W)})]}),e.jsx("div",{style:{display:"flex",justifyContent:"space-between",paddingRight:6,fontFamily:C,fontSize:10,color:n.neutral800,marginTop:8,marginBottom:4,overflow:"hidden"},children:j.map((p,y)=>e.jsx("span",{style:{whiteSpace:"nowrap"},children:p},y))})]})]})}function ae({title:t,value:l,delta:r,children:s}){return e.jsxs("div",{style:{flex:1,background:n.white,border:`1px solid ${n.border}`,borderRadius:8,padding:24,display:"flex",flexDirection:"column",gap:24,minWidth:0,boxShadow:n.shadowCard},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsx("span",{style:{fontFamily:Z,fontWeight:600,fontSize:15,color:n.ink,lineHeight:1.2},children:t}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"flex-end",gap:4,fontFamily:Z,fontWeight:600},children:[e.jsx("span",{style:{fontSize:20,color:n.black,lineHeight:1},children:l}),e.jsx("span",{style:{fontSize:10,color:n.neutral300,lineHeight:1},children:r})]})]}),e.jsx("div",{style:{flex:1},children:s})]})}function be({icon:t,title:l,trailing:r,iconColor:s=n.ink,bordered:o=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:o?12:0,borderBottom:o?`1px solid ${n.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:s}})}),e.jsx("div",{style:{flex:1,fontFamily:Z,fontWeight:600,fontSize:16,color:n.ink,lineHeight:1.2,textTransform:"uppercase",letterSpacing:"0.02em"},children:l}),r&&e.jsx("div",{style:{fontFamily:C,fontSize:14,color:n.ink},children:r})]})}function Ze({text:t,bullet:l,citation:r,date:s,href:o}){const a=t??l??"";return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:C,fontSize:14,color:n.ink,lineHeight:"24px",gap:16},children:[o?e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",style:{color:n.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:n.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:n.ink},children:r}),s?e.jsxs("span",{style:{color:n.muted},children:["(",s,")"]}):null]})]})}function We({title:t,summary:l,calls:r,percent:s,delta:o,bullets:a,defaultExpanded:d=!1}){const[c,D]=k.useState(d),f=s??o??"",g=Array.isArray(a)?a:[];return e.jsxs("div",{style:{borderTop:`1px solid ${n.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>D(m=>!m),"aria-expanded":c,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:C},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontFamily:C,fontWeight:500,fontSize:14,color:n.black,lineHeight:"24px"},children:t}),e.jsx("span",{style:{fontFamily:C,fontSize:14,color:n.muted,lineHeight:"24px"},children:l})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(u.Phone,{size:12,color:n.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:n.ink},children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(u.TrendingUp,{size:12,color:n.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:n.ink},children:f})]})]})]}),e.jsx(u.ChevronDown,{size:20,color:n.ink,strokeWidth:2,style:{flexShrink:0,transform:c?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),c&&g.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:g.map((m,j)=>e.jsx(Ze,{...m},j))})]})}function Le({label:t,value:l}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 8px 12px",borderBottom:`1px solid ${n.border}`,fontFamily:C,fontSize:13,lineHeight:"1.2"},children:[e.jsx("span",{style:{color:n.ink},children:t}),e.jsx("span",{style:{color:n.muted},children:l})]})}function Je({value:t=0,max:l=5}){const r=typeof t=="number"?t:parseFloat(t)||0,s=Math.floor(r),o=r%1>0&&s<l;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:l}).map((a,d)=>d<s?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:n.black,display:"inline-block"}},d):d===s&&o?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:n.black,display:"inline-block"}})},d):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:n.white,border:`1px solid ${n.border}`,display:"inline-block",boxSizing:"border-box"}},d))})}const Qe=[{id:"title",label:"Title",width:220,sortable:!0,filterable:!0},{id:"date",label:"Date",width:170,sortable:!0},{id:"duration",label:"Duration",width:170,sortable:!0},{id:"lift",label:"Lift",width:120,sortable:!0},{id:"compass",label:"Compass Score",width:220,sortable:!0,render:t=>{const l=typeof t=="number"?t:parseFloat(t)||0;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(Je,{value:l})]})}}];function $e({icon:t,title:l}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:n.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:n.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:Z,fontWeight:600,fontSize:16,color:n.ink,lineHeight:1.2},children:l})]})}function Me({agentName:t="",startDate:l="",endDate:r="",totalCalls:s="",onBack:o,className:a="",kpiBaseline:d={value:"",label:"",sub:"",trend:"up"},kpiAgentLift:c={value:"",label:"",sub:"",trend:"down"},kpiScore:D={value:"",label:"",sub:"",trend:"up"},baselineChart:f={value:"",delta:""},agentLiftChart:g={value:"",delta:""},scoreChart:m={value:"",delta:""},csatChart:j={value:"",delta:""},volumeChart:z={value:"",delta:""},guidanceItems:R=[],strengthItems:w=[],callDrivers:V=[],callParadigms:T=[],strengthsTitle:O="",guidanceTitle:E="",callMixTitle:U="",driversTitle:N="",paradigmsTitle:K="",sessionsTitle:h="",baselineChartTitle:b="",agentLiftChartTitle:$="",scoreChartTitle:H="",csatChartTitle:Y="",volumeChartTitle:_="",sessions:Q=[],sessionColumns:te=[],initialPageSize:X=10,selectedWindow:ie="30d",onWindowChange:q,dateRange:B,onDateRangeChange:ne,sessionsTotal:p=null,sessionsPage:y=null,sessionsPageSize:W=null,onSessionsPageChange:P,onSessionsPageSizeChange:I,onExport:A,onSessionClick:ye,onSessionsVisibleColumnsChange:ee}){const xe=!!(B!=null&&B.from&&(B!=null&&B.to)),L=F=>!!(F&&(F.value||F.delta||Array.isArray(F.points)&&F.points.length>0)),le=L(f)||L(g)||L(m),se=L(j)||L(z);return e.jsxs("div",{className:a,style:{background:n.white,fontFamily:C,color:n.ink,width:"100%",minWidth:1192,boxSizing:"border-box",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"23px 32px",minHeight:78,boxSizing:"border-box"},children:[e.jsx("button",{type:"button","aria-label":"Back",onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,background:"transparent",border:"none",cursor:"pointer",color:n.ink,padding:0,flexShrink:0},children:e.jsx(u.ArrowLeft,{size:20,strokeWidth:1.75})}),e.jsx("div",{style:{paddingLeft:16,borderLeft:`1px solid ${n.border}`,flex:1,minWidth:0,alignSelf:"stretch",display:"flex",alignItems:"center"},children:e.jsx("h1",{style:{fontFamily:Z,fontSize:24,fontWeight:400,color:n.ink,margin:0,lineHeight:1,whiteSpace:"nowrap"},children:t})}),e.jsxs("button",{type:"button",onClick:()=>A==null?void 0:A(),disabled:!A,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${n.neutralBorder}`,background:n.white,cursor:A?"pointer":"not-allowed",opacity:A?1:.5,fontFamily:C,fontSize:14,lineHeight:"24px",color:n.neutral800,flexShrink:0},children:[e.jsx(u.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{padding:"0 32px 32px",display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,paddingLeft:49},children:[e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(u.CalendarDays,{size:14,color:n.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:n.ink,lineHeight:1.5},children:Ce(l)}),e.jsx(u.ArrowRight,{size:12,color:n.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:n.ink,lineHeight:1.5},children:Ce(r)})]}),e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(u.Phone,{size:14,color:n.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:n.ink,lineHeight:1.5},children:s})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}].map(F=>e.jsx(qe,{label:F.label,active:!xe&&F.id===ie,onClick:()=>q==null?void 0:q(F.id)},F.id)),e.jsx(ve,{value:B,onChange:ne})]})]}),e.jsxs("div",{style:{background:n.beige,border:`1px solid ${n.border}`,borderRadius:8,padding:16,display:"flex",gap:24,alignItems:"center"},children:[e.jsx(me,{value:d.value,label:d.label,sub:d.sub,trend:d.trend,points:d.points}),e.jsx(u.ArrowRight,{size:20,color:n.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx(me,{value:c.value,label:c.label,sub:c.sub,trend:c.trend,points:c.points}),e.jsx(u.ArrowRight,{size:20,color:n.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx(me,{value:D.value,label:D.label,sub:D.sub,trend:D.trend,points:D.points})]}),le&&e.jsxs("div",{style:{display:"flex",gap:24},children:[L(f)&&e.jsx(ae,{title:b,value:f.value,delta:f.delta,children:e.jsx(oe,{yLabels:f.yLabels,xLabels:f.xLabels,points:f.points})}),L(g)&&e.jsx(ae,{title:$,value:g.value,delta:g.delta,children:e.jsx(oe,{yLabels:g.yLabels,xLabels:g.xLabels,points:g.points})}),L(m)&&e.jsx(ae,{title:H,value:m.value,delta:m.delta,children:e.jsx(oe,{yLabels:m.yLabels,xLabels:m.xLabels,points:m.points})})]}),se&&e.jsxs("div",{style:{display:"flex",gap:24},children:[L(j)&&e.jsx(ae,{title:Y,value:j.value,delta:j.delta,children:e.jsx(oe,{yLabels:j.yLabels,xLabels:j.xLabels,points:j.points})}),L(z)&&e.jsx(ae,{title:_,value:z.value,delta:z.delta,children:e.jsx(oe,{yLabels:z.yLabels,xLabels:z.xLabels,points:z.points})})]}),e.jsxs("div",{style:{display:"flex",gap:24,marginTop:8,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(be,{icon:u.ShieldCheck,title:O,iconColor:n.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:w.map((F,G)=>e.jsx(We,{...F},G))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(be,{icon:u.Lightbulb,title:E,iconColor:n.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:R.map((F,G)=>e.jsx(We,{...F},G))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[e.jsx(be,{icon:u.Phone,title:U,iconColor:n.railCompliance}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx($e,{icon:u.FolderKanban,title:N}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:V.map((F,G)=>e.jsx(Le,{...F},G))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx($e,{icon:u.Layers,title:K}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:T.map((F,G)=>e.jsx(Le,{...F},G))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[h&&e.jsx("span",{style:{fontFamily:Z,fontWeight:600,fontSize:16,color:n.ink,lineHeight:1.2},children:h}),e.jsx(Pe.DataTable2,{data:Q,columns:te,initialPageSize:X,totalCount:p,page:y,pageSize:W,onPageChange:P,onPageSizeChange:I,onRowClick:ye,onVisibleColumnsChange:ee})]})]})]})}const de={value:"",label:"",trend:"up"},i={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",green:"var(--color-green)",red:"var(--color-red-strong)",neutralBorder:"var(--neutral-250)",neutralLight:"var(--neutral-100)",beige:"var(--surface-warm-40)",neutral800:"var(--neutral-800)",textInk:"var(--text-ink)",textFaintGrey:"var(--text-faint-grey)",hoverWarm40:"var(--hover-warm-40)",shadowPopover:"var(--shadow-popover)",shadowDropdown:"var(--shadow-dropdown)",railCompliance:"var(--rail-compliance)"},J="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",S="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function Re({trend:t="up",width:l=49.618,height:r=35}){const s=k.useId(),o="M1.00049 13.5213C7.85975 11.7032 8.88149 4.73912 13.7838 4.73912C19.8344 4.73912 23.6237 17.166 29.1281 17.166C34.5998 17.166 37.4149 4.88121 43.4004 8.61051C47.9764 11.4616 50.6186 1.00024 50.6186 1.00024",a="M1.00049 16.692C8.88149 15.6975 8.88149 7.79403 13.7838 7.79403C19.8344 7.79403 23.6237 21.4034 29.1281 21.4034C34.5998 21.4034 37.4149 8.93821 43.4004 12.7223C47.9764 15.6152 50.6186 5.00024 50.6186 5.00024V36.0002C50.6186 36.0002 10.8223 36.0002 1.00049 36.0002C1.00049 28.8653 1.00049 19.4871 1.00049 16.692Z";return e.jsxs("svg",{width:l,height:r,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:t==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${s}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:i.ink}),e.jsx("stop",{offset:"1",stopColor:i.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:a,fill:`url(#spark-${s})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d:o,stroke:i.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:t==="down"?"2 4":void 0})]})}function Oe({direction:t="up",color:l=i.muted}){const r="M12.4167 0.75H17.4167M17.4167 0.75V5.75M17.4167 0.75L10.3333 7.83333L6.16667 3.66667L0.75 9.08333",s="M12.4167 9.25H17.4167M17.4167 9.25V4.25M17.4167 9.25L10.3333 2.16667L6.16667 6.33333L0.75 0.91667";return e.jsx("svg",{width:18,height:9.5,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?r:s,stroke:l,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ie({value:t,label:l,trend:r="up",muted:s=!1,beigeBg:o=!1,style:a={}}){return e.jsxs("div",{style:{background:o?i.beige:i.white,border:`1px solid ${i.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...a},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(Re,{trend:r}),e.jsx(Oe,{direction:r})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:J,fontSize:28,fontWeight:500,lineHeight:"1.2",color:s?i.muted:i.ink,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:13,color:i.ink,lineHeight:"1.2"},children:l})]})]})}function je({value:t,label:l,trend:r="up",withDivider:s=!1}){return e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,paddingLeft:s?24:0,borderLeft:s?`1px solid ${i.border}`:"none",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(Re,{trend:r}),e.jsx(Oe,{direction:r})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:J,fontSize:28,fontWeight:500,lineHeight:"1.2",color:i.muted,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:13,color:i.ink,lineHeight:"1.2"},children:l})]})]})}function et({icon:t,children:l,trailing:r}){return e.jsxs("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${i.neutralBorder}`,background:i.white,cursor:"pointer",fontFamily:S,fontSize:14,color:i.neutral800,whiteSpace:"nowrap"},children:[t&&e.jsx(t,{size:18,strokeWidth:1.75}),l,r&&e.jsx(r,{size:16,strokeWidth:2})]})}const tt=["January","February","March","April","May","June","July","August","September","October","November","December"],it=["Su","Mo","Tu","We","Th","Fr","Sa"];function pe(t){const l=new Date(t);return l.setHours(0,0,0,0),l}function nt(t,l){const s=new Date(t,l,1).getDay(),o=new Date(t,l,1-s);return Array.from({length:42},(a,d)=>{const c=new Date(o);return c.setDate(o.getDate()+d),c})}function lt({value:t,onApply:l,onClose:r,anchorRef:s}){const o=k.useRef(null),[a,d]=k.useState(t!=null&&t.from?pe(t.from):null),[c,D]=k.useState(t!=null&&t.to?pe(t.to):null),f=a||new Date,[g,m]=k.useState(f.getFullYear()),[j,z]=k.useState(f.getMonth()),[R,w]=k.useState({top:0,left:0});k.useLayoutEffect(()=>{const h=()=>{if(!(s!=null&&s.current))return;const b=s.current.getBoundingClientRect(),$=320;w({top:b.bottom+6,left:Math.max(8,b.right-$)})};return h(),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[s]),k.useEffect(()=>{const h=$=>{var H,Y;(H=o.current)!=null&&H.contains($.target)||(Y=s==null?void 0:s.current)!=null&&Y.contains($.target)||r()},b=$=>{$.key==="Escape"&&r()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",b)}},[r,s]);const V=nt(g,j),T=pe(new Date),O=h=>{const b=pe(h);b>T||(!a||a&&c?(d(b),D(null)):b<a?d(b):D(b))},E=()=>{j===0?(z(11),m(g-1)):z(j-1)},U=()=>{j===11?(z(0),m(g+1)):z(j+1)},N=h=>a&&c&&h>=a&&h<=c,K=h=>a&&h.getTime()===a.getTime()||c&&h.getTime()===c.getTime();return Ye.createPortal(e.jsxs("div",{ref:o,style:{position:"fixed",top:R.top,left:R.left,width:320,background:i.white,border:`1px solid ${i.borderSubtle}`,borderRadius:12,boxShadow:i.shadowPopover,padding:16,zIndex:9999,fontFamily:S},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsx("button",{type:"button",onClick:E,style:Ae,"aria-label":"Previous month",children:e.jsx(u.ChevronLeft,{size:18,strokeWidth:1.75})}),e.jsxs("div",{style:{fontSize:14,fontWeight:600,color:i.ink},children:[tt[j]," ",g]}),e.jsx("button",{type:"button",onClick:U,style:Ae,"aria-label":"Next month",children:e.jsx(u.ChevronRight,{size:18,strokeWidth:1.75})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:it.map(h=>e.jsx("div",{style:{textAlign:"center",fontSize:12,color:i.muted,padding:"4px 0"},children:h},h))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:V.map(h=>{const b=h.getMonth()===j,$=N(h),H=K(h),Y=h.getTime()===T.getTime(),_=h>T;return e.jsx("button",{type:"button",onClick:()=>O(h),disabled:_,"aria-disabled":_,style:{height:36,border:"none",borderRadius:8,background:H?i.black:$?i.hoverWarm40:"transparent",color:H?i.white:_?i.textFaintGrey:b?i.ink:i.muted,fontFamily:S,fontSize:13,fontWeight:Y?500:400,cursor:_?"not-allowed":"pointer",opacity:_?.6:1},children:h.getDate()},h.toISOString())})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:12,paddingTop:12,borderTop:`1px solid ${i.borderSubtle}`},children:[e.jsx("button",{type:"button",onClick:()=>{d(null),D(null)},style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:14,fontWeight:500,color:i.ink},children:"Clear"}),e.jsx("button",{type:"button",disabled:!a||!c,onClick:()=>{l({from:a,to:c}),r()},style:{background:!a||!c?i.neutralBorder:i.black,color:i.white,border:"none",borderRadius:10,height:30,padding:"0 16px",fontFamily:S,fontSize:14,fontWeight:600,cursor:!a||!c?"not-allowed":"pointer"},children:"Apply"})]})]}),document.body)}const Ae={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,border:"none",background:"transparent",borderRadius:6,cursor:"pointer",color:i.ink};function ve({value:t,onChange:l}){const[r,s]=k.useState(!1),o=k.useRef(null),a=!!(t!=null&&t.from&&(t!=null&&t.to));return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:o,type:"button",onClick:()=>s(d=>!d),style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:a?"none":`1px solid ${i.neutralBorder}`,background:a?i.black:i.white,cursor:"pointer",fontFamily:S,fontSize:14,color:a?i.white:i.neutral800,fontWeight:a?600:400,whiteSpace:"nowrap"},children:[e.jsx(u.CalendarDays,{size:18,strokeWidth:1.75}),"Date Range"]}),r&&e.jsx(lt,{value:t,anchorRef:o,onClose:()=>s(!1),onApply:d=>l==null?void 0:l(d)})]})}function st({label:t,active:l=!1,onClick:r}){return e.jsx("button",{type:"button",onClick:r,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:l?"none":`1px solid ${i.borderSubtle}`,background:l?i.black:i.white,color:l?i.white:i.black,fontFamily:S,fontSize:14,cursor:"pointer"},children:t})}const rt=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}],Ne={"8h":8*60*60*1e3,"1d":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3};function ue(t){return t.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"})}function ot(t){const l=Ne[t];if(!l)return"";const r=new Date,s=new Date(r.getTime()-l);return`${ue(s)} – ${ue(r)}`}function at({value:t=0,max:l=5}){const r=typeof t=="number"?t:parseFloat(t)||0,s=Math.floor(r),o=r%1>0&&s<l;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:l}).map((a,d)=>d<s?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:i.black,display:"inline-block"}},d):d===s&&o?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:i.black,display:"inline-block"}})},d):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:i.white,border:`1px solid ${i.border}`,display:"inline-block",boxSizing:"border-box"}},d))})}const dt=[{id:"agent",label:"Agent",width:180,sortable:!0,filterable:!0},{id:"supervisor",label:"Supervisor",width:170,sortable:!0,filterable:!0},{id:"calls",label:"Calls",width:100,sortable:!0},{id:"baseline",label:"Baseline",width:110,sortable:!0},{id:"lift",label:"Lift",width:100,sortable:!0},{id:"score",label:"Score",width:100,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Compass Score",width:200,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(at,{value:typeof t=="number"?t:0})]})},{id:"totalDuration",label:"Total Duration",width:150,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1},{id:"avgDuration",label:"Average Duration",width:170,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1}];function he({icon:t,title:l,trailing:r,iconColor:s=i.ink,bordered:o=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:o?12:0,borderBottom:o?`1px solid ${i.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:s}})}),e.jsx("div",{style:{flex:1,fontFamily:J,fontWeight:600,fontSize:16,color:i.ink,lineHeight:"1.2",textTransform:"uppercase",letterSpacing:"0.02em"},children:l}),r&&e.jsx("div",{style:{fontFamily:S,fontSize:14,color:i.ink},children:r})]})}function Te({icon:t,title:l}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:i.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:i.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:J,fontWeight:600,fontSize:16,color:i.ink,lineHeight:"24px"},children:l})]})}function He({title:t,summary:l,calls:r,percent:s,bullets:o,defaultExpanded:a=!1}){const[d,c]=k.useState(a),D=Array.isArray(o)?o:[];return e.jsxs("div",{style:{borderTop:`1px solid ${i.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>c(f=>!f),"aria-expanded":d,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:S},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("div",{style:{fontFamily:J,fontWeight:600,fontSize:14,color:i.black,lineHeight:"24px"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:14,color:i.muted,lineHeight:"24px"},children:l})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(u.Phone,{size:14,color:i.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:S,fontSize:12,color:i.ink,lineHeight:1.5},children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(u.TrendingUp,{size:14,color:i.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:S,fontSize:12,color:i.ink,lineHeight:1.5},children:s})]})]})]}),e.jsx(u.ChevronDown,{size:20,color:i.ink,strokeWidth:2,style:{flexShrink:0,transform:d?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),d&&D.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:D.map((f,g)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontFamily:S,fontSize:14,color:i.ink,lineHeight:"24px",gap:16},children:[f.href?e.jsx("a",{href:f.href,target:"_blank",rel:"noopener noreferrer",style:{color:i.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:i.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.text}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.text}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:i.ink},children:f.citation}),e.jsxs("span",{style:{color:i.muted},children:["(",f.date,")"]})]})]},g))})]})}function fe({label:t,value:l}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 0",borderBottom:`1px solid ${i.border}`,fontFamily:S,fontSize:13,lineHeight:"24px"},children:[e.jsx("span",{style:{color:i.ink},children:t}),e.jsx("span",{style:{color:i.muted},children:l})]})}function ce({message:t=""}){return t?e.jsx("div",{style:{padding:"16px 0",fontFamily:S,fontSize:13,color:i.muted,lineHeight:1.5},children:t}):null}function ct({className:t="",onAgentClick:l,title:r="",subtitle:s="",dateRangeLabel:o="",viewByOptions:a=[],initialViewBy:d="",onViewByChange:c,aggregatedByLabel:D="",volumeStat:f=de,compassStat:g=de,baselineSubStat:m=de,agentLiftSubStat:j=de,scoreSubStat:z=de,agentRows:R=[],agentColumns:w=[],initialPageSize:V=10,guidanceItems:T=[],strengthItems:O=[],callDrivers:E=[],callParadigms:U=[],topSignalsLeft:N=[],topSignalsRight:K=[],topSignalsTrailing:h="",strengthsTitle:b="",guidanceTitle:$="",callMixTitle:H="",driversTitle:Y="",paradigmsTitle:_="",topSignalsTitle:Q="",emptyStrengthsMessage:te="",emptyGuidanceMessage:X="",emptyDriversMessage:ie="",emptyParadigmsMessage:q="",emptyTopSignalsMessage:B="",rangeOptions:ne=rt,selectedWindow:p="30d",onWindowChange:y,dateRangePicker:W,dateRange:P,onDateRangeChange:I,onExport:A,onVisibleColumnsChange:ye}){var De,ze;const[ee,xe]=k.useState(null),[L,le]=k.useState(!1),[se,F]=k.useState(d),[G,ke]=k.useState(null),M=P!==void 0?P:G,ge=!!(M!=null&&M.from&&(M!=null&&M.to)),_e=x=>{ke(x),I==null||I(x)},Be=x=>{ke(null),I==null||I(null),y==null||y(x)},we=k.useRef(null),Se=k.useRef(null);k.useEffect(()=>{if(!L)return;const x=v=>{var re,Fe;(re=Se.current)!=null&&re.contains(v.target)||(Fe=we.current)!=null&&Fe.contains(v.target)||le(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[L]);const Ee=((De=a.find(x=>x.id===se))==null?void 0:De.label)||(((ze=a[0])==null?void 0:ze.label)??""),Ue=x=>{if(l){l(x);return}xe(x)};return e.jsxs(e.Fragment,{children:[ee&&(()=>{let x=null,v=null;if(ge)x=M.from,v=M.to;else{const re=Ne[p];re&&(v=new Date,x=new Date(v.getTime()-re))}return e.jsx(Me,{className:t,agentName:ee.agent,startDate:x||"",endDate:v||"",totalCalls:`${ee.calls} Calls`,onBack:()=>xe(null),selectedWindow:p,dateRange:M})})(),e.jsxs("div",{className:t,style:{background:i.white,fontFamily:S,color:i.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",flexDirection:"column",gap:24,display:ee?"none":"flex"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,paddingTop:12},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4},children:[e.jsx("h1",{style:{fontFamily:J,fontSize:24,fontWeight:500,color:i.ink,margin:0,lineHeight:"1.2",letterSpacing:"-0.01em"},children:r}),e.jsx("p",{style:{fontFamily:S,fontSize:14,color:"var(--neutral-950)",margin:0,lineHeight:"1.4"},children:s})]}),e.jsxs("button",{type:"button",onClick:()=>A==null?void 0:A(),disabled:!A,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${i.neutralBorder}`,background:i.white,cursor:A?"pointer":"not-allowed",opacity:A?1:.5,fontFamily:S,fontSize:14,color:i.neutral800},children:[e.jsx(u.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{type:"button",ref:we,onClick:()=>le(x=>!x),"aria-haspopup":"listbox","aria-expanded":L,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${i.neutralBorder}`,background:i.white,cursor:"pointer",fontFamily:S,fontSize:14,lineHeight:"24px",color:i.neutral800,whiteSpace:"nowrap"},children:[Ee,e.jsx(u.ChevronDown,{size:20,strokeWidth:1.75,style:{transform:L?"rotate(180deg)":"none",transition:"transform 120ms ease"}})]}),L&&e.jsxs("div",{ref:Se,role:"listbox",style:{position:"absolute",top:36,left:0,zIndex:20,background:i.white,border:`1px solid ${i.border}`,borderRadius:4,boxShadow:i.shadowDropdown,display:"flex",flexDirection:"column",minWidth:144,fontFamily:S},children:[D&&e.jsx("div",{style:{padding:12,fontFamily:J,fontWeight:600,fontSize:13,color:i.ink,lineHeight:1.2},children:D}),a.map(x=>{const v=se===x.id;return e.jsxs("button",{type:"button",role:"option","aria-selected":v,onClick:()=>{x.id!==se&&(F(x.id),c==null||c(x.id)),le(!1)},style:{display:"flex",alignItems:"center",gap:8,padding:v?12:"12px 12px 12px 40px",borderTop:`1px solid ${i.border}`,borderLeft:"none",borderRight:"none",borderBottom:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontFamily:S,fontSize:13,lineHeight:1.2,color:i.ink,width:"100%"},children:[v&&e.jsx(u.Check,{size:20,color:i.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{children:x.label})]},x.id)})]})]}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(()=>{const v=(ge?`${ue(M.from)} – ${ue(M.to)}`:"")||o||ot(p);return v?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:S,fontSize:13,color:i.ink},children:[e.jsx(u.CalendarDays,{size:16,strokeWidth:1.75,color:i.muted}),v]}):null})(),ne.map(x=>e.jsx(st,{label:x.label,active:!ge&&x.id===p,onClick:()=>Be(x.id)},x.id)),W?e.jsx(k.Suspense,{fallback:e.jsx(et,{icon:u.CalendarDays,children:"Date Range"}),children:W}):e.jsx(ve,{value:M,onChange:_e})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx(Ie,{value:f.value,label:f.label,trend:f.trend,style:{width:264,flexShrink:0}}),e.jsx(Ie,{value:g.value,label:g.label,trend:g.trend,style:{width:264,flexShrink:0}}),e.jsxs("div",{style:{flex:1,background:i.beige,border:`1px solid ${i.border}`,borderRadius:8,padding:16,display:"flex",gap:24,alignItems:"stretch",boxSizing:"border-box"},children:[e.jsx(je,{value:m.value,label:m.label,trend:m.trend}),e.jsx(je,{value:j.value,label:j.label,trend:j.trend,withDivider:!0}),e.jsx(je,{value:z.value,label:z.label,trend:z.trend,withDivider:!0})]})]}),e.jsx(Pe.DataTable2,{data:R,columns:w,initialPageSize:V,onRowClick:Ue,onVisibleColumnsChange:ye}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:u.ShieldCheck,title:b,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${i.border}`,maxHeight:480,overflowY:"auto"},children:O.length===0?e.jsx(ce,{message:te}):O.map((x,v)=>e.jsx(He,{...x},v))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:u.Lightbulb,title:$,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${i.border}`,maxHeight:480,overflowY:"auto"},children:T.length===0?e.jsx(ce,{message:X}):T.map((x,v)=>e.jsx(He,{...x},v))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:u.Phone,title:H,iconColor:"var(--rail-compliance)"}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Te,{icon:u.FolderKanban,title:Y}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:E.length===0?e.jsx(ce,{message:ie}):E.map((x,v)=>e.jsx(fe,{...x},v))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Te,{icon:u.Layers,title:_}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:U.length===0?e.jsx(ce,{message:q}):U.map((x,v)=>e.jsx(fe,{...x},v))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:u.Signal,title:Q,iconColor:"var(--rail-compliance)",trailing:h,bordered:!0}),N.length===0&&K.length===0?e.jsx(ce,{message:B}):e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:N.map((x,v)=>e.jsx(fe,{...x},v))}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:K.map((x,v)=>e.jsx(fe,{...x},v))})]})]})]})]})}exports.DEFAULT_AGENT_COLUMNS=dt;exports.DEFAULT_SESSION_COLUMNS=Qe;exports.DateRangeButton=ve;exports.PerformanceDetailsPage=Me;exports.PerformancePanel=ct;
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),w=require("react"),ht=require("react-dom"),h=require("lucide-react"),qe=require("./DataTable2.cjs.js"),ve={"8h":8*60*60*1e3,"1d":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3},Je="en-US",yt={month:"2-digit",day:"2-digit",year:"numeric"},mt={hour:"numeric",minute:"2-digit",hour12:!0};function he(t){if(!t)return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t;const n=String(t).trim(),i=n.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);if(i){const o=new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));return Number.isNaN(o.getTime())?null:o}const r=new Date(n);return Number.isNaN(r.getTime())?null:r}function Ze(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function ee(t){const n=t instanceof Date?t:he(t);return n?n.toLocaleDateString(Je,yt):""}function Ce(t){return t.toLocaleTimeString(Je,mt)}function se(t){return`${ee(t)} ${Ce(t)}`}function Qe(t,n){const i=he(t),r=he(n);return!i||!r?"":Ze(i,r)?`${se(i)} – ${Ce(r)}`:`${se(i)} – ${se(r)}`}function et(t,n){const i=he(t),r=he(n);return!i||!r?null:Ze(i,r)?{from:se(i),to:Ce(r)}:{from:se(i),to:se(r)}}function je(t){const n=ve[t];if(!n)return null;const i=new Date;return{from:new Date(i.getTime()-n),to:i}}function tt(t){if(!ve[t])return"";const i=je(t);return i?t==="8h"?Qe(i.from,i.to):`${ee(i.from)} – ${ee(i.to)}`:""}const nt="M1.00049 13.5213C7.85975 11.7032 8.88149 4.73912 13.7838 4.73912C19.8344 4.73912 23.6237 17.166 29.1281 17.166C34.5998 17.166 37.4149 4.88121 43.4004 8.61051C47.9764 11.4616 50.6186 1.00024 50.6186 1.00024",it="M1.00049 16.692C8.88149 15.6975 8.88149 7.79403 13.7838 7.79403C19.8344 7.79403 23.6237 21.4034 29.1281 21.4034C34.5998 21.4034 37.4149 8.93821 43.4004 12.7223C47.9764 15.6152 50.6186 5.00024 50.6186 5.00024V36.0002C50.6186 36.0002 10.8223 36.0002 1.00049 36.0002C1.00049 28.8653 1.00049 19.4871 1.00049 16.692Z";function ke(t){if(!Array.isArray(t))return null;const n=t.map(i=>Array.isArray(i)?Number(i[1]):i==null||i===""?NaN:Number(i)).filter(i=>Number.isFinite(i));return n.length>=2?n:null}function $e(t,n=52,i=36){const r=ke(t);if(!r)return null;const o=Math.min(...r),a=Math.max(...r),d=4,c=a-o||1,F=i-d*2-4,p=D=>(r.length===1?0:D/(r.length-1)*(n-2))+1,y=D=>d+(1-(D-o)/c)*F;let b="";for(let D=0;D<r.length;D++)b+=`${D===0?"M":"L"}${p(D).toFixed(2)},${y(r[D]).toFixed(2)}`;const v=p(r.length-1),S=p(0),W=`${b} L${v.toFixed(2)},${i} L${S.toFixed(2)},${i} Z`;return{line:b,area:W}}function we(t){const n=ke(t);if(!n)return null;const i=n[0],r=n[n.length-1];return r>i?"up":r<i?"down":"up"}const Ae="—";function Se(t){if(t==null)return!0;const n=String(t).trim();return!!(!n||/^[-−–—]$/.test(n)||/^(n\/a|null|undefined)$/i.test(n))}function ye(t){return!Se(t)}function Ie(t,n=Ae){return Se(t)?n:String(t)}function Oe(t){return t!=null&&String(t).trim()!==""}function U(t){return t?Oe(t.value)||Oe(t.delta)?!0:Array.isArray(t.points)&&t.points.length>0:!1}function lt(t){if(Se(t))return null;const n=String(t).trim(),i=n.match(/\(\s*([+-])?\s*([\d.]+)/);return i?i[1]==="-"?"down":i[1]==="+"?"up":parseFloat(i[2])<0?"down":"up":/^[-−]/.test(n)?"down":/^\+/.test(n)?"up":/-\d/.test(n)?"down":null}function De(t,n){return lt(n)??(t==="down"?"down":"up")}function rt(t,n,i){return we(i)??(ye(n)?De(t,n):t==="down"?"down":"up")}const s={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",neutralBorder:"var(--neutral-250)",neutral800:"var(--neutral-800)",neutral600:"var(--neutral-600)",neutral450:"var(--neutral-450)",neutral400:"var(--neutral-400)",neutral300:"var(--neutral-300)",neutral150:"var(--neutral-150)",neutral100:"var(--neutral-100)",beige:"var(--surface-warm-40)",shadowCard:"var(--shadow-card)",railCompliance:"var(--rail-compliance)",accentYellow:"var(--accent-yellow)"},te="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",z="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function st({direction:t="up",color:n=s.muted}){const i="M12.4167 0.75H17.4167M17.4167 0.75V5.75M17.4167 0.75L10.3333 7.83333L6.16667 3.66667L0.75 9.08333",r="M12.4167 9.25H17.4167M17.4167 9.25V4.25M17.4167 9.25L10.3333 2.16667L6.16667 6.33333L0.75 0.91667";return e.jsx("svg",{width:18,height:9.5,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?i:r,stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _e(t){if(!t)return"";const n={month:"2-digit",day:"2-digit",year:"numeric"};if(t instanceof Date)return Number.isNaN(t.getTime())?"":t.toLocaleDateString("en-US",n);const i=String(t).trim(),r=i.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);if(r)return new Date(Number(r[1]),Number(r[2])-1,Number(r[3])).toLocaleDateString("en-US",n);const o=new Date(i);return Number.isNaN(o.getTime())?i:o.toLocaleDateString("en-US",n)}function gt({trend:t="up",points:n,empty:i=!1,width:r=49.618,height:o=35}){const a=w.useId();if(i)return e.jsx("svg",{width:r,height:o,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:"M2,18 L50,18",stroke:s.ink,strokeWidth:"2",strokeLinecap:"round"})});const d=$e(n),c=d?d.line:nt,F=d?d.area:it;return e.jsxs("svg",{width:r,height:o,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:!d&&t==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${a}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:s.ink}),e.jsx("stop",{offset:"1",stopColor:s.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:F,fill:`url(#spark-${a})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d:c,stroke:s.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:!d&&t==="down"?"2 4":void 0})]})}function bt({value:t,label:n,sub:i,trend:r="up",points:o}){const a=Ie(t),d=ye(t)||ke(o)!=null,c=rt(r,t,o);return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,flexShrink:0,alignItems:"flex-end"},children:[e.jsx(gt,{trend:c,points:o,empty:!d}),d?e.jsx(st,{direction:c}):null]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[e.jsx("div",{style:{fontFamily:te,fontSize:28,fontWeight:400,lineHeight:"1.2",color:s.muted,letterSpacing:"-0.01em",whiteSpace:"nowrap"},children:a}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("span",{style:{fontFamily:z,fontSize:13,color:s.ink,lineHeight:"1.2"},children:n}),e.jsx("span",{style:{fontFamily:z,fontSize:13,color:s.neutral600,lineHeight:"1.2"},children:i})]})]})]})}function jt({label:t,active:n=!1,onClick:i}){return e.jsx("button",{type:"button",onClick:i,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:n?"none":`1px solid ${s.borderSubtle}`,background:n?s.black:s.white,color:n?s.white:s.black,fontFamily:z,fontSize:14,cursor:"pointer"},children:t})}function ue({yLabels:t,xLabels:n=[],points:i,highlightIndex:r}){const[o,a]=w.useState(null),d=460,c=110,F=Array.isArray(i)&&i.length>0,p=w.useId(),y=6,b=Array.isArray(n)?n:[],v=b.length<=y?b:Array.from({length:y},(x,m)=>b[Math.round(m*(b.length-1)/(y-1))]),S=Math.max(2,v.length||y),W=Array.from({length:S},(x,m)=>m/(S-1)*d);if(!F)return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{width:24,flexShrink:0}}),e.jsx("div",{style:{flex:1,position:"relative",minWidth:0},children:e.jsx("svg",{width:"100%",height:c+14,viewBox:`0 0 ${d} ${c+14}`,preserveAspectRatio:"none",children:W.map((x,m)=>e.jsx("line",{x1:x,y1:"0",x2:x,y2:c,stroke:s.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${m}`))})})]});const D=Array.isArray(i[0])?i:i.map((x,m)=>[m,x]),Y=D.map(([,x])=>x),I=Math.min(...Y),E=Math.max(...Y),X=E===I?Math.max(Math.abs(E)*.1,1):(E-I)*.1,G=I-X,O=E+X,J=O-G||1,f=x=>(O-x)/J*c,j=D.map(([x,m])=>[x,f(m)]),C=t&&t.length?t:Array.from({length:5},(x,m)=>{const T=O-m/4*(O-G),P=Math.abs(T),$=P>=100?0:P>=10?1:2;return T.toFixed($)}),M=j[0][0],_=j[j.length-1][0]-M||1,ie=8,oe=Math.max(1,d-ie*2),q=x=>ie+(x-M)/_*oe,Z=x=>{const m=Number(x);if(!Number.isFinite(m))return String(x??"");const T=Math.abs(m),P=T>=100?0:T>=10?1:2;return m.toFixed(P)},Q=j.map(([x,m],T)=>`${T===0?"M":"L"}${q(x)},${m}`).join(" "),B=`${Q} L${q(j[j.length-1][0])},${c} L${q(j[0][0])},${c} Z`,ae=r??j.length-1;return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"14px 0",fontFamily:z,fontSize:10,color:s.neutral800,flexShrink:0},children:C.map(x=>e.jsx("span",{children:x},x))}),e.jsxs("div",{style:{flex:1,position:"relative",minWidth:0},children:[o&&e.jsxs("div",{style:{position:"absolute",left:`${o.xPct}%`,top:`${o.yPct}%`,transform:"translate(-50%, calc(-100% - 10px))",pointerEvents:"none",zIndex:2,background:s.black,color:s.white,borderRadius:6,minWidth:60,padding:"8px 10px",boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontFamily:z,fontSize:11,lineHeight:1.25,whiteSpace:"nowrap",textAlign:"left"},children:[e.jsx("div",{children:o.label}),e.jsx("div",{style:{fontWeight:600},children:o.value}),e.jsx("div",{style:{position:"absolute",left:"50%",bottom:-5,width:10,height:10,background:s.black,transform:"translateX(-50%) rotate(45deg)",borderRadius:2}})]}),e.jsxs("svg",{width:"100%",height:c+14,viewBox:`0 0 ${d} ${c+14}`,preserveAspectRatio:"none",onMouseLeave:()=>a(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`area-${p}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s.black,stopOpacity:.08}}),e.jsx("stop",{offset:"100%",style:{stopColor:s.black,stopOpacity:0}})]})}),W.map((x,m)=>e.jsx("line",{x1:x,y1:"0",x2:x,y2:c,stroke:s.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${m}`)),e.jsx("path",{d:B,fill:`url(#area-${p})`}),e.jsx("path",{d:Q,stroke:s.black,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),j.map(([x,m],T)=>{const P=T===ae;return e.jsx("circle",{cx:q(x),cy:m,r:P?4:3,fill:P?s.black:s.white,stroke:s.black,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke",onMouseEnter:()=>{var $;a({xPct:q(x)/d*100,yPct:m/(c+28)*100,label:b[T]||`Point ${T+1}`,value:Z(($=D[T])==null?void 0:$[1])})}},T)})]}),e.jsx("div",{style:{display:"flex",justifyContent:"space-between",paddingRight:6,fontFamily:z,fontSize:10,color:s.neutral800,marginTop:8,marginBottom:4,overflow:"hidden"},children:v.map((x,m)=>e.jsx("span",{style:{whiteSpace:"nowrap"},children:x},m))})]})]})}function xe({title:t,value:n,delta:i,children:r}){const o=Ie(n),a=ye(i),d=a?De("up",i):"up";return e.jsxs("div",{style:{flex:1,background:s.white,border:`1px solid ${s.border}`,borderRadius:8,padding:24,display:"flex",flexDirection:"column",gap:24,minWidth:0,boxShadow:s.shadowCard},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsx("span",{style:{fontFamily:te,fontWeight:600,fontSize:15,color:s.ink,lineHeight:1.2},children:t}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"flex-end",gap:4,fontFamily:te,fontWeight:600},children:[e.jsx("span",{style:{fontSize:20,color:s.black,lineHeight:1},children:o}),a?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,color:s.neutral300,lineHeight:1},children:[e.jsx(st,{direction:d,color:s.neutral300}),i]}):null]})]}),e.jsx("div",{style:{flex:1},children:r})]})}function Te({icon:t,title:n,trailing:i,iconColor:r=s.ink,bordered:o=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:o?12:0,borderBottom:o?`1px solid ${s.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:r}})}),e.jsx("div",{style:{flex:1,fontFamily:te,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2,textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),i&&e.jsx("div",{style:{fontFamily:z,fontSize:14,color:s.ink},children:i})]})}function vt({text:t,bullet:n,citation:i,date:r,href:o}){const a=t??n??"";return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:z,fontSize:14,color:s.ink,lineHeight:"24px",gap:16},children:[o?e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",style:{color:s.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:s.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:s.ink},children:i}),r?e.jsxs("span",{style:{color:s.muted},children:["(",r,")"]}):null]})]})}function Be({title:t,summary:n,calls:i,percent:r,delta:o,bullets:a,defaultExpanded:d=!1}){const[c,F]=w.useState(d),p=r??o,y=ye(p),b=y?String(p):Ae,S=(y?De("up",b):"up")==="down"?h.TrendingDown:h.TrendingUp,W=Array.isArray(a)?a:[];return e.jsxs("div",{style:{borderTop:`1px solid ${s.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>F(D=>!D),"aria-expanded":c,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:z},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontFamily:z,fontWeight:500,fontSize:14,color:s.black,lineHeight:"24px"},children:t}),e.jsx("span",{style:{fontFamily:z,fontSize:14,color:s.muted,lineHeight:"24px"},children:n})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(h.Phone,{size:12,color:s.ink,strokeWidth:1.75}),e.jsxs("span",{style:{fontFamily:z,fontSize:12,color:s.ink},children:[i," calls"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[y?e.jsx(S,{size:12,color:s.ink,strokeWidth:1.75}):null,e.jsx("span",{style:{fontFamily:z,fontSize:12,color:y?s.ink:s.muted},children:b})]})]})]}),e.jsx(h.ChevronDown,{size:20,color:s.ink,strokeWidth:2,style:{flexShrink:0,transform:c?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),c&&W.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:W.map((D,Y)=>e.jsx(vt,{...D},Y))})]})}function Ue({label:t,value:n}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 8px 12px",borderBottom:`1px solid ${s.border}`,fontFamily:z,fontSize:13,lineHeight:"1.2"},children:[e.jsx("span",{style:{color:s.ink},children:t}),e.jsx("span",{style:{color:s.muted},children:n})]})}function kt({value:t=0,max:n=5}){const i=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(i),o=i%1>0&&r<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((a,d)=>d<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:s.black,display:"inline-block"}},d):d===r&&o?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:s.black,display:"inline-block"}})},d):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:s.white,border:`1px solid ${s.border}`,display:"inline-block",boxSizing:"border-box"}},d))})}const wt=[{id:"title",label:"Title",width:220,sortable:!0,filterable:!0},{id:"date",label:"Date",width:170,sortable:!0},{id:"duration",label:"Duration",width:170,sortable:!0},{id:"lift",label:"Lift",width:120,sortable:!0},{id:"compass",label:"Compass Score",width:220,sortable:!0,render:t=>{const n=typeof t=="number"?t:parseFloat(t)||0;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(kt,{value:n})]})}}];function Ye({icon:t,title:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:s.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:s.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:te,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2},children:n})]})}function ot({agentName:t="",startDate:n="",endDate:i="",totalCalls:r="",onBack:o,className:a="",kpiBaseline:d={value:"",label:"",sub:"",trend:"up"},kpiAgentLift:c={value:"",label:"",sub:"",trend:"down"},kpiScore:F={value:"",label:"",sub:"",trend:"up"},baselineChart:p={value:"",delta:""},agentLiftChart:y={value:"",delta:""},scoreChart:b={value:"",delta:""},csatChart:v={value:"",delta:""},volumeChart:S={value:"",delta:""},guidanceItems:W=[],strengthItems:D=[],callDrivers:Y=[],callParadigms:I=[],strengthsTitle:E="",guidanceTitle:X="",callMixTitle:G="",driversTitle:O="",paradigmsTitle:J="",sessionsTitle:f="",baselineChartTitle:j="",agentLiftChartTitle:C="",scoreChartTitle:M="",csatChartTitle:K="",volumeChartTitle:_="",sessions:ie=[],sessionColumns:oe=[],initialPageSize:q=10,selectedWindow:Z="30d",onWindowChange:Q,dateRange:B,onDateRangeChange:ae,sessionsTotal:x=null,sessionsPage:m=null,sessionsPageSize:T=null,onSessionsPageChange:P,onSessionsPageSizeChange:$,onExport:A,onSessionClick:Le,onSessionsVisibleColumnsChange:le}){const re=!!(B!=null&&B.from&&(B!=null&&B.to)),H=(()=>{if(re||Z!=="8h")return null;const g=je("8h");return g?et(g.from,g.to):null})(),V=(()=>{if(re||Z==="8h")return null;const g=je(Z);return g?{from:ee(g.from),to:ee(g.to)}:null})(),de=U(p)||U(y)||U(b),Fe=U(v)||U(S);return e.jsxs("div",{className:a,style:{background:s.white,fontFamily:z,color:s.ink,width:"100%",minWidth:1192,boxSizing:"border-box",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"23px 32px",minHeight:78,boxSizing:"border-box"},children:[e.jsx("button",{type:"button","aria-label":"Back",onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,background:"transparent",border:"none",cursor:"pointer",color:s.ink,padding:0,flexShrink:0},children:e.jsx(h.ArrowLeft,{size:20,strokeWidth:1.75})}),e.jsx("div",{style:{paddingLeft:16,borderLeft:`1px solid ${s.border}`,flex:1,minWidth:0,alignSelf:"stretch",display:"flex",alignItems:"center"},children:e.jsx("h1",{style:{fontFamily:te,fontSize:24,fontWeight:400,color:s.ink,margin:0,lineHeight:1,whiteSpace:"nowrap"},children:t})}),e.jsxs("button",{type:"button",onClick:()=>A==null?void 0:A(),disabled:!A,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${s.neutralBorder}`,background:s.white,cursor:A?"pointer":"not-allowed",opacity:A?1:.5,fontFamily:z,fontSize:14,lineHeight:"24px",color:s.neutral800,flexShrink:0},children:[e.jsx(h.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{padding:"0 32px 32px",display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,paddingLeft:49},children:[e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(h.CalendarDays,{size:14,color:s.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:z,fontSize:12,color:s.ink,lineHeight:1.5},children:(H==null?void 0:H.from)??(V==null?void 0:V.from)??_e(n)}),e.jsx(h.ArrowRight,{size:12,color:s.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:z,fontSize:12,color:s.ink,lineHeight:1.5},children:(H==null?void 0:H.to)??(V==null?void 0:V.to)??_e(i)})]}),e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(h.Phone,{size:14,color:s.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:z,fontSize:12,color:s.ink,lineHeight:1.5},children:r})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}].map(g=>e.jsx(jt,{label:g.label,active:!re&&g.id===Z,onClick:()=>Q==null?void 0:Q(g.id)},g.id)),e.jsx(Me,{value:B,onChange:ae})]})]}),e.jsx("div",{style:{background:s.beige,border:`1px solid ${s.border}`,borderRadius:8,padding:16,display:"flex",alignItems:"center"},children:[{key:"baseline",kpi:d},{key:"agent-lift",kpi:c},{key:"score",kpi:F}].map((g,N)=>e.jsxs(w.Fragment,{children:[N>0?e.jsx(h.ArrowRight,{size:20,color:s.ink,strokeWidth:1.75,style:{flexShrink:0,margin:"0 24px"}}):null,e.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",minWidth:0},children:e.jsx(bt,{value:g.kpi.value,label:g.kpi.label,sub:g.kpi.sub,trend:g.kpi.trend,points:g.kpi.points})})]},g.key))}),de&&e.jsxs("div",{style:{display:"flex",gap:24},children:[U(p)&&e.jsx(xe,{title:j,value:p.value,delta:p.delta,children:e.jsx(ue,{yLabels:p.yLabels,xLabels:p.xLabels,points:p.points})}),U(y)&&e.jsx(xe,{title:C,value:y.value,delta:y.delta,children:e.jsx(ue,{yLabels:y.yLabels,xLabels:y.xLabels,points:y.points})}),U(b)&&e.jsx(xe,{title:M,value:b.value,delta:b.delta,children:e.jsx(ue,{yLabels:b.yLabels,xLabels:b.xLabels,points:b.points})})]}),Fe&&e.jsxs("div",{style:{display:"flex",gap:24},children:[U(v)&&e.jsx(xe,{title:K,value:v.value,delta:v.delta,children:e.jsx(ue,{yLabels:v.yLabels,xLabels:v.xLabels,points:v.points})}),U(S)&&e.jsx(xe,{title:_,value:S.value,delta:S.delta,children:e.jsx(ue,{yLabels:S.yLabels,xLabels:S.xLabels,points:S.points})})]}),e.jsxs("div",{style:{display:"flex",gap:24,marginTop:8,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(Te,{icon:h.ShieldCheck,title:E,iconColor:s.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:D.map((g,N)=>e.jsx(Be,{...g},N))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(Te,{icon:h.Lightbulb,title:X,iconColor:s.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:W.map((g,N)=>e.jsx(Be,{...g},N))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[e.jsx(Te,{icon:h.Phone,title:G,iconColor:s.railCompliance}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx(Ye,{icon:h.FolderKanban,title:O}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:Y.map((g,N)=>e.jsx(Ue,{...g},N))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx(Ye,{icon:h.Layers,title:J}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:I.map((g,N)=>e.jsx(Ue,{...g},N))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[f&&e.jsx("span",{style:{fontFamily:te,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2},children:f}),e.jsx(qe.DataTable2,{data:ie,columns:oe,initialPageSize:q,totalCount:x,page:m,pageSize:T,onPageChange:P,onPageSizeChange:$,onRowClick:Le,onVisibleColumnsChange:le})]})]})]})}const fe={value:"",label:"",trend:"up"},l={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",green:"var(--color-green)",red:"var(--color-red-strong)",neutralBorder:"var(--neutral-250)",neutralLight:"var(--neutral-100)",beige:"var(--surface-warm-40)",neutral800:"var(--neutral-800)",textInk:"var(--text-ink)",textFaintGrey:"var(--text-faint-grey)",hoverWarm40:"var(--hover-warm-40)",shadowPopover:"var(--shadow-popover)",shadowDropdown:"var(--shadow-dropdown)",railCompliance:"var(--rail-compliance)"},ne="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",L="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function at({trend:t="up",points:n,width:i=49.618,height:r=35}){const o=w.useId(),a=$e(n),d=a?a.line:nt,c=a?a.area:it,F=we(n)??t;return e.jsxs("svg",{width:i,height:r,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:!a&&F==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${o}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:l.ink}),e.jsx("stop",{offset:"1",stopColor:l.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:c,fill:`url(#spark-${o})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d,stroke:l.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:!a&&F==="down"?"2 4":void 0})]})}function dt(t,n){return we(n)??(t==="down"?"down":"up")}function ct({direction:t="up",color:n=l.muted}){const i="M12.4167 0.75H17.4167M17.4167 0.75V5.75M17.4167 0.75L10.3333 7.83333L6.16667 3.66667L0.75 9.08333",r="M12.4167 9.25H17.4167M17.4167 9.25V4.25M17.4167 9.25L10.3333 2.16667L6.16667 6.33333L0.75 0.91667";return e.jsx("svg",{width:18,height:9.5,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?i:r,stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ve({value:t,label:n,trend:i="up",points:r,muted:o=!1,beigeBg:a=!1,style:d={}}){const c=dt(i,r);return e.jsxs("div",{style:{background:a?l.beige:l.white,border:`1px solid ${l.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...d},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(at,{trend:c,points:r}),e.jsx(ct,{direction:c})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:ne,fontSize:28,fontWeight:500,lineHeight:"1.2",color:o?l.muted:l.ink,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:L,fontSize:13,color:l.ink,lineHeight:"1.2"},children:n})]})]})}function We({value:t,label:n,trend:i="up",points:r,withDivider:o=!1}){const a=dt(i,r);return e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,paddingLeft:o?24:0,borderLeft:o?`1px solid ${l.border}`:"none",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(at,{trend:a,points:r}),e.jsx(ct,{direction:a})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:ne,fontSize:28,fontWeight:500,lineHeight:"1.2",color:l.muted,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:L,fontSize:13,color:l.ink,lineHeight:"1.2"},children:n})]})]})}function St({icon:t,children:n,trailing:i}){return e.jsxs("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:"pointer",fontFamily:L,fontSize:14,color:l.neutral800,whiteSpace:"nowrap"},children:[t&&e.jsx(t,{size:18,strokeWidth:1.75}),n,i&&e.jsx(i,{size:16,strokeWidth:2})]})}const Dt=["January","February","March","April","May","June","July","August","September","October","November","December"],Lt=["Su","Mo","Tu","We","Th","Fr","Sa"];function me(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function Ft(t,n){const r=new Date(t,n,1).getDay(),o=new Date(t,n,1-r);return Array.from({length:42},(a,d)=>{const c=new Date(o);return c.setDate(o.getDate()+d),c})}function zt({value:t,onApply:n,onClose:i,anchorRef:r}){const o=w.useRef(null),[a,d]=w.useState(t!=null&&t.from?me(t.from):null),[c,F]=w.useState(t!=null&&t.to?me(t.to):null),p=a||new Date,[y,b]=w.useState(p.getFullYear()),[v,S]=w.useState(p.getMonth()),[W,D]=w.useState({top:0,left:0});w.useLayoutEffect(()=>{const f=()=>{if(!(r!=null&&r.current))return;const j=r.current.getBoundingClientRect(),C=320;D({top:j.bottom+6,left:Math.max(8,j.right-C)})};return f(),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[r]),w.useEffect(()=>{const f=C=>{var M,K;(M=o.current)!=null&&M.contains(C.target)||(K=r==null?void 0:r.current)!=null&&K.contains(C.target)||i()},j=C=>{C.key==="Escape"&&i()};return document.addEventListener("mousedown",f),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",j)}},[i,r]);const Y=Ft(y,v),I=me(new Date),E=f=>{const j=me(f);j>I||(!a||a&&c?(d(j),F(null)):j<a?d(j):F(j))},X=()=>{v===0?(S(11),b(y-1)):S(v-1)},G=()=>{v===11?(S(0),b(y+1)):S(v+1)},O=f=>a&&c&&f>=a&&f<=c,J=f=>a&&f.getTime()===a.getTime()||c&&f.getTime()===c.getTime();return ht.createPortal(e.jsxs("div",{ref:o,style:{position:"fixed",top:W.top,left:W.left,width:320,background:l.white,border:`1px solid ${l.borderSubtle}`,borderRadius:12,boxShadow:l.shadowPopover,padding:16,zIndex:9999,fontFamily:L},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsx("button",{type:"button",onClick:X,style:Xe,"aria-label":"Previous month",children:e.jsx(h.ChevronLeft,{size:18,strokeWidth:1.75})}),e.jsxs("div",{style:{fontSize:14,fontWeight:600,color:l.ink},children:[Dt[v]," ",y]}),e.jsx("button",{type:"button",onClick:G,style:Xe,"aria-label":"Next month",children:e.jsx(h.ChevronRight,{size:18,strokeWidth:1.75})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:Lt.map(f=>e.jsx("div",{style:{textAlign:"center",fontSize:12,color:l.muted,padding:"4px 0"},children:f},f))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:Y.map(f=>{const j=f.getMonth()===v,C=O(f),M=J(f),K=f.getTime()===I.getTime(),_=f>I;return e.jsx("button",{type:"button",onClick:()=>E(f),disabled:_,"aria-disabled":_,style:{height:36,border:"none",borderRadius:8,background:M?l.black:C?l.hoverWarm40:"transparent",color:M?l.white:_?l.textFaintGrey:j?l.ink:l.muted,fontFamily:L,fontSize:13,fontWeight:K?500:400,cursor:_?"not-allowed":"pointer",opacity:_?.6:1},children:f.getDate()},f.toISOString())})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:12,paddingTop:12,borderTop:`1px solid ${l.borderSubtle}`},children:[e.jsx("button",{type:"button",onClick:()=>{d(null),F(null)},style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:14,fontWeight:500,color:l.ink},children:"Clear"}),e.jsx("button",{type:"button",disabled:!a||!c,onClick:()=>{n({from:a,to:c}),i()},style:{background:!a||!c?l.neutralBorder:l.black,color:l.white,border:"none",borderRadius:10,height:30,padding:"0 16px",fontFamily:L,fontSize:14,fontWeight:600,cursor:!a||!c?"not-allowed":"pointer"},children:"Apply"})]})]}),document.body)}const Xe={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,border:"none",background:"transparent",borderRadius:6,cursor:"pointer",color:l.ink};function Me({value:t,onChange:n}){const[i,r]=w.useState(!1),o=w.useRef(null),a=!!(t!=null&&t.from&&(t!=null&&t.to));return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:o,type:"button",onClick:()=>r(d=>!d),style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:a?"none":`1px solid ${l.neutralBorder}`,background:a?l.black:l.white,cursor:"pointer",fontFamily:L,fontSize:14,color:a?l.white:l.neutral800,fontWeight:a?600:400,whiteSpace:"nowrap"},children:[e.jsx(h.CalendarDays,{size:18,strokeWidth:1.75}),"Date Range"]}),i&&e.jsx(zt,{value:t,anchorRef:o,onClose:()=>r(!1),onApply:d=>n==null?void 0:n(d)})]})}function Tt({label:t,active:n=!1,onClick:i}){return e.jsx("button",{type:"button",onClick:i,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:n?"none":`1px solid ${l.borderSubtle}`,background:n?l.black:l.white,color:n?l.white:l.black,fontFamily:L,fontSize:14,cursor:"pointer"},children:t})}const Wt=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}];function Ct({value:t=0,max:n=5}){const i=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(i),o=i%1>0&&r<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((a,d)=>d<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:l.black,display:"inline-block"}},d):d===r&&o?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:l.black,display:"inline-block"}})},d):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:l.white,border:`1px solid ${l.border}`,display:"inline-block",boxSizing:"border-box"}},d))})}const $t=[{id:"agent",label:"Agent",width:180,sortable:!0,filterable:!0},{id:"supervisor",label:"Supervisor",width:170,sortable:!0,filterable:!0},{id:"calls",label:"Calls",width:100,sortable:!0},{id:"baseline",label:"Baseline",width:110,sortable:!0},{id:"lift",label:"Lift",width:100,sortable:!0},{id:"score",label:"Score",width:100,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Compass Score",width:200,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(Ct,{value:typeof t=="number"?t:0})]})},{id:"totalDuration",label:"Total Duration",width:150,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1},{id:"avgDuration",label:"Average Duration",width:170,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1}];function ge({icon:t,title:n,trailing:i,iconColor:r=l.ink,bordered:o=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:o?12:0,borderBottom:o?`1px solid ${l.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:r}})}),e.jsx("div",{style:{flex:1,fontFamily:ne,fontWeight:600,fontSize:16,color:l.ink,lineHeight:"1.2",textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),i&&e.jsx("div",{style:{fontFamily:L,fontSize:14,color:l.ink},children:i})]})}function Ge({icon:t,title:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:l.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:l.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:ne,fontWeight:600,fontSize:16,color:l.ink,lineHeight:"24px"},children:n})]})}function Ke({title:t,summary:n,calls:i,percent:r,bullets:o,defaultExpanded:a=!1}){const[d,c]=w.useState(a),F=Array.isArray(o)?o:[];return e.jsxs("div",{style:{borderTop:`1px solid ${l.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>c(p=>!p),"aria-expanded":d,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:L},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("div",{style:{fontFamily:ne,fontWeight:600,fontSize:14,color:l.black,lineHeight:"24px"},children:t}),e.jsx("div",{style:{fontFamily:L,fontSize:14,color:l.muted,lineHeight:"24px"},children:n})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(h.Phone,{size:14,color:l.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:L,fontSize:12,color:l.ink,lineHeight:1.5},children:i})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(h.TrendingUp,{size:14,color:l.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:L,fontSize:12,color:l.ink,lineHeight:1.5},children:r})]})]})]}),e.jsx(h.ChevronDown,{size:20,color:l.ink,strokeWidth:2,style:{flexShrink:0,transform:d?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),d&&F.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:F.map((p,y)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontFamily:L,fontSize:14,color:l.ink,lineHeight:"24px",gap:16},children:[p.href?e.jsx("a",{href:p.href,target:"_blank",rel:"noopener noreferrer",style:{color:l.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:l.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.text}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.text}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:l.ink},children:p.citation}),e.jsxs("span",{style:{color:l.muted},children:["(",p.date,")"]})]})]},y))})]})}function be({label:t,value:n}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 0",borderBottom:`1px solid ${l.border}`,fontFamily:L,fontSize:13,lineHeight:"24px"},children:[e.jsx("span",{style:{color:l.ink},children:t}),e.jsx("span",{style:{color:l.muted},children:n})]})}function pe({message:t=""}){return t?e.jsx("div",{style:{padding:"16px 0",fontFamily:L,fontSize:13,color:l.muted,lineHeight:1.5},children:t}):null}function At({className:t="",onAgentClick:n,title:i="",subtitle:r="",dateRangeLabel:o="",viewByOptions:a=[],initialViewBy:d="",onViewByChange:c,aggregatedByLabel:F="",volumeStat:p=fe,compassStat:y=fe,baselineSubStat:b=fe,agentLiftSubStat:v=fe,scoreSubStat:S=fe,agentRows:W=[],agentColumns:D=[],initialPageSize:Y=10,guidanceItems:I=[],strengthItems:E=[],callDrivers:X=[],callParadigms:G=[],topSignalsLeft:O=[],topSignalsRight:J=[],topSignalsTrailing:f="",strengthsTitle:j="",guidanceTitle:C="",callMixTitle:M="",driversTitle:K="",paradigmsTitle:_="",topSignalsTitle:ie="",emptyStrengthsMessage:oe="",emptyGuidanceMessage:q="",emptyDriversMessage:Z="",emptyParadigmsMessage:Q="",emptyTopSignalsMessage:B="",rangeOptions:ae=Wt,selectedWindow:x="30d",onWindowChange:m,dateRangePicker:T,dateRange:P,onDateRangeChange:$,onExport:A,onVisibleColumnsChange:Le}){var Ne,Re;const[le,re]=w.useState(null),[H,V]=w.useState(!1),[de,Fe]=w.useState(d),[g,N]=w.useState(null),R=P!==void 0?P:g,ze=!!(R!=null&&R.from&&(R!=null&&R.to)),ut=u=>{N(u),$==null||$(u)},xt=u=>{N(null),$==null||$(null),m==null||m(u)},Pe=w.useRef(null),He=w.useRef(null);w.useEffect(()=>{if(!H)return;const u=k=>{var ce,Ee;(ce=He.current)!=null&&ce.contains(k.target)||(Ee=Pe.current)!=null&&Ee.contains(k.target)||V(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[H]);const ft=((Ne=a.find(u=>u.id===de))==null?void 0:Ne.label)||(((Re=a[0])==null?void 0:Re.label)??""),pt=u=>{if(n){n(u);return}re(u)};return e.jsxs(e.Fragment,{children:[le&&(()=>{let u=null,k=null;if(ze)u=R.from,k=R.to;else{const ce=ve[x];ce&&(k=new Date,u=new Date(k.getTime()-ce))}return e.jsx(ot,{className:t,agentName:le.agent,startDate:u||"",endDate:k||"",totalCalls:`${le.calls} Calls`,onBack:()=>re(null),selectedWindow:x,dateRange:R})})(),e.jsxs("div",{className:t,style:{background:l.white,fontFamily:L,color:l.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",flexDirection:"column",gap:24,display:le?"none":"flex"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,paddingTop:12},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4},children:[e.jsx("h1",{style:{fontFamily:ne,fontSize:24,fontWeight:500,color:l.ink,margin:0,lineHeight:"1.2",letterSpacing:"-0.01em"},children:i}),e.jsx("p",{style:{fontFamily:L,fontSize:14,color:"var(--neutral-950)",margin:0,lineHeight:"1.4"},children:r})]}),e.jsxs("button",{type:"button",onClick:()=>A==null?void 0:A(),disabled:!A,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:A?"pointer":"not-allowed",opacity:A?1:.5,fontFamily:L,fontSize:14,color:l.neutral800},children:[e.jsx(h.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{type:"button",ref:Pe,onClick:()=>V(u=>!u),"aria-haspopup":"listbox","aria-expanded":H,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:"pointer",fontFamily:L,fontSize:14,lineHeight:"24px",color:l.neutral800,whiteSpace:"nowrap"},children:[ft,e.jsx(h.ChevronDown,{size:20,strokeWidth:1.75,style:{transform:H?"rotate(180deg)":"none",transition:"transform 120ms ease"}})]}),H&&e.jsxs("div",{ref:He,role:"listbox",style:{position:"absolute",top:36,left:0,zIndex:20,background:l.white,border:`1px solid ${l.border}`,borderRadius:4,boxShadow:l.shadowDropdown,display:"flex",flexDirection:"column",minWidth:144,fontFamily:L},children:[F&&e.jsx("div",{style:{padding:12,fontFamily:ne,fontWeight:600,fontSize:13,color:l.ink,lineHeight:1.2},children:F}),a.map(u=>{const k=de===u.id;return e.jsxs("button",{type:"button",role:"option","aria-selected":k,onClick:()=>{u.id!==de&&(Fe(u.id),c==null||c(u.id)),V(!1)},style:{display:"flex",alignItems:"center",gap:8,padding:k?12:"12px 12px 12px 40px",borderTop:`1px solid ${l.border}`,borderLeft:"none",borderRight:"none",borderBottom:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontFamily:L,fontSize:13,lineHeight:1.2,color:l.ink,width:"100%"},children:[k&&e.jsx(h.Check,{size:20,color:l.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{children:u.label})]},u.id)})]})]}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(()=>{const k=(ze?`${ee(R.from)} – ${ee(R.to)}`:"")||tt(x)||o;return k?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:L,fontSize:13,color:l.ink},children:[e.jsx(h.CalendarDays,{size:16,strokeWidth:1.75,color:l.muted}),k]}):null})(),ae.map(u=>e.jsx(Tt,{label:u.label,active:!ze&&u.id===x,onClick:()=>xt(u.id)},u.id)),T?e.jsx(w.Suspense,{fallback:e.jsx(St,{icon:h.CalendarDays,children:"Date Range"}),children:T}):e.jsx(Me,{value:R,onChange:ut})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx(Ve,{value:p.value,label:p.label,trend:p.trend,points:p.points,style:{width:264,flexShrink:0}}),e.jsx(Ve,{value:y.value,label:y.label,trend:y.trend,points:y.points,style:{width:264,flexShrink:0}}),e.jsxs("div",{style:{flex:1,background:l.beige,border:`1px solid ${l.border}`,borderRadius:8,padding:16,display:"flex",gap:24,alignItems:"stretch",boxSizing:"border-box"},children:[e.jsx(We,{value:b.value,label:b.label,trend:b.trend,points:b.points}),e.jsx(We,{value:v.value,label:v.label,trend:v.trend,points:v.points,withDivider:!0}),e.jsx(We,{value:S.value,label:S.label,trend:S.trend,points:S.points,withDivider:!0})]})]}),e.jsx(qe.DataTable2,{data:W,columns:D,initialPageSize:Y,onRowClick:pt,onVisibleColumnsChange:Le}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.ShieldCheck,title:j,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${l.border}`,maxHeight:480,overflowY:"auto"},children:E.length===0?e.jsx(pe,{message:oe}):E.map((u,k)=>e.jsx(Ke,{...u},k))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.Lightbulb,title:C,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${l.border}`,maxHeight:480,overflowY:"auto"},children:I.length===0?e.jsx(pe,{message:q}):I.map((u,k)=>e.jsx(Ke,{...u},k))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.Phone,title:M,iconColor:"var(--rail-compliance)"}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ge,{icon:h.FolderKanban,title:K}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:X.length===0?e.jsx(pe,{message:Z}):X.map((u,k)=>e.jsx(be,{...u},k))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ge,{icon:h.Layers,title:_}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:G.length===0?e.jsx(pe,{message:Q}):G.map((u,k)=>e.jsx(be,{...u},k))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.Signal,title:ie,iconColor:"var(--rail-compliance)",trailing:f,bordered:!0}),O.length===0&&J.length===0?e.jsx(pe,{message:B}):e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:O.map((u,k)=>e.jsx(be,{...u},k))}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:J.map((u,k)=>e.jsx(be,{...u},k))})]})]})]})]})}exports.DEFAULT_AGENT_COLUMNS=$t;exports.DEFAULT_SESSION_COLUMNS=wt;exports.DateRangeButton=Me;exports.METRIC_PLACEHOLDER=Ae;exports.PerformanceDetailsPage=ot;exports.PerformancePanel=At;exports.RANGE_TO_MS=ve;exports.buildSparkPaths=$e;exports.computeWindowLabel=tt;exports.formatEightHourRangeEndpoints=et;exports.formatEightHourWindowLabel=Qe;exports.formatLocalDate=ee;exports.formatMetricDisplay=Ie;exports.getPresetWindowDates=je;exports.hasChartData=U;exports.hasMeaningfulMetric=ye;exports.isNullishMetric=Se;exports.normalizeSparkPoints=ke;exports.resolveKpiTrend=rt;exports.resolveTrend=De;exports.trendFromPoints=we;exports.trendFromSignedValue=lt;
|
|
2
2
|
//# sourceMappingURL=PerformancePanel.cjs.js.map
|