"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../motion-utils/dist-es-errors.cjs");
const easing = require("../motion-dom/dist-es-animation-waapi-utils-easing.cjs");
function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeInOut", times } = {}) {
  const keyframeOptions = { [valueName]: keyframes };
  if (times)
    keyframeOptions.offset = times;
  const easing$1 = easing.mapEasingToNativeEasing(ease, duration);
  if (Array.isArray(easing$1))
    keyframeOptions.easing = easing$1;
  return element.animate(keyframeOptions, {
    delay,
    duration,
    easing: !Array.isArray(easing$1) ? easing$1 : "linear",
    fill: "both",
    iterations: repeat + 1,
    direction: repeatType === "reverse" ? "alternate" : "normal"
  });
}
exports.startWaapiAnimation = startWaapiAnimation;
//# sourceMappingURL=dist-es-animation-animators-waapi-index.cjs.map
