"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uviewPro_components_uBadge_types = require("./types.js");
const uni_modules_uviewPro_libs_index = require("../../libs/index.js");
require("../../libs/util/logger.js");
require("../../libs/config/theme-tokens.js");
const __default__ = {
  name: "u-badge",
  options: {
    addGlobalClass: true,
    virtualHost: true,
    styleIsolation: "shared"
  }
};
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  ...__default__,
  props: uni_modules_uviewPro_components_uBadge_types.BadgeProps,
  setup(__props) {
    const props = __props;
    const boxStyle = common_vendor.computed(() => {
      let style = {};
      if (props.isCenter) {
        style.top = 0;
        style.right = 0;
        style.transform = "translateY(-50%) translateX(50%)";
      } else {
        style.top = props.offset[0] + "rpx";
        style.right = props.offset[1] + "rpx";
        style.transform = "translateY(0) translateX(0)";
      }
      if (props.size === "mini") {
        style.transform = style.transform + " scale(0.8)";
      }
      return style;
    });
    const showText = common_vendor.computed(() => {
      if (props.isDot)
        return "";
      else {
        if (Number(props.count) > props.overflowCount)
          return `${props.overflowCount}+`;
        else
          return props.count;
      }
    });
    const show = common_vendor.computed(() => {
      if (Number(props.count) === 0 && props.showZero === false)
        return false;
      else
        return true;
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: show.value
      }, show.value ? {
        b: common_vendor.t(showText.value),
        c: common_vendor.n(_ctx.isDot ? "u-badge-dot" : ""),
        d: common_vendor.n(_ctx.size === "mini" ? "u-badge-mini" : ""),
        e: common_vendor.n(_ctx.type ? "u-badge--bg--" + _ctx.type : ""),
        f: common_vendor.n(_ctx.customClass),
        g: common_vendor.s(common_vendor.unref(uni_modules_uviewPro_libs_index.$u).toStyle({
          top: _ctx.offset[0] + "rpx",
          right: _ctx.offset[1] + "rpx",
          fontSize: _ctx.fontSize + "rpx",
          position: _ctx.absolute ? "absolute" : "static",
          color: _ctx.color,
          backgroundColor: _ctx.bgColor
        }, boxStyle.value, _ctx.customStyle))
      } : {});
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-53906a69"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-pro/components/u-badge/u-badge.js.map
