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