"use client";
function c(i) {
  var e, u = () => null, t = !1, r = null, a = (n) => {
    if (!t) {
      if (Array.isArray(n)) {
        if (!n.length)
          return;
        var l = n, [f, ...o] = l;
        if (typeof f == "number") {
          r = i.setTimeout(a.bind(null, o), f);
          return;
        }
        a(f), r = i.setTimeout(a.bind(null, o));
        return;
      }
      typeof n == "string" && (e = n, u(e)), typeof n == "object" && (e = n, u(e)), typeof n == "function" && n();
    }
  };
  return {
    stop: () => {
      t = !0;
    },
    start: (n) => {
      t = !1, r && (r(), r = null), a(n);
    },
    subscribe: (n) => (u = n, () => {
      u = () => null;
    }),
    getTimeoutController: () => i
  };
}
export {
  c as createAnimateManager
};
