"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const Avatar = require("../../common/Avatar.vue.js");
const useUserInfoHooks = require("./useUserInfoHooks.js");
const vTap = require("../../../directives/vTap.js");
require("../../../services/main.js");
const roomService = require("../../../services/roomService.js");
require("../../../locales/index.js");
require("@tencentcloud/tuiroom-engine-js");
require("mitt");
require("../../../services/manager/roomActionManager.js");
require("@tencentcloud/tui-core");
const _hoisted_1 = { class: "user-info-content" };
const _hoisted_2 = { class: "name" };
const _hoisted_3 = {
  key: 0,
  class: "user-control-container"
};
const _hoisted_4 = { class: "logout-mobile" };
const _hoisted_5 = { class: "logout-mobile-main" };
const _hoisted_6 = { class: "logout" };
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "UserInfoH5",
  props: {
    userId: {},
    userName: {},
    avatarUrl: {}
  },
  emits: ["log-out"],
  setup(__props) {
    const userInfoConfig = roomService.roomService.getComponentConfig("UserInfo");
    const { userInfoRef, showUserControl, t, handleUserControl } = useUserInfoHooks.default();
    return (_ctx, _cache) => {
      return Vue.unref(userInfoConfig).visible ? (Vue.openBlock(), Vue.createElementBlock("div", {
        key: 0,
        ref_key: "userInfoRef",
        ref: userInfoRef,
        class: "user-info-container"
      }, [
        Vue.withDirectives((Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
          Vue.createVNode(Avatar.default, {
            class: "avatar",
            "img-src": _ctx.avatarUrl
          }, null, 8, ["img-src"]),
          Vue.createElementVNode("div", _hoisted_2, Vue.toDisplayString(_ctx.userName || _ctx.userId), 1)
        ])), [
          [Vue.unref(vTap.default), Vue.unref(handleUserControl)]
        ]),
        Vue.unref(showUserControl) ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_3, [
          Vue.createElementVNode("div", _hoisted_4, [
            Vue.createElementVNode("div", _hoisted_5, [
              Vue.withDirectives((Vue.openBlock(), Vue.createElementBlock("div", _hoisted_6, [
                Vue.createElementVNode("i", null, Vue.toDisplayString(Vue.unref(t)("Log out")), 1)
              ])), [
                [Vue.unref(vTap.default), () => _ctx.$emit("log-out")]
              ]),
              Vue.createElementVNode("div", {
                class: "close",
                onClick: _cache[0] || (_cache[0] = Vue.withModifiers(($event) => showUserControl.value = false, ["stop"]))
              }, [
                Vue.createElementVNode("i", null, Vue.toDisplayString(Vue.unref(t)("Cancel")), 1)
              ])
            ])
          ])
        ])) : Vue.createCommentVNode("", true)
      ], 512)) : Vue.createCommentVNode("", true);
    };
  }
});
exports.default = _sfc_main;
