import f from "./index-objectWithoutPropertiesLoose.js";
import u from "./index-extends.js";
const l = ["duration", "easing", "delay"], p = {
  // This is the most common easing curve.
  easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
  // Objects enter the screen at full velocity from off-screen and
  // slowly decelerate to a resting point.
  easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
  // Objects leave the screen at full velocity. They do not decelerate when off-screen.
  easeIn: "cubic-bezier(0.4, 0, 1, 1)",
  // The sharp curve is used by objects that may return to the screen at any time.
  sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
}, y = {
  shortest: 150,
  shorter: 200,
  short: 250,
  // most basic recommended timing
  standard: 300,
  // this is to be used in complex animations
  complex: 375,
  // recommended when something is entering screen
  enteringScreen: 225,
  // recommended when something is leaving screen
  leavingScreen: 195
};
function m(e) {
  return `${Math.round(e)}ms`;
}
function h(e) {
  if (!e)
    return 0;
  const t = e / 36;
  return Math.round((4 + 15 * t ** 0.25 + t / 5) * 10);
}
function O(e) {
  const t = u({}, p, e.easing), c = u({}, y, e.duration);
  return u({
    getAutoHeightDuration: h,
    create: (n = ["all"], s = {}) => {
      const {
        duration: o = c.standard,
        easing: g = t.easeInOut,
        delay: i = 0
      } = s, b = f(s, l);
      if (process.env.NODE_ENV !== "production") {
        const r = (a) => typeof a == "string", d = (a) => !isNaN(parseFloat(a));
        !r(n) && Array.isArray(n), !d(o) && r(o), r(g), !d(i) && r(i), Object.keys(b).length;
      }
      return (Array.isArray(n) ? n : [n]).map((r) => `${r} ${typeof o == "string" ? o : m(o)} ${g} ${typeof i == "string" ? i : m(i)}`).join(",");
    }
  }, e, {
    easing: t,
    duration: c
  });
}
export {
  O as default,
  y as duration,
  p as easing
};
