import{A as e,D as t,_ as n,b as r,et as i,w as a}from"./runtime-core.esm-bundler-Babufkcf.js";import{t as o}from"./create-CGAkPJkS.js";import{r as s}from"./Platform-BxNC0BGj.js";import{c,l}from"./dom-BXiDqs7-.js";function u(){let t=i(!s.value);return t.value||e(()=>{t.value=!0}),{isHydrated:t}}var d=typeof ResizeObserver<`u`,f=d?{}:{style:`display:block;position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1;`,url:`about:blank`},p=o({name:`QResizeObserver`,props:{debounce:{type:[String,Number],default:100}},emits:[`resize`],setup(i,{emit:o}){let s=null,p,m={width:-1,height:-1};function h(e){e===!0||i.debounce===0||i.debounce===`0`?g():s===null&&(s=setTimeout(g,i.debounce))}function g(){if(s!==null&&(clearTimeout(s),s=null),p){let{offsetWidth:e,offsetHeight:t}=p;(e!==m.width||t!==m.height)&&(m={width:e,height:t},o(`resize`,m))}}let{proxy:_}=n();if(_.trigger=h,d){let n,r=e=>{p=_.$el.parentNode,p?(n=new ResizeObserver(h),n.observe(p),g()):e||a(()=>{r(!0)})};return e(()=>{r()}),t(()=>{s!==null&&clearTimeout(s),n!==void 0&&(n.disconnect===void 0?p&&n.unobserve(p):n.disconnect())}),l}let{isHydrated:v}=u(),y,b=()=>{s!==null&&(clearTimeout(s),s=null),y!==void 0&&(y.removeEventListener!==void 0&&y.removeEventListener(`resize`,h,c.passive),y=void 0)},x=()=>{b(),p?.contentDocument&&(y=p.contentDocument.defaultView,y.addEventListener(`resize`,h,c.passive),g())};return e(()=>{a(()=>{p=_.$el,p&&x()})}),t(b),()=>{if(v.value)return r(`object`,{class:`q--avoid-card-border`,style:f.style,tabindex:-1,type:`text/html`,data:f.url,"aria-hidden":`true`,onLoad:x})}}});export{p as t};