import{_ as C}from"./Cd5yfd14.js";import{_ as T}from"./DM9QX0ua.js";import{d as x,G as F,v as h,l as I,s as L,c as a,f as v,e as n,h as e,j as V,t,F as D,p as B,w as H,b as i,q as S,g as X,_ as A}from"./tpFEFzWU.js";import{u as y}from"./Grz13CMP.js";const E={class:"terminal-page"},R={class:"card"},j={class:"section-header"},q={class:"session-badge"},z={key:0,class:"column-badge"},G={key:0,class:"loading"},J={key:1,class:"error-message"},O={key:2,class:"empty"},W={key:3,class:"terminal-content"},Y={class:"log-time"},K={class:"log-level"},M={class:"log-message"},P={class:"actions"},Q=x({__name:"terminal",async setup(U){let o,c;const p=F(),l=p.params.id,u=p.params.sessionId,{data:r}=([o,c]=h(()=>y(`/api/issues/${l}`,"$WXwXsy2rDm")),o=await o,c(),o),f=I(()=>{if(!r.value)return null;const s={id:r.value.key,title:r.value.title,column:r.value.column_slug};return r.value.priority&&(s.priority=r.value.priority),s}),{data:d,status:$,error:g}=([o,c]=h(()=>y(`/api/issues/${l}/history/${u}/log`,"$7VJyO-YXL0")),o=await o,c(),o),k=s=>{const m=new Date(s);return isNaN(m.getTime())?s:m.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})};return L({title:`Terminal ${u} - ${l} - AutoCode`}),(s,m)=>{const w=C,b=T;return i(),a("div",E,[v(w,{issue:e(f),"active-tab":"history"},null,8,["issue"]),n("div",R,[n("div",j,[n("h2",null,t(s.$t("history.viewTerminal")),1),n("span",q,t(e(u)),1),e(d)?.column?(i(),a("span",z,t(e(d).column),1)):V("",!0)]),e($)==="pending"?(i(),a("div",G,t(s.$t("app.loading")),1)):e(g)?(i(),a("div",J,t(e(g).message),1)):e(d)?.logs?.length?(i(),a("div",W,[(i(!0),a(D,null,B(e(d).logs,(_,N)=>(i(),a("div",{key:N,class:S(["log-entry",`log-${_.level}`])},[n("span",Y,t(k(_.timestamp)),1),n("span",K,t(_.level),1),n("span",M,t(_.message),1)],2))),128))])):(i(),a("div",O,t(s.$t("terminal.noLogs")),1))]),n("div",P,[v(b,{to:`/issue/${e(l)}/history`,class:"btn-secondary"},{default:H(()=>[X(t(s.$t("nav.back")),1)]),_:1},8,["to"])])])}}}),os=A(Q,[["__scopeId","data-v-608b488c"]]);export{os as default};
