import{K as m,c as C,n as T}from"./index-XbihxApF.js";import{u as y}from"./useQuery-DQ6fRPhk.js";import{u as f,a}from"./constants-Cn7R_Bik.js";function S(t,s){const e=C.c(13);let r;e[0]!==t?(r={connectionId:a,orgId:t},e[0]=t,e[1]=r):r=e[1];const l=f(r);let u;e[2]!==t||e[3]!==s?(u=m.project(t,s),e[2]=t,e[3]=s,e[4]=u):u=e[4];let c;e[5]!==l||e[6]!==t||e[7]!==s?(c=async()=>{const p=await l.callTool({name:"PROJECT_GET",arguments:{organizationId:t,slug:s}});return(p.structuredContent??p).project},e[5]=l,e[6]=t,e[7]=s,e[8]=c):c=e[8];const o=!!t&&!!s;let n;return e[9]!==u||e[10]!==c||e[11]!==o?(n={queryKey:u,queryFn:c,enabled:o,staleTime:3e4},e[9]=u,e[10]=c,e[11]=o,e[12]=n):n=e[12],y(n)}function _(t,s){const e=f({connectionId:a,orgId:t}),r={queryKey:m.projects(t),queryFn:async()=>{const l=await e.callTool({name:"PROJECT_LIST",arguments:{organizationId:t}});return(l.structuredContent??l).projects.map(c=>({...c,organizationId:t}))},staleTime:3e4};return s?.suspense?T(r):y({...r,enabled:!!t})}export{_ as a,S as u};
