import { defineComponent, computed, unref, openBlock, createBlock, createCommentVNode } from "vue";
import IconButton from "./base/IconButton.vue.mjs";
import { IconButtonLayout } from "../../constants/room.mjs";
import LanguageIcon from "./icons/LanguageIcon.vue.mjs";
import { useBasicStore } from "../../stores/basic.mjs";
import i18n from "../../locales/index.mjs";
import "../../services/main.mjs";
import { roomService } from "../../services/roomService.mjs";
import "@tencentcloud/tuiroom-engine-js";
import "mitt";
import "../../services/manager/roomActionManager.mjs";
import "@tencentcloud/tui-core";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Language",
  setup(__props) {
    const basicStore = useBasicStore();
    const title = computed(
      () => basicStore.lang === "en-US" ? "English" : "中文"
    );
    const languageConfig = roomService.getComponentConfig("Language");
    const handleChange = () => {
      roomService.setLanguage(
        i18n.global.locale.value === "en-US" ? "zh-CN" : "en-US"
      );
    };
    return (_ctx, _cache) => {
      return unref(languageConfig).visible ? (openBlock(), createBlock(IconButton, {
        key: 0,
        title: title.value,
        layout: unref(IconButtonLayout).HORIZONTAL,
        icon: LanguageIcon,
        onClickIcon: handleChange
      }, null, 8, ["title", "layout"])) : createCommentVNode("", true);
    };
  }
});
export {
  _sfc_main as default
};
