import { inject as f, onMounted as T, createElementBlock as m, createCommentVNode as _, openBlock as s, createElementVNode as g, Fragment as y, renderList as v, toDisplayString as k } from "vue";
import "../../../hooks/useMessageDraft.js";
import "../../../hooks/useSearchModel.js";
import { useTheme as B } from "../../../hooks/useTheme.js";
/* empty css                              */
import I from "../../../_virtual/_plugin-vue_export-helper.js";
/* empty css                                              */
import "../../../node_modules/linkifyjs/dist/linkify.js";
import "../../../node_modules/linkify-string/dist/linkify-string.js";
import "../../../functions/parseMarkdown.js";
/* empty css               */
const x = { key: 0 }, A = ["value", "selected"], E = {
  __name: "ThemeMode",
  props: {
    themes: {
      type: Array,
      default: () => []
    },
    show: Boolean
  },
  emits: ["selectedTheme"],
  setup(c, { emit: a }) {
    const n = c, i = a, r = f("chatAppId"), { getTheme: p } = B(r), l = () => {
      const e = n.themes.find((t) => t.default === !0);
      return e ? e.code : n.themes[0].code;
    }, u = (e) => {
      const t = e.target.value;
      d(t);
    }, d = (e) => {
      r && (document.getElementById(r).dataset.theme = e, p().theme = e, i("selectedTheme", e));
    };
    return T(() => {
      const e = l();
      d(e);
    }), (e, t) => c.show ? (s(), m("div", x, [
      g("select", {
        onChange: t[0] || (t[0] = (o) => u(o))
      }, [
        (s(!0), m(y, null, v(n.themes, (o, h) => (s(), m("option", {
          key: h,
          value: o.code,
          selected: o.default === !0
        }, k(o.name), 9, A))), 128))
      ], 32)
    ])) : _("", !0);
  }
}, q = /* @__PURE__ */ I(E, [["__scopeId", "data-v-c6c5d7cb"]]);
export {
  q as default
};
