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