import{ar as R,_ as l}from"./bootstrap-Bqxdt4iG.js";import{i as w}from"./ResizeObserver.es-CDE7jhPe.js";import{a1 as C,P as x,aa as M,o as H,ad as W,U,k as _}from"../jse/index-index-BUJ_4tQs.js";const P=C({compatConfig:{MODE:3},name:"ResizeObserver",props:{disabled:Boolean,onResize:Function},emits:["resize"],setup(i,v){let{slots:c}=v;const n=x({width:0,height:0,offsetHeight:0,offsetWidth:0});let h=null,s=null;const r=()=>{s&&(s.disconnect(),s=null)},b=e=>{const{onResize:t}=i,o=e[0].target,{width:p,height:O}=o.getBoundingClientRect(),{offsetWidth:d,offsetHeight:f}=o,g=Math.floor(p),m=Math.floor(O);if(n.width!==g||n.height!==m||n.offsetWidth!==d||n.offsetHeight!==f){const u={width:g,height:m,offsetWidth:d,offsetHeight:f};l(n,u),t&&Promise.resolve().then(()=>{t(l(l({},u),{offsetWidth:d,offsetHeight:f}),o)})}},z=_(),a=()=>{const{disabled:e}=i;if(e){r();return}const t=R(z);t!==h&&(r(),h=t),!s&&t&&(s=new w(b),s.observe(t))};return M(()=>{a()}),H(()=>{a()}),W(()=>{r()}),U(()=>i.disabled,()=>{a()},{flush:"post"}),()=>{var e;return(e=c.default)===null||e===void 0?void 0:e.call(c)[0]}}});export{P as R};
