import{E as P,a as B,a3 as G,ae as L,an as F,H as j,ac as I,m as w,a5 as k}from"./index.ab0d47a4.js";var A=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i0},t.prototype.connect_=function(){!O||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),K?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!O||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=U.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),C=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof v(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new re(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof v(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;!n.has(e)||(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(!!this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ie(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),H=typeof WeakMap<"u"?new WeakMap:new A,W=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Y.getInstance(),r=new oe(e,n,this);H.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){W.prototype[t]=function(){var e;return(e=H.get(this))[t].apply(e,arguments)}});var se=function(){return typeof p.ResizeObserver<"u"?p.ResizeObserver:W}();const ue=P({name:"ResizeObserver",props:{disabled:Boolean,onResize:Function},emits:["resize"],setup:function(e,n){var r=n.slots,i=B({width:0,height:0,offsetHeight:0,offsetWidth:0}),o=null,s=null,a=function(){s&&(s.disconnect(),s=null)},u=function(m){var f=e.onResize,d=m[0].target,E=d.getBoundingClientRect(),S=E.width,D=E.height,g=d.offsetWidth,y=d.offsetHeight,R=Math.floor(S),M=Math.floor(D);if(i.width!==R||i.height!==M||i.offsetWidth!==g||i.offsetHeight!==y){var z={width:R,height:M,offsetWidth:g,offsetHeight:y};w(i,z),f&&Promise.resolve().then(function(){f(w(w({},z),{offsetWidth:g,offsetHeight:y}),d)})}},l=k(),c=function(){var m=e.disabled;if(m){a();return}var f=I(l),d=f!==o;d&&(a(),o=f),!s&&f&&(s=new se(u),s.observe(f))};return G(function(){c()}),L(function(){c()}),F(function(){a()}),j(function(){return e.disabled},function(){c()},{flush:"post"}),function(){var h;return(h=r.default)===null||h===void 0?void 0:h.call(r)[0]}}});export{ue as R,se as i};