import{d as j,U as F,M as U,g as n,p as V,I as H,am as L,aA as f,ap as M,c as r,j as t,a as c,l as i,a2 as q,o as p,n as u,u as e,aB as E,aC as R,H as J,q as m,aD as O,t as P,i as Q,aE as Y,aF as $,ay as z,A as G,af as K}from"./index-bJiZR03d.js";import{u as W}from"./usePageTitle-wT6f1BZv.js";const ta=j({__name:"TaskRun",setup(X){const g=q(),k=F("taskRunId"),d=U(),T=n(()=>[{label:"Details",hidden:V.xl},{label:"Logs"},{label:"Artifacts"},{label:"Task Inputs"}]),l=H("tab","Logs"),{tabs:b}=L(T,l),y=n(()=>k.value?[k.value]:null),I=f(d.taskRuns.getTaskRun,y,{interval:3e4}),a=n(()=>I.response),o=n(()=>{var s;return(s=a.value)==null?void 0:s.flowRunId}),w=n(()=>o.value?[o.value]:null),h=f(d.flowRuns.getFlowRun,w),v=n(()=>{var s;return(s=a.value)!=null&&s.taskInputs?JSON.stringify(a.value.taskInputs,void 0,2):"{}"});function x(){h.refresh(),g.push(K.flowRun(o.value))}const A=n(()=>{var s;return(s=a.value)==null?void 0:s.stateType});M(A);const D=n(()=>a.value?`Task Run: ${a.value.name}`:"Task Run");return W(D),(s,_)=>{const C=i("p-code-highlight"),S=i("p-tabs"),B=i("p-layout-well");return a.value?(p(),r(B,{key:0,class:"task-run"},{header:t(()=>[u(e(E),{"task-run-id":a.value.id,onDelete:x},null,8,["task-run-id"])]),well:t(()=>[u(e(R),{alternate:"","task-run":a.value},null,8,["task-run"])]),default:t(()=>[u(S,{selected:e(l),"onUpdate:selected":_[0]||(_[0]=N=>G(l)?l.value=N:null),tabs:e(b)},J({details:t(()=>[u(e(R),{"task-run":a.value},null,8,["task-run"])]),logs:t(()=>[u(e(Y),{"task-run":a.value},null,8,["task-run"])]),artifacts:t(()=>[a.value?(p(),r(e($),{key:0,"task-run":a.value},null,8,["task-run"])):c("",!0)]),"task-inputs":t(()=>[a.value?(p(),r(e(z),{key:0,"text-to-copy":v.value},{default:t(()=>[u(C,{lang:"json",text:v.value,class:"task-run__inputs"},null,8,["text"])]),_:1},8,["text-to-copy"])):c("",!0)]),_:2},[a.value?{name:"task-inputs-heading",fn:t(()=>[m(" Task inputs "),u(e(O),{title:"Task Inputs"},{default:t(()=>[m(P(e(Q).info.taskInput),1)]),_:1})]),key:"0"}:void 0]),1032,["selected","tabs"])]),_:1})):c("",!0)}}});export{ta as default};
