const e=require("../_util/props-util/index.js"),t=require("../node_modules/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js");let n=require("vue");var r=(0,n.defineComponent)({compatConfig:{MODE:3},name:`ResizeObserver`,props:{disabled:Boolean,onResize:Function},emits:[`resize`],setup(r,{slots:i}){let a=(0,n.reactive)({width:0,height:0,offsetHeight:0,offsetWidth:0}),o=null,s=null,c=()=>{s&&(s.disconnect(),s=null)},l=e=>{let{onResize:t}=r,n=e[0].target,{width:i,height:o}=n.getBoundingClientRect(),{offsetWidth:s,offsetHeight:c}=n,l=Math.floor(i),u=Math.floor(o);if(a.width!==l||a.height!==u||a.offsetWidth!==s||a.offsetHeight!==c){let e={width:l,height:u,offsetWidth:s,offsetHeight:c};Object.assign(a,e),t&&Promise.resolve().then(()=>{t({...e,offsetWidth:s,offsetHeight:c},n)})}},u=(0,n.getCurrentInstance)(),d=()=>{let{disabled:n}=r;if(n){c();return}let i=e.findDOMNode(u);i!==o&&(c(),o=i),!s&&i&&(s=new t.default(l),s.observe(i))};return(0,n.onMounted)(()=>{d()}),(0,n.onUpdated)(()=>{d()}),(0,n.onUnmounted)(()=>{c()}),(0,n.watch)(()=>r.disabled,()=>{d()},{flush:`post`}),()=>i.default?.()[0]}});exports.default=r;