// @bun
var{defineProperty:P,getOwnPropertyNames:U,getOwnPropertyDescriptor:V}=Object,W=Object.prototype.hasOwnProperty;function X(j){return this[j]}var $=(j)=>{var q=(T??=new WeakMap).get(j),D;if(q)return q;if(q=P({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var G of U(j))if(!W.call(q,G))P(q,G,{get:X.bind(j,G),enumerable:!(D=V(j,G))||D.enumerable})}return T.set(j,q),q},T;var Y=(j)=>j;function Z(j,q){this[j]=Y.bind(null,q)}var h=(j,q)=>{for(var D in q)P(j,D,{get:q[D],enumerable:!0,configurable:!0,set:Z.bind(q,D)})};var C=(j,q)=>()=>(j&&(q=j(j=0)),q);var E=import.meta.require;function Q(){return typeof window<"u"&&"ResizeObserver"in window}function I(j){if(!j||j.length===0)return null;let q=j[0];return{width:q.inlineSize,height:q.blockSize,inlineSize:q.inlineSize,blockSize:q.blockSize}}function _(j,q,D={}){let G=Q(),H={contentRect:null,contentBoxSize:null,borderBoxSize:null,devicePixelContentBoxSize:null},B=[],F=null,L=()=>{if(typeof j==="function")return j();return j},N=(w)=>{if(w.length>0){let A=w[0];H={contentRect:A.contentRect,contentBoxSize:I(A.contentBoxSize),borderBoxSize:I(A.borderBoxSize),devicePixelContentBoxSize:I(A.devicePixelContentBoxSize)}}if(q)q(w);B.forEach((A)=>A(w))},J=()=>{if(!G)return;let w=L();if(!w)return;if(!F)F=new ResizeObserver(N);F.observe(w,{box:D.box})},K=()=>{if(F)F.disconnect(),F=null};return{get:()=>H,subscribe:(w)=>{if(B.length===0)J();return B.push(w),()=>{if(B=B.filter((A)=>A!==w),B.length===0&&!q)K()}},observe:J,disconnect:K,isSupported:()=>G}}function O(j,q,D={}){let G=Q(),H=new Map,B=[],F=null,L=()=>{if(typeof j==="function")return j();return j},N=(w)=>{for(let A of w)H.set(A.target,{contentRect:A.contentRect,contentBoxSize:I(A.contentBoxSize),borderBoxSize:I(A.borderBoxSize),devicePixelContentBoxSize:I(A.devicePixelContentBoxSize)});if(q)q(w);B.forEach((A)=>A(w))},J=()=>{if(!G)return;let w=L();if(w.length===0)return;if(!F)F=new ResizeObserver(N);for(let A of w)F.observe(A,{box:D.box})},K=()=>{if(F)F.disconnect(),F=null;H.clear()};return{get:()=>H.values().next().value||{contentRect:null,contentBoxSize:null,borderBoxSize:null,devicePixelContentBoxSize:null},states:()=>H,subscribe:(w)=>{if(B.length===0)J();return B.push(w),()=>{if(B=B.filter((A)=>A!==w),B.length===0&&!q)K()}},observe:J,disconnect:K,isSupported:()=>G}}function R(j){let q={width:0,height:0},D=[],G=_(j,(H)=>{if(H.length>0){let B=H[0].contentRect;q={width:B.width,height:B.height},D.forEach((F)=>F(q))}});return{get:()=>q,subscribe:(H)=>{if(D.push(H),H(q),D.length===1)G.observe();return()=>{if(D=D.filter((B)=>B!==H),D.length===0)G.disconnect()}},isSupported:G.isSupported}}function x(){return Q()}export{O as useResizeObserverMultiple,_ as useResizeObserver,R as useElementSize,x as hasResizeObserver};
