import{d as B,S,ae as _,f as r,p as D,o as u,k as m,c as i,a as f,i as a,m as l,bm as N,bn as P,bo as z,bp as G,bq as $,br as q,bs as A,aw as L,u as Z,v as H,bt as J,ah as h,bu as K,al as M,bv as Q,bw as W,bx as X,by as Y,bz as ee,bg as U,g as k,h as o,a6 as le,bA as F,bB as te,bC as se,bD as ne,bE as ae,bF as oe,bG as ue}from"./index-B8dvxl4J.js";import{u as re}from"./usePageTitle-BP6ee6do.js";const ie={class:"flow-run-graphs__graph-panel-container"},fe={class:"flow-run-graphs__graphs"},ce={class:"flow-run-graphs__panel p-background"},pe=B({__name:"FlowRunGraphs",props:{flowRun:{}},setup(R){const v=S(),p=_(),n=_(!1),e=_(null),w=r(()=>({root:{"flow-run-graphs--fullscreen":n.value,"flow-run-graphs--show-panel":e.value?.kind==="task-run"||e.value?.kind==="flow-run"}})),c=async({nodeId:d,since:s,until:t})=>{const b={anyResource:{id:[`prefect.flow-run.${d}`]},event:{excludePrefix:["prefect.log.write","prefect.task-run."]},occurred:{since:s,until:t}},{events:g}=await v.events.getEvents(b);return g};return(d,s)=>(u(),D("div",{class:L(["flow-run-graphs",w.value.root])},[m("div",ie,[m("div",fe,[a(l(N),{fullscreen:n.value,"onUpdate:fullscreen":s[0]||(s[0]=t=>n.value=t),viewport:p.value,"onUpdate:viewport":s[1]||(s[1]=t=>p.value=t),selected:e.value,"onUpdate:selected":s[2]||(s[2]=t=>e.value=t),"flow-run":R.flowRun,"fetch-events":c,class:"flow-run-graphs__flow-run"},null,8,["fullscreen","viewport","selected","flow-run"])]),m("div",ce,[e.value?.kind==="task-run"||e.value?.kind==="flow-run"?(u(),i(l(P),{key:0,selection:e.value,"onUpdate:selection":s[3]||(s[3]=t=>e.value=t),floating:n.value},null,8,["selection","floating"])):f("",!0)])]),e.value&&e.value.kind==="event"?(u(),i(l(z),{key:0,selection:e.value,"onUpdate:selection":s[4]||(s[4]=t=>e.value=t)},null,8,["selection"])):f("",!0),e.value&&e.value.kind==="events"?(u(),i(l(G),{key:1,selection:e.value,"onUpdate:selection":s[5]||(s[5]=t=>e.value=t)},null,8,["selection"])):f("",!0),e.value&&e.value.kind==="artifacts"?(u(),i(l($),{key:2,selection:e.value,"onUpdate:selection":s[6]||(s[6]=t=>e.value=t)},null,8,["selection"])):f("",!0),e.value?.kind==="state"?(u(),i(l(q),{key:3,selection:e.value,"onUpdate:selection":s[7]||(s[7]=t=>e.value=t)},null,8,["selection"])):f("",!0),a(l(A),{selection:e.value,"onUpdate:selection":s[8]||(s[8]=t=>e.value=t)},null,8,["selection"])],2))}}),we=B({__name:"FlowRun",setup(R){const v=Z(),p=H("flowRunId"),{flowRun:n,subscription:e}=J(p,{interval:5e3}),w=r(()=>h(n.value?.parameters??{})),c=r(()=>n.value?.stateType?K(n.value.stateType):!0),d=r(()=>h(n.value?.jobVariables??{})),s=r(()=>[{label:"Logs"},{label:"Task Runs",hidden:c.value},{label:"Subflow Runs",hidden:c.value},{label:"Artifacts",hidden:c.value},{label:"Details"},{label:"Parameters"},{label:"Job Variables"}]),t=M("tab","Logs"),{tabs:b}=Q(s,t),g=r(()=>[p.value]),{filter:O}=W({flowRuns:{parentFlowRunId:g}});function V(){v.push(U.runs())}X(n);const j=r(()=>n.value?`Flow Run: ${n.value.name}`:"Flow Run");return re(j),Y(()=>{e.error&&ee(e.error).isInRange("clientError")&&v.replace(U[404]())}),(C,y)=>{const x=k("p-code-highlight"),E=k("p-tabs"),I=k("p-layout-default");return l(n)?(u(),i(I,{key:l(n).id,class:"flow-run"},{header:o(()=>[a(l(ue),{"flow-run-id":l(n).id,onDelete:V},null,8,["flow-run-id"])]),default:o(()=>[c.value?f("",!0):(u(),i(pe,{key:0,"flow-run":l(n)},null,8,["flow-run"])),a(E,{selected:l(t),"onUpdate:selected":y[0]||(y[0]=T=>le(t)?t.value=T:null),tabs:l(b)},{details:o(()=>[a(l(oe),{"flow-run":l(n)},null,8,["flow-run"])]),logs:o(()=>[a(l(ae),{"flow-run":l(n)},null,8,["flow-run"])]),artifacts:o(()=>[a(l(ne),{"flow-run":l(n)},null,8,["flow-run"])]),"task-runs":o(()=>[a(l(se),{"flow-run-id":l(n).id},null,8,["flow-run-id"])]),"subflow-runs":o(()=>[a(l(te),{filter:l(O)},null,8,["filter"])]),parameters:o(()=>[a(l(F),{"text-to-copy":w.value},{default:o(()=>[a(x,{lang:"json",text:w.value,class:"flow-run__parameters"},null,8,["text"])]),_:1},8,["text-to-copy"])]),"job-variables":o(()=>[a(l(F),{"text-to-copy":d.value},{default:o(()=>[a(x,{lang:"json",text:d.value,class:"flow-run__job-variables"},null,8,["text"])]),_:1},8,["text-to-copy"])]),_:1},8,["selected","tabs"])]),_:1})):f("",!0)}}});export{we as default};
//# sourceMappingURL=FlowRun-CU_vdWF9.js.map
