import P from "../../../classnames/index.mjs";
import "../../../rc-progress/es/Line.mjs";
import W from "../../../rc-progress/es/Circle/index.mjs";
import * as t from "react";
import x from "../tooltip/index.mjs";
import { getSize as y, getStrokeColor as D, getPercentage as M } from "./utils.mjs";
const N = 3, $ = (e) => N / e * 100, j = (e) => {
  const {
    prefixCls: n,
    trailColor: a = null,
    strokeLinecap: m = "round",
    gapPosition: d,
    gapDegree: r,
    width: g = 120,
    type: c,
    children: l,
    success: p,
    size: C = g
  } = e, [o, f] = y(C, "circle");
  let {
    strokeWidth: i
  } = e;
  i === void 0 && (i = Math.max($(o), 6));
  const u = {
    width: o,
    height: f,
    fontSize: o * 0.15 + 6
  }, h = t.useMemo(() => {
    if (r || r === 0)
      return r;
    if (c === "dashboard")
      return 75;
  }, [r, c]), k = d || c === "dashboard" && "bottom" || void 0, E = Object.prototype.toString.call(e.strokeColor) === "[object Object]", b = D({
    success: p,
    strokeColor: e.strokeColor
  }), S = P(`${n}-inner`, {
    [`${n}-circle-gradient`]: E
  }), s = /* @__PURE__ */ t.createElement(W, {
    percent: M(e),
    strokeWidth: i,
    trailWidth: i,
    strokeColor: b,
    strokeLinecap: m,
    trailColor: a,
    prefixCls: n,
    gapDegree: h,
    gapPosition: k
  });
  return /* @__PURE__ */ t.createElement("div", {
    className: S,
    style: u
  }, o <= 20 ? /* @__PURE__ */ t.createElement(x, {
    title: l
  }, /* @__PURE__ */ t.createElement("span", null, s)) : /* @__PURE__ */ t.createElement(t.Fragment, null, s, l));
}, R = j;
export {
  R as default
};
