(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{1774:(e,t,l)=>{Promise.resolve().then(l.bind(l,46863))},46863:(e,t,l)=>{"use strict";l.d(t,{default:()=>c});var a=l(95155),s=l(12115),r=l(82556),n=l(90620);let u={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function c(){let[e,t]=(0,s.useState)([]),[,l]=(0,s.useState)(!1),c=(0,s.useRef)(null),d=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,s.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>l(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-n.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>n.UY.maxLines?t.slice(-n.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>l(!1),()=>e.close()},[]),(0,s.useEffect)(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e]),(0,a.jsx)("div",{className:"",children:(0,a.jsxs)(r.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,a.jsx)(r.$n,{size:"sm",variant:"outline",icon:"Trash2",onClick:d,children:"Clear"})}),(0,a.jsx)("div",{ref:c,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,a.jsx)("span",{className:"text-[var(--text-secondary)]",children:"No console logs yet."}):(0,a.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,s;return(0,a.jsx)("div",{children:(s=u[((l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null)??"LOG"]||"text-green-400",(0,a.jsx)("span",{className:s,children:e}))},t)})})})]})})}},82556:(e,t,l)=>{"use strict";l.d(t,{x0:()=>w.default,Ex:()=>d.default,$n:()=>a.default,Zp:()=>n.default,Qv:()=>c.CardSkeleton,CK:()=>p.default,G9:()=>N.default,wI:()=>y.default,vj:()=>j.default,vE:()=>E.default,pd:()=>s.default,Mh:()=>g.default,uR:()=>x.default,Nf:()=>h.default,aF:()=>u.default,rq:()=>i.default,gw:()=>b.default,LF:()=>f.default,Wx:()=>O.default,gM:()=>m.default,Iz:()=>k.default,l6:()=>r.default,lM:()=>o.default,m_:()=>L.default,jK:()=>v.default});var a=l(35806),s=l(34422),r=l(42994),n=l(81060),u=l(71361),c=l(42267);l(55121);var d=l(64599),o=l(19790);l(83090),l(55846),l(41605),l(35804),l(99023);var f=l(80178),i=l(85444),x=l(91961),p=l(24537),h=l(36090),v=l(8158);l(33573),l(33228),l(8952),l(25079);var m=l(15049);l(1652);var g=l(92701);l(18150);var N=l(71689),E=l(66440),j=l(88472),y=l(60229),w=l(91332),b=l(72113),k=l(33709),L=l(20728),O=l(51939);l(98248),l(97050)}},e=>{e.O(0,[2574,5730,3862,7924,3242,8475,8500,131,1327,6173,3795,7467,6357,5816,85,9208,1131,8441,3794,7358],()=>e(e.s=1774)),_N_E=e.O()}]);