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