chordia-ui 3.9.1 → 3.9.3
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 +928 -898
- 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/chat.cjs.js +3 -3
- package/dist/components/chat.cjs.js.map +1 -1
- package/dist/components/chat.es.js +67 -67
- package/dist/components/chat.es.js.map +1 -1
- package/dist/components/media.cjs.js +1 -1
- package/dist/components/media.cjs.js.map +1 -1
- package/dist/components/media.es.js +4 -4
- package/dist/components/media.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 +130 -149
- 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/chat/ChatHistoryPanel.jsx +3 -3
- package/src/components/chat/ChatInterface.jsx +3 -3
- package/src/components/media/InteractionSummaryCard.jsx +1 -1
- package/src/components/performance/PerformanceDetailsPage.jsx +185 -90
- 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 +93 -0
- package/src/components/performance/performanceSparkline.js +52 -0
- package/src/components/reports/ReportsDetails.jsx +2 -2
- 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"),xt=require("react-dom"),h=require("lucide-react"),Ge=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},Ke=void 0,ut={month:"2-digit",day:"2-digit",year:"numeric"},ft={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 a=new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));return Number.isNaN(a.getTime())?null:a}const r=new Date(n);return Number.isNaN(r.getTime())?null:r}function qe(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function Q(t){const n=t instanceof Date?t:he(t);return n?n.toLocaleDateString(Ke,ut):""}function Te(t){return t.toLocaleTimeString(Ke,ft)}function se(t){return`${Q(t)} ${Te(t)}`}function Je(t,n){const i=he(t),r=he(n);return!i||!r?"":qe(i,r)?`${se(i)} – ${Te(r)}`:`${se(i)} – ${se(r)}`}function Ze(t,n){const i=he(t),r=he(n);return!i||!r?null:qe(i,r)?{from:se(i),to:Te(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 Qe(t){if(!ve[t])return"";const i=je(t);return i?t==="8h"?Je(i.from,i.to):`${Q(i.from)} – ${Q(i.to)}`:""}const pt="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",ht="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 We(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 et(t,n=52,i=36){const r=We(t);if(!r)return null;const a=Math.min(...r),o=Math.max(...r),d=4,p=o-a||1,k=i-d*2-4,c=D=>(r.length===1?0:D/(r.length-1)*(n-2))+1,y=D=>d+(1-(D-a)/p)*k;let j="";for(let D=0;D<r.length;D++)j+=`${D===0?"M":"L"}${c(D).toFixed(2)},${y(r[D]).toFixed(2)}`;const g=c(r.length-1),m=c(0),$=`${j} L${g.toFixed(2)},${i} L${m.toFixed(2)},${i} Z`;return{line:j,area:$}}function ke(t){const n=We(t);if(!n)return null;const i=n[0],r=n[n.length-1];return r>i?"up":r<i?"down":"up"}const $e="—";function we(t){if(t==null)return!0;const n=String(t).trim();return!!(!n||/^[-−–—]$/.test(n)||/^(n\/a|null|undefined)$/i.test(n))}function Se(t){return!we(t)}function tt(t,n=$e){return we(t)?n:String(t)}function Ee(t){return t!=null&&String(t).trim()!==""}function O(t){return t?Ee(t.value)||Ee(t.delta)?!0:Array.isArray(t.points)&&t.points.length>0:!1}function nt(t){if(we(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 nt(n)??(t==="down"?"down":"up")}function yt(t,n,i){return ke(i)??(Se(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)"},oe="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",W="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function gt({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 Re(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(void 0,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(void 0,n);const a=new Date(i);return Number.isNaN(a.getTime())?i:a.toLocaleDateString(void 0,n)}function mt({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:W,fontSize:14,cursor:"pointer"},children:t})}function xe({yLabels:t,xLabels:n=[],points:i,highlightIndex:r,xAxisLabel:a="",yAxisLabel:o=""}){const[d,p]=w.useState(null),k=460,c=110,y=Array.isArray(i)&&i.length>0,j=w.useId(),g=6,m=Array.isArray(n)?n:[],$=m.length<=g?m:Array.from({length:g},(f,b)=>m[Math.round(b*(m.length-1)/(g-1))]),D=Math.max(2,$.length||g),_=Array.from({length:D},(f,b)=>b/(D-1)*k);if(!y)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 ${k} ${c+14}`,preserveAspectRatio:"none",children:_.map((f,b)=>e.jsx("line",{x1:f,y1:"0",x2:f,y2:c,stroke:s.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${b}`))})})]});const M=Array.isArray(i[0])?i:i.map((f,b)=>[b,f]),X=M.map(([,f])=>f),B=Math.min(...X),N=Math.max(...X),G=N===B?Math.max(Math.abs(N)*.1,1):(N-B)*.1,K=B-G,u=N+G,A=u-K||1,I=f=>(u-f)/A*c,T=M.map(([f,b])=>[f,I(b)]),Y=t&&t.length?t:Array.from({length:5},(f,b)=>{const L=u-b/4*(u-K),z=Math.abs(L),Z=z>=100?0:z>=10?1:2;return L.toFixed(Z)}),C=T[0][0],ae=T[T.length-1][0]-C||1,ne=8,q=Math.max(1,k-ne*2),E=f=>ne+(f-C)/ae*q,R=f=>{const b=Number(f);if(!Number.isFinite(b))return String(f??"");const L=Math.abs(b),z=L>=100?0:L>=10?1:2;return b.toFixed(z)},ie=T.map(([f,b],L)=>`${L===0?"M":"L"}${E(f)},${b}`).join(" "),J=`${ie} L${E(T[T.length-1][0])},${c} L${E(T[0][0])},${c} Z`,ee=r??T.length-1;return e.jsxs("div",{style:{display:"flex",gap:8,height:a?151:133,width:"100%"},children:[o?e.jsx("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:e.jsx("span",{style:{writingMode:"vertical-rl",transform:"rotate(180deg)",fontFamily:W,fontSize:10,fontWeight:500,color:s.neutral800,whiteSpace:"nowrap"},children:o})}):null,e.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"14px 0",fontFamily:W,fontSize:10,color:s.neutral800,flexShrink:0},children:Y.map(f=>e.jsx("span",{children:f},f))}),e.jsxs("div",{style:{flex:1,position:"relative",minWidth:0},children:[d&&e.jsxs("div",{style:{position:"absolute",left:`${d.xPct}%`,top:`${d.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:W,fontSize:11,lineHeight:1.25,whiteSpace:"nowrap",textAlign:"left"},children:[e.jsx("div",{children:d.label}),e.jsx("div",{style:{fontWeight:600},children:d.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 ${k} ${c+14}`,preserveAspectRatio:"none",onMouseLeave:()=>p(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`area-${j}`,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}})]})}),_.map((f,b)=>e.jsx("line",{x1:f,y1:"0",x2:f,y2:c,stroke:s.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${b}`)),e.jsx("path",{d:J,fill:`url(#area-${j})`}),e.jsx("path",{d:ie,stroke:s.black,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),T.map(([f,b],L)=>{const z=L===ee;return e.jsx("circle",{cx:E(f),cy:b,r:z?4:3,fill:z?s.black:s.white,stroke:s.black,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke",onMouseEnter:()=>{var Z;p({xPct:E(f)/k*100,yPct:b/(c+28)*100,label:m[L]||`Point ${L+1}`,value:R((Z=M[L])==null?void 0:Z[1])})}},L)})]}),e.jsx("div",{style:{display:"flex",justifyContent:"space-between",paddingRight:6,fontFamily:W,fontSize:10,color:s.neutral800,marginTop:8,marginBottom:4,overflow:"hidden"},children:$.map((f,b)=>e.jsx("span",{style:{whiteSpace:"nowrap"},children:f},b))}),a?e.jsx("div",{style:{textAlign:"center",fontFamily:W,fontSize:10,fontWeight:500,color:s.neutral800},children:a}):null]})]})}function ue({title:t,value:n,delta:i,children:r}){const a=tt(n),o=Se(i),d=o?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:oe,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:oe,fontWeight:600},children:[e.jsx("span",{style:{fontSize:20,color:s.black,lineHeight:1},children:a}),o?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,color:s.neutral300,lineHeight:1},children:[e.jsx(gt,{direction:d,color:s.neutral300}),i]}):null]})]}),e.jsx("div",{style:{flex:1},children:r})]})}function ze({icon:t,title:n,trailing:i,iconColor:r=s.ink,bordered:a=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:a?12:0,borderBottom:a?`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:oe,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2,textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),i&&e.jsx("div",{style:{fontFamily:W,fontSize:14,color:s.ink},children:i})]})}function bt({text:t,bullet:n,citation:i,date:r,href:a}){const o=t??n??"";return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:W,fontSize:14,color:s.ink,lineHeight:"24px",gap:16},children:[a?e.jsx("a",{href:a,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:o}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}),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 Oe({title:t,summary:n,calls:i,percent:r,delta:a,bullets:o,defaultExpanded:d=!1}){const[p,k]=w.useState(d),c=r??a,y=Se(c),j=y?String(c):$e,m=(y?De("up",j):"up")==="down"?h.TrendingDown:h.TrendingUp,$=Array.isArray(o)?o:[];return e.jsxs("div",{style:{borderTop:`1px solid ${s.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>k(D=>!D),"aria-expanded":p,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:W},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:W,fontWeight:500,fontSize:14,color:s.black,lineHeight:"24px"},children:t}),e.jsx("span",{style:{fontFamily:W,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:W,fontSize:12,color:s.ink},children:[i," Interactions"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[y?e.jsx(m,{size:12,color:s.ink,strokeWidth:1.75}):null,e.jsx("span",{style:{fontFamily:W,fontSize:12,color:y?s.ink:s.muted},children:j})]})]})]}),e.jsx(h.ChevronDown,{size:20,color:s.ink,strokeWidth:2,style:{flexShrink:0,transform:p?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),p&&$.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:$.map((D,_)=>e.jsx(bt,{...D},_))})]})}function _e({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:W,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 jt({value:t=0,max:n=5}){const i=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(i),a=i%1>0&&r<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((o,d)=>d<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:s.black,display:"inline-block"}},d):d===r&&a?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 vt=[{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(jt,{value:n})]})}}];function Be({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:oe,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2},children:n})]})}function it({agentName:t="",startDate:n="",endDate:i="",totalCalls:r="",onBack:a,className:o="",kpiBaseline:d={value:"",label:"",sub:"",trend:"up"},kpiAgentLift:p={value:"",label:"",sub:"",trend:"down"},kpiScore:k={value:"",label:"",sub:"",trend:"up"},baselineChart:c={value:"",delta:""},agentLiftChart:y={value:"",delta:""},scoreChart:j={value:"",delta:""},csatChart:g={value:"",delta:""},volumeChart:m={value:"",delta:""},guidanceItems:$=[],strengthItems:D=[],callDrivers:_=[],callParadigms:M=[],strengthsTitle:X="",guidanceTitle:B="",callMixTitle:N="",driversTitle:G="",paradigmsTitle:K="",sessionsTitle:u="",baselineChartTitle:A="",agentLiftChartTitle:I="",scoreChartTitle:T="",csatChartTitle:Y="",volumeChartTitle:C="",sessions:ye=[],sessionColumns:ae=[],initialPageSize:ne=10,selectedWindow:q="30d",onWindowChange:E,dateRange:R,onDateRangeChange:ie,sessionsTotal:J=null,sessionsPage:ee=null,sessionsPageSize:f=null,onSessionsPageChange:b,onSessionsPageSizeChange:L,onExport:z,onSessionClick:Z,onSessionsVisibleColumnsChange:le}){const re=!!(R!=null&&R.from&&(R!=null&&R.to)),P=(()=>{if(re||q!=="8h")return null;const F=je("8h");return F?Ze(F.from,F.to):null})(),U=(()=>{if(re||q==="8h")return null;const F=je(q);return F?{from:Q(F.from),to:Q(F.to)}:null})(),de=O(c)||O(y)||O(j),Le=O(g)||O(m);return e.jsxs("div",{className:o,style:{background:s.white,fontFamily:W,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:a,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:oe,fontSize:24,fontWeight:400,color:s.ink,margin:0,lineHeight:1,whiteSpace:"nowrap"},children:t})}),e.jsxs("button",{type:"button",onClick:()=>z==null?void 0:z(),disabled:!z,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${s.neutralBorder}`,background:s.white,cursor:z?"pointer":"not-allowed",opacity:z?1:.5,fontFamily:W,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:W,fontSize:12,color:s.ink,lineHeight:1.5},children:(P==null?void 0:P.from)??(U==null?void 0:U.from)??Re(n)}),e.jsx(h.ArrowRight,{size:12,color:s.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:W,fontSize:12,color:s.ink,lineHeight:1.5},children:(P==null?void 0:P.to)??(U==null?void 0:U.to)??Re(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:W,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(F=>e.jsx(mt,{label:F.label,active:!re&&F.id===q,onClick:()=>E==null?void 0:E(F.id)},F.id)),e.jsx(Ie,{value:R,onChange:ie})]})]}),de&&e.jsxs("div",{style:{display:"flex",gap:24},children:[O(c)&&e.jsx(ue,{title:A,value:c.value,delta:c.delta,children:e.jsx(xe,{yLabels:c.yLabels,xLabels:c.xLabels,points:c.points,xAxisLabel:c.xAxisLabel,yAxisLabel:c.yAxisLabel})}),O(y)&&e.jsx(ue,{title:I,value:y.value,delta:y.delta,children:e.jsx(xe,{yLabels:y.yLabels,xLabels:y.xLabels,points:y.points,xAxisLabel:y.xAxisLabel,yAxisLabel:y.yAxisLabel})}),O(j)&&e.jsx(ue,{title:T,value:j.value,delta:j.delta,children:e.jsx(xe,{yLabels:j.yLabels,xLabels:j.xLabels,points:j.points,xAxisLabel:j.xAxisLabel,yAxisLabel:j.yAxisLabel})})]}),Le&&e.jsxs("div",{style:{display:"flex",gap:24},children:[O(g)&&e.jsx(ue,{title:Y,value:g.value,delta:g.delta,children:e.jsx(xe,{yLabels:g.yLabels,xLabels:g.xLabels,points:g.points,xAxisLabel:g.xAxisLabel,yAxisLabel:g.yAxisLabel})}),O(m)&&e.jsx(ue,{title:C,value:m.value,delta:m.delta,children:e.jsx(xe,{yLabels:m.yLabels,xLabels:m.xLabels,points:m.points,xAxisLabel:m.xAxisLabel,yAxisLabel:m.yAxisLabel})})]}),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(ze,{icon:h.ShieldCheck,title:X,iconColor:s.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:D.map((F,V)=>e.jsx(Oe,{...F},V))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(ze,{icon:h.Lightbulb,title:B,iconColor:s.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:$.map((F,V)=>e.jsx(Oe,{...F},V))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[e.jsx(ze,{icon:h.Phone,title:N,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(Be,{icon:h.FolderKanban,title:G}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:_.map((F,V)=>e.jsx(_e,{...F},V))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx(Be,{icon:h.Layers,title:K}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:M.map((F,V)=>e.jsx(_e,{...F},V))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[u&&e.jsx("span",{style:{fontFamily:oe,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2},children:u}),e.jsx(Ge.DataTable2,{data:ye,columns:ae,initialPageSize:ne,totalCount:J,page:ee,pageSize:f,onPageChange:b,onPageSizeChange:L,onRowClick:Z,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)"},te="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",S="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function lt({trend:t="up",points:n,width:i=49.618,height:r=35}){const a=w.useId(),o=et(n),d=o?o.line:pt,p=o?o.area:ht,k=ke(n)??t;return e.jsxs("svg",{width:i,height:r,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:!o&&k==="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:l.ink}),e.jsx("stop",{offset:"1",stopColor:l.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:p,fill:`url(#spark-${a})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d,stroke:l.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:!o&&k==="down"?"2 4":void 0})]})}function rt(t,n){return ke(n)??(t==="down"?"down":"up")}function st({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 Ye({value:t,label:n,trend:i="up",points:r,muted:a=!1,beigeBg:o=!1,style:d={}}){const p=rt(i,r);return e.jsxs("div",{style:{background:o?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(lt,{trend:p,points:r}),e.jsx(st,{direction:p})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:te,fontSize:28,fontWeight:500,lineHeight:"1.2",color:a?l.muted:l.ink,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:13,color:l.ink,lineHeight:"1.2"},children:n})]})]})}function Ae({value:t,label:n,trend:i="up",points:r,withDivider:a=!1}){const o=rt(i,r);return e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,paddingLeft:a?24:0,borderLeft:a?`1px solid ${l.border}`:"none",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(lt,{trend:o,points:r}),e.jsx(st,{direction:o})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:te,fontSize:28,fontWeight:500,lineHeight:"1.2",color:l.muted,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:13,color:l.ink,lineHeight:"1.2"},children:n})]})]})}function kt({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:S,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 wt=["January","February","March","April","May","June","July","August","September","October","November","December"],St=["Su","Mo","Tu","We","Th","Fr","Sa"];function ge(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function Dt(t,n){const r=new Date(t,n,1).getDay(),a=new Date(t,n,1-r);return Array.from({length:42},(o,d)=>{const p=new Date(a);return p.setDate(a.getDate()+d),p})}function Lt({value:t,onApply:n,onClose:i,anchorRef:r}){const a=w.useRef(null),[o,d]=w.useState(t!=null&&t.from?ge(t.from):null),[p,k]=w.useState(t!=null&&t.to?ge(t.to):null),c=o||new Date,[y,j]=w.useState(c.getFullYear()),[g,m]=w.useState(c.getMonth()),[$,D]=w.useState({top:0,left:0});w.useLayoutEffect(()=>{const u=()=>{if(!(r!=null&&r.current))return;const A=r.current.getBoundingClientRect(),I=320;D({top:A.bottom+6,left:Math.max(8,A.right-I)})};return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[r]),w.useEffect(()=>{const u=I=>{var T,Y;(T=a.current)!=null&&T.contains(I.target)||(Y=r==null?void 0:r.current)!=null&&Y.contains(I.target)||i()},A=I=>{I.key==="Escape"&&i()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",A),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",A)}},[i,r]);const _=Dt(y,g),M=ge(new Date),X=u=>{const A=ge(u);A>M||(!o||o&&p?(d(A),k(null)):A<o?d(A):k(A))},B=()=>{g===0?(m(11),j(y-1)):m(g-1)},N=()=>{g===11?(m(0),j(y+1)):m(g+1)},G=u=>o&&p&&u>=o&&u<=p,K=u=>o&&u.getTime()===o.getTime()||p&&u.getTime()===p.getTime();return xt.createPortal(e.jsxs("div",{ref:a,style:{position:"fixed",top:$.top,left:$.left,width:320,background:l.white,border:`1px solid ${l.borderSubtle}`,borderRadius:12,boxShadow:l.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:B,style:Ue,"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:[wt[g]," ",y]}),e.jsx("button",{type:"button",onClick:N,style:Ue,"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:St.map(u=>e.jsx("div",{style:{textAlign:"center",fontSize:12,color:l.muted,padding:"4px 0"},children:u},u))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:_.map(u=>{const A=u.getMonth()===g,I=G(u),T=K(u),Y=u.getTime()===M.getTime(),C=u>M;return e.jsx("button",{type:"button",onClick:()=>X(u),disabled:C,"aria-disabled":C,style:{height:36,border:"none",borderRadius:8,background:T?l.black:I?l.hoverWarm40:"transparent",color:T?l.white:C?l.textFaintGrey:A?l.ink:l.muted,fontFamily:S,fontSize:13,fontWeight:Y?500:400,cursor:C?"not-allowed":"pointer",opacity:C?.6:1},children:u.getDate()},u.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),k(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:!o||!p,onClick:()=>{n({from:o,to:p}),i()},style:{background:!o||!p?l.neutralBorder:l.black,color:l.white,border:"none",borderRadius:10,height:30,padding:"0 16px",fontFamily:S,fontSize:14,fontWeight:600,cursor:!o||!p?"not-allowed":"pointer"},children:"Apply"})]})]}),document.body)}const Ue={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,border:"none",background:"transparent",borderRadius:6,cursor:"pointer",color:l.ink};function Ie({value:t,onChange:n}){const[i,r]=w.useState(!1),a=w.useRef(null),o=!!(t!=null&&t.from&&(t!=null&&t.to));return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:a,type:"button",onClick:()=>r(d=>!d),style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:o?"none":`1px solid ${l.neutralBorder}`,background:o?l.black:l.white,cursor:"pointer",fontFamily:S,fontSize:14,color:o?l.white:l.neutral800,fontWeight:o?600:400,whiteSpace:"nowrap"},children:[e.jsx(h.CalendarDays,{size:18,strokeWidth:1.75}),"Date Range"]}),i&&e.jsx(Lt,{value:t,anchorRef:a,onClose:()=>r(!1),onApply:d=>n==null?void 0:n(d)})]})}function Ft({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:S,fontSize:14,cursor:"pointer"},children:t})}const zt=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}];function At({value:t=0,max:n=5}){const i=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(i),a=i%1>0&&r<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((o,d)=>d<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:l.black,display:"inline-block"}},d):d===r&&a?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 Tt=[{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 me({icon:t,title:n,trailing:i,iconColor:r=l.ink,bordered:a=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:a?12:0,borderBottom:a?`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:te,fontWeight:600,fontSize:16,color:l.ink,lineHeight:"1.2",textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),i&&e.jsx("div",{style:{fontFamily:S,fontSize:14,color:l.ink},children:i})]})}function Ve({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:te,fontWeight:600,fontSize:16,color:l.ink,lineHeight:"24px"},children:n})]})}function Xe({title:t,summary:n,calls:i,percent:r,bullets:a,defaultExpanded:o=!1}){const[d,p]=w.useState(o),k=Array.isArray(a)?a:[];return e.jsxs("div",{style:{borderTop:`1px solid ${l.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>p(c=>!c),"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:te,fontWeight:600,fontSize:14,color:l.black,lineHeight:"24px"},children:t}),e.jsx("div",{style:{fontFamily:S,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:S,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:S,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&&k.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:k.map((c,y)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontFamily:S,fontSize:14,color:l.ink,lineHeight:"24px",gap:16},children:[c.href?e.jsx("a",{href:c.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:c.text}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.text}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:l.ink},children:c.citation}),e.jsxs("span",{style:{color:l.muted},children:["(",c.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:S,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:S,fontSize:13,color:l.muted,lineHeight:1.5},children:t}):null}function Wt({className:t="",onAgentClick:n,title:i="",subtitle:r="",dateRangeLabel:a="",viewByOptions:o=[],initialViewBy:d="",onViewByChange:p,aggregatedByLabel:k="",volumeStat:c=fe,compassStat:y=fe,baselineSubStat:j=fe,agentLiftSubStat:g=fe,scoreSubStat:m=fe,agentRows:$=[],agentColumns:D=[],initialPageSize:_=10,guidanceItems:M=[],strengthItems:X=[],callDrivers:B=[],callParadigms:N=[],topSignalsLeft:G=[],topSignalsRight:K=[],topSignalsTrailing:u="",strengthsTitle:A="",guidanceTitle:I="",callMixTitle:T="",driversTitle:Y="",paradigmsTitle:C="",topSignalsTitle:ye="",emptyStrengthsMessage:ae="",emptyGuidanceMessage:ne="",emptyDriversMessage:q="",emptyParadigmsMessage:E="",emptyTopSignalsMessage:R="",rangeOptions:ie=zt,selectedWindow:J="30d",onWindowChange:ee,dateRangePicker:f,dateRange:b,onDateRangeChange:L,onExport:z,onVisibleColumnsChange:Z}){var Pe,He;const[le,re]=w.useState(null),[P,U]=w.useState(!1),[de,Le]=w.useState(d),[F,V]=w.useState(null),H=b!==void 0?b:F,Fe=!!(H!=null&&H.from&&(H!=null&&H.to)),ot=x=>{V(x),L==null||L(x)},at=x=>{V(null),L==null||L(null),ee==null||ee(x)},Me=w.useRef(null),Ce=w.useRef(null);w.useEffect(()=>{if(!P)return;const x=v=>{var ce,Ne;(ce=Ce.current)!=null&&ce.contains(v.target)||(Ne=Me.current)!=null&&Ne.contains(v.target)||U(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[P]);const dt=((Pe=o.find(x=>x.id===de))==null?void 0:Pe.label)||(((He=o[0])==null?void 0:He.label)??""),ct=x=>{if(n){n(x);return}re(x)};return e.jsxs(e.Fragment,{children:[le&&(()=>{let x=null,v=null;if(Fe)x=H.from,v=H.to;else{const ce=ve[J];ce&&(v=new Date,x=new Date(v.getTime()-ce))}return e.jsx(it,{className:t,agentName:le.agent,startDate:x||"",endDate:v||"",totalCalls:`${le.calls} Calls`,onBack:()=>re(null),selectedWindow:J,dateRange:H})})(),e.jsxs("div",{className:t,style:{background:l.white,fontFamily:S,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:te,fontSize:24,fontWeight:500,color:l.ink,margin:0,lineHeight:"1.2",letterSpacing:"-0.01em"},children:i}),e.jsx("p",{style:{fontFamily:S,fontSize:14,color:"var(--neutral-950)",margin:0,lineHeight:"1.4"},children:r})]}),e.jsxs("button",{type:"button",onClick:()=>z==null?void 0:z(),disabled:!z,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:z?"pointer":"not-allowed",opacity:z?1:.5,fontFamily:S,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:Me,onClick:()=>U(x=>!x),"aria-haspopup":"listbox","aria-expanded":P,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:S,fontSize:14,lineHeight:"24px",color:l.neutral800,whiteSpace:"nowrap"},children:[dt,e.jsx(h.ChevronDown,{size:20,strokeWidth:1.75,style:{transform:P?"rotate(180deg)":"none",transition:"transform 120ms ease"}})]}),P&&e.jsxs("div",{ref:Ce,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:S},children:[k&&e.jsx("div",{style:{padding:12,fontFamily:te,fontWeight:600,fontSize:13,color:l.ink,lineHeight:1.2},children:k}),o.map(x=>{const v=de===x.id;return e.jsxs("button",{type:"button",role:"option","aria-selected":v,onClick:()=>{x.id!==de&&(Le(x.id),p==null||p(x.id)),U(!1)},style:{display:"flex",alignItems:"center",gap:8,padding:v?12:"12px 12px 12px 40px",borderTop:`1px solid ${l.border}`,borderLeft:"none",borderRight:"none",borderBottom:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontFamily:S,fontSize:13,lineHeight:1.2,color:l.ink,width:"100%"},children:[v&&e.jsx(h.Check,{size:20,color:l.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=(Fe?`${Q(H.from)} – ${Q(H.to)}`:"")||Qe(J)||a;return v?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:S,fontSize:13,color:l.ink},children:[e.jsx(h.CalendarDays,{size:16,strokeWidth:1.75,color:l.muted}),v]}):null})(),ie.map(x=>e.jsx(Ft,{label:x.label,active:!Fe&&x.id===J,onClick:()=>at(x.id)},x.id)),f?e.jsx(w.Suspense,{fallback:e.jsx(kt,{icon:h.CalendarDays,children:"Date Range"}),children:f}):e.jsx(Ie,{value:H,onChange:ot})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx(Ye,{value:c.value,label:c.label,trend:c.trend,points:c.points,style:{width:264,flexShrink:0}}),e.jsx(Ye,{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(Ae,{value:j.value,label:j.label,trend:j.trend,points:j.points}),e.jsx(Ae,{value:g.value,label:g.label,trend:g.trend,points:g.points,withDivider:!0}),e.jsx(Ae,{value:m.value,label:m.label,trend:m.trend,points:m.points,withDivider:!0})]})]}),e.jsx(Ge.DataTable2,{data:$,columns:D,initialPageSize:_,onRowClick:ct,onVisibleColumnsChange:Z}),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(me,{icon:h.ShieldCheck,title:A,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${l.border}`,maxHeight:480,overflowY:"auto"},children:X.length===0?e.jsx(pe,{message:ae}):X.map((x,v)=>e.jsx(Xe,{...x},v))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(me,{icon:h.Lightbulb,title:I,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${l.border}`,maxHeight:480,overflowY:"auto"},children:M.length===0?e.jsx(pe,{message:ne}):M.map((x,v)=>e.jsx(Xe,{...x},v))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(me,{icon:h.Phone,title:T,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(Ve,{icon:h.FolderKanban,title:Y}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:B.length===0?e.jsx(pe,{message:q}):B.map((x,v)=>e.jsx(be,{...x},v))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ve,{icon:h.Layers,title:C}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:N.length===0?e.jsx(pe,{message:E}):N.map((x,v)=>e.jsx(be,{...x},v))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(me,{icon:h.Signal,title:ye,iconColor:"var(--rail-compliance)",trailing:u,bordered:!0}),G.length===0&&K.length===0?e.jsx(pe,{message:R}):e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:G.map((x,v)=>e.jsx(be,{...x},v))}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:K.map((x,v)=>e.jsx(be,{...x},v))})]})]})]})]})}exports.DEFAULT_AGENT_COLUMNS=Tt;exports.DEFAULT_SESSION_COLUMNS=vt;exports.DateRangeButton=Ie;exports.METRIC_PLACEHOLDER=$e;exports.PerformanceDetailsPage=it;exports.PerformancePanel=Wt;exports.RANGE_TO_MS=ve;exports.buildSparkPaths=et;exports.computeWindowLabel=Qe;exports.formatEightHourRangeEndpoints=Ze;exports.formatEightHourWindowLabel=Je;exports.formatLocalDate=Q;exports.formatMetricDisplay=tt;exports.getPresetWindowDates=je;exports.hasChartData=O;exports.hasMeaningfulMetric=Se;exports.isNullishMetric=we;exports.normalizeSparkPoints=We;exports.resolveKpiTrend=yt;exports.resolveTrend=De;exports.trendFromPoints=ke;exports.trendFromSignedValue=nt;
|
|
2
2
|
//# sourceMappingURL=PerformancePanel.cjs.js.map
|