import { defineComponent, ref, openBlock, createElementBlock, withModifiers, createVNode, unref, createBlock, createCommentVNode, pushScopeId, popScopeId, createElementVNode } from "vue";
import { n as _export_sfc, a as _sfc_main$1, o as defaultAvatar, p as _sfc_main$2, r as _sfc_main$3, C as Comp } from "./index2.js";
import "vant";
import "@wltech/svg";
import "dayjs";
import "qs";
import "vuedraggable";
import "vue-router";
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
const _withScopeId = (n) => (pushScopeId("data-v-b192bf94"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "render-card-friends a-row" };
const _hoisted_2 = ["onClick"];
const _hoisted_3 = ["onClick"];
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, "\u6DFB\u52A0", -1));
const _hoisted_5 = { key: 2 };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    data: { default: () => {
    } },
    listItem: { default: () => {
      return {};
    } },
    is_trial: { type: Boolean, default: false },
    env_data: { default: () => {
      return {};
    } }
  },
  emits: ["onPersonChoose", "onItem"],
  setup(__props, { emit }) {
    const props = __props;
    const showPerson = ref(false);
    const onAdd = () => {
      showPerson.value = true;
    };
    const onPersonChoose = (obj) => {
      emit("onPersonChoose", obj);
    };
    const onItem = () => {
      var _a;
      if (!((_a = props.listItem) == null ? void 0 : _a.allowClick))
        return;
      emit("onItem", {
        data: props.data,
        listItem: props.listItem
      });
    };
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e;
      return openBlock(), createElementBlock("div", _hoisted_1, [
        ((_a = __props.data) == null ? void 0 : _a.bind_id) ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: "user",
          onClick: withModifiers(onItem, ["stop"])
        }, [
          createVNode(_sfc_main$1, {
            class: "user-img",
            src: ((_b = __props.data) == null ? void 0 : _b.head_img_url) || unref(defaultAvatar),
            alt: ""
          }, null, 8, ["src"]),
          createVNode(_sfc_main$2, {
            class: "user-name a-row",
            name: __props.data.nick_name,
            openid: (_c = __props.data) == null ? void 0 : _c.userid_third,
            is_trial: __props.is_trial
          }, null, 8, ["name", "openid", "is_trial"]),
          ((_d = __props.listItem) == null ? void 0 : _d.allowClick) ? (openBlock(), createBlock(_sfc_main$3, {
            key: 0,
            type: "arrowRight",
            width: "16",
            height: "16",
            color: "#C2C8CC",
            class: "arrow-icon"
          })) : createCommentVNode("", true)
        ], 8, _hoisted_2)) : !((_e = __props.data) == null ? void 0 : _e.bind_id) && __props.listItem.isAdd ? (openBlock(), createElementBlock("div", {
          key: 1,
          class: "friends-add",
          onClick: withModifiers(onAdd, ["stop"])
        }, [
          createVNode(_sfc_main$3, {
            type: "add",
            width: "12",
            height: "12",
            color: "var(--wl-primary-color)"
          }),
          _hoisted_4
        ], 8, _hoisted_3)) : (openBlock(), createElementBlock("div", _hoisted_5, "--")),
        createVNode(unref(Comp), {
          value: showPerson.value,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => showPerson.value = $event),
          title: __props.listItem.title || `\u9009\u62E9${__props.listItem.label}`,
          env_data: __props.env_data,
          tabTypes: [1, 2],
          isRadio: "",
          onOnHandleChoose: onPersonChoose
        }, null, 8, ["value", "title", "env_data"])
      ]);
    };
  }
});
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b192bf94"]]);
export { index as default };
