import { mixNumber as c } from "../../utils/mix/number.es.js";
import { px as x, percent as u } from "../../value/types/numbers/units.es.js";
import { progress as h } from "../../../../../../../motion-utils@12.36.0/node_modules/motion-utils/dist/es/progress.es.js";
import { noop as L } from "../../../../../../../motion-utils@12.36.0/node_modules/motion-utils/dist/es/noop.es.js";
import { circOut as B } from "../../../../../../../motion-utils@12.36.0/node_modules/motion-utils/dist/es/easing/circ.es.js";
const p = [
  "borderTopLeftRadius",
  "borderTopRightRadius",
  "borderBottomLeftRadius",
  "borderBottomRightRadius"
], M = p.length, d = (t) => typeof t == "string" ? parseFloat(t) : t, a = (t) => typeof t == "number" || x.test(t);
function V(t, o, r, i, R, y) {
  R ? (t.opacity = c(0, r.opacity ?? 1, C(i)), t.opacityExit = c(o.opacity ?? 1, 0, O(i))) : y && (t.opacity = c(o.opacity ?? 1, r.opacity ?? 1, i));
  for (let f = 0; f < M; f++) {
    const s = p[f];
    let n = m(o, s), e = m(r, s);
    if (n === void 0 && e === void 0)
      continue;
    n || (n = 0), e || (e = 0), n === 0 || e === 0 || a(n) === a(e) ? (t[s] = Math.max(c(d(n), d(e), i), 0), (u.test(e) || u.test(n)) && (t[s] += "%")) : t[s] = e;
  }
  (o.rotate || r.rotate) && (t.rotate = c(o.rotate || 0, r.rotate || 0, i));
}
function m(t, o) {
  return t[o] !== void 0 ? t[o] : t.borderRadius;
}
const C = /* @__PURE__ */ b(0, 0.5, B), O = /* @__PURE__ */ b(0.5, 0.95, L);
function b(t, o, r) {
  return (i) => i < t ? 0 : i > o ? 1 : r(h(t, o, i));
}
export {
  V as mixValues
};
//# sourceMappingURL=mix-values.es.js.map
