module.exports=[912532,a=>{"use strict";var b=a.i(22169);a.s(["Card",()=>b.default])},731588,a=>{"use strict";var b=a.i(187924),c=a.i(572131);a.i(807284);var d=a.i(912532),e=a.i(401374),f=a.i(883945);let g={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};a.s(["default",0,function(){let[a,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(!1),k=(0,c.useRef)(null),l=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(a){console.error("Failed to clear console logs:",a)}};return(0,c.useEffect)(()=>{let a=new EventSource("/api/translator/console-logs/stream");return a.onopen=()=>j(!0),a.onmessage=a=>{let b=JSON.parse(a.data);"init"===b.type?h(b.logs.slice(-f.CONSOLE_LOG_CONFIG.maxLines)):"line"===b.type?h(a=>{let c=[...a,b.line];return c.length>f.CONSOLE_LOG_CONFIG.maxLines?c.slice(-f.CONSOLE_LOG_CONFIG.maxLines):c}):"clear"===b.type&&h([])},a.onerror=()=>j(!1),()=>a.close()},[]),(0,c.useEffect)(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[a]),(0,b.jsx)("div",{className:"",children:(0,b.jsxs)(d.Card,{children:[(0,b.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,b.jsx)(e.Button,{size:"sm",variant:"outline",icon:"delete",onClick:l,children:"Clear"})}),(0,b.jsx)("div",{ref:k,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===a.length?(0,b.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,b.jsx)("div",{className:"space-y-0.5",children:a.map((a,c)=>{let d,e;return(0,b.jsx)("div",{children:(e=g[(d=a.match(/\[(\w+)\]/g))?d[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,b.jsx)("span",{className:e,children:a}))},c)})})})]})})}])}];

//# sourceMappingURL=src_0d~5zyr._.js.map