import{z as _,u as l}from"./vendor-tanstack-BpuysabX.js";import{bH as k,aU as c,dM as R,dN as w}from"./index-CREafGO4.js";const y=a=>{const{data:t}=_(k(a)),u=t?.map(s=>s.flow_run_id).filter(s=>s!=null&&s!==void 0),o=t?.map(s=>s.task_run_id).filter(s=>s!=null&&s!==void 0),{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:u}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:o}},sort:"ID_DESC",offset:0})],combine:s=>{const[n,e]=s;return{flowRuns:n.data,taskRuns:e.data}}});return t?.map(s=>{const n=r?.find(d=>d.id===s.flow_run_id),e=i?.find(d=>d.id===s.task_run_id);return{...s,flow_run:n,task_run:e}})},D=a=>{const{data:t}=_(w(a)),u=t?.flow_run_id,o=t?.task_run_id,{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:[u??""]}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:[o??""]}},sort:"ID_DESC",offset:0})],combine:f=>{const[s,n]=f;return{flowRuns:s.data,taskRuns:n.data}}});return{...t,flow_run:r?.[0],task_run:i?.[0]}};export{D as a,y as u};
//# sourceMappingURL=use-get-artifacts-flow-task-runs-h-x6N6s1.js.map
