import { jsx as g } from "react/jsx-runtime";
import { forwardRef as x, useState as E, useEffect as R } from "react";
import $ from "../../hooks/useInterval.js";
const h = 10, b = x((o, a) => {
  const {
    start: i,
    end: n,
    prefix: f = "",
    unit: l = "",
    speed: m = h,
    decreasing: s = !1,
    onEnd: u = () => {
    },
    className: c = "",
    ...d
  } = o, [e, p] = E(i), t = s ? e > n : e < n;
  return $(
    () => {
      p((r) => s ? r - 1 : r + 1);
    },
    t ? m : null
  ), R(() => {
    t || u();
  }), /* @__PURE__ */ g("span", { ref: a, ...d, className: c, children: `${f}${e}${l}` });
});
export {
  b as AnimatedNumber,
  b as default
};
//# sourceMappingURL=AnimatedNumber.js.map
