import{r as c}from"./vendor-react-DX7tU9aY.js";function s(n,t){if(n.length!==t.length)return!1;for(var r=0;r<n.length;r++)if(n[r]!==t[r])return!1;return!0}function l(n,t){var r=c.useState(function(){return{inputs:t,result:n()}})[0],o=c.useRef(!0),e=c.useRef(r),a=o.current||!!(t&&e.current.inputs&&s(t,e.current.inputs)),i=a?e.current:{inputs:t,result:n()};return c.useEffect(function(){o.current=!1,e.current=i},[i]),i.result}function w(n,t){return l(function(){return n},t)}var O=l,L=w,B="Invariant failed";function S(n,t){throw new Error(B)}var v=function(t){var r=t.top,o=t.right,e=t.bottom,a=t.left,i=o-a,f=e-r,d={top:r,right:o,bottom:e,left:a,width:i,height:f,x:a,y:r,center:{x:(o+a)/2,y:(e+r)/2}};return d},R=function(t,r){return{top:t.top-r.top,left:t.left-r.left,bottom:t.bottom+r.bottom,right:t.right+r.right}},p=function(t,r){return{top:t.top+r.top,left:t.left+r.left,bottom:t.bottom-r.bottom,right:t.right-r.right}},W=function(t,r){return{top:t.top+r.y,left:t.left+r.x,bottom:t.bottom+r.y,right:t.right+r.x}},g={top:0,right:0,bottom:0,left:0},b=function(t){var r=t.borderBox,o=t.margin,e=o===void 0?g:o,a=t.border,i=a===void 0?g:a,f=t.padding,d=f===void 0?g:f,h=v(R(r,e)),m=v(p(r,i)),x=v(p(m,d));return{marginBox:h,borderBox:v(r),paddingBox:m,contentBox:x,margin:e,border:i,padding:d}},u=function(t){var r=t.slice(0,-2),o=t.slice(-2);if(o!=="px")return 0;var e=Number(r);return isNaN(e)&&S(),e},C=function(){return{x:window.pageXOffset,y:window.pageYOffset}},F=function(t,r){var o=t.borderBox,e=t.border,a=t.margin,i=t.padding,f=W(o,r);return b({borderBox:f,border:e,margin:a,padding:i})},N=function(t,r){return r===void 0&&(r=C()),F(t,r)},A=function(t,r){var o={top:u(r.marginTop),right:u(r.marginRight),bottom:u(r.marginBottom),left:u(r.marginLeft)},e={top:u(r.paddingTop),right:u(r.paddingRight),bottom:u(r.paddingBottom),left:u(r.paddingLeft)},a={top:u(r.borderTopWidth),right:u(r.borderRightWidth),bottom:u(r.borderBottomWidth),left:u(r.borderLeftWidth)};return b({borderBox:t,margin:o,padding:e,border:a})},T=function(t){var r=t.getBoundingClientRect(),o=window.getComputedStyle(t);return A(r,o)},$=function(t){var r=[],o=null,e=function(){for(var i=arguments.length,f=new Array(i),d=0;d<i;d++)f[d]=arguments[d];r=f,!o&&(o=requestAnimationFrame(function(){o=null,t.apply(void 0,r)}))};return e.cancel=function(){o&&(cancelAnimationFrame(o),o=null)},e};export{L as a,v as b,b as c,A as d,R as e,T as g,F as o,$ as r,O as u,N as w};
