import { defineComponent as p, watch as C, toRef as f, computed as k, createElementBlock as S, openBlock as u, Fragment as M, createBlock as D, createCommentVNode as v, createVNode as y, resolveDynamicComponent as w, withCtx as r, createTextVNode as $, toDisplayString as B, unref as t, renderSlot as i } from "vue";
import { useColorMode as N } from "@scalar/use-hooks/useColorMode";
import { useSeoMeta as R } from "@unhead/vue";
import { useFavicon as U } from "@vueuse/core";
import { useReactiveSpec as V } from "../hooks/useReactiveSpec.js";
import F from "./Layouts/Layouts.vue.js";
const z = /* @__PURE__ */ p({
  __name: "SingleApiReference",
  props: {
    configuration: {}
  },
  emits: ["updateContent"],
  setup(e) {
    const { toggleColorMode: d, isDarkMode: a } = N({
      initialColorMode: e.configuration.darkMode ? "dark" : void 0,
      overrideColorMode: e.configuration.forceDarkModeState
    });
    C(
      () => e.configuration.darkMode,
      (o) => a.value = !!o
    ), e.configuration.metaData && R(e.configuration.metaData);
    const { parsedSpec: m, rawSpec: s } = V({
      proxyUrl: f(() => e.configuration.proxyUrl || ""),
      specConfig: f(() => e.configuration || {})
    }), l = k(() => e.configuration.favicon);
    return U(l), (o, n) => {
      var c;
      return u(), S(M, null, [
        (c = o.configuration) != null && c.customCss ? (u(), D(w("style"), { key: 0 }, {
          default: r(() => [
            $(B(o.configuration.customCss), 1)
          ]),
          _: 1
        })) : v("", !0),
        y(t(F), {
          configuration: o.configuration,
          isDark: t(a),
          parsedSpec: t(m),
          rawSpec: t(s),
          onToggleDarkMode: n[0] || (n[0] = () => t(d)()),
          onUpdateContent: n[1] || (n[1] = (g) => o.$emit("updateContent", g))
        }, {
          footer: r(() => [
            i(o.$slots, "footer")
          ]),
          "content-end": r(() => [
            i(o.$slots, "footer")
          ]),
          "document-selector": r(() => [
            i(o.$slots, "document-selector")
          ]),
          _: 3
        }, 8, ["configuration", "isDark", "parsedSpec", "rawSpec"])
      ], 64);
    };
  }
});
export {
  z as default
};
