import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, createBlock, createVNode, toDisplayString, createCommentVNode } from "vue";
import { n as _export_sfc, a as _sfc_main$1, o as defaultAvatar, p as _sfc_main$2 } from "./index2.js";
import { t as typeDetection } from "./utils.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 _hoisted_1 = {
  key: 0,
  class: "fs0"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    data: { default: () => {
      return {};
    } },
    listItem: { default: () => {
      return {
        aRow: true,
        sliceNum: 1
      };
    } },
    is_trial: { type: Boolean, default: false }
  },
  setup(__props) {
    const props = __props;
    const list = computed(() => {
      return typeDetection(props.data) === "object" ? [props.data] : props.data;
    });
    const listItemObj = computed(() => {
      return {
        aRow: true,
        sliceNum: 1,
        ...props.listItem
      };
    });
    const getName = (arr) => {
      var _a, _b;
      const nameList = (_b = arr == null ? void 0 : arr.map((e) => {
        var _a2;
        return e.nick_name || ((_a2 = e.add_user) == null ? void 0 : _a2.nick_name);
      })) == null ? void 0 : _b.slice(0, (_a = listItemObj.value) == null ? void 0 : _a.sliceNum);
      return (arr == null ? void 0 : arr.length) > 1 ? `${nameList == null ? void 0 : nameList.join("\u3001")}` : nameList == null ? void 0 : nameList[0];
    };
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e;
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["user-groups", { "a-row": unref(listItemObj).aRow }])
      }, [
        (openBlock(true), createElementBlock(Fragment, null, renderList((_a = unref(list)) == null ? void 0 : _a.slice(0, 3), (item, index2) => {
          var _a2;
          return openBlock(), createBlock(_sfc_main$1, {
            key: item == null ? void 0 : item.id,
            class: normalizeClass(["user_img", { "uno-ml-n-10": index2 >= 1 }]),
            src: (item == null ? void 0 : item.head_img_url) || ((_a2 = item.add_user) == null ? void 0 : _a2.head_img_url) || unref(defaultAvatar),
            alt: ""
          }, null, 8, ["src", "class"]);
        }), 128)),
        createVNode(_sfc_main$2, {
          class: normalizeClass(["user-groups-name", { "a-row": unref(listItemObj).aRow }]),
          name: getName(unref(list)),
          openid: (_c = (_b = unref(list)) == null ? void 0 : _b[0]) == null ? void 0 : _c.userid_third,
          is_trial: __props.is_trial
        }, null, 8, ["class", "name", "openid", "is_trial"]),
        ((_d = unref(list)) == null ? void 0 : _d.length) > 1 ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(`\u7B49${(_e = unref(list)) == null ? void 0 : _e.length}\u4EBA`), 1)) : createCommentVNode("", true)
      ], 2);
    };
  }
});
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-38fd9a21"]]);
export { index as default };
