const t=["top","right","bottom","left"],n=Math.min,o=Math.max,r=Math.round,e=Math.floor,i=t=>({x:t,y:t}),u={left:"right",right:"left",bottom:"top",top:"bottom"},c={start:"end",end:"start"};function f(t,r,e){return o(t,n(r,e))}function h(t,n){return"function"==typeof t?t(n):t}function a(t){return t.split("-")[0]}function l(t){return t.split("-")[1]}function p(t){return"x"===t?"y":"x"}function s(t){return"y"===t?"height":"width"}function g(t){return["top","bottom"].includes(a(t))?"y":"x"}function m(t){return p(g(t))}function b(t,n,o){void 0===o&&(o=!1);const r=l(t),e=m(t),i=s(e);let u="x"===e?r===(o?"end":"start")?"right":"left":"start"===r?"bottom":"top";return n.reference[i]>n.floating[i]&&(u=w(u)),[u,w(u)]}function d(t){const n=w(t);return[x(t),n,x(n)]}function x(t){return t.replace(/start|end/g,(t=>c[t]))}function y(t,n,o,r){const e=l(t);let i=function(t,n,o){const r=["left","right"],e=["right","left"],i=["top","bottom"],u=["bottom","top"];switch(t){case"top":case"bottom":return o?n?e:r:n?r:e;case"left":case"right":return n?i:u;default:return[]}}(a(t),"start"===o,r);return e&&(i=i.map((t=>t+"-"+e)),n&&(i=i.concat(i.map(x)))),i}function w(t){return t.replace(/left|right|bottom|top/g,(t=>u[t]))}function M(t){return{top:0,right:0,bottom:0,left:0,...t}}function v(t){return"number"!=typeof t?M(t):{top:t,right:t,bottom:t,left:t}}function j(t){const{x:n,y:o,width:r,height:e}=t;return{width:r,height:e,top:o,left:n,right:n+r,bottom:o+e,x:n,y:o}}export{f as clamp,i as createCoords,h as evaluate,M as expandPaddingObject,e as floor,l as getAlignment,m as getAlignmentAxis,b as getAlignmentSides,s as getAxisLength,d as getExpandedPlacements,x as getOppositeAlignmentPlacement,p as getOppositeAxis,y as getOppositeAxisPlacements,w as getOppositePlacement,v as getPaddingObject,a as getSide,g as getSideAxis,o as max,n as min,j as rectToClientRect,r as round,t as sides};
//# sourceMappingURL=floating-ui.utils.js.map
