import { defineComponent, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode } from "vue";
import { useUIKit, TUIDialog } from "@tencentcloud/uikit-base-component-vue3";
import { AudioSettingPanel, VideoSettingPanel } from "tuikit-atomicx-vue3/room";
const _hoisted_1 = { class: "setting-body" };
const _hoisted_2 = { class: "setting-tabs" };
const _hoisted_3 = ["onClick"];
const _hoisted_4 = { class: "setting-content" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "SettingDialog",
  props: {
    visible: { type: Boolean }
  },
  emits: ["close"],
  setup(__props, { emit: __emit }) {
    const { t } = useUIKit();
    const emit = __emit;
    const activeSettingTab = ref("audio");
    const settingTabsTitleList = computed(() => [
      { label: t("Setting.AudioSetting"), value: "audio" },
      { label: t("Setting.VideoSetting"), value: "video" }
    ]);
    function handleClose() {
      emit("close");
    }
    function handleUpdateActiveTab(tabTitle) {
      activeSettingTab.value = tabTitle;
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(TUIDialog), {
        title: unref(t)("Settings.Title"),
        visible: __props.visible,
        customClasses: ["custom-setting-dialog"],
        appendTo: "#roomPage",
        onClose: handleClose
      }, {
        footer: withCtx(() => [..._cache[1] || (_cache[1] = [
          createElementVNode("div", null, null, -1)
        ])]),
        default: withCtx(() => [
          createElementVNode("div", _hoisted_1, [
            createElementVNode("div", _hoisted_2, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(settingTabsTitleList.value, (item, index) => {
                return openBlock(), createElementBlock("div", {
                  key: index,
                  class: normalizeClass([
                    "tabs-title",
                    `${activeSettingTab.value === item.value ? "active" : ""}`
                  ]),
                  onClick: ($event) => handleUpdateActiveTab(item.value)
                }, toDisplayString(item.label), 11, _hoisted_3);
              }), 128))
            ]),
            _cache[0] || (_cache[0] = createElementVNode("div", { class: "divide-line" }, null, -1)),
            createElementVNode("div", _hoisted_4, [
              activeSettingTab.value === "audio" ? (openBlock(), createBlock(unref(AudioSettingPanel), {
                key: 0,
                outputVolumeVisible: false,
                class: "setting-tab"
              })) : createCommentVNode("", true),
              activeSettingTab.value === "video" ? (openBlock(), createBlock(unref(VideoSettingPanel), {
                key: 1,
                class: "setting-tab"
              })) : createCommentVNode("", true)
            ])
          ])
        ]),
        _: 1
      }, 8, ["title", "visible"]);
    };
  }
});
export {
  _sfc_main as default
};
