import p from "../../../@babel/runtime/helpers/esm/slicedToArray.mjs";
import l from "../../../rc-util/es/raf.mjs";
import { useState as g, useRef as v, useEffect as S } from "react";
var R = function(n) {
  var t = n.activeTabOffset, a = n.horizontal, i = n.rtl, r = n.indicatorSize, h = g(), f = p(h, 2), d = f[0], m = f[1], o = v(), u = function(c) {
    return typeof r == "function" ? r(c) : typeof r == "number" ? r : c;
  };
  function s() {
    l.cancel(o.current);
  }
  return S(function() {
    var e = {};
    return t && (a ? (i ? (e.right = t.right + t.width / 2, e.transform = "translateX(50%)") : (e.left = t.left + t.width / 2, e.transform = "translateX(-50%)"), e.width = u(t.width)) : (e.top = t.top + t.height / 2, e.transform = "translateY(-50%)", e.height = u(t.height))), s(), o.current = l(function() {
      m(e);
    }), s;
  }, [t, a, i, r]), {
    style: d
  };
};
export {
  R as default
};
