"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),d=require("@vueuse/core");require("../hooks/index.js");const m=require("../hooks/useResize.js"),h=t.defineComponent({name:"ResizeObserver",__name:"index",props:{onResize:{type:Function},throttle:{type:[Boolean,Number],default:16}},setup(r,{expose:i}){const u=r.throttle==!0?16:r.throttle,c=d.useThrottleFn(b,u),{observe:a,unobserve:f}=m.useResize(),o=t.getCurrentInstance();let n=t.ref(!1);function l(){if(n.value)return;const e=o?.proxy?.$el;e?.nextElementSibling&&(a(e.nextElementSibling,c),n.value=!0)}function s(){if(n.value){const e=o?.proxy?.$el;e?.nextElementSibling&&(f(e.nextElementSibling),n.value=!1)}}function b(e){r.onResize(e)===!1&&s()}return t.onMounted(()=>{l()}),t.onBeforeUnmount(()=>{s()}),i({visible:t.computed(()=>t.unref(n)),cancel:s,resume:l}),(e,v)=>t.renderSlot(e.$slots,"default")}});exports.default=h;
