"use strict";
const jsxRuntime = require("react/jsx-runtime");
const langMarkdown = require("@codemirror/lang-markdown");
const langPython = require("@codemirror/lang-python");
const language = require("@codemirror/language");
const yaml = require("@codemirror/legacy-modes/mode/yaml");
const ReactCodeMirror = require("@uiw/react-codemirror");
const kit_Theme_UI = require("../Theme/UI.cjs");
require("../Theme/themeUtils.cjs");
require("../Theme/themes.cjs");
const langs = {
  markdown: () => langMarkdown.markdown({ base: langMarkdown.markdownLanguage }),
  python: langPython.python,
  yaml: () => language.StreamLanguage.define(yaml.yaml)
};
const CodeMirrorEditor = ({ syntax, ...props }) => {
  const {
    themeSettings: { themeIsDark }
  } = kit_Theme_UI.useTheme();
  return /* @__PURE__ */ jsxRuntime.jsx(
    ReactCodeMirror,
    {
      extensions: [langs[syntax]()],
      theme: themeIsDark ? "dark" : "light",
      ...props
    }
  );
};
module.exports = CodeMirrorEditor;
