import{b as m,c as b,i as w}from"./index-d6e02b87-1720452812367.js";import{U as p,A as O,r as M,q as h,bU as y}from"./index-8fb4d12a-1720452812367.js";function l(e){var n;const o=b(e);return(n=o==null?void 0:o.$el)!=null?n:o}const z=w?window:void 0;function A(){const e=M(!1),n=y();return n&&h(()=>{e.value=!0},n),e}function R(e){const n=A();return p(()=>(n.value,!!e()))}function U(e,n,o={}){const{window:t=z,...d}=o;let s;const i=R(()=>t&&"ResizeObserver"in t),u=()=>{s&&(s.disconnect(),s=void 0)},f=p(()=>Array.isArray(e)?e.map(r=>l(r)):[l(e)]),v=O(f,r=>{if(u(),i.value&&t){s=new ResizeObserver(n);for(const c of r)c&&s.observe(c,d)}},{immediate:!0,flush:"post"}),a=()=>{u(),v()};return m(a),{isSupported:i,stop:a}}export{U as u};
