import { defineComponent, unref, openBlock, createBlock, createCommentVNode } from "vue";
import IconButton from "./base/IconButton.vue.mjs";
import SwitchThemeIcon from "./icons/SwitchThemeIcon.vue.mjs";
import { IconButtonLayout } from "../../constants/room.mjs";
import { useBasicStore } from "../../stores/basic.mjs";
import { useI18n } 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: "SwitchTheme",
  props: {
    visible: { type: Boolean, default: true }
  },
  setup(__props) {
    const basicStore = useBasicStore();
    const { t } = useI18n();
    const switchThemeConfig = roomService.getComponentConfig("SwitchTheme");
    function handleSwitchTheme() {
      roomService.setTheme(basicStore.defaultTheme === "white" ? "black" : "white");
    }
    return (_ctx, _cache) => {
      return _ctx.visible && unref(switchThemeConfig).visible ? (openBlock(), createBlock(IconButton, {
        key: 0,
        title: unref(t)("Switch Theme"),
        layout: unref(IconButtonLayout).HORIZONTAL,
        icon: SwitchThemeIcon,
        onClickIcon: handleSwitchTheme
      }, null, 8, ["title", "layout"])) : createCommentVNode("", true);
    };
  }
});
export {
  _sfc_main as default
};
