import { f as __name } from "./chunk-TCCFYFTB-d3HOqL2I.js";
let parse;
let __tla = (async () => {
  var _a;
  var parsers = {}, initializers = {
    info: __name(async () => {
      let { createInfoServices: e } = await import("./info-VBDWY6EO-D2lvLLw5.js");
      parsers.info = e().Info.parser.LangiumParser;
    }, "info"),
    packet: __name(async () => {
      let { createPacketServices: e } = await import("./packet-DYOGHKS2-CmWtF3uO.js");
      parsers.packet = e().Packet.parser.LangiumParser;
    }, "packet"),
    pie: __name(async () => {
      let { createPieServices: e } = await import("./pie-VRWISCQL-B6u8vus8.js");
      parsers.pie = e().Pie.parser.LangiumParser;
    }, "pie"),
    architecture: __name(async () => {
      let { createArchitectureServices: e } = await import("./architecture-7HQA4BMR-CS9jOrqM.js");
      parsers.architecture = e().Architecture.parser.LangiumParser;
    }, "architecture"),
    gitGraph: __name(async () => {
      let { createGitGraphServices: e } = await import("./gitGraph-G5XIXVHT-DGlbae5m.js");
      parsers.gitGraph = e().GitGraph.parser.LangiumParser;
    }, "gitGraph"),
    radar: __name(async () => {
      let { createRadarServices: e } = await import("./radar-ZZBFDIW7-XAmXSa8s.js");
      parsers.radar = e().Radar.parser.LangiumParser;
    }, "radar"),
    treemap: __name(async () => {
      let { createTreemapServices: e } = await import("./treemap-GDKQZRPO-Du95DV6u.js");
      parsers.treemap = e().Treemap.parser.LangiumParser;
    }, "treemap")
  };
  parse = async function(e, i) {
    let a = initializers[e];
    if (!a) throw Error(`Unknown diagram type: ${e}`);
    parsers[e] || await a();
    let o = parsers[e].parse(i);
    if (o.lexerErrors.length > 0 || o.parserErrors.length > 0) throw new MermaidParseError(o);
    return o.value;
  };
  __name(parse, "parse");
  var MermaidParseError = (_a = class extends Error {
    constructor(e) {
      let n = e.lexerErrors.map((e2) => e2.message).join("\n"), r = e.parserErrors.map((e2) => e2.message).join("\n");
      super(`Parsing failed: ${n} ${r}`), this.result = e;
    }
  }, __name(_a, "MermaidParseError"), _a);
})();
export {
  __tla,
  parse as t
};
