import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{i as t,r as n}from"./button-V4IQ8FFq.js";import{Ca as r,Fa as i}from"./vendor-react-Dj1rnUQ4.js";var a=e(i(),1);function o(){let[e,n]=(0,a.useState)(t.getAllConnections());return(0,a.useEffect)(()=>t.listenToAllEntities((t,r)=>{n({...e,[r]:t})}),[e]),e}function s(){let e=t.calculateIdFromEntity(n),[r,i]=(0,a.useState)(t.getConnectionById(n));return(0,a.useEffect)(()=>t.listenToEntity(e,i),[e]),r}function c(){return s()}function l(){let{user:e}=c();return e?.fabricRole===`fabric_admin`||e?.fabricRole===`super_user`}function u(e){let i=n,{clusterId:o,instanceId:s}=r({strict:!1}),[c,l]=(0,a.useState)(t.getConnectionById(i??s??o));return(0,a.useEffect)(()=>t.listenToEntity(i,l),[i]),c}export{o as a,s as i,c as n,u as r,l as t};
//# sourceMappingURL=useAuth-DqzxNJHV.js.map