PageSourceSearch

https://app.elxchatbot.ai/assets/MessageVsResponseTime-DiPiDsTE.js

js elxchatbot.ai collected 2026-10-02 06:24:12 UTC 4,587 bytes, 1 lines download raw bytes

1import{gu as C,j as s,B as r,T as l,gv as A,a2 as i,a1 as R,s as T,gw as v,r as j,gx as D,fp as Y,Y as p,fu as E}from"./index-CCrC0TJJ.js";import{L as _}from"./LineChart-psBOQ-ZC.js";p.extend(E);const M={left:60,right:60,top:60,bottom:80},b=400,w=["YYYY-MM-DD","DD-MM-YYYY","MM/DD/YYYY"],m=e=>{if(!e)return null;if(p.isDayjs(e))return e.isValid()?e:null;const t=p(e,w,!0);if(t.isValid())return t;const o=p(e);return o.isValid()?o:null},S=e=>{const t=m(e);return t?t.format("MM/DD/YYYY"):e?String(e):""},N=(e,t,o)=>{const d=m(t),c=m(o);return!d||!c?e:e.filter(n=>{const a=m(n.created_date??n.date??n.day??n.label);return a?!a.isBefore(d,"day")&&!a.isAfter(c,"day"):!0})},k=e=>{if(!e||e.error||e.success===!1)return[];const t=e?.data?.grouped_data;return Array.isArray(t)?t:Array.isArray(e?.grouped_data)?e.grouped_data:Array.isArray(e?.data)?e.data:[]},$=e=>e.map(t=>({date:S(t.created_date??t.date??t.day??t.label),messages:Number(t.total_messages??t.messages??t.message_count??0),responseTime:parseFloat(Number(t.avg_response_time??t.average_response_time??t.response_time??0).toFixed(2))})),y=T(v)(({theme:{spacing:e}})=>({padding:e(3)})),F=({xAxisLabels:e,messagesData:t,responseTimeData:o,resetKey:d})=>{const c=j.useRef(null),[n,a]=j.useState(0);return j.useEffect(()=>{const x=c.current;if(!x||typeof ResizeObserver>"u")return;const u=h=>{typeof h=="number"&&h>0&&a(Math.floor(h))},f=new ResizeObserver(h=>{u(h[0]?.contentRect?.width)});return f.observe(x),u(x.getBoundingClientRect().width),()=>f.disconnect()},[]),s.jsxs(y,{children:[s.jsx(r,{ref:c,sx:{width:"100%"},children:s.jsx(D,{children:s.jsx(r,{sx:{position:"relative",width:"100%",height:b},children:n>1&&s.jsxs(s.Fragment,{children:[s.jsx(Y,{width:n,height:b,margin:M,xAxis:[{scaleType:"band",data:e,categoryGapRatio:.3,barGapRatio:0,tickLabelStyle:{angle:-45,textAnchor:"end",fontSize:12,fill:i.colors.neutral[700]}}],series:[{data:t,color:i.colors.purple[300],label:"No. of Messages"}],slotProps:{legend:{hidden:!0}},sx:{width:"100%"}},`msg-bars-${d}-${e.join("|")}-${t.join(",")}-${n}`),s.jsx(r,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:s.jsx(_,{width:n,height:b,margin:M,xAxis:[{scaleType:"band",data:e,tickLabelStyle:{angle:-45,textAnchor:"end",fontSize:12,fill:i.colors.neutral[700]}}],series:[{data:o,label:"Avg. Response Time (seconds)",color:i.colors.orange[300],curve:"linear"}],leftAxis:null,rightAxis:{tickLabelStyle:{fontSize:12,fill:i.colors.neutral[700]}},slotProps:{legend:{hidden:!0}},sx:{width:"100%","& .MuiLineElement-root":{strokeWidth:3},"& .MuiMarkElement-root":{strokeWidth:2,r:4},"& .MuiLineElement-root, & .MuiMarkElement-root":{pointerEvents:"auto"}}},`msg-line-${d}-${e.join("|")}-${o.join(",")}-${n}`)})]})})})}),s.jsxs(r,{sx:{display:"flex",justifyContent:"center",gap:3,mt:2,fontSize:"0.875rem"},children:[s.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(r,{sx:{width:16,height:16,backgroundColor:i.colors.purple[300]}}),s.jsx(l,{variant:"body-xs",children:"No. of messages"})]}),s.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(r,{sx:{width:16,height:16,backgroundColor:i.colors.orange[300]}}),s.jsx(l,{variant:"body-xs",children:"Avg. response time (seconds)"})]})]})]})},I=({from_date:e,to_date:t})=>{const{data:o,isLoading:d,isError:c}=C(e,t),n=c||!!o?.error||o?.success===!1,a=$(N(k(o),e,t)),x=a.map(g=>g.date),u=a.map(g=>g.messages),f=a.map(g=>g.responseTime),h=`${e}|${t}`;return d?s.jsxs(r,{children:[s.jsx(l,{variant:"h5-semibold",sx:{mb:2,fontWeight:600},children:"No. of messages vs response time"}),s.jsx(y,{children:s.jsx(A,{children:s.jsx(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:300},children:s.jsx(l,{sx:{color:i.colors.neutral[700]},children:"Loading..."})})})})]}):n?s.jsxs(r,{children:[s.jsx(l,{variant:"h5-semibold",sx:{mb:2,fontWeight:600},children:"No. of messages vs response time"}),s.jsx(y,{children:s.jsx(A,{children:s.jsx(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:300},children:s.jsx(l,{sx:{color:i.error.main},children:"Error loading data"})})})})]}):a.length?s.jsxs(r,{children:[s.jsx(l,{variant:"h5-semibold",sx:{mb:2,fontWeight:600},children:"No. of messages vs response time"}),s.jsx(F,{xAxisLabels:x,messagesData:u,responseTimeData:f,resetKey:h})]}):s.jsxs(r,{children:[s.jsx(l,{variant:"h5-semibold",sx:{mb:2,fontWeight:600},children:"No. of messages vs response time"}),s.jsx(R,{content:"No messages and response time data available for the selected date range"})]})};export{I as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.