import{r as e,j as s,c as a}from"./vendor-react-Co0R0q1H.js";import{c as t,bP as l,bQ as r,w as c,bR as i,bS as n,bT as o,bU as m,y as d,B as x,bV as p,bE as h,m as g,bW as u}from"./index-nE6cslhy.js";import{P as j,a as y,B as b,C as f}from"./PageLayout-DHM-Wc7R.js";import"./maplibre-gl-b91ci4Kr.js";import"./vendor-core-B_fdKJ1g.js";const v=t("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),N=t("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),w=e.memo(function({log:e}){return s.jsx(g.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:s.jsxs("div",{className:"flex items-baseline gap-3",children:[s.jsx("span",{className:a("type-data-sm w-14 shrink-0",u(e.level)),children:e.level}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:e.message}),s.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(e.timestamp).toLocaleString()})]})]})})});function k({showDebug:e,onToggle:t}){return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:a("type-data-sm",e?"text-sys-orange":"text-sys-cyan"),children:e?"DEBUG":"INFO"}),s.jsx(h,{enabled:e,onChange:t,size:"sm"})]})}function D(){const t=l(),h=r(),g=c(),u=i(),D=n(),[E,P]=e.useState(!1),B=e.useCallback(()=>{P(e=>!e)},[]),C=E?t:t.filter(e=>"DEBUG"!==e.level),L=e.useRef(u);return L.current=u,e.useEffect(()=>{if(!g)return;L.current();const e=setInterval(()=>L.current(),o.logs);return()=>clearInterval(e)},[g]),s.jsxs(j,{children:[s.jsx(y,{title:"System Logs",icon:s.jsx(m,{}),controls:s.jsx(k,{showDebug:E,onToggle:B})}),s.jsx(b,{children:s.jsxs(f,{neomorphic:!0,noPadding:!0,children:[s.jsx(d,{listHeader:!0,icon:s.jsx(m,{className:"icon-sm"}),title:"Log Entries",actions:s.jsx(x,{plain:!0,color:g?"danger":"primary",onClick:()=>D(!g),title:g?"Pause":"Resume",className:a(!g&&"animate-pulse-slow"),children:g?s.jsx(N,{"data-slot":"icon",className:"!w-5 !h-5"}):s.jsx(v,{"data-slot":"icon",className:"!w-5 !h-5"})})}),s.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:h&&0===t.length?s.jsx(p,{count:10}):0===C.length?s.jsx("div",{className:"text-center py-12 text-fg-muted",children:0===t.length?"No logs available":"No logs match selected filters"}):C.map((e,a)=>s.jsx(w,{log:e},`${e.timestamp}-${a}`))})]})})]})}export{D as default};
