import{t as m,b as w,i as y}from"./index-94975ec6.js";import{L as v,y as _,r as h,aC as S,n as $}from"./index-e7035897.js";function f(e){var n;const o=w(e);return(n=o==null?void 0:o.$el)!=null?n:o}const j=y?window:void 0;function M(){const e=h(!1);return S()&&$(()=>{e.value=!0}),e}function P(e){const n=M();return v(()=>(n.value,!!e()))}var c=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,z=(e,n)=>{var o={};for(var t in e)R.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&c)for(var t of c(e))n.indexOf(t)<0&&g.call(e,t)&&(o[t]=e[t]);return o};function I(e,n,o={}){const t=o,{window:s=j}=t,d=z(t,["window"]);let r;const i=P(()=>s&&"ResizeObserver"in s),u=()=>{r&&(r.disconnect(),r=void 0)},b=v(()=>Array.isArray(e)?e.map(a=>f(a)):[f(e)]),O=_(b,a=>{if(u(),i.value&&s){r=new ResizeObserver(n);for(const p of a)p&&r.observe(p,d)}},{immediate:!0,flush:"post",deep:!0}),l=()=>{u(),O()};return m(l),{isSupported:i,stop:l}}export{I as u};