import{d as I,f as y,e as f,o,l as W,L as g,n as v,j as e,af as E,c as u,ag as q,a as i,ah as z,ai as H,aj as Q,ak as $,al as G,W as J,am as K,an as M,Q as X,ao as Y,ap as Z,aq as ee,ar as ae,g as r,h as k,a1 as le,as as se,at as te,au as ne,av as oe,aw as ue,ax as re,ay as ie,az as fe,aA as pe,aB as ce,aC as x,y as de,ae as F,aD as ve}from"./index-CPxpbp4R.js";import{u as we}from"./usePageTitle-CcH2lmI6.js";const me={class:"flow-run-graphs__graph-panel-container"},_e={class:"flow-run-graphs__graphs"},be={class:"flow-run-graphs__panel p-background"},ye=I({__name:"FlowRunGraphs",props:{flowRun:{}},setup(j){const m=y(),c=y(!1),l=y(null),a=f(()=>{var d,s;return{root:{"flow-run-graphs--fullscreen":c.value,"flow-run-graphs--show-panel":((d=l.value)==null?void 0:d.kind)==="task-run"||((s=l.value)==null?void 0:s.kind)==="flow-run"}}});return(d,s)=>{var _,p,w;return o(),W("div",{class:$(["flow-run-graphs",a.value.root])},[g("div",me,[g("div",_e,[v(e(E),{fullscreen:c.value,"onUpdate:fullscreen":s[0]||(s[0]=n=>c.value=n),viewport:m.value,"onUpdate:viewport":s[1]||(s[1]=n=>m.value=n),selected:l.value,"onUpdate:selected":s[2]||(s[2]=n=>l.value=n),"flow-run":d.flowRun,class:"flow-run-graphs__flow-run"},null,8,["fullscreen","viewport","selected","flow-run"])]),g("div",be,[((_=l.value)==null?void 0:_.kind)==="task-run"||((p=l.value)==null?void 0:p.kind)==="flow-run"?(o(),u(e(q),{key:0,selection:l.value,"onUpdate:selection":s[3]||(s[3]=n=>l.value=n),floating:c.value},null,8,["selection","floating"])):i("",!0)])]),l.value&&l.value.kind==="artifacts"?(o(),u(e(z),{key:0,selection:l.value,"onUpdate:selection":s[4]||(s[4]=n=>l.value=n)},null,8,["selection"])):i("",!0),((w=l.value)==null?void 0:w.kind)==="state"?(o(),u(e(H),{key:1,selection:l.value,"onUpdate:selection":s[5]||(s[5]=n=>l.value=n)},null,8,["selection"])):i("",!0),v(e(Q),{selection:l.value,"onUpdate:selection":s[6]||(s[6]=n=>l.value=n)},null,8,["selection"])],2)}}}),Re=I({__name:"FlowRun",setup(j){const m=G(),c=le(),l=J("flowRunId"),{flowRun:a,subscription:d}=K(l,{interval:5e3}),s=f(()=>{var t;return(t=a.value)==null?void 0:t.deploymentId}),{deployment:_}=M(s),p=f(()=>{var t;return(t=a.value)!=null&&t.stateType?se(a.value.stateType):!0}),w=f(()=>{var t;return te(((t=a.value)==null?void 0:t.jobVariables)??{})}),n=f(()=>[{label:"Logs"},{label:"Task Runs",hidden:p.value},{label:"Subflow Runs",hidden:p.value},{label:"Results",hidden:p.value},{label:"Artifacts",hidden:p.value},{label:"Details"},{label:"Parameters"},{label:"Job Variables",hidden:!m.access.flowRunInfraOverrides}]),b=X("tab","Logs"),{tabs:C}=Y(n,b),U=f(()=>{var t;return((t=a.value)==null?void 0:t.parameters)??{}}),B=f(()=>{var t;return((t=_.value)==null?void 0:t.parameterOpenApiSchema)??{}}),R=f(()=>ne(U.value,B.value)),S=f(()=>[l.value]),{filter:V}=Z({flowRuns:{parentFlowRunId:S}});function A(){c.push(F.flowRuns())}const L=f(()=>{var t;return(t=a.value)==null?void 0:t.stateType});ee(L);const N=f(()=>a.value?`Flow Run: ${a.value.name}`:"Flow Run");return we(N),ae(()=>{d.error&&ve(d.error).isInRange("clientError")&&c.replace(F[404]())}),(t,h)=>{const T=k("p-code-highlight"),D=k("p-tabs"),O=k("p-layout-default");return o(),u(O,{class:"flow-run"},{header:r(()=>[e(a)?(o(),u(e(oe),{key:0,"flow-run-id":e(a).id,onDelete:A},null,8,["flow-run-id"])):i("",!0)]),default:r(()=>[e(a)&&!p.value?(o(),u(ye,{key:0,"flow-run":e(a)},null,8,["flow-run"])):i("",!0),v(D,{selected:e(b),"onUpdate:selected":h[0]||(h[0]=P=>de(b)?b.value=P:null),tabs:e(C)},{details:r(()=>[e(a)?(o(),u(e(ue),{key:0,"flow-run":e(a)},null,8,["flow-run"])):i("",!0)]),logs:r(()=>[e(a)?(o(),u(e(re),{key:0,"flow-run":e(a)},null,8,["flow-run"])):i("",!0)]),results:r(()=>[e(a)?(o(),u(e(ie),{key:0,"flow-run":e(a)},null,8,["flow-run"])):i("",!0)]),artifacts:r(()=>[e(a)?(o(),u(e(fe),{key:0,"flow-run":e(a)},null,8,["flow-run"])):i("",!0)]),"task-runs":r(()=>[e(a)?(o(),u(e(pe),{key:0,"flow-run-id":e(a).id},null,8,["flow-run-id"])):i("",!0)]),"subflow-runs":r(()=>[v(e(ce),{filter:e(V)},null,8,["filter"])]),parameters:r(()=>[e(a)?(o(),u(e(x),{key:0,"text-to-copy":R.value},{default:r(()=>[v(T,{lang:"json",text:R.value,class:"flow-run__parameters"},null,8,["text"])]),_:1},8,["text-to-copy"])):i("",!0)]),"job-variables":r(()=>[e(a)?(o(),u(e(x),{key:0,"text-to-copy":w.value},{default:r(()=>[v(T,{lang:"json",text:w.value,class:"flow-run__job-variables"},null,8,["text"])]),_:1},8,["text-to-copy"])):i("",!0)]),_:1},8,["selected","tabs"])]),_:1})}}});export{Re as default};
//# sourceMappingURL=FlowRun-BrpDay7O.js.map
