PageSourceSearch

https://towmatic.ai/static/js/2548.a09b8782.chunk.js

js towmatic.ai collected 2026-09-25 03:32:36 UTC 21,471 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[2548],{12548(e,t,s){s.r(t),s.d(t,{default:()=>E});var a=s(53986),l=s(89379),n=s(65043),i=s(44687),r=s(83124),c=s(13390),o=s(91140),d=s(92264),m=s(31555),x=s(56328),h=s(56790),u=s(26405),p=s(75088),j=s(73062),g=s(91286),f=s(46963),b=s(44919),v=s(70095),y=s(80379),N=s(41180),w=s(87734),k=s(28791),F=s(35963),_=s(88234),C=s(52185),A=s(6026),D=s(82291),R=s(877),S=s(16350),W=s(95316),M=s(58002),O=s(70579);const T=["dateObj"];function E(){const{user:e}=(0,r.A)(),{ready:t}=(0,W.o)(),[s,E]=(0,n.useState)([]),[G,I]=(0,n.useState)([]),[K,P]=(0,n.useState)(!0),Z=175,z=e=>{const t=e.getFullYear(),s=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(s,"-").concat(a)},Y=()=>{const e=new Date,t=new Date(e);return t.setDate(t.getDate()-1),{start:z(t),end:z(e)}},U=Y(),[$,B]=(0,n.useState)(U.start),[J,L]=(0,n.useState)(U.end),Q=e=>{if(!e)return null;try{const t=new Date(e);if(!isNaN(t.getTime()))return t;const s=e.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})\s+(\d{1,2}):(\d{2})\s*(AM|PM)?/i);if(s){let[,e,t,a,l,n,i]=s;return l=parseInt(l),i&&("PM"===i.toUpperCase()&&12!==l&&(l+=12),"AM"===i.toUpperCase()&&12===l&&(l=0)),new Date(a,e-1,t,l,parseInt(n))}return null}catch(t){return null}},V=(0,n.useCallback)(async()=>{if(null!==e&&void 0!==e&&e.company_id)try{const[t,s]=await Promise.all([i.sheetsAPI.getCallLogsFromSheet(e.company_id),i.sheetsAPI.getMasterJobLog(e.company_id)]),a=t.data.calls||[],l=s.data.jobs||[];if(E(a),I(l),a.length>0){let e=null,t=null;a.forEach(s=>{const a=Q(s.timestamp);a&&((!e||a<e)&&(e=a),(!t||a>t)&&(t=a))})}}catch(t){console.error("Error fetching analytics data:",t),x.toast.error("Failed to load analytics data. Please refresh page")}finally{P(!1)}else P(!1)},[null===e||void 0===e?void 0:e.company_id]);(0,n.useEffect)(()=>{V()},[V]);const q=(0,n.useMemo)(()=>s.filter(e=>{if($&&e.timestamp){const t=Q(e.timestamp);if(!t)return!0;const[s,a,l]=$.split("-").map(Number);if(t<new Date(s,a-1,l,0,0,0,0))return!1}if(J&&e.timestamp){const t=Q(e.timestamp);if(!t)return!0;const[s,a,l]=J.split("-").map(Number);if(t>new Date(s,a-1,l,23,59,59,999))return!1}return!0}),[s,$,J]),X=(0,n.useMemo)(()=>G.filter(e=>{if(e.cancelled)return!1;if(!e.timestamp_booked)return!1;const t=Q(e.timestamp_booked);if(!t)return!1;if($){const[e,s,a]=$.split("-").map(Number);if(t<new Date(e,s-1,a,0,0,0,0))return!1}if(J){const[e,s,a]=J.split("-").map(Number);if(t>new Date(e,s-1,a,23,59,59,999))return!1}return!0}),[G,$,J]),H=(0,n.useMemo)(()=>{let e=0,t=0,s=0,a=0;return X.forEach(l=>{l.price&&l.price>0?(e++,s+=l.price):(t++,a+=Z)}),{total:s+a,actual:s,estimated:a,jobsWithPrice:e,jobsWithoutPrice:t,totalJobs:e+t,hasEstimates:t>0}},[X,Z]),ee=(0,n.useMemo)(()=>{const e=q.length,t=q.reduce((e,t)=>e+(t.cost||0),0);return{totalCost:t,totalMinutes:q.reduce((e,t)=>e+(t.duration_seconds||0),0)/60,totalCalls:e,avgCostPerCall:e>0?t/e:0}},[q]),te=(0,n.useMemo)(()=>{const e={};return q.forEach(t=>{const s=Q(t.timestamp);if(!s)return;const a="".concat(s.getMonth()+1,"/").concat(s.getDate(),"/").concat(s.getFullYear());e[a]||(e[a]={date:a,dateObj:new Date(s.getFullYear(),s.getMonth(),s.getDate()),calls:0,cost:0,minutes:0}),e[a].calls+=1,e[a].cost+=t.cost||0,e[a].minutes+=(t.duration_seconds||0)/60}),Object.values(e).sort((e,t)=>e.dateObj-t.dateObj).map(e=>({date:e.date,calls:e.calls,cost:parseFloat(e.cost.toFixed(2)),minutes:parseFloat(e.minutes.toFixed(1))}))},[q]),se=(0,n.useMemo)(()=>{const e={};return X.forEach(t=>{const s=Q(t.timestamp_booked);if(!s)return;const a="".concat(s.getMonth()+1,"/").concat(s.getDate(),"/").concat(s.getFullYear());e[a]||(e[a]={date:a,dateObj:new Date(s.getFullYear(),s.getMonth(),s.getDate()),actualRevenue:0,estimatedRevenue:0,totalRevenue:0,jobs:0}),e[a].jobs+=1,t.price&&t.price>0?(e[a].actualRevenue+=t.price,e[a].totalRevenue+=t.price):(e[a].estimatedRevenue+=Z,e[a].totalRevenue+=Z)}),Object.values(e).sort((e,t)=>e.dateObj-t.dateObj).map(e=>({date:e.date,actualRevenue:parseFloat(e.actualRevenue.toFixed(2)),estimatedRevenue:parseFloat(e.estimatedRevenue.toFixed(2)),totalRevenue:parseFloat(e.totalRevenue.toFixed(2)),jobs:e.jobs}))},[X,Z]),ae=(0,n.useMemo)(()=>{const e=(e,t,s,a)=>({label:e,key:t,color:s,Icon:a,count:0,actualRevenue:0,estimatedRevenue:0,get totalRevenue(){return this.actualRevenue+this.estimatedRevenue}}),t={voice_ai:e("Voice AI","voice_ai","#F97316",g.A),web_form:e("Online Form","web_form","#F59E0B",u.A),app:e("App","app","#3B82F6",f.A)};
1X.forEach(e=>{const s="app"===e.submission_type?"app":"web_form"===e.submission_type?"web_form":"voice_ai",a=t[s];a.count+=1,e.price&&e.price>0?a.actualRevenue+=e.price:a.estimatedRevenue+=Z});const s=t.voice_ai.count+t.web_form.count+t.app.count,a=e=>(0,l.A)((0,l.A)({},e),{},{totalRevenue:e.actualRevenue+e.estimatedRevenue,pct:s>0?e.count/s*100:0});return{totalCount:s,voice_ai:a(t.voice_ai),web_form:a(t.web_form),app:a(t.app),get visibleTiles(){const e=[this.voice_ai];return this.web_form.count>0&&e.push(this.web_form),this.app.count>0&&e.push(this.app),e}}},[X,Z]),le=(0,n.useMemo)(()=>{const e={};return X.forEach(t=>{const s=Q(t.timestamp_booked);if(!s)return;const a="".concat(s.getMonth()+1,"/").concat(s.getDate(),"/").concat(s.getFullYear());e[a]||(e[a]={date:a,dateObj:new Date(s.getFullYear(),s.getMonth(),s.getDate()),voice_ai:0,web_form:0,app:0});const l="app"===t.submission_type?"app":"web_form"===t.submission_type?"web_form":"voice_ai";e[a][l]+=1}),Object.values(e).sort((e,t)=>e.dateObj-t.dateObj).map(e=>{let{dateObj:t}=e;return(0,a.A)(e,T)})},[X]),ne=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e),ie=e=>{let{active:t,payload:s,label:a,valuePrefix:l="",valueSuffix:n=""}=e;return t&&s&&s.length?(0,O.jsxs)("div",{className:"bg-white p-2 border rounded shadow-sm",children:[(0,O.jsx)("p",{className:"text-sm font-medium",children:a}),(0,O.jsxs)("p",{className:"text-sm text-brand-orange-500",children:[l,s[0].value.toLocaleString(),n]})]}):null},re=e=>{let{active:t,payload:s,label:a}=e;if(t&&s&&s.length){const e=s[0].payload;return(0,O.jsxs)("div",{className:"bg-white p-3 border rounded shadow-sm",children:[(0,O.jsx)("p",{className:"text-sm font-medium mb-2",children:a}),(0,O.jsxs)("p",{className:"text-sm text-green-600",children:["Total: ",ne(e.totalRevenue)]}),e.estimatedRevenue>0&&(0,O.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:["(Includes ",ne(e.estimatedRevenue)," estimated*)"]}),(0,O.jsxs)("p",{className:"text-xs text-gray-400 mt-1",children:[e.jobs," job",1!==e.jobs?"s":""," booked"]})]})}return null};return(0,O.jsxs)("div",{className:"p-4 md:p-8 bg-gray-50 min-h-screen",children:[!t&&(0,O.jsx)(M.A,{}),(0,O.jsx)(o.Zp,{className:"mb-6",children:(0,O.jsxs)(o.Wu,{className:"p-6",children:[(0,O.jsx)("h3",{className:"text-lg font-heading font-bold text-center mb-6",children:"Date Range Filter"}),(0,O.jsxs)("div",{className:"flex flex-col sm:flex-row items-end justify-center gap-4",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("label",{className:"text-sm text-gray-600 mb-1 block",children:"From Date"}),(0,O.jsx)(d.p,{type:"date",value:$,onChange:e=>B(e.target.value),className:"w-48","data-testid":"analytics-start-date"})]}),(0,O.jsxs)("div",{children:[(0,O.jsx)("label",{className:"text-sm text-gray-600 mb-1 block",children:"To Date"}),(0,O.jsx)(d.p,{type:"date",value:J,onChange:e=>L(e.target.value),className:"w-48","data-testid":"analytics-end-date"})]}),(0,O.jsx)(c.$,{variant:"outline",onClick:()=>{const e=Y();B(e.start),L(e.end)},"data-testid":"analytics-clear-btn",children:"Clear"})]})]})}),K?(0,O.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:Array.from({length:4}).map((e,t)=>(0,O.jsx)(o.Zp,{children:(0,O.jsxs)(o.Wu,{className:"p-6",children:[(0,O.jsx)(m.E,{className:"h-4 w-24 mb-2"}),(0,O.jsx)(m.E,{className:"h-10 w-32"})]})},t))}):(0,O.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6","data-testid":"analytics-stats",children:[(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsx)(o.Wu,{className:"p-6",children:(0,O.jsxs)("div",{className:"flex items-start justify-between",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("p",{className:"text-sm text-gray-500 mb-1",children:"Total Cost"}),(0,O.jsxs)("p",{className:"text-3xl font-heading font-bold text-gray-900",children:["$",ee.totalCost.toFixed(4)]}),(0,O.jsxs)("p",{className:"text-sm text-gray-400 mt-1",children:["Across ",ee.totalCalls," calls"]})]}),(0,O.jsx)(j.A,{className:"w-5 h-5 text-brand-orange-500"})]})})}),(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsx)(o.Wu,{className:"p-6",children:(0,O.jsxs)("div",{className:"flex items-start justify-between",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("p",{className:"text-sm text-gray-500 mb-1",children:"Calling Minutes"}),(0,O.jsx)("p",{className:"text-3xl font-heading font-bold text-gray-900",children:ee.totalMinutes.toFixed(1)}),(0,O.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"Total minutes used"})]}),(0,O.jsx)(p.A,{className:"w-5 h-5 text-brand-orange-500"})]})})}),(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsx)(o.Wu,{className:"p-6",children:(0,O.jsxs)("div",{className:"flex items-start justify-between",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("p",{className:"text-sm text-gray-500 mb-1",children:"Number of Calls"}),(0,O.jsx)("p",{className:"text-3xl font-heading font-bold text-gray-900",children:ee.totalCalls}),(0,O.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"Total calls made"})]}),(0,O.jsx)(g.A,{className:"w-5 h-5 text-brand-orange-500"})]})})}),(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsx)(o.Wu,{className:"p-6",children:(0,O.jsxs)("div",{className:"flex items-start justify-between",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)("p",{className:"text-sm text-gray-500 mb-1",children:"Avg Cost per Call"}),(0,O.jsxs)("p",{className:"text-3xl font-heading font-bold text-gray-900",children:["$",ee.avgCostPerCall.toFixed(4)]}),(0,O.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"Average per call"})]}),(0,O.jsx)(b.A,{className:"w-5 h-5 text-brand-orange-500"})]})})})]}),!K&&(0,O.jsx)(o.Zp,{className:"mb-6 bg-gradient-to-br from-green-50 to-emerald-50 border-green-200",children:(0,O.jsx)(o.Wu,{className:"p-6",children:(0,O.jsxs)("div",{className:"flex items-start justify-between",children:[(0,O.jsxs)("div",{className:"flex-1",children:[(0,O.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,O.jsx)("p",{className:"text-sm font-medium text-green-700",children:"Revenue Captured by Towmatic"}),H.hasEstimates&&(0,O.jsx)("span",{className:"text-green-600",children:"*"})]}),(0,O.jsx)("p",{className:"text-4xl font-heading font-bold text-green-700",children:ne(H.total)}),(0,O.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,O.jsxs)("p",{className:"text-sm text-green-600",children:[H.totalJobs," job",1!==H.totalJobs?"s":""," booked"]}),H.hasEstimates&&(0,O.jsxs)("p",{className:"text-xs text-green-600/70",children:["(",ne(H.actual)," quoted + ",ne(H.estimated)," estimated)"]})]}),H.hasEstimates&&(0,O.jsx)("p",{className:"text-xs text-green-600/60 mt-3 italic",children:"*Some revenue is estimated based on average job values when quotes weren't provided"})]}),(0,O.jsx)("div",{className:"p-3 bg-green-100 rounded-xl",children:(0,O.jsx)(h.A,{className:"w-8 h-8 text-green-600"})})]})})}),!K&&ae.totalCount>0&&(0,O.jsx)(o.Zp,{className:"mb-6 bg-white","data-testid":"analytics-booking-channels",children:(0,O.jsxs)(o.Wu,{className:"p-4 sm:p-6",children:[(0,O.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1 mb-4 sm:mb-5",children:[(0,O.jsx)("h3",{className:"text-lg font-heading font-bold",children:"Booking Channels"}),(0,O.jsxs)("p",{className:"text-xs sm:text-sm text-gray-500",children:["Where ",ae.totalCount," booking",1!==ae.totalCount?"s":""," came from"]})]}),(0,O.jsx)("div",{className:"grid gap-3 sm:gap-4 mb-5 sm:mb-6 grid-cols-1 ".concat(1===ae.visibleTiles.length?"":2===ae.visibleTiles.length?"sm:grid-cols-2":"sm:grid-cols-3"),children:ae.visibleTiles.map(e=>{const t=e.Icon;return(0,O.jsxs)("div",{"data-testid":"analytics-channel-tile-".concat(e.key.replace("_","-")),className:"rounded-xl border border-gray-200 bg-white p-4 flex flex-col gap-2 hover:shadow-sm transition-shadow",style:{borderLeft:"4px solid ".concat(e.color)},children:[(0,O.jsxs)("div",{className:"flex items-center justify-between",children:[(0,O.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e.label}),(0,O.jsx)("div",{className:"p-2 rounded-lg",style:{backgroundColor:"".concat(e.color,"1A")},children:(0,O.jsx)(t,{className:"w-4 h-4",style:{color:e.color}})})]}),(0,O.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,O.jsx)("span",{className:"text-2xl sm:text-3xl font-heading font-bold text-gray-900",children:e.count}),(0,O.jsxs)("span",{className:"text-xs text-gray-500",children:[e.pct.toFixed(0),"% of bookings"]})]}),(0,O.jsxs)("p",{className:"text-sm font-semibold",style:{color:e.color},children:[ne(e.totalRevenue)," captured"]})]},e.key)})}),ae.visibleTiles.length>1&&(0,O.jsxs)("div",{"data-testid":"analytics-channel-bar",className:"mb-5 sm:mb-6",children:[(0,O.jsx)("div",{className:"flex w-full h-3 rounded-full overflow-hidden bg-gray-100",children:ae.visibleTiles.map(e=>e.pct>0&&(0,O.jsx)("div",{className:"h-full first:rounded-l-full last:rounded-r-full transition-all",style:{width:"".concat(e.pct,"%"),backgroundColor:e.color},title:"".concat(e.label,": ").concat(e.pct.toFixed(1),"%")},e.key))}),(0,O.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-2",children:ae.visibleTiles.map(e=>(0,O.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-gray-600",children:[(0,O.jsx)("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),(0,O.jsx)("span",{children:e.label}),(0,O.jsx)("span",{className:"text-gray-400",children:"\xb7"}),(0,O.jsxs)("span",{className:"font-medium text-gray-700",children:[e.pct.toFixed(0),"%"]})]},e.key))})]}),le.length>0&&ae.visibleTiles.length>1&&(0,O.jsxs)("div",{"data-testid":"analytics-channel-trend-chart",children:[(0,O.jsx)("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:"Daily Bookings by Channel"}),(0,O.jsx)("div",{className:"h-56 sm:h-64 -mx-2 sm:mx-0",children:(0,O.jsx)(N.u,{width:"100%",height:"100%",children:(0,O.jsxs)(R.Q,{data:le,children:[(0,O.jsx)(w.d,{strokeDasharray:"3 3",stroke:"#F3F4F6",vertical:!1}),(0,O.jsx)(C.W,{dataKey:"date",tick:{fontSize:10},angle:-45,textAnchor:"end",height:55}),(0,O.jsx)(A.h,{tick:{fontSize:11},allowDecimals:!1}),(0,O.jsx)(y.m,{content:e=>{let{active:t,payload:s,label:a}=e;if(!t||null===s||void 0===s||!s.length)return null;const l=s.reduce((e,t)=>
1e+(t.value||0),0);return(0,O.jsxs)("div",{className:"bg-white p-3 border rounded shadow-sm text-xs",children:[(0,O.jsx)("p",{className:"font-medium mb-2 text-sm",children:a}),s.slice().reverse().map(e=>e.value>0&&(0,O.jsxs)("p",{style:{color:e.color},children:[e.name,": ",e.value]},e.dataKey)),(0,O.jsxs)("p",{className:"mt-1 pt-1 border-t border-gray-100 text-gray-500",children:["Total: ",l]})]})}}),(0,O.jsx)(v.s,{wrapperStyle:{fontSize:"11px",paddingTop:"8px"},iconType:"circle",iconSize:8}),(0,O.jsx)(F.Gk,{type:"monotone",dataKey:"voice_ai",name:"Voice AI",stackId:"channels",stroke:ae.voice_ai.color,fill:ae.voice_ai.color,fillOpacity:.7,hide:0===ae.voice_ai.count}),(0,O.jsx)(F.Gk,{type:"monotone",dataKey:"web_form",name:"Online Form",stackId:"channels",stroke:ae.web_form.color,fill:ae.web_form.color,fillOpacity:.7,hide:0===ae.web_form.count}),(0,O.jsx)(F.Gk,{type:"monotone",dataKey:"app",name:"App",stackId:"channels",stroke:ae.app.color,fill:ae.app.color,fillOpacity:.7,hide:0===ae.app.count})]})})})]})]})}),!K&&te.length>0&&(0,O.jsxs)("div",{className:"space-y-6",children:[se.length>0&&(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsxs)(o.Wu,{className:"p-6",children:[(0,O.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,O.jsx)("h3",{className:"text-lg font-heading font-bold",children:"Revenue Captured by Towmatic"}),H.hasEstimates&&(0,O.jsx)("span",{className:"text-xs text-gray-500 italic",children:"*Includes estimated values"})]}),(0,O.jsx)("div",{className:"h-64",children:(0,O.jsx)(N.u,{width:"100%",height:"100%",children:(0,O.jsxs)(S.X,{data:se,children:[(0,O.jsx)("defs",{children:(0,O.jsxs)("linearGradient",{id:"revenueGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,O.jsx)("stop",{offset:"5%",stopColor:"#22c55e",stopOpacity:.3}),(0,O.jsx)("stop",{offset:"95%",stopColor:"#22c55e",stopOpacity:.05})]})}),(0,O.jsx)(C.W,{dataKey:"date",tick:{fontSize:10},angle:-45,textAnchor:"end",height:60}),(0,O.jsx)(A.h,{tick:{fontSize:12},tickFormatter:e=>"$".concat(e)}),(0,O.jsx)(y.m,{content:(0,O.jsx)(re,{})}),(0,O.jsx)(F.Gk,{type:"monotone",dataKey:"totalRevenue",stroke:"#22c55e",strokeWidth:2,fill:"url(#revenueGradient)"}),(0,O.jsx)(k.N1,{type:"monotone",dataKey:"totalRevenue",stroke:"#22c55e",strokeWidth:2,dot:{fill:"#fff",stroke:"#22c55e",strokeWidth:2,r:4}})]})})}),(0,O.jsx)("div",{className:"flex justify-center mt-4",children:(0,O.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,O.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,O.jsx)("span",{children:"Daily Revenue"})]})})]})}),(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsxs)(o.Wu,{className:"p-6",children:[(0,O.jsx)("h3",{className:"text-lg font-heading font-bold mb-4",children:"Daily Call Volume"}),(0,O.jsx)("div",{className:"h-64",children:(0,O.jsx)(N.u,{width:"100%",height:"100%",children:(0,O.jsxs)(D.E,{data:te,children:[(0,O.jsx)(C.W,{dataKey:"date",tick:{fontSize:10},angle:-45,textAnchor:"end",height:60}),(0,O.jsx)(A.h,{tick:{fontSize:12}}),(0,O.jsx)(y.m,{content:(0,O.jsx)(ie,{valueSuffix:" calls"})}),(0,O.jsx)(_.yP,{dataKey:"calls",fill:"#F97316",radius:[4,4,0,0]})]})})})]})}),(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsxs)(o.Wu,{className:"p-6",children:[(0,O.jsx)("h3",{className:"text-lg font-heading font-bold mb-4",children:"Daily Cost Trend"}),(0,O.jsx)("div",{className:"h-64",children:(0,O.jsx)(N.u,{width:"100%",height:"100%",children:(0,O.jsxs)(R.Q,{data:te,children:[(0,O.jsx)("defs",{children:(0,O.jsxs)("linearGradient",{id:"costGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,O.jsx)("stop",{offset:"5%",stopColor:"#F97316",stopOpacity:.3}),(0,O.jsx)("stop",{offset:"95%",stopColor:"#F97316",stopOpacity:.05})]})}),(0,O.jsx)(C.W,{dataKey:"date",tick:{fontSize:10},angle:-45,textAnchor:"end",height:60}),(0,O.jsx)(A.h,{tick:{fontSize:12}}),(0,O.jsx)(y.m,{content:(0,O.jsx)(ie,{valuePrefix:"$"})}),(0,O.jsx)(F.Gk,{type:"monotone",dataKey:"cost",stroke:"#F97316",strokeWidth:2,fill:"url(#costGradient)",dot:{fill:"#fff",stroke:"#F97316",strokeWidth:2,r:3}})]})})})]})}),(0,O.jsx)(o.Zp,{className:"bg-white",children:(0,O.jsxs)(o.Wu,{className:"p-6",children:[(0,O.jsx)("h3",{className:"text-lg font-heading font-bold mb-4",children:"Daily Minutes Usage"}),(0,O.jsx)("div",{className:"h-64",children:(0,O.jsx)(N.u,{width:"100%",height:"100%",children:(0,O.jsxs)(R.Q,{data:te,children:[(0,O.jsx)("defs",{children:(0,O.jsxs)("linearGradient",{id:"minutesGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,O.jsx)("stop",{offset:"5%",
1stopColor:"#F97316",stopOpacity:.3}),(0,O.jsx)("stop",{offset:"95%",stopColor:"#F97316",stopOpacity:.05})]})}),(0,O.jsx)(C.W,{dataKey:"date",tick:{fontSize:10},angle:-45,textAnchor:"end",height:60}),(0,O.jsx)(A.h,{tick:{fontSize:12}}),(0,O.jsx)(y.m,{content:(0,O.jsx)(ie,{valueSuffix:" min"})}),(0,O.jsx)(F.Gk,{type:"monotone",dataKey:"minutes",stroke:"#F97316",strokeWidth:2,fill:"url(#minutesGradient)",dot:{fill:"#fff",stroke:"#F97316",strokeWidth:2,r:3}})]})})}),(0,O.jsx)("div",{className:"flex justify-center mt-4",children:(0,O.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,O.jsx)("div",{className:"w-3 h-3 rounded-full bg-brand-orange-500"}),(0,O.jsx)("span",{children:"Minutes"})]})})]})})]}),!K&&0===te.length&&(0,O.jsx)(o.Zp,{children:(0,O.jsxs)(o.Wu,{className:"p-8 text-center text-gray-500",children:[(0,O.jsx)(g.A,{className:"w-12 h-12 mx-auto mb-3 text-gray-300"}),(0,O.jsx)("p",{children:"No call data available for the selected date range"})]})})]})}},31555(e,t,s){s.d(t,{E:()=>c});var a=s(89379),l=s(53986),n=s(99766),i=s(70579);const r=["className"];function c(e){let{className:t}=e,s=(0,l.A)(e,r);return(0,i.jsx)("div",(0,a.A)({className:(0,n.cn)("animate-pulse rounded-md bg-primary/10",t)},s))}},58002(e,t,s){s.d(t,{A:()=>n});var a=s(75088),l=s(70579);function n(){return(0,l.jsxs)("div",{className:"mb-4 flex items-start gap-3 rounded-lg border border-orange-200 bg-orange-50 px-4 py-3","data-testid":"setup-in-progress-banner",children:[(0,l.jsx)(a.A,{className:"h-5 w-5 flex-shrink-0 text-orange-500 mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 text-sm",children:[(0,l.jsx)("p",{className:"font-medium text-orange-900",children:"Your dashboard is still being set up"}),(0,l.jsx)("p",{className:"mt-0.5 text-orange-800",children:"Data will start appearing here once your agency completes the wire-up. You'll receive a welcome email the moment everything is live."})]})]})}}}]);
2//# sourceMappingURL=2548.a09b8782.chunk.js.map

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.