"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const pinia = require("pinia");
const IconButton = require("../common/base/IconButton.vue.js");
const ManageMemberIcon = require("../common/icons/ManageMemberIcon.vue.js");
const basic = require("../../stores/basic.js");
const room = require("../../stores/room.js");
const index = require("../../locales/index.js");
require("../../services/main.js");
const roomService = require("../../services/roomService.js");
require("@tencentcloud/tuiroom-engine-js");
require("mitt");
require("../../services/manager/roomActionManager.js");
require("@tencentcloud/tui-core");
const _hoisted_1 = {
  key: 0,
  class: "manage-member-control-container"
};
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "ManageMemberControl",
  setup(__props) {
    const manageMemberControlConfig = roomService.roomService.getComponentConfig(
      "ManageMemberControl"
    );
    const { t } = index.useI18n();
    const basicStore = basic.useBasicStore();
    const { sidebarName } = pinia.storeToRefs(basicStore);
    const roomStore = room.useRoomStore();
    const { userNumber } = pinia.storeToRefs(roomStore);
    const memberTitle = Vue.computed(() => `${t("Members")}(${userNumber.value})`);
    function toggleMangeMemberSidebar() {
      if (basicStore.setSidebarOpenStatus && sidebarName.value === "manage-member") {
        basicStore.setSidebarOpenStatus(false);
        basicStore.setSidebarName("");
        return;
      }
      basicStore.setSidebarOpenStatus(true);
      basicStore.setSidebarName("manage-member");
    }
    return (_ctx, _cache) => {
      return Vue.unref(manageMemberControlConfig).visible ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        Vue.createVNode(IconButton.default, {
          "is-active": Vue.unref(sidebarName) === "manage-member",
          title: memberTitle.value,
          icon: ManageMemberIcon.default,
          onClickIcon: toggleMangeMemberSidebar
        }, null, 8, ["is-active", "title"])
      ])) : Vue.createCommentVNode("", true);
    };
  }
});
exports.default = _sfc_main;
