import{d as Q,B as z,v as A,R as d,c as r,r as k,C as K,D as O,a as F,e as t,w as i,o as s,m as a,g as e,G as P,k as h,Q as j,F as C,I as q,S as b,K as E,i as f,L as w,N as G,U as I,O as W,T as X,V as Y,W as Z,X as M,Y as $,n as ee,Z as se}from"./index-a91efef8.js";import{u as oe}from"./usePageTitle-6b86fe3b.js";const te={class:"flow-runs__list"},ne={class:"flow-runs__list-controls"},le={class:"flow-runs__list-controls--right"},de=Q({__name:"FlowRuns",setup(ae){const g=z(),c=A(),_=d(c.flowRuns.getFlowRunsCount,[{}]),S=r(()=>_.executed),V=r(()=>_.response===0),p=k(),x=K(p,1200),{filter:o,isCustomFilter:N}=O({flowRuns:{nameLike:x}}),m={interval:3e4},R=d(c.flowRuns.getFlowRunsCount,[o],m),B=r(()=>R.response),T=d(c.ui.getFlowRunHistory,[o],m),U=r(()=>T.response??[]),v=d(c.flowRuns.getFlowRuns,[o],m),y=r(()=>v.response??[]),n=k([]);function L(){g.push(se.flowRuns())}const D=()=>{n.value=[],v.refresh(),R.refresh()};return oe("Flow Runs"),(ue,l)=>{const H=F("p-button"),J=F("p-layout-default");return s(),t(J,{class:"flow-runs"},{header:i(()=>[a(e(P))]),default:i(()=>[S.value?(s(),h(C,{key:0},[V.value?(s(),t(e(j),{key:0})):(s(),h(C,{key:1},[a(e(q)),e(b).md?(s(),t(e(E),{key:0,history:U.value,"start-date":e(o).flowRuns.expectedStartTimeAfter,"end-date":e(o).flowRuns.expectedStartTimeBefore,class:"flow-runs__chart"},null,8,["history","start-date","end-date"])):f("",!0),w("div",te,[w("div",ne,[w("div",le,[n.value.length==0?(s(),t(e(G),{key:0,count:B.value,label:"Flow run"},null,8,["count"])):(s(),t(e(I),{key:1,count:n.value.length},null,8,["count"])),a(e(W),{selected:n.value,onDelete:D},null,8,["selected"])]),e(b).md?(s(),t(e(X),{key:0,modelValue:p.value,"onUpdate:modelValue":l[0]||(l[0]=u=>p.value=u),placeholder:"Search by run name",label:"Search by run name"},null,8,["modelValue"])):f("",!0),a(e(Y),{modelValue:e(o).sort,"onUpdate:modelValue":l[1]||(l[1]=u=>e(o).sort=u)},null,8,["modelValue"])]),a(e(Z),{selected:n.value,"onUpdate:selected":l[2]||(l[2]=u=>n.value=u),"flow-runs":y.value},null,8,["selected","flow-runs"]),y.value.length?f("",!0):(s(),t(e(M),{key:0},$({_:2},[e(N)?{name:"actions",fn:i(()=>[a(H,{size:"sm",secondary:"",onClick:L},{default:i(()=>[ee(" Clear Filters ")]),_:1})]),key:"0"}:void 0]),1024))])],64))],64)):f("",!0)]),_:1})}}});export{de as default};
