1import{aN as p,r as i,y as x,j as a,$ as y}from"./index-D0BqTXvF.js";import{M as r}from"./metric-card-BDHEtXxP.js";import{P as h}from"./panel-C3RUmjrx.js";import{R as u,T as g}from"./generateCategoricalChart-Daz18WO_.js";import{L as j,a as l}from"./LineChart-BsKRbCjz.js";import{C as b}from"./CartesianGrid-BdA_mH_j.js";import{X as k,Y as v}from"./YAxis-VGbfXR3p.js";import{f as n}from"./format-PliGeAVb.js";import"./index-8OimGdHJ.js";import"./index-Chjiymov.js";import"./string-cKWu9XK9.js";import"./en-US-BZ0UpF_e.js";function K(){const{date:t}=p(),[e,m]=i.useState({summary:{},chart:[]}),[c,o]=i.useState(!0);i.useEffect(()=>{d()},[t]);const d=async()=>{o(!0);try{const s={};t?.from&&(s.startDate=n(t.from,"yyyy-MM-dd")),t?.to&&(s.endDate=n(t.to,"yyyy-MM-dd"));const f=await x.get("/api/app/analytics/chatbot",{params:s});m(f.data||{summary:{},chart:[]})}catch(s){console.error(s)}finally{o(!1)}};return c?a.jsx("div",{className:"flex h-full items-center justify-center",children:a.jsx(y,{className:"w-10 h-10 animate-spin text-primary"})}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2.5",children:[a.jsx(r,{title:"Total Trigger",value:e.summary.total_triggers||0}),a.jsx(r,{title:"Ditangani AI",value:e.summary.ai_handled||0}),a.jsx(r,{title:"Fallback",value:e.summary.fallback||0}),a.jsx(r,{title:"Avg Response",value:e.summary.avg_response||"0s"})]}),a.jsx(h,{title:"Aktivitas Chatbot",bodyClass:"h-[220px] p-3",children:a.jsx(u,{width:"100%",height:"100%",children:a.jsxs(j,{data:e.chart,children:[a.jsx(b,{strokeDasharray:"3 3",vertical:!1,stroke:"#e2e8f0"}),a.jsx(k,{dataKey:"time",tick:{fontSize:10,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),a.jsx(v,{tick:{fontSize:10,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),a.jsx(g,{contentStyle:{fontSize:"12px",borderRadius:"10px",border:"1px solid #e2e8f0",boxShadow:"0 6px 16px -8px rgba(15,23,42,.18)"}}),a.jsx(l,{type:"monotone",dataKey:"triggers",stroke:"#8b5cf6",strokeWidth:2,name:"Triggers",dot:!1}),a.jsx(l,{type:"monotone",dataKey:"fallback",stroke:"#ef4444",strokeWidth:2,name:"Fallback",dot:!1})]})})})]})}export{K 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.