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