import{j as e,E as D,t as S,r as u}from"./vendor-tanstack-CvGXetsl.js";import{E as C,t as d,v,w as j,x as w,D as b,bl as r,bm as E,bn as N,bo as P,ag as k}from"./index-D51s66kn.js";import{D as F}from"./index-BeFXnr7B.js";import{D as O}from"./header-7458wL9d.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-y_Ik_hIG.js";import"./vendor-recharts-heKD2IVO.js";import"./vendor-forms-BVeRYtt6.js";import"./vendor-date-GSGg4LXF.js";import"./use-quick-run-Dygln5kD.js";import"./use-delete-confirmation-dialog-DhzClBrB.js";import"./data-table-TN-R-9cX.js";import"./table-C7sL0Rx2.js";import"./delete-confirmation-dialog-CLcHXNx2.js";import"./index-DhBlCnY2.js";import"./cronstrue-KkUp9cvy.js";import"./use-is-overflowing-Jy_YJFp4.js";import"./index-2O-Q9Wk4.js";import"./tags-input-CETYfeHv.js";import"./dropdown-menu-0GXqpEoR.js";const Q=()=>e.jsxs(C,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(d,{id:"Workflow"}),e.jsx(d,{id:"MoreHorizontal"}),e.jsx(d,{id:"Rocket"})]}),e.jsx(v,{children:"Create a deployment to get started"}),e.jsx(j,{children:"Deployments elevate workflows from functions you call manually to API objects that can be remotely triggered."}),e.jsx(w,{children:e.jsx(b,{id:"deployments-guide"})})]}),_=()=>{const t=r.useSearch(),o=r.useNavigate(),s=(t.page??1)-1,a=t.limit??10,n=u.useMemo(()=>({pageIndex:s,pageSize:a}),[s,a]),m=u.useCallback(i=>{o({to:".",search:p=>({...p,page:i.pageIndex+1,limit:i.pageSize}),replace:!0})},[o]);return[n,m]},A=()=>{const t=r.useSearch(),o=r.useNavigate(),s=a=>{o({to:".",search:n=>({...n,sort:a}),replace:!0})};return[t.sort,s]},I=()=>{const t=r.useSearch(),o=r.useNavigate(),s=u.useMemo(()=>[{id:"flowOrDeploymentName",value:t.flowOrDeploymentName},{id:"tags",value:t.tags}],[t.flowOrDeploymentName,t.tags]),a=u.useCallback(n=>{o({to:".",search:m=>{const i=n.find(l=>l.id==="flowOrDeploymentName")?.value,p=n.find(l=>l.id==="tags")?.value;return{...m,offset:0,flowOrDeploymentName:i,tags:p}},replace:!0})},[o]);return[s,a]},oe=function(){const o=r.useSearch(),[s,a]=_(),[n,m]=A(),[i,p]=I(),[{data:l},{data:g}]=D({queries:[E(),N(P(o))]}),y=g?.results??[],{data:f}=S(k({flows:{operator:"and_",id:{any_:[...new Set(y.map(c=>c.flow_id))]}},offset:0,sort:"NAME_ASC"})),h=y.map(c=>({...c,flow:f?.find(x=>x.id===c.flow_id)}));return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(O,{}),l===0?e.jsx(Q,{}):e.jsx(F,{deployments:h,currentDeploymentsCount:l,pageCount:g?.pages??0,pagination:s,sort:n,columnFilters:i,onPaginationChange:a,onSortChange:m,onColumnFiltersChange:p})]})};export{oe as component};
//# sourceMappingURL=index-CdydTK0g.js.map
