index-64303d0e-1715840129614.js 734 B

1
  1. import{b as m,c as b,i as w}from"./index-95d27d49-1715840129614.js";import{S as p,y as O,r as S,p as y,bS as M}from"./index-27f38392-1715840129614.js";function l(e){var n;const o=b(e);return(n=o==null?void 0:o.$el)!=null?n:o}const h=w?window:void 0;function z(){const e=S(!1),n=M();return n&&y(()=>{e.value=!0},n),e}function R(e){const n=z();return p(()=>(n.value,!!e()))}function W(e,n,o={}){const{window:t=h,...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{W as u};