import{v as f,aw as d,e as g,u as m,r as q,z as w,q as y}from"./main-tangy-colts-beg.js";import{f as C}from"./_applist-tangy-colts-beg-36.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function F(e,t,i){const{id:s}=f(d),a=g(C),{data:n,isFetching:r,isLoading:u,refetch:h}=m({enabled:i,queryFn:()=>y("connections",{appSlug:e},void 0,"POST"),queryKey:["connections",e||"all","all"],select:c=>c.data||[],staleTime:10*1e3});return q.useEffect(()=>{s&&a(c=>w(c,l=>{const o=l[s];o!=null&&o.states&&(o.states.connections=n)}))},[n,t,s,a]),{connectionRefetch:h,connections:n,isConnectionFetching:r,isConnectionLoading:u}}export{F as u};
