import{u as n}from"./useProjectionStream-DMf_8m8X.js";import{b1 as r,b0 as b}from"./index-DrvLDslf.js";function d(t){const c=n({autoConnect:!1});function o(a){const e=a?.payload;if(e)switch(a.kind){case"alarm":t.onAlarm?.(e);break;case"object-created":t.onObjectCreated?.(e);break;case"object-deleted":t.onObjectDeleted?.(e);break;case"object-patched":t.onObjectPatched?.(e);break;case"object-batch-changed":t.onObjectBatchChanged?.(e);break;case"pick-result":t.onPickResult?.(e);break;case"selection-detail":t.onSelectionDetail?.(e);break}}return r(()=>{c.on(o),c.connect()}),b(()=>{c.off(o),c.disconnect()}),{connected:c.connected}}export{d as u};
