import { mix as x } from "../../../../../popmotion/dist/es/utils/mix.es.js";
import { distance as u } from "../../../../../popmotion/dist/es/utils/distance.es.js";
function m(i) {
  return i.max - i.min;
}
function f(i, n, o) {
  return n === void 0 && (n = 0), o === void 0 && (o = 0.01), u(i, n) < o;
}
function s(i, n, o, c) {
  c === void 0 && (c = 0.5), i.origin = c, i.originPoint = x(n.min, n.max, i.origin), i.scale = m(o) / m(n), (f(i.scale, 1, 1e-4) || isNaN(i.scale)) && (i.scale = 1), i.translate = x(o.min, o.max, i.origin) - i.originPoint, (f(i.translate) || isNaN(i.translate)) && (i.translate = 0);
}
function P(i, n, o, c) {
  s(i.x, n.x, o.x, c == null ? void 0 : c.originX), s(i.y, n.y, o.y, c == null ? void 0 : c.originY);
}
function v(i, n, o) {
  i.min = o.min + n.min, i.max = i.min + m(n);
}
function R(i, n, o) {
  v(i.x, n.x, o.x), v(i.y, n.y, o.y);
}
function l(i, n, o) {
  i.min = n.min - o.min, i.max = i.min + m(n);
}
function A(i, n, o) {
  l(i.x, n.x, o.x), l(i.y, n.y, o.y);
}
export {
  s as calcAxisDelta,
  P as calcBoxDelta,
  m as calcLength,
  v as calcRelativeAxis,
  l as calcRelativeAxisPosition,
  R as calcRelativeBox,
  A as calcRelativePosition,
  f as isNear
};
//# sourceMappingURL=delta-calc.es.js.map
