import{watch as a}from"vue";import{defaultWindow as f}from"./_configurable.mjs";import{tryOnScopeDispose as d}from"./tryOnScopeDispose.mjs";import{unrefElement as v}from"./unrefElement.mjs";import{useSupported as b}from"./useSupported.mjs";function h(s,p,u={}){const{window:o=f,...m}=u;let t;const e=b(()=>o&&"MutationObserver"in o),r=()=>{t&&(t.disconnect(),t=void 0)},c=a(()=>v(s),i=>{r(),e.value&&o&&i&&(t=new MutationObserver(p),t.observe(i,m))},{immediate:!0}),n=()=>{r(),c()};return d(n),{isSupported:e,stop:n}}export{h as useMutationObserver};
