import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, toDisplayString, createCommentVNode } from "vue";
const _hoisted_1 = {
  key: 0,
  class: "tui-badge-count"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Badge",
  props: {
    type: { default: "primary" },
    value: { default: "" },
    max: { default: 99 },
    hidden: { type: Boolean, default: false },
    isDot: { type: Boolean, default: false }
  },
  setup(__props) {
    const props = __props;
    const showBadge = computed(() => !props.hidden && (props.value || props.isDot));
    const content = computed(() => {
      if (props.isDot) return "";
      if (typeof props.value === "number" && typeof props.max === "number") {
        return props.value > props.max ? `${props.max}+` : props.value;
      }
      return props.value;
    });
    const badgeClass = computed(() => [
      "tui-badge",
      `tui-badge-${props.type}`,
      props.isDot ? "tui-badge-isDot" : ""
    ]);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(badgeClass.value)
      }, [
        renderSlot(_ctx.$slots, "default", {}, void 0, true),
        showBadge.value ? (openBlock(), createElementBlock("sup", _hoisted_1, toDisplayString(content.value), 1)) : createCommentVNode("", true)
      ], 2);
    };
  }
});
export {
  _sfc_main as default
};
