import { defineComponent as u, onMounted as c, watch as p, computed as s, openBlock as d, createElementBlock as f, normalizeStyle as y, normalizeClass as g, toDisplayString as N } from "vue";
import { C as r } from "./base-PQGakkrl.js";
const b = /* @__PURE__ */ u({
  name: "ClBadge",
  __name: "Index",
  props: {
    className: String,
    // desc: 自定义CSS类名
    color: {
      type: String,
      default: "default"
      // enum: default, green, red, yellow, black, gray (可自定义) | desc: 颜色主题
    },
    colorSty: String,
    // desc: 自定义颜色样式
    num: [String, Number],
    // desc: 显示的数字
    maxNum: {
      type: Number,
      default: -1
      // desc: 最大显示数字，超过显示 maxNum+
    },
    isHideZero: {
      type: Boolean,
      default: !0
      // desc: 是否隐藏数字为0的徽章
    },
    isDot: {
      type: Boolean,
      default: !1
      // desc: 是否显示为圆点
    }
  },
  setup(a) {
    const t = a, n = () => {
      r.isEmpty(t.num) && !t.isDot && console.warn('[ClBadge] Warning: Either "num" prop or "isDot" prop is required. When "num" is not provided, "isDot" must be true.');
    };
    c(() => {
      n();
    }), p(() => [t.num, t.isDot], () => {
      n();
    });
    const i = s(() => {
      let e = "";
      if (!r.isEmpty(t.num)) {
        const o = Number(t.num);
        o === 0 && t.isHideZero ? e = "" : o > (t.maxNum ?? -1) && (t.maxNum ?? -1) > 0 ? e = `${t.maxNum}+` : e = o.toString();
      }
      return e;
    }), m = s(() => {
      const e = {
        badge: !0
      };
      return r.isEmpty(t.color) || (e[`bg-${t.color}`] = !0), t.className && !r.isEmpty(t.className) && t.className.split(" ").forEach((o) => {
        r.isEmpty(o) || (e[o] = !0);
      }), t.isDot && (e["badge-dot"] = !0), e;
    }), l = s(() => {
      const e = {};
      return r.isEmpty(t.colorSty) || (e["background-color"] = `${t.colorSty} !important`), e;
    });
    return (e, o) => (d(), f("span", {
      class: g(m.value),
      style: y(l.value)
    }, N(i.value), 7));
  }
});
export {
  b as _
};
//# sourceMappingURL=Index.vue_vue_type_script_setup_true_lang-CejRfZxl.js.map
