import{g as v}from"./codebaseEvents-CnQo2e5C.js";import{r as s,l as b,n as E,p as o}from"./jwt-decode.esm-rEBc1yJt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a380fa60-55d6-4028-97fb-e87b6b9c09c5",e._sentryDebugIdIdentifier="sentry-dbid-a380fa60-55d6-4028-97fb-e87b6b9c09c5")}catch{}})();const y=new Set(["changed","created","deleted","moved"]),_=new Set(["lock_acquired","lock_released"]);function w(){const e=s(!1),n=s(null),r=s(null),c=s(null),u=s(null),l=v(),i=t=>{y.has(t.event)?n.value=t:_.has(t.event)?r.value=t:c.value=t},a=()=>{e.value=l.isConnected()};let d;const f=setInterval(a,1e3);return b(()=>{d(),clearInterval(f)}),E(()=>{d=l.subscribe(i),a()}),{isConnected:o(e),lastEvent:o(n),lastLockEvent:o(r),lastPresenceEvent:o(c),error:o(u)}}export{w as u};
//# sourceMappingURL=useCodebaseEvents-RQWkpOal.js.map
