import { defineComponent, useCssVars, unref, ref, computed, watchEffect, openBlock, createElementBlock, withModifiers, createElementVNode, normalizeClass, Fragment, createBlock, toDisplayString, createCommentVNode, withDirectives, createVNode, mergeProps, vShow, createTextVNode } from "vue";
import WlSvg from "@wltech/svg";
var index_vue_vue_type_style_index_0_lang$1 = "";
const _hoisted_1$1 = ["onClick"];
const _hoisted_2$1 = {
  key: 1,
  class: "dot"
};
const _hoisted_3 = {
  key: 2,
  class: "count"
};
const _hoisted_4 = {
  key: 0,
  class: "uno-pl-8"
};
const __default__$1 = {
  name: "WlRadioIcon"
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  ...__default__$1,
  props: {
    isChoosed: { type: Boolean, default: false },
    disabled: { type: Boolean, default: false },
    size: { default: 18 },
    color: { default: "var(--wl-primary-color)" },
    count: { default: 1 },
    type: { default: "hook" },
    iconType: { default: "" },
    text: { default: "" }
  },
  emits: ["onClick"],
  setup(__props, { emit }) {
    const props = __props;
    useCssVars((_ctx) => ({
      "4d335b1a": unref(iconSize),
      "272de063": __props.color
    }));
    const isChecked = ref(false);
    const iconSize = computed(() => props.size + "px");
    const svgType = computed(
      () => props.type === "hook" ? "successFill" : props.iconType
    );
    const radioWrapClass = computed(() => {
      return `radio-wrap ${isChecked.value ? "" : "checked"}`;
    });
    const onClick = () => {
      if (props.disabled)
        return;
      emit("onClick", isChecked.value);
    };
    watchEffect(() => {
      isChecked.value = props.isChoosed;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "radio-icon-wrap",
        onClick: withModifiers(onClick, ["stop"]),
        "data-weiling-mobile-ui-wl-radio-icon": ""
      }, [
        createElementVNode("div", {
          class: normalizeClass(unref(radioWrapClass))
        }, [
          isChecked.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
            ["hook", "icon"].includes(__props.type) ? (openBlock(), createBlock(unref(WlSvg), {
              key: 0,
              type: unref(svgType),
              color: "var(--wl-primary-color)",
              height: unref(iconSize),
              width: unref(iconSize)
            }, null, 8, ["type", "height", "width"])) : __props.type === "dot" ? (openBlock(), createElementBlock("p", _hoisted_2$1)) : __props.type === "count" ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.count), 1)) : createCommentVNode("", true)
          ], 64)) : createCommentVNode("", true)
        ], 2),
        __props.text ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(__props.text), 1)) : createCommentVNode("", true)
      ], 8, _hoisted_1$1);
    };
  }
});
var index_vue_vue_type_style_index_0_lang = "";
const _hoisted_1 = { class: "checkbox" };
const _hoisted_2 = { key: 0 };
const __default__ = {
  name: "BCTotal"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    title: { default: "" },
    count: { default: 0 },
    checkboxVisible: { type: Boolean, default: false },
    unChosedColor: { default: "#EEEEEE" }
  },
  emits: ["onToggleCheckbox"],
  setup(__props, { emit }) {
    const props = __props;
    let isChoosed = ref(false);
    const onToggleCheckbox = () => {
      if (!props.checkboxVisible)
        return;
      isChoosed.value = !isChoosed.value;
      emit("onToggleCheckbox", isChoosed.value);
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "bc-total",
        "data-weiling-mobile-ui-bc-total": "",
        onClick: onToggleCheckbox
      }, [
        withDirectives(createElementVNode("p", _hoisted_1, [
          createVNode(_sfc_main$1, mergeProps({ isChoosed: unref(isChoosed) }, _ctx.$attrs, { unChosedColor: __props.unChosedColor }), null, 16, ["isChoosed", "unChosedColor"])
        ], 512), [
          [vShow, __props.checkboxVisible]
        ]),
        createElementVNode("p", null, [
          createTextVNode(toDisplayString(__props.title) + " ", 1),
          __props.count ? (openBlock(), createElementBlock("span", _hoisted_2, "\xB7" + toDisplayString(__props.count), 1)) : createCommentVNode("", true)
        ])
      ]);
    };
  }
});
var __uno = "";
_sfc_main.install = (app) => {
  app.component(_sfc_main.name, _sfc_main);
};
export { _sfc_main as default };
