import{unrefElement as e}from"./unrefElement.mjs";import{useResizeObserver as t}from"./useResizeObserver.mjs";import{shallowRef as n,watch as r}from"vue";function i(i,a={width:0,height:0},o={}){let{box:s=`content-box`}=o,c=n(a.width),l=n(a.height);return t(i,([e])=>{let t=s===`border-box`?e.borderBoxSize:s===`content-box`?e.contentBoxSize:e.devicePixelContentBoxSize;t?(c.value=t.reduce((e,{inlineSize:t})=>e+t,0),l.value=t.reduce((e,{blockSize:t})=>e+t,0)):(c.value=e.contentRect.width,l.value=e.contentRect.height)},o),r(()=>e(i),e=>{c.value=e?a.width:0,l.value=e?a.height:0}),{width:c,height:l}}export{i as useElementSize};