import { defineComponent as d, createBlock as a, openBlock as n, unref as o } from "vue";
import { getActiveProxyUrl as i } from "../../../helpers/get-active-proxy-url.js";
import s from "../../settings/DocumentSettings.vue.js";
import h from "../../settings/CollectionSettings.vue.js";
const x = /* @__PURE__ */ d({
  __name: "Settings",
  props: {
    documentSlug: {},
    document: {},
    eventBus: {},
    layout: {},
    path: {},
    method: {},
    exampleName: {},
    environment: {},
    securitySchemes: {},
    workspaceStore: {},
    activeWorkspace: {},
    plugins: {},
    customThemes: {},
    currentTheme: {},
    isDarkMode: { type: Boolean },
    fetchRegistryDocument: { type: Function },
    collectionType: {}
  },
  setup(e) {
    const m = (t) => {
      e.eventBus.emit("document:update:watch-mode", t);
    }, u = (t) => {
      e.eventBus.emit("workspace:update:theme", t);
    }, r = (t) => {
      e.eventBus.emit("workspace:update:active-proxy", t);
    }, l = (t) => {
      e.eventBus.emit("workspace:update:color-mode", t);
    };
    return (t, c) => e.collectionType === "document" ? (n(), a(o(s), {
      key: 0,
      documentUrl: e.document?.["x-scalar-original-source-url"],
      isDraftDocument: e.documentSlug === "drafts",
      title: e.document?.info.title ?? "",
      watchMode: e.document?.["x-scalar-watch-mode"],
      "onDelete:document": c[0] || (c[0] = (y) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
      "onUpdate:watchMode": m
    }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (n(), a(o(h), {
      key: 1,
      activeProxyUrl: o(i)(
        e.workspaceStore.workspace["x-scalar-active-proxy"],
        e.layout
      ),
      activeThemeSlug: e.workspaceStore.workspace["x-scalar-theme"] ?? "none",
      colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
      customThemes: e.customThemes,
      "onUpdate:colorMode": l,
      "onUpdate:proxyUrl": r,
      "onUpdate:themeSlug": u
    }, null, 8, ["activeProxyUrl", "activeThemeSlug", "colorMode", "customThemes"]));
  }
});
export {
  x as default
};
