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