"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_mdts_frontend"] = self["webpackChunk_mdts_frontend"] || []).push([["vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-OA4YK3LP_mjs"],{

/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/chunk-2Q5K7J3B.mjs"
/*!**************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/chunk-2Q5K7J3B.mjs ***!
  \**************************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   ImperativeState: () => (/* binding */ ImperativeState)\n/* harmony export */ });\n/* harmony import */ var _chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-Y2CYZVJY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs\");\n\n\n// src/utils/imperativeState.ts\nvar ImperativeState = class {\n  /**\n   * @param init - Function that creates the default state.\n   */\n  constructor(init) {\n    this.init = init;\n    this.records = this.init();\n  }\n  static {\n    ;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_0__.__name)(this, \"ImperativeState\");\n  }\n  reset() {\n    this.records = this.init();\n  }\n};\n\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/chunk-2Q5K7J3B.mjs?\n}");

/***/ },

/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs"
/*!**************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs ***!
  \**************************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   populateCommonDb: () => (/* binding */ populateCommonDb)\n/* harmony export */ });\n/* harmony import */ var _chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-Y2CYZVJY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs\");\n\n\n// src/diagrams/common/populateCommonDb.ts\nfunction populateCommonDb(ast, db) {\n  if (ast.accDescr) {\n    db.setAccDescription?.(ast.accDescr);\n  }\n  if (ast.accTitle) {\n    db.setAccTitle?.(ast.accTitle);\n  }\n  if (ast.title) {\n    db.setDiagramTitle?.(ast.title);\n  }\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_0__.__name)(populateCommonDb, \"populateCommonDb\");\n\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs?\n}");

/***/ },

