import{r as f}from"./index-BH-cN4KT.js";import{f as a}from"./index-JcJvmTtT.js";function z(r){const[e,o]=f.useState(void 0);return a(()=>{if(r){o({width:r.offsetWidth,height:r.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const c=i[0];let t,s;if("borderBoxSize"in c){const u=c.borderBoxSize,b=Array.isArray(u)?u[0]:u;t=b.inlineSize,s=b.blockSize}else t=r.offsetWidth,s=r.offsetHeight;o({width:t,height:s})});return n.observe(r,{box:"border-box"}),()=>n.unobserve(r)}else o(void 0)},[r]),e}function v(r){const e=f.useRef({value:r,previous:r});return f.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{v as a,z as u};
