import { interpolate as f } from "../../utils/interpolate.es.js";
import { easeInOut as p } from "../../easing/index.es.js";
function m(e, t) {
  return e.map(() => t || p).splice(0, e.length - 1);
}
function g(e) {
  const t = e.length;
  return e.map((r, n) => n !== 0 ? n / (t - 1) : 0);
}
function y(e, t) {
  return e.map((r) => r * t);
}
function A({ from: e = 0, to: t = 1, ease: r, offset: n, duration: u = 300 }) {
  const o = { done: !1, value: e }, a = Array.isArray(t) ? t : [e, t], c = y(n && n.length === a.length ? n : g(a), u);
  function l() {
    return f(c, a, {
      ease: Array.isArray(r) ? r : m(a, r)
    });
  }
  let i = l();
  return {
    next: (s) => (o.value = i(s), o.done = s >= u, o),
    flipTarget: () => {
      a.reverse(), i = l();
    }
  };
}
export {
  y as convertOffsetToTimes,
  m as defaultEasing,
  g as defaultOffset,
  A as keyframes
};
//# sourceMappingURL=keyframes.es.js.map