/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/diagram-OA4YK3LP.mjs"
/*!****************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/diagram-OA4YK3LP.mjs ***!
  \****************************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   diagram: () => (/* binding */ diagram)\n/* harmony export */ });\n/* harmony import */ var _chunk_2Q5K7J3B_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-2Q5K7J3B.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-2Q5K7J3B.mjs\");\n/* harmony import */ var _chunk_JWPE2WC7_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-JWPE2WC7.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs\");\n/* harmony import */ var _chunk_VAUOI2AC_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-VAUOI2AC.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-VAUOI2AC.mjs\");\n/* harmony import */ var _chunk_HOUHSVGY_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-HOUHSVGY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-HOUHSVGY.mjs\");\n/* harmony import */ var _chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-ICXQ74PX.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICXQ74PX.mjs\");\n/* harmony import */ var _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chunk-WYO6CB5R.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-WYO6CB5R.mjs\");\n/* harmony import */ var _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./chunk-X3CZISLH.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-X3CZISLH.mjs\");\n/* harmony import */ var _chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./chunk-Y2CYZVJY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs\");\n/* harmony import */ var _mermaid_js_parser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @mermaid-js/parser */ \"./node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs\");\n\n\n\n\n\n\n\n\n\n// src/diagrams/treeView/parser.ts\n\n\n// src/diagrams/treeView/boxDrawingPreprocessor.ts\nvar ALL_BOX_CHARS = /[─━│┃└┗├┣]/;\nvar BRANCH_CHAR = /[└┗├┣]/;\nvar DASH_CHAR = /[─━]/;\nvar DECORATION_ONLY = /^[\\s│┃]+$/;\nvar METADATA_LINE = /^\\s*(title[\\t ]|accTitle[\\t ]*:|accDescr[\\t ]*[:{])/;\nvar COMMENT_LINE = /^\\s*%%/;\nvar INDENT_UNIT = \"    \";\nfunction isBoxDrawingFormat(lines) {\n  return lines.some((line) => ALL_BOX_CHARS.test(line));\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(isBoxDrawingFormat, \"isBoxDrawingFormat\");\nfunction inferSegmentWidth(contentLines) {\n  for (const line of contentLines) {\n    const match = BRANCH_CHAR.exec(line);\n    if (match?.index && match.index > 0) {\n      return match.index;\n    }\n  }\n  return 4;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(inferSegmentWidth, \"inferSegmentWidth\");\nfunction remapErrorLines(message, lineMap) {\n  return message.replace(/\\bline\\s+(\\d+)\\b/gi, (match, lineStr) => {\n    const line = parseInt(lineStr, 10);\n    const original = lineMap.get(line);\n    return original ? `line ${original}` : match;\n  });\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(remapErrorLines, \"remapErrorLines\");\nfunction preprocessBoxDrawing(input) {\n  const lines = input.split(\"\\n\");\n  const lineMap = /* @__PURE__ */ new Map();\n  let keywordIdx = -1;\n  for (const [i, line] of lines.entries()) {\n    if (line.trim() === \"treeView-beta\") {\n      keywordIdx = i;\n      break;\n    }\n  }\n  if (keywordIdx === -1) {\n    return { text: input, lineMap };\n  }\n  const contentLineTexts = [];\n  for (let i = keywordIdx + 1; i < lines.length; i++) {\n    const line = lines[i];\n    const trimmed = line.trim();\n    if (trimmed === \"\" || COMMENT_LINE.test(line) || METADATA_LINE.test(line)) {\n      continue;\n    }\n    if (DECORATION_ONLY.test(line)) {\n      continue;\n    }\n    contentLineTexts.push(line.replace(/\\t/g, \"    \"));\n  }\n  if (!isBoxDrawingFormat(contentLineTexts)) {\n    return { text: input, lineMap };\n  }\n  const segmentWidth = inferSegmentWidth(contentLineTexts);\n  const outputLines = [];\n  let outLineNo = 0;\n  for (let i = 0; i <= keywordIdx; i++) {\n    outputLines.push(lines[i]);\n    outLineNo++;\n    lineMap.set(outLineNo, i + 1);\n  }\n  for (let i = keywordIdx + 1; i < lines.length; i++) {\n    const line = lines[i];\n    const trimmed = line.trim();\n    const origLineNo = i + 1;\n    if (trimmed === \"\") {\n      outputLines.push(line);\n      outLineNo++;\n      lineMap.set(outLineNo, origLineNo);\n      continue;\n    }\n    if (COMMENT_LINE.test(line)) {\n      outputLines.push(line);\n      outLineNo++;\n      lineMap.set(outLineNo, origLineNo);\n      continue;\n    }\n    if (METADATA_LINE.test(line)) {\n      outputLines.push(line);\n      outLineNo++;\n      lineMap.set(outLineNo, origLineNo);\n      continue;\n    }\n    if (DECORATION_ONLY.test(line)) {\n      continue;\n    }\n    const normalized = line.replace(/\\t/g, \"    \");\n    const branchMatch = BRANCH_CHAR.exec(normalized);\n    if (branchMatch?.index !== void 0) {\n      const branchCol = branchMatch.index;\n      const depth = Math.round(branchCol / segmentWidth) + 1;\n      let pos = branchCol + 1;\n      while (pos < normalized.length && DASH_CHAR.test(normalized[pos])) {\n        pos++;\n      }\n      while (pos < normalized.length && normalized[pos] === \" \") {\n        pos++;\n      }\n      const content = normalized.slice(pos).trimEnd();\n      if (!content) {\n        throw new Error(\n          `Line ${origLineNo}: Empty node \\u2014 expected a filename or directory name after the box-drawing prefix`\n        );\n      }\n      const indent = INDENT_UNIT.repeat(depth);\n      outputLines.push(indent + content);\n      outLineNo++;\n      lineMap.set(outLineNo, origLineNo);\n    } else if (/^[\\s─━│┃└┗├┣]+$/.test(normalized)) {\n      continue;\n    } else if (ALL_BOX_CHARS.test(normalized)) {\n      outputLines.push(line);\n      outLineNo++;\n      lineMap.set(outLineNo, origLineNo);\n    } else if (/^\\s+/.test(normalized)) {\n      throw new Error(\n        `Line ${origLineNo}: Unexpected indentation without box-drawing characters. In box-drawing format, use \\u251C\\u2500\\u2500 or \\u2514\\u2500\\u2500 prefixes for indented nodes.`\n      );\n    } else {\n      outputLines.push(line);\n      outLineNo++;\n      lineMap.set(outLineNo, origLineNo);\n    }\n  }\n  return { text: outputLines.join(\"\\n\"), lineMap };\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(preprocessBoxDrawing, \"preprocessBoxDrawing\");\n\n// src/diagrams/treeView/db.ts\nvar state = new _chunk_2Q5K7J3B_mjs__WEBPACK_IMPORTED_MODULE_0__.ImperativeState(() => ({\n  cnt: 1,\n  stack: [\n    {\n      id: 0,\n      level: -1,\n      name: \"/\",\n      nodeType: \"directory\",\n      children: []\n    }\n  ]\n}));\nvar clear2 = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(() => {\n  state.reset();\n  (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.clear)();\n}, \"clear\");\nvar getRoot = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(() => {\n  return state.records.stack[0];\n}, \"getRoot\");\nvar getCount = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(() => state.records.cnt, \"getCount\");\nvar defaultConfig = _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.defaultConfig_default.treeView;\nvar getConfig2 = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(() => {\n  return (0,_chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_4__.cleanAndMerge)(defaultConfig, (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.getConfig)().treeView);\n}, \"getConfig\");\nvar addNode = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((level, name, nodeType, cssClass, icon, description) => {\n  while (level <= state.records.stack[state.records.stack.length - 1].level) {\n    state.records.stack.pop();\n  }\n  const node = {\n    id: state.records.cnt++,\n    level,\n    name,\n    nodeType,\n    icon,\n    cssClass,\n    description,\n    children: []\n  };\n  state.records.stack[state.records.stack.length - 1].children.push(node);\n  state.records.stack.push(node);\n}, \"addNode\");\nvar db = {\n  clear: clear2,\n  addNode,\n  getRoot,\n  getCount,\n  getConfig: getConfig2,\n  getAccTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.getAccTitle,\n  getAccDescription: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.getAccDescription,\n  getDiagramTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.getDiagramTitle,\n  setAccDescription: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.setAccDescription,\n  setAccTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.setAccTitle,\n  setDiagramTitle: _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.setDiagramTitle\n};\nvar db_default = db;\n\n// src/diagrams/treeView/parser.ts\nvar populate = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((ast) => {\n  (0,_chunk_JWPE2WC7_mjs__WEBPACK_IMPORTED_MODULE_1__.populateCommonDb)(ast, db_default);\n  for (const node of ast.nodes) {\n    const level = typeof node.indent === \"number\" ? node.indent : 0;\n    let name = node.name;\n    const isDirectory = name.endsWith(\"/\");\n    if (isDirectory) {\n      name = name.slice(0, -1);\n    }\n    const nodeType = isDirectory ? \"directory\" : \"file\";\n    const cssClass = node.classAnnotation || void 0;\n    const rawIcon = node.iconAnnotation;\n    const icon = rawIcon !== void 0 ? rawIcon || \"none\" : void 0;\n    const rawDesc = node.descAnnotation || void 0;\n    const description = rawDesc ? (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.sanitizeText)(rawDesc, (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.getConfig)()) : void 0;\n    db_default.addNode(level, name, nodeType, cssClass, icon, description);\n  }\n}, \"populate\");\nvar parser = {\n  parse: /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(async (input) => {\n    const { text, lineMap } = preprocessBoxDrawing(input);\n    try {\n      const ast = await (0,_mermaid_js_parser__WEBPACK_IMPORTED_MODULE_8__.parse)(\"treeView\", text);\n      _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_6__.log.debug(ast);\n      populate(ast);\n    } catch (error) {\n      if (lineMap.size > 0 && error instanceof Error) {\n        error.message = remapErrorLines(error.message, lineMap);\n      }\n      throw error;\n    }\n  }, \"parse\")\n};\n\n// src/diagrams/treeView/icons.ts\nvar treeViewIcons = {\n  prefix: \"mermaid-treeview\",\n  height: 24,\n  width: 24,\n  icons: {\n    folder: {\n      body: '<path fill=\"currentColor\" d=\"M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z\"/>'\n    },\n    file: {\n      body: '<path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z\" clip-rule=\"evenodd\"/>'\n    }\n  }\n};\nfunction detectIcon(name, config) {\n  const filenameIcon = config?.filenameIcons?.[name];\n  if (filenameIcon) {\n    return filenameIcon;\n  }\n  const dotIdx = name.lastIndexOf(\".\");\n  if (dotIdx > 0) {\n    const ext = name.substring(dotIdx).toLowerCase();\n    const extensionIcons = config?.extensionIcons;\n    return extensionIcons?.[ext] ?? extensionIcons?.[ext.slice(1)];\n  }\n  return void 0;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(detectIcon, \"detectIcon\");\nfunction qualifyIcon(icon, defaultIconPack) {\n  if (icon.includes(\":\")) {\n    return icon;\n  }\n  if (icon in treeViewIcons.icons || !defaultIconPack) {\n    return `${treeViewIcons.prefix}:${icon}`;\n  }\n  return `${defaultIconPack}:${icon}`;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(qualifyIcon, \"qualifyIcon\");\nfunction getNodeIcon(node, config) {\n  if (node.icon === \"none\") {\n    return void 0;\n  }\n  if (node.icon) {\n    return qualifyIcon(node.icon, config.defaultIconPack);\n  }\n  if (!config.showIcons) {\n    return void 0;\n  }\n  if (node.nodeType === \"file\") {\n    const detected = detectIcon(node.name, config);\n    if (detected === \"none\") {\n      return void 0;\n    }\n    if (detected) {\n      return qualifyIcon(detected, config.defaultIconPack);\n    }\n  }\n  return `${treeViewIcons.prefix}:${node.nodeType === \"directory\" ? \"folder\" : \"file\"}`;\n}\n;(0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(getNodeIcon, \"getNodeIcon\");\n\n// src/diagrams/treeView/renderer.ts\n(0,_chunk_HOUHSVGY_mjs__WEBPACK_IMPORTED_MODULE_3__.registerIconPacks)([\n  {\n    name: treeViewIcons.prefix,\n    icons: treeViewIcons\n  }\n]);\nvar ICON_SIZE = 14;\nvar ICON_GAP = 4;\nvar DESC_GAP = 16;\nvar iconSymbolId = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((diagramId, icon) => `tv-icon-${diagramId}-${icon.replace(/[^\\w-]/g, \"-\")}`, \"iconSymbolId\");\nvar injectIconDefs = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(async (svg, root, config, diagramId) => {\n  const usedIcons = /* @__PURE__ */ new Set();\n  const collect = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((node) => {\n    const icon = getNodeIcon(node, config);\n    if (icon) {\n      usedIcons.add(icon);\n    }\n    node.children.forEach(collect);\n  }, \"collect\");\n  collect(root);\n  if (usedIcons.size === 0) {\n    return;\n  }\n  const iconSVGs = await Promise.all(\n    [...usedIcons].map(async (icon) => ({\n      icon,\n      svg: await (0,_chunk_HOUHSVGY_mjs__WEBPACK_IMPORTED_MODULE_3__.getIconSVG)(icon, {\n        height: ICON_SIZE,\n        width: ICON_SIZE\n      })\n    }))\n  );\n  const defs = svg.append(\"defs\");\n  for (const { icon, svg: iconSVG } of iconSVGs) {\n    defs.append(\"g\").attr(\"id\", iconSymbolId(diagramId, icon)).html(iconSVG);\n  }\n}, \"injectIconDefs\");\nvar positionLabel = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((x, y, node, domElem, config, diagramId) => {\n  const nodeGroup = domElem.append(\"g\");\n  let cssClasses = \"treeView-node-label\";\n  if (node.nodeType === \"directory\") {\n    cssClasses += \" treeView-node-dir\";\n  }\n  if (node.cssClass) {\n    cssClasses += ` ${node.cssClass}`;\n  }\n  const iconOffset = ICON_SIZE + ICON_GAP;\n  const icon = getNodeIcon(node, config);\n  const showIcon = icon !== void 0;\n  if (icon) {\n    nodeGroup.append(\"use\").attr(\"xlink:href\", `#${iconSymbolId(diagramId, icon)}`).attr(\"x\", x + config.paddingX).attr(\"y\", y + config.paddingY).attr(\"class\", \"treeView-node-icon\");\n  }\n  const label = nodeGroup.append(\"text\").text(node.name).attr(\"dominant-baseline\", \"middle\").attr(\"class\", cssClasses);\n  const { height: labelHeight, width: labelWidth } = label.node().getBBox();\n  const height = labelHeight + config.paddingY * 2;\n  const labelX = x + config.paddingX + (showIcon ? iconOffset : 0);\n  label.attr(\"x\", labelX);\n  label.attr(\"y\", y + height / 2);\n  const labelRightEdge = labelX + labelWidth;\n  const width = labelWidth + config.paddingX * 2 + (showIcon ? iconOffset : 0);\n  node.BBox = { x, y, width, height };\n  if (node.cssClass?.split(/\\s+/).includes(\"highlight\")) {\n    nodeGroup.insert(\"rect\", \":first-child\").attr(\"x\", x).attr(\"y\", y + 1).attr(\"width\", 0).attr(\"height\", height - 2).attr(\"rx\", 3).attr(\"class\", \"treeView-highlight-bg\");\n  }\n  return { node, nodeGroup, labelRightEdge, centerY: y + height / 2 };\n}, \"positionLabel\");\nvar positionLine = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((domElem, x1, y1, x2, y2, lineThickness) => {\n  return domElem.append(\"line\").attr(\"x1\", x1).attr(\"y1\", y1).attr(\"x2\", x2).attr(\"y2\", y2).attr(\"stroke-width\", lineThickness).attr(\"class\", \"treeView-node-line\");\n}, \"positionLine\");\nvar drawTree = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((elem, root, config, diagramId) => {\n  let totalHeight = 0;\n  let totalWidth = 0;\n  const renderInfos = [];\n  const drawNode = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((elem2, node, config2, depth) => {\n    const indent = depth * (config2.rowIndent + config2.paddingX);\n    const info = positionLabel(indent, totalHeight, node, elem2, config2, diagramId);\n    renderInfos.push(info);\n    const { height, width } = node.BBox;\n    positionLine(\n      elem2,\n      indent - config2.rowIndent,\n      totalHeight + height / 2,\n      indent,\n      totalHeight + height / 2,\n      config2.lineThickness\n    );\n    totalWidth = Math.max(totalWidth, indent + width);\n    totalHeight += height;\n  }, \"drawNode\");\n  const processNode = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)((node, depth = 0) => {\n    drawNode(elem, node, config, depth);\n    node.children.forEach((child) => {\n      processNode(child, depth + 1);\n    });\n    const { x, y, height } = node.BBox;\n    if (node.children.length) {\n      const { y: endY, height: endHeight } = node.children[node.children.length - 1].BBox;\n      positionLine(\n        elem,\n        x + config.paddingX,\n        y + height,\n        x + config.paddingX,\n        endY + endHeight / 2 + config.lineThickness / 2,\n        config.lineThickness\n      );\n    }\n  }, \"processNode\");\n  processNode(root);\n  const nodesWithDesc = renderInfos.filter((ri) => ri.node.description);\n  if (nodesWithDesc.length > 0) {\n    const maxLabelRight = Math.max(...renderInfos.map((ri) => ri.labelRightEdge));\n    const descX = maxLabelRight + DESC_GAP;\n    for (const ri of nodesWithDesc) {\n      const desc = ri.nodeGroup.append(\"text\").text(ri.node.description).attr(\"dominant-baseline\", \"middle\").attr(\"class\", \"treeView-node-description\").attr(\"x\", descX).attr(\"y\", ri.centerY);\n      const descBBox = desc.node().getBBox();\n      totalWidth = Math.max(totalWidth, descX + descBBox.width + config.paddingX);\n    }\n  }\n  for (const ri of renderInfos) {\n    if (ri.node.cssClass?.split(/\\s+/).includes(\"highlight\")) {\n      const rect = ri.nodeGroup.select(\".treeView-highlight-bg\");\n      if (!rect.empty()) {\n        const rectWidth = totalWidth - ri.node.BBox.x + 8;\n        rect.attr(\"width\", rectWidth);\n        totalWidth = Math.max(totalWidth, ri.node.BBox.x + rectWidth + 2);\n      }\n    }\n  }\n  return { totalHeight, totalWidth };\n}, \"drawTree\");\nvar draw = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(async (text, id, _ver, diagObj) => {\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_6__.log.debug(\"Rendering treeView diagram\\n\" + text);\n  const db2 = diagObj.db;\n  const root = db2.getRoot();\n  const config = db2.getConfig();\n  const svg = (0,_chunk_VAUOI2AC_mjs__WEBPACK_IMPORTED_MODULE_2__.selectSvgElement)(id);\n  await injectIconDefs(svg, root, config, id);\n  const treeElem = svg.append(\"g\");\n  treeElem.attr(\"class\", \"tree-view\");\n  const { totalHeight, totalWidth } = drawTree(treeElem, root, config, id);\n  svg.attr(\"viewBox\", `-${config.lineThickness / 2} 0 ${totalWidth} ${totalHeight}`);\n  (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_5__.configureSvgSize)(svg, totalHeight, totalWidth, config.useMaxWidth);\n}, \"draw\");\nvar renderer = {\n  draw\n};\nvar renderer_default = renderer;\n\n// src/diagrams/treeView/styles.ts\nvar defaultTreeViewDiagramStyles = {\n  labelFontSize: \"16px\",\n  labelColor: \"black\",\n  lineColor: \"black\",\n  iconColor: \"#546e7a\",\n  descriptionColor: \"#6a9955\",\n  highlightBg: \"rgba(255, 193, 7, 0.15)\",\n  highlightStroke: \"#ffc107\"\n};\nvar styles = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_7__.__name)(({\n  treeView\n}) => {\n  const {\n    labelFontSize,\n    labelColor,\n    lineColor,\n    iconColor,\n    descriptionColor,\n    highlightBg,\n    highlightStroke\n  } = (0,_chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_4__.cleanAndMerge)(defaultTreeViewDiagramStyles, treeView);\n  return `\n    .treeView-node-label {\n        font-size: ${labelFontSize};\n        fill: ${labelColor};\n        white-space: pre;\n    }\n    .treeView-node-dir {\n        font-weight: bold;\n    }\n    .treeView-node-line {\n        stroke: ${lineColor};\n    }\n    .treeView-node-icon {\n        color: ${iconColor};\n    }\n    .treeView-node-description {\n        font-size: ${labelFontSize};\n        fill: ${descriptionColor};\n        font-style: italic;\n        white-space: pre;\n    }\n    .treeView-highlight-bg {\n        fill: ${highlightBg};\n        stroke: ${highlightStroke};\n        stroke-width: 1;\n    }\n    `;\n}, \"styles\");\nvar styles_default = styles;\n\n// src/diagrams/treeView/diagram.ts\nvar diagram = {\n  db: db_default,\n  renderer: renderer_default,\n  parser,\n  styles: styles_default\n};\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/diagram-OA4YK3LP.mjs?\n}");

/***/ }

}]);