oh-my-agent-web 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/server/engine/builtin.js +2 -0
  2. package/dist/server/engine/codex.js +10 -8
  3. package/dist/server/engine/dsh-prompt-patch.js +48 -0
  4. package/dist/server/engine/pi-sdk.js +20 -3
  5. package/dist/server/engine/suggestion-guidance.js +22 -9
  6. package/dist/server/engine/wiring.js +11 -0
  7. package/dist/server/index.js +16 -1
  8. package/dist/server/session/settings.js +15 -0
  9. package/package.json +1 -1
  10. package/web/dist/assets/{arc-zmD1IRwE.js → arc-Df9SI9yh.js} +1 -1
  11. package/web/dist/assets/{architecture-WOLXFQ4H-C5B92zMK.js → architecture-WOLXFQ4H-iO49E8Y1.js} +1 -1
  12. package/web/dist/assets/{blockDiagram-RJAE7QA3-BOZKv8NT.js → blockDiagram-RJAE7QA3-D8d1ukIs.js} +1 -1
  13. package/web/dist/assets/channel-C2-OT56h.js +1 -0
  14. package/web/dist/assets/{chunk-55XCU76K-Cqr92VtU.js → chunk-55XCU76K-C5wOvqDb.js} +1 -1
  15. package/web/dist/assets/{chunk-7S6XSTFO-DDqM0lw8.js → chunk-7S6XSTFO-WIrWcDbG.js} +1 -1
  16. package/web/dist/assets/{chunk-AQDTSKZB-CeUIfGt5.js → chunk-AQDTSKZB-OkzYqFsw.js} +1 -1
  17. package/web/dist/assets/{chunk-DSNLSHJZ-Bf4nxMnG.js → chunk-DSNLSHJZ-CHEA9kYd.js} +1 -1
  18. package/web/dist/assets/{chunk-HNE4Q36P-CP_5bmzn.js → chunk-HNE4Q36P-CPsq34CI.js} +1 -1
  19. package/web/dist/assets/{chunk-VQ5W62QI-C4KlhrWA.js → chunk-VQ5W62QI-CamPnEuF.js} +1 -1
  20. package/web/dist/assets/{chunk-WQQL4CDK-OBr867RS.js → chunk-WQQL4CDK-gNypBVAM.js} +1 -1
  21. package/web/dist/assets/{chunk-ZAUX2LTX-BGf21XAP.js → chunk-ZAUX2LTX--4WyRBRV.js} +1 -1
  22. package/web/dist/assets/{chunk-ZCHMQSOR-B1v2_vIA.js → chunk-ZCHMQSOR-umv3Lkpn.js} +1 -1
  23. package/web/dist/assets/{classDiagram-v2-4MYWR3UA-D73WliGc.js → classDiagram-v2-4MYWR3UA-C1XldpO1.js} +1 -1
  24. package/web/dist/assets/{cose-bilkent-JH36ORCC-BHjex_ed.js → cose-bilkent-JH36ORCC-BvugZzFU.js} +1 -1
  25. package/web/dist/assets/{cynefin-EF2NZ3EQ-BkwUbDxE.js → cynefin-EF2NZ3EQ-6qXB70s4.js} +1 -1
  26. package/web/dist/assets/{dagre-NK4GIZVX-HBESSwxd.js → dagre-NK4GIZVX-DDdlABYw.js} +1 -1
  27. package/web/dist/assets/{diagram-I5XIIV2D-B0x4b3TO.js → diagram-I5XIIV2D-T8oWy5CY.js} +1 -1
  28. package/web/dist/assets/{diagram-RJA3I4VV-D5I3zPSl.js → diagram-RJA3I4VV-CkdHTtfV.js} +1 -1
  29. package/web/dist/assets/{elk-QONTBCTQ-Bf1nltwr.js → elk-QONTBCTQ-BiEUbJJX.js} +1 -1
  30. package/web/dist/assets/{erDiagram-KYQIGQAA-DPncMSdU.js → erDiagram-KYQIGQAA-q3WwhyzH.js} +1 -1
  31. package/web/dist/assets/{eventmodeling-K75KTNOO-DMA5HThh.js → eventmodeling-K75KTNOO-BO5gW_NC.js} +1 -1
  32. package/web/dist/assets/{flowDiagram-IUGLLWBU-tz3GJD8_.js → flowDiagram-IUGLLWBU-DubjP6UK.js} +1 -1
  33. package/web/dist/assets/{ganttDiagram-R7GPNTJY-BdLbjwpy.js → ganttDiagram-R7GPNTJY-lKNRH8CI.js} +1 -1
  34. package/web/dist/assets/{gitGraph-VSP46ZUC-D-EmEDwq.js → gitGraph-VSP46ZUC-Cwlv3omT.js} +1 -1
  35. package/web/dist/assets/{gitGraphDiagram-PDYL7XHY-C1MNufrt.js → gitGraphDiagram-PDYL7XHY-Bo9GpFvW.js} +1 -1
  36. package/web/dist/assets/index-CeYhxqkk.js +113 -0
  37. package/web/dist/assets/index-GJgJwZ23.css +1 -0
  38. package/web/dist/assets/{info-OHQRW6UA-Dnj11J5n.js → info-OHQRW6UA-g3MbTRmN.js} +1 -1
  39. package/web/dist/assets/{infoDiagram-MVDRKAX5-CR1Pc-ET.js → infoDiagram-MVDRKAX5-CmILYLoB.js} +1 -1
  40. package/web/dist/assets/{journeyDiagram-BOSHW7O7-BaQQ5bT0.js → journeyDiagram-BOSHW7O7-Av8T0U1C.js} +1 -1
  41. package/web/dist/assets/{kanban-definition-FNSA4HC5-CryJiCse.js → kanban-definition-FNSA4HC5-B9NyWQYN.js} +1 -1
  42. package/web/dist/assets/{line-DAqohcwr.js → line-BUrll1My.js} +1 -1
  43. package/web/dist/assets/{linear-Aj6QlF4i.js → linear-DjET0phX.js} +1 -1
  44. package/web/dist/assets/{math-OLjDjiS-.js → math-BJAjkhlu.js} +1 -1
  45. package/web/dist/assets/{mermaid-parser.core-BfmVJIf8.js → mermaid-parser.core-CaTdkhkS.js} +3 -3
  46. package/web/dist/assets/{mermaid.core-DcmL9PWM.js → mermaid.core-Cktx937U.js} +4 -4
  47. package/web/dist/assets/{packet-JDAUHWVQ-DmHJYz0u.js → packet-JDAUHWVQ-DhG6l3PG.js} +1 -1
  48. package/web/dist/assets/{pie-XZMESJXO-DyIYlEiZ.js → pie-XZMESJXO-YPcOx7s0.js} +1 -1
  49. package/web/dist/assets/{pieDiagram-GNMPY74T-CbmNjslV.js → pieDiagram-GNMPY74T-DesiZKUl.js} +1 -1
  50. package/web/dist/assets/{quadrantDiagram-D57K4MC3-b8t3m46P.js → quadrantDiagram-D57K4MC3-Cn1kBVgu.js} +1 -1
  51. package/web/dist/assets/{radar-ABXABTNO-BRduUljF.js → radar-ABXABTNO-CtuRfYSz.js} +1 -1
  52. package/web/dist/assets/{railroad-I3PHUGI6-CS79uNF5.js → railroad-I3PHUGI6-D5Gnyy0R.js} +1 -1
  53. package/web/dist/assets/{railroad-abnf-LNEFI6M7-80I8zkTd.js → railroad-abnf-LNEFI6M7-Kw4pmJEm.js} +1 -1
  54. package/web/dist/assets/{railroad-ebnf-DWYD2UWJ-CvMLODGQ.js → railroad-ebnf-DWYD2UWJ-D8Mk5dIe.js} +1 -1
  55. package/web/dist/assets/{railroad-peg-JR7BVNR7-CDA3EuEX.js → railroad-peg-JR7BVNR7-R5Jwzs8F.js} +1 -1
  56. package/web/dist/assets/{requirementDiagram-EQYSW5RA-Bp5ukALL.js → requirementDiagram-EQYSW5RA-B9RDq-cL.js} +1 -1
  57. package/web/dist/assets/{sankeyDiagram-SY24JHO5-DWEy27rM.js → sankeyDiagram-SY24JHO5-DoEatOm6.js} +1 -1
  58. package/web/dist/assets/{sequenceDiagram-BLEHNHQU-Hz6IqSZC.js → sequenceDiagram-BLEHNHQU-DGE5Z9lT.js} +1 -1
  59. package/web/dist/assets/{src-DtpyLxw7.js → src-BnEL7pZw.js} +1 -1
  60. package/web/dist/assets/{stateDiagram-v2-A6IESKWZ-BXLpOvku.js → stateDiagram-v2-A6IESKWZ-_vn8W-k_.js} +1 -1
  61. package/web/dist/assets/{timeline-definition-JXYKGLGB-COLhHvFy.js → timeline-definition-JXYKGLGB-BaSLTtgR.js} +1 -1
  62. package/web/dist/assets/{treeView-D4JQ5SDB-Bv_XbrZv.js → treeView-D4JQ5SDB-DZElyFgL.js} +1 -1
  63. package/web/dist/assets/{treemap-SAJKECNS-DiIJdbav.js → treemap-SAJKECNS-DWDO4K4G.js} +1 -1
  64. package/web/dist/assets/{wardley-7MLQ67FV-9RG35vNe.js → wardley-7MLQ67FV-DTOUsk6Q.js} +1 -1
  65. package/web/dist/assets/{xychartDiagram-4URNHDU4-D_SC3zbf.js → xychartDiagram-4URNHDU4-DiaCfgAB.js} +1 -1
  66. package/web/dist/index.html +2 -2
  67. package/web/dist/assets/channel-DVBc3OcZ.js +0 -1
  68. package/web/dist/assets/index-DxuhX7Zj.css +0 -1
  69. package/web/dist/assets/index-Zo1mtXrj.js +0 -111
@@ -31,6 +31,7 @@ export function createBuiltinEngineRegistry(options) {
31
31
  options.onNotice(text, level);
32
32
  },
33
33
  ...(options.skillPaths ? { skillPaths: options.skillPaths } : {}),
34
+ ...(options.thinkCount ? { thinkCount: options.thinkCount } : {}),
34
35
  }),
35
36
  },
36
37
  ...(options.codex
@@ -63,6 +64,7 @@ export function createBuiltinEngineRegistry(options) {
63
64
  client: options.codex?.client,
64
65
  log: options.onLog,
65
66
  ...(options.codex?.subagentPolicy ? { subagentPolicy: options.codex.subagentPolicy } : {}),
67
+ ...(options.thinkCount ? { thinkCount: options.thinkCount } : {}),
66
68
  }),
67
69
  },
68
70
  ]
@@ -3,6 +3,7 @@ import { createCodexClient } from "./codex-transport.js";
3
3
  import { codexMultiAgentConfig, codexSubagentGuidance, createCodexSubagents } from "./codex-subagents.js";
4
4
  import { registerCodexApprovals } from "./codex-approvals.js";
5
5
  import { sanitizeHistoricalActions } from "../markers/actions.js";
6
+ import { suggestionGuidance } from "./suggestion-guidance.js";
6
7
  import { ensureCodexProject } from "./codex-sessions.js";
7
8
  import { mkdtemp, rm } from "node:fs/promises";
8
9
  import { tmpdir } from "node:os";
@@ -295,14 +296,15 @@ export function createCodexEngine(options = {}) {
295
296
  }))
296
297
  : [],
297
298
  }),
298
- ...(codexSubagentGuidance({ enabled: plan.enabled, profiles: plan.profiles })
299
- ? {
300
- developerInstructions: codexSubagentGuidance({
301
- enabled: plan.enabled,
302
- profiles: plan.profiles,
303
- }),
304
- }
305
- : {}),
299
+ // 「下一步建议」的写法一直带(ADR-0022,否则 codex 永远出不了建议按钮);
300
+ // 开了子代理就把委派说明接在后面。两者都是 **thread 级**覆盖,
301
+ // 只对这条新会话生效 —— 不写用户的 `~/.codex/config.toml`,Codex Desktop 不受影响。
302
+ developerInstructions: [
303
+ suggestionGuidance(options.thinkCount?.() ?? null),
304
+ codexSubagentGuidance({ enabled: plan.enabled, profiles: plan.profiles }),
305
+ ]
306
+ .filter((part) => part !== null)
307
+ .join("\n\n"),
306
308
  });
307
309
  const threadId = response?.thread?.id;
308
310
  if (!threadId)
@@ -0,0 +1,48 @@
1
+ /**
2
+ * 把「下一步建议」的写法带进 dsh(ADR-0022 的 dsh 版)。
3
+ *
4
+ * 为什么只能走 patch 文件:ACP 是**唯一**入口,而它的 `session/new` 只有
5
+ * `cwd / additionalDirectories / mcpServers / _meta`(schema 实测),没有系统提示字段;
6
+ * dsh 的系统提示由插件栈里的 `@deepseek-ai/dsh-system-prompt` 组装,其中
7
+ * `personaSuffix` 排在系统提示末尾 —— 正好是这段说明该待的位置。
8
+ *
9
+ * 两个必须写清的约束:
10
+ * 1. patch 的 `config` 是**整块替换**(不是深合并):只写 `personaSuffix` 会把 acp 模板
11
+ * 原本的 `personaPrefix` 冲掉(实测 dump 里会整个消失)。所以两句 persona 都带上,
12
+ * 取值照抄 `@deepseek-ai/dsh-acp-app` 的默认值;dsh 改这两句默认值时这里要跟着改。
13
+ * 2. 它是**进程级**的:dsh 子进程启动时才 compose 配置栈,所以改完「想想」条数要
14
+ * 重启工作台(引擎)才生效 —— 不像 pi / codex 那样每条新会话现读。
15
+ */
16
+ import { mkdirSync, writeFileSync } from "node:fs";
17
+ import { join } from "node:path";
18
+ /** `@deepseek-ai/dsh-acp-app` 给 acp profile 的默认 persona(照抄,别改措辞) */
19
+ const PERSONA_PREFIX = "You are a coding agent powered by the {{model}} model.";
20
+ const PERSONA_SUFFIX = "Your working directory is {{cwd}}.";
21
+ /** YAML 块标量的缩进:`personaSuffix: |` 下的内容比 key 深两级 */
22
+ function indentBlock(text) {
23
+ return text
24
+ .split("\n")
25
+ .map((line) => (line === "" ? "" : ` ${line}`))
26
+ .join("\n");
27
+ }
28
+ /** 纯函数:生成 patch 文件内容(喂给 `dsh --patch <file>`) */
29
+ export function dshSuggestionPatch(guidance) {
30
+ return [
31
+ "# 由 oh-my-agent-web 生成(不要手改):给 dsh 的 system prompt 追加「下一步建议」写法。",
32
+ "# 改条数请改设置里的「想想」,然后重启工作台 —— dsh 的配置栈是进程启动时 compose 的。",
33
+ "- id: system-prompt",
34
+ " config:",
35
+ " personaPrefix: |",
36
+ indentBlock(PERSONA_PREFIX),
37
+ " personaSuffix: |",
38
+ indentBlock(`${PERSONA_SUFFIX}\n\n${guidance}`),
39
+ "",
40
+ ].join("\n");
41
+ }
42
+ /** 写到一个临时目录里(不污染用户的 `dsh-patches` 目录),返回 patch 文件路径 */
43
+ export function writeDshSuggestionPatch(dir, guidance) {
44
+ mkdirSync(dir, { recursive: true });
45
+ const file = join(dir, "dsh-suggestion-patch.yml");
46
+ writeFileSync(file, dshSuggestionPatch(guidance), "utf8");
47
+ return file;
48
+ }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * 与 SDK 的对接方式(M3 侦察结论):
8
8
  */
9
- import { DefaultResourceLoader, SessionManager, createAgentSession, getAgentDir, } from "@earendil-works/pi-coding-agent";
9
+ import { DefaultResourceLoader, SessionManager, createAgentSession, getAgentDir, initTheme, } from "@earendil-works/pi-coding-agent";
10
10
  import { dirname } from "node:path";
11
11
  import { getBuiltinModels } from "@earendil-works/pi-ai/providers/all";
12
12
  import { classifyScope } from "../approval/scope.js";
@@ -131,13 +131,26 @@ function toAuthEvent(event) {
131
131
  /** 教模型怎么写「下一步建议」(ADR-0022):刻意写得短(每次请求都付 token) */
132
132
  import { reloadModelRegistry } from "./model-registry-reload.js";
133
133
  import { NARRATE_GUIDANCE } from "./narrate-guidance.js";
134
- import { SUGGESTION_GUIDANCE } from "./suggestion-guidance.js";
134
+ import { SUGGESTION_GUIDANCE, suggestionGuidance } from "./suggestion-guidance.js";
135
135
  import { SUBAGENT_GUIDANCE } from "./subagent-guidance.js";
136
136
  export { NARRATE_GUIDANCE, SUGGESTION_GUIDANCE, SUBAGENT_GUIDANCE };
137
137
  import { createPiThinking } from "./pi-thinking.js";
138
138
  import { piSdkVersion } from "./pi-version.js";
139
139
  import { renameSessionIn } from "./pi-rename.js";
140
140
  export function createPiSdkEngine(options = {}) {
141
+ /**
142
+ * pi 的 `theme` 是个全局 Proxy:没调过 `initTheme()` 就抛
143
+ * `Theme not initialized. Call initTheme() first.`(import 本身**不会**初始化它)。
144
+ *
145
+ * TUI 启动时自己会初始化,而这个无界面的工作台不会 —— 但扩展里那些「给终端画东西」的代码
146
+ * (`getMarkdownTheme().heading()`、`new Text(..., theme.fg(...))`)照样会被调用,尤其是
147
+ * 塞在 `setTimeout` 里的渲染:那个异常没人接,**直接把这个服务进程带走**(同事机器上真踩过:
148
+ * 扩展 `token-speed.ts` 的定时渲染崩了整个 agent-web)。
149
+ *
150
+ * 所以宿主这边先初始化一次,让这类渲染退化成「画了个没人看的东西」,而不是崩服务。
151
+ * 顺带也是所有 `@earendil-works/*` 导入的唯一出口(本文件)。
152
+ */
153
+ initTheme();
141
154
  const sessions = new Map();
142
155
  const thinking = createPiThinking(sessions);
143
156
  let approvalHandler = null;
@@ -234,7 +247,11 @@ export function createPiSdkEngine(options = {}) {
234
247
  extensionFactories,
235
248
  // 教模型「下一步建议」的写法(ADR-0022):纯文本标记,不需要调用任何工具
236
249
  // 「动手前先说话」:过程默认折叠,不写正文用户就不知道它在干什么
237
- appendSystemPrompt: [SUGGESTION_GUIDANCE, NARRATE_GUIDANCE, ...(subagentReady ? [SUBAGENT_GUIDANCE] : [])],
250
+ appendSystemPrompt: [
251
+ suggestionGuidance(options.thinkCount?.() ?? null),
252
+ NARRATE_GUIDANCE,
253
+ ...(subagentReady ? [SUBAGENT_GUIDANCE] : []),
254
+ ],
238
255
  });
239
256
  await resourceLoader.reload();
240
257
  const { session } = await createAgentSession({
@@ -1,9 +1,22 @@
1
- /** 教模型「下一步建议」的写法(ADR-0022):纯文本标记,不需要调用任何工具 */
2
- export const SUGGESTION_GUIDANCE = [
3
- "## Suggested next actions",
4
- "When the user must choose what to do next, end the reply with 4 to 5 lines of:",
5
- "[[action:suggest:<button text>]]",
6
- "Clicking a button sends that text as the next user message.",
7
- "Use [[action:suggest:<short label>,prompt=<text to send>]] when the label should differ from the sent text.",
8
- "Put them on their own lines at the very end, and never mention this syntax in prose.",
9
- ].join("\n");
1
+ /**
2
+ * 教模型「下一步建议」的写法(ADR-0022):纯文本标记,不需要调用任何工具。
3
+ *
4
+ * 条数由调用方给(设置里「想想」那一个 `settings.thinkCount`,取值 1~5):
5
+ * 界面上「再给一批」按几条问,模型结尾就写几条 —— 两边用同一个数,不然按钮数和
6
+ * 「想想」的结果数对不上。拿不到就退回默认区间 4~5(与 ADR-0039 一致)。
7
+ */
8
+ export function suggestionGuidance(count) {
9
+ const wanted = typeof count === "number" && Number.isInteger(count) && count >= 1 && count <= 5 ? count : null;
10
+ const amount = wanted === null ? "4 to 5" : String(wanted);
11
+ const unit = wanted === 1 ? "line" : "lines";
12
+ return [
13
+ "## Suggested next actions",
14
+ `When the user must choose what to do next, end the reply with ${amount} ${unit} of:`,
15
+ "[[action:suggest:<button text>]]",
16
+ "Clicking a button sends that text as the next user message.",
17
+ "Use [[action:suggest:<short label>,prompt=<text to send>]] when the label should differ from the sent text.",
18
+ "Put them on their own lines at the very end, and never mention this syntax in prose.",
19
+ ].join("\n");
20
+ }
21
+ /** 默认版(4~5 条):给拿不到设置的地方用(测试、临时会话、预热) */
22
+ export const SUGGESTION_GUIDANCE = suggestionGuidance();
@@ -9,6 +9,7 @@
9
9
  * codex 客户端构造时不 spawn:机器上没装 codex 也能正常启动,只有在切到它时才报错。
10
10
  */
11
11
  import { existsSync, readFileSync, readdirSync } from "node:fs";
12
+ import { tmpdir } from "node:os";
12
13
  import { join } from "node:path";
13
14
  import { createBuiltinEngineRegistry } from "./builtin.js";
14
15
  import { enabledSubagentSpecs, readSubagentSettings } from "../subagents/profile-store.js";
@@ -18,6 +19,8 @@ import { createClaudeClient } from "./claude-transport.js";
18
19
  import { createCodexSessionsProvider } from "./codex-sessions.js";
19
20
  import { createCodexClient } from "./codex-transport.js";
20
21
  import { createDshClient } from "./dsh-transport.js";
22
+ import { writeDshSuggestionPatch } from "./dsh-prompt-patch.js";
23
+ import { suggestionGuidance } from "./suggestion-guidance.js";
21
24
  import { createDshSessionsProvider } from "./dsh-sessions.js";
22
25
  import { createOpencodeSessionsProvider } from "./opencode-sessions.js";
23
26
  import { readOpencodeSessionDirs } from "./opencode-projects.js";
@@ -59,7 +62,14 @@ export function createEngineWiring(options) {
59
62
  * 顺序 = 环境变量里显式给的 → 用户目录里的 `*.yml`(按文件名)。
60
63
  */
61
64
  const patchDir = options.dshPatchDir;
65
+ /**
66
+ * 「下一步建议」的写法:dsh 只能靠 patch 叠加层带进去(ACP 的 session/new 没有系统提示字段)。
67
+ * 写在工作台自己的临时目录,**不**混进用户的 `dsh-patches`;排在最前面,
68
+ * 用户自己写的 patch 仍有最终决定权。
69
+ */
70
+ const suggestionPatchFile = writeDshSuggestionPatch(join(tmpdir(), "oh-my-agent-web"), suggestionGuidance(options.thinkCount?.() ?? null));
62
71
  const patchFiles = [
72
+ suggestionPatchFile,
63
73
  ...(options.dshPatches ?? []),
64
74
  ...(patchDir && existsSync(patchDir)
65
75
  ? readdirSync(patchDir)
@@ -154,6 +164,7 @@ export function createEngineWiring(options) {
154
164
  onNotice: options.onNotice,
155
165
  ...(options.skillPaths ? { skillPaths: options.skillPaths } : {}),
156
166
  onLog: (text) => options.onLog(text),
167
+ ...(options.thinkCount ? { thinkCount: options.thinkCount } : {}),
157
168
  codex: { client: codexClient, bin: options.codexBin, subagentPolicy: codexSubagentPolicy },
158
169
  dsh: { client: dshClient, bin: options.dshBin, model: defaultModel },
159
170
  opencode: {
@@ -13,7 +13,7 @@ import { existsSync, mkdirSync } from "node:fs";
13
13
  import { PROTOCOL_VERSION } from "./protocol.js";
14
14
  import { acquireLock, describeHolder, releaseLock } from "./session/lock.js";
15
15
  import { createRuntime } from "./session/runtime.js";
16
- import { createFileSettingsStore } from "./session/settings.js";
16
+ import { createFileSettingsStore, readSettingsSync } from "./session/settings.js";
17
17
  import { createSender } from "./snapshot/sender.js";
18
18
  import { createPiSessionsProvider, piAgentDir } from "./session/pi-sessions-provider.js";
19
19
  import { createUploadStore, uploadsDir } from "./uploads/upload-store.js";
@@ -79,6 +79,18 @@ process.on("unhandledRejection", (reason) => {
79
79
  message: reason instanceof Error ? (reason.stack ?? reason.message) : String(reason),
80
80
  });
81
81
  });
82
+ // 同一个口径的另外半边:**同步抛出**的异常(最典型的是扩展塞在 setTimeout 里的渲染,
83
+ // 比如 `token-speed.ts` 调 pi 的 theme 时抛 `Theme not initialized`)。
84
+ // 没人 catch 的 timer 异常在 Node 里等于「杀进程」—— 一条扩展的渲染错就能把整个工作台带走,
85
+ // 用户看到的就是服务突然没了、终端回到提示符。这里记下来、继续跑。
86
+ //
87
+ // 取舍:单用户本地工作台,宁可带着可能的脏状态继续(顶多某个界面块不刷新),
88
+ // 也不要一按就死 —— 死了连日志面板都打不开。真到了没法自救的地步,用户重启就是了。
89
+ process.on("uncaughtException", (error) => {
90
+ logger.error("未捕获的异常(已记录,进程继续)", {
91
+ message: error instanceof Error ? (error.stack ?? error.message) : String(error),
92
+ });
93
+ });
82
94
  /** 局域网地址自动放行;域名仍要显式配 */
83
95
  const localAddresses = Object.values(networkInterfaces())
84
96
  .flat()
@@ -119,6 +131,9 @@ const engineWiring = createEngineWiring({
119
131
  skillPaths: [defaultSkillsDir()],
120
132
  // 子代理模板目录:pi 与 codex 共用同一份(codex 的 spawn 类型就是这些模板)
121
133
  subagentAgentDir: piAgentDir(),
134
+ // 「下一步建议」要几条 = 设置里「想想」的那个数:pi / codex 建会话时现读(读的是盘上的
135
+ // settings.json,改了设置下一条会话就生效);dsh 只能在启动时取一次(进程级 patch)
136
+ thinkCount: () => readSettingsSync(config.dataDir).thinkCount,
122
137
  workspace: config.workspace,
123
138
  piSessions,
124
139
  onNotice: (text, level) => runtimeRef.current?.notify(text, level),
@@ -5,6 +5,7 @@
5
5
  * 归一化放在纯函数里(`normalizeQuickPhrases`),因为「用户能贴进来什么」永远想不到 ——
6
6
  * 单条超长、重复、空白、几百条,都必须在上盘前收敛。
7
7
  */
8
+ import { readFileSync } from "node:fs";
8
9
  import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
9
10
  import { dirname, isAbsolute, join } from "node:path";
10
11
  const SETTINGS_FILE = "settings.json";
@@ -311,6 +312,20 @@ function parseSettings(text) {
311
312
  export function settingsPath(dataDir) {
312
313
  return join(dataDir, SETTINGS_FILE);
313
314
  }
315
+ /**
316
+ * 同步读设置(缺文件/坏文件 → 默认值,与 `createFileSettingsStore().load()` 同口径)。
317
+ *
318
+ * 只给「进程启动时就要定型」的场景用(目前只有一处:dsh 的 system prompt patch)。
319
+ * 平时请走异步的 SettingsStore —— 这里每调一次就读一次盘。
320
+ */
321
+ export function readSettingsSync(dataDir) {
322
+ try {
323
+ return parseSettings(readFileSync(settingsPath(dataDir), "utf8"));
324
+ }
325
+ catch {
326
+ return defaultSettings();
327
+ }
328
+ }
314
329
  export function createFileSettingsStore(dataDir) {
315
330
  return {
316
331
  async load() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-agent-web",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "bin": {
5
5
  "oh-my-agent-web": "dist/server/cli.js",
6
6
  "aw": "dist/server/cli.js",
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,p as s,r as c,s as l,t as u,u as d}from"./math-OLjDjiS-.js";import{n as f,t as p}from"./path-fybaL0A-.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,n,i,a,o,s,c){var l=e-i,u=n-a,d=(c?s:-s)/r(l*l+u*u),f=d*u,p=-d*l,m=e+f,h=n+p,g=i+f,_=a+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=o-s,w=m*_-g*h,T=(x<0?-1:1)*r(t(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(o/C-1),y11:D*(o/C-1)}}function x(){var t=m,x=h,S=f(0),C=null,w=g,T=_,E=v,D=null,O=p(k);function k(){var f,p,m=+t.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-l,_=T.apply(this,arguments)-l,v=u(_-g),k=_>g;if(D||=f=O(),h<m&&(p=h,h=m,m=p),!(h>1e-12))D.moveTo(0,0);else if(v>s-1e-12)D.moveTo(h*e(g),h*n(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*e(_),m*n(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):r(m*m+h*h)),R=a(u(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=c(L/m*n(I)),W=c(L/h*n(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*e(A),K=h*n(A),q=m*e(N),J=m*n(N);if(R>1e-12){var Y=h*e(j),X=h*n(j),Z=m*e(M),Q=m*n(M),$;if(v<d){if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/n(o((ee*ne+te*re)/(r(ee*ee+te*te)*r(ne*ne+re*re)))/2),ae=r($[0]*$[0]+$[1]*$[1]);z=a(R,(m-ae)/(ie-1)),B=a(R,(h-ae)/(ie+1))}else z=B=0}}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,i(V.y01,V.x01),i(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,i(V.y01,V.x01),i(V.y11,V.x11),!k),D.arc(0,0,h,i(V.cy+V.y11,V.cx+V.x11),i(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,i(H.y11,H.x11),i(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,i(V.y01,V.x01),i(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,i(V.y01,V.x01),i(V.y11,V.x11),!k),D.arc(0,0,m,i(V.cy+V.y11,V.cx+V.x11),i(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,i(H.y11,H.x11),i(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),f)return D=null,f+``||null}return k.centroid=function(){var r=(+t.apply(this,arguments)+ +x.apply(this,arguments))/2,i=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-d/2;return[e(i)*r,n(i)*r]},k.innerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:f(+e),k):t},k.outerRadius=function(e){return arguments.length?(x=typeof e==`function`?e:f(+e),k):x},k.cornerRadius=function(e){return arguments.length?(S=typeof e==`function`?e:f(+e),k):S},k.padRadius=function(e){return arguments.length?(C=e==null?null:typeof e==`function`?e:f(+e),k):C},k.startAngle=function(e){return arguments.length?(w=typeof e==`function`?e:f(+e),k):w},k.endAngle=function(e){return arguments.length?(T=typeof e==`function`?e:f(+e),k):T},k.padAngle=function(e){return arguments.length?(E=typeof e==`function`?e:f(+e),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
1
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,p as s,r as c,s as l,t as u,u as d}from"./math-BJAjkhlu.js";import{n as f,t as p}from"./path-fybaL0A-.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,n,i,a,o,s,c){var l=e-i,u=n-a,d=(c?s:-s)/r(l*l+u*u),f=d*u,p=-d*l,m=e+f,h=n+p,g=i+f,_=a+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=o-s,w=m*_-g*h,T=(x<0?-1:1)*r(t(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(o/C-1),y11:D*(o/C-1)}}function x(){var t=m,x=h,S=f(0),C=null,w=g,T=_,E=v,D=null,O=p(k);function k(){var f,p,m=+t.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-l,_=T.apply(this,arguments)-l,v=u(_-g),k=_>g;if(D||=f=O(),h<m&&(p=h,h=m,m=p),!(h>1e-12))D.moveTo(0,0);else if(v>s-1e-12)D.moveTo(h*e(g),h*n(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*e(_),m*n(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):r(m*m+h*h)),R=a(u(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=c(L/m*n(I)),W=c(L/h*n(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*e(A),K=h*n(A),q=m*e(N),J=m*n(N);if(R>1e-12){var Y=h*e(j),X=h*n(j),Z=m*e(M),Q=m*n(M),$;if(v<d){if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/n(o((ee*ne+te*re)/(r(ee*ee+te*te)*r(ne*ne+re*re)))/2),ae=r($[0]*$[0]+$[1]*$[1]);z=a(R,(m-ae)/(ie-1)),B=a(R,(h-ae)/(ie+1))}else z=B=0}}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,i(V.y01,V.x01),i(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,i(V.y01,V.x01),i(V.y11,V.x11),!k),D.arc(0,0,h,i(V.cy+V.y11,V.cx+V.x11),i(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,i(H.y11,H.x11),i(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,i(V.y01,V.x01),i(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,i(V.y01,V.x01),i(V.y11,V.x11),!k),D.arc(0,0,m,i(V.cy+V.y11,V.cx+V.x11),i(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,i(H.y11,H.x11),i(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),f)return D=null,f+``||null}return k.centroid=function(){var r=(+t.apply(this,arguments)+ +x.apply(this,arguments))/2,i=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-d/2;return[e(i)*r,n(i)*r]},k.innerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:f(+e),k):t},k.outerRadius=function(e){return arguments.length?(x=typeof e==`function`?e:f(+e),k):x},k.cornerRadius=function(e){return arguments.length?(S=typeof e==`function`?e:f(+e),k):S},k.padRadius=function(e){return arguments.length?(C=e==null?null:typeof e==`function`?e:f(+e),k):C},k.startAngle=function(e){return arguments.length?(w=typeof e==`function`?e:f(+e),k):w},k.endAngle=function(e){return arguments.length?(T=typeof e==`function`?e:f(+e),k):T},k.padAngle=function(e){return arguments.length?(E=typeof e==`function`?e:f(+e),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
@@ -1 +1 @@
1
- import"./chunk-NGNAAXSQ-DuHRe0y2.js";export{j as createArchitectureServices}from"./mermaid-parser.core-BfmVJIf8.js";
1
+ import"./chunk-NGNAAXSQ-DuHRe0y2.js";export{j as createArchitectureServices}from"./mermaid-parser.core-CaTdkhkS.js";
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t as n}from"./chunk-DUW6YSOI-Dgx8z5s3.js";import{m as r,p as i}from"./src-DtpyLxw7.js";import{a,b as o,c as s,rt as c,s as l,y as u}from"./chunk-DSNLSHJZ-Bf4nxMnG.js";import{t as d}from"./channel-DVBc3OcZ.js";import{i as f,r as p}from"./chunk-ZAUX2LTX-BGf21XAP.js";import"./chunk-AQDTSKZB-CeUIfGt5.js";import{A as m,B as h,C as g,D as _,E as v,F as y,H as b,I as x,L as S,M as C,N as w,O as T,P as E,R as D,S as O,T as k,U as A,V as j,c as M,g as ee,j as te,k as ne,v as re,w as ie,x as ae,z as oe}from"./chunk-7S6XSTFO-DDqM0lw8.js";import{i as se,n as ce,o as le,r as ue,s as de}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{a as fe,c as pe,i as me,l as he}from"./chunk-WQQL4CDK-OBr867RS.js";import{t as ge}from"./graphlib-DS17s2tU.js";function _e(e){return Array.isArray(e)}function ve(e){if(re(e))return e;let t=A(e);if(!ye(e))return{};if(_e(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?xe(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Se(n,e),N(n,e),be(n,e),n}function ye(e){switch(A(e)){case ae:case g:case O:case k:case ie:case v:case _:case T:case te:case ne:case m:case C:case w:case E:case y:case x:case S:case D:case j:case b:case oe:case h:return!0;default:return!1}}function N(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function be(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function xe(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Se(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t as n}from"./chunk-DUW6YSOI-Dgx8z5s3.js";import{m as r,p as i}from"./src-BnEL7pZw.js";import{a,b as o,c as s,rt as c,s as l,y as u}from"./chunk-DSNLSHJZ-CHEA9kYd.js";import{t as d}from"./channel-C2-OT56h.js";import{i as f,r as p}from"./chunk-ZAUX2LTX--4WyRBRV.js";import"./chunk-AQDTSKZB-OkzYqFsw.js";import{A as m,B as h,C as g,D as _,E as v,F as y,H as b,I as x,L as S,M as C,N as w,O as T,P as E,R as D,S as O,T as k,U as A,V as j,c as M,g as ee,j as te,k as ne,v as re,w as ie,x as ae,z as oe}from"./chunk-7S6XSTFO-WIrWcDbG.js";import{i as se,n as ce,o as le,r as ue,s as de}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{a as fe,c as pe,i as me,l as he}from"./chunk-WQQL4CDK-gNypBVAM.js";import{t as ge}from"./graphlib-DS17s2tU.js";function _e(e){return Array.isArray(e)}function ve(e){if(re(e))return e;let t=A(e);if(!ye(e))return{};if(_e(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?xe(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Se(n,e),N(n,e),be(n,e),n}function ye(e){switch(A(e)){case ae:case g:case O:case k:case ie:case v:case _:case T:case te:case ne:case m:case C:case w:case E:case y:case x:case S:case D:case j:case b:case oe:case h:return!0;default:return!1}}function N(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function be(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function xe(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Se(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};_.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{at as e,it as t}from"./chunk-DSNLSHJZ-CHEA9kYd.js";var n=(n,r)=>e.lang.round(t.parse(n)[r]);export{n as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{p as t}from"./src-DtpyLxw7.js";import{k as n}from"./chunk-DSNLSHJZ-Bf4nxMnG.js";import{m as r}from"./math-OLjDjiS-.js";var i=r(),a=e((e,t)=>{let n=e.append(`rect`);if(n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),t.name&&n.attr(`name`,t.name),t.rx&&n.attr(`rx`,t.rx),t.ry&&n.attr(`ry`,t.ry),t.attrs!==void 0)for(let e in t.attrs)n.attr(e,t.attrs[e]);return t.class&&n.attr(`class`,t.class),n},`drawRect`),o=e((e,t)=>{a(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:`rect`}).lower()},`drawBackgroundRect`),s=e((e,t)=>{let r=t.text.replace(n,` `),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.attr(`class`,`legend`),i.style(`text-anchor`,t.anchor),t.class&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.text(r),i},`drawText`),c=e((e,t,n,r)=>{let a=e.append(`image`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,o)},`drawImage`),l=e((e,t,n,r)=>{let a=e.append(`use`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,`#${o}`)},`drawEmbeddedImage`),u=e(()=>({x:0,y:0,width:100,height:100,fill:`#EDF2AE`,stroke:`#666`,anchor:`start`,rx:0,ry:0}),`getNoteRect`),d=e(()=>({x:0,y:0,width:100,height:100,"text-anchor":`start`,style:`#666`,textMargin:0,rx:0,ry:0,tspan:!0}),`getTextObj`),f=e(()=>{let e=t(`.mermaidTooltip`);return e.empty()&&(e=t(`body`).append(`div`).attr(`class`,`mermaidTooltip`).style(`opacity`,0).style(`position`,`absolute`).style(`text-align`,`center`).style(`max-width`,`200px`).style(`padding`,`2px`).style(`font-size`,`12px`).style(`background`,`#ffffde`).style(`border`,`1px solid #333`).style(`border-radius`,`2px`).style(`pointer-events`,`none`).style(`z-index`,`100`)),e},`createTooltip`);export{a,d as c,c as i,o as n,s as o,l as r,u as s,f as t};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{p as t}from"./src-BnEL7pZw.js";import{k as n}from"./chunk-DSNLSHJZ-CHEA9kYd.js";import{m as r}from"./math-BJAjkhlu.js";var i=r(),a=e((e,t)=>{let n=e.append(`rect`);if(n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),t.name&&n.attr(`name`,t.name),t.rx&&n.attr(`rx`,t.rx),t.ry&&n.attr(`ry`,t.ry),t.attrs!==void 0)for(let e in t.attrs)n.attr(e,t.attrs[e]);return t.class&&n.attr(`class`,t.class),n},`drawRect`),o=e((e,t)=>{a(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:`rect`}).lower()},`drawBackgroundRect`),s=e((e,t)=>{let r=t.text.replace(n,` `),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.attr(`class`,`legend`),i.style(`text-anchor`,t.anchor),t.class&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.text(r),i},`drawText`),c=e((e,t,n,r)=>{let a=e.append(`image`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,o)},`drawImage`),l=e((e,t,n,r)=>{let a=e.append(`use`);a.attr(`x`,t),a.attr(`y`,n);let o=(0,i.sanitizeUrl)(r);a.attr(`xlink:href`,`#${o}`)},`drawEmbeddedImage`),u=e(()=>({x:0,y:0,width:100,height:100,fill:`#EDF2AE`,stroke:`#666`,anchor:`start`,rx:0,ry:0}),`getNoteRect`),d=e(()=>({x:0,y:0,width:100,height:100,"text-anchor":`start`,style:`#666`,textMargin:0,rx:0,ry:0,tspan:!0}),`getTextObj`),f=e(()=>{let e=t(`.mermaidTooltip`);return e.empty()&&(e=t(`body`).append(`div`).attr(`class`,`mermaidTooltip`).style(`opacity`,0).style(`position`,`absolute`).style(`text-align`,`center`).style(`max-width`,`200px`).style(`padding`,`2px`).style(`font-size`,`12px`).style(`background`,`#ffffde`).style(`border`,`1px solid #333`).style(`border-radius`,`2px`).style(`pointer-events`,`none`).style(`z-index`,`100`)),e},`createTooltip`);export{a,d as c,c as i,o as n,s as o,l as r,u as s,f as t};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-DtpyLxw7.js";import{L as r,h as i,p as a,r as o,s}from"./chunk-DSNLSHJZ-Bf4nxMnG.js";import{m as c}from"./math-OLjDjiS-.js";function l(e){this._context=e}l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function u(e){return new l(e)}var d=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function f(e){return new d(e,!0)}function ee(e){return new d(e,!1)}function p(){}function m(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function h(e){this._context=e}h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:m(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:m(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function te(e){return new h(e)}function ne(e){this._context=e}ne.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:m(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function re(e){return new ne(e)}function ie(e){this._context=e}ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:m(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ae(e){return new ie(e)}function oe(e,t){this._basis=new h(e),this._beta=t}oe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var se=(function e(t){function n(e){return t===1?new h(e):new oe(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function g(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _(e,t){this._context=e,this._k=(1-t)/6}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:g(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:g(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ce=(function e(t){function n(e){return new _(e,t)}return n.tension=function(t){return e(+t)},n})(0);function v(e,t){this._context=e,this._k=(1-t)/6}v.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:g(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var le=(function e(t){function n(e){return new v(e,t)}return n.tension=function(t){return e(+t)},n})(0);function y(e,t){this._context=e,this._k=(1-t)/6}y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:g(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ue=(function e(t){function n(e){return new y(e,t)}return n.tension=function(t){return e(+t)},n})(0);function b(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function de(e,t){this._context=e,this._alpha=t}de.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:b(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var x=(function e(t){function n(e){return t?new de(e,t):new _(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function S(e,t){this._context=e,this._alpha=t}S.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:b(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var fe=(function e(t){function n(e){return t?new S(e,t):new v(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function pe(e,t){this._context=e,this._alpha=t}pe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:b(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var me=(function e(t){function n(e){return t?new pe(e,t):new y(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function he(e){this._context=e}he.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ge(e){return new he(e)}function _e(e){return e<0?-1:1}function ve(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(_e(a)+_e(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ye(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function C(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function w(e){this._context=e}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:C(this,this._t0,ye(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,C(this,ye(this,n=ve(this,e,t)),n);break;default:C(this,this._t0,n=ve(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function be(e){this._context=new xe(e)}(be.prototype=Object.create(w.prototype)).point=function(e,t){w.prototype.point.call(this,t,e)};function xe(e){this._context=e}xe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Se(e){return new w(e)}function Ce(e){return new be(e)}function we(e){this._context=e}we.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Te(e),i=Te(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Te(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Ee(e){return new we(e)}function T(e,t){this._context=e,this._t=t}T.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function De(e){return new T(e,.5)}function Oe(e){return new T(e,0)}function ke(e){return new T(e,1)}function E(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ae(){}function D(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function O(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var k=`[object RegExp]`,A=`[object String]`,j=`[object Number]`,M=`[object Boolean]`,N=`[object Arguments]`,je=`[object Symbol]`,Me=`[object Date]`,Ne=`[object Map]`,Pe=`[object Set]`,Fe=`[object Array]`,Ie=`[object ArrayBuffer]`,Le=`[object Object]`,Re=`[object DataView]`,ze=`[object Uint8Array]`,Be=`[object Uint8ClampedArray]`,Ve=`[object Uint16Array]`,He=`[object Uint32Array]`,Ue=`[object Int8Array]`,We=`[object Int16Array]`,P=`[object Int32Array]`,Ge=`[object Float32Array]`,Ke=`[object Float64Array]`,qe=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function F(e){return qe.Buffer!==void 0&&qe.Buffer.isBuffer(e)}function Je(e){return Number.isSafeInteger(e)&&e>=0}function Ye(e){return e!=null&&typeof e!=`function`&&Je(e.length)}function Xe(e){return e===`__proto__`}function I(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function L(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ze(e,t){return R(e,void 0,e,new Map,t)}function R(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(I(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=R(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,R(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(R(a,void 0,n,r,i));return t}if(F(e))return e.subarray();if(L(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=R(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),z(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),z(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),z(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,z(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),z(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),z(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),z(t,e,n,r,i),t}if(typeof e==`object`&&Qe(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),z(t,e,n,r,i),t}return e}function z(e,t,n=e,r,i){let a=[...Object.keys(t),...D(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=R(t[s],s,n,r,i))}}function Qe(e){switch(O(e)){case N:case Fe:case Ie:case Re:case M:case Me:case Ge:case Ke:case Ue:case We:case P:case Ne:case j:case Le:case k:case Pe:case A:case je:case ze:case Be:case Ve:case He:return!0;default:return!1}}function $e(e,t){return Ze(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(O(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),z(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case j:case A:case M:{let t=new e.constructor(e?.valueOf());return z(t,e),t}case N:{let t={};return z(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function et(e){return $e(e)}function B(e){return typeof e==`object`&&!!e&&O(e)===`[object Arguments]`}function V(e){return typeof e==`object`&&!!e}function tt(e){return V(e)&&Ye(e)}function H(e){return L(e)}function U(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(U.Cache||Map),n}U.Cache=Map;function nt(e){if(I(e))return e;if(Array.isArray(e)||L(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function rt(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=W(i,t,r,new Map)}return i}function W(e,t,n,r){if(I(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return nt(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)e in t||(t[e]=void 0)}let i=[...Object.keys(t),...D(t)];for(let a=0;a<i.length;a++){let o=i[a];if(Xe(o))continue;let s=t[o],c=e[o];if(B(s)&&(s={...s}),B(c)&&(c={...c}),F(s)&&(s=et(s)),Array.isArray(s)){if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(tt(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[]}let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||V(c)&&V(s)&&(E(c)||E(s)||H(c)||H(s))?e[o]=W(c,s,n,r):c==null&&E(s)?e[o]=W({},s,n,r):c==null&&H(s)?e[o]=et(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function it(e,...t){return rt(e,...t,Ae)}var at=c(),ot={curveBasis:te,curveBasisClosed:re,curveBasisOpen:ae,curveBumpX:f,curveBumpY:ee,curveBundle:se,curveCardinalClosed:le,curveCardinalOpen:ue,curveCardinal:ce,curveCatmullRomClosed:fe,curveCatmullRomOpen:me,curveCatmullRom:x,curveLinear:u,curveLinearClosed:ge,curveMonotoneX:Se,curveMonotoneY:Ce,curveNatural:Ee,curveStep:De,curveStepAfter:ke,curveStepBefore:Oe},st=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ct=e(function(e,t){let n=lt(e,/(?:init\b)|(?:initialize\b)/),i={};if(Array.isArray(n)){let e=n.map(e=>e.args);r(e),i=o(i,[...e])}else i=n.args;if(!i)return;let s=a(e,t),c=`config`;return i[c]!==void 0&&(s===`flowchart-v2`&&(s=`flowchart`),i[s]=i[c],delete i[c]),i},`detectInit`),lt=e(function(e,n=null){try{let r=RegExp(`[%]{2}(?![{]${st.source})(?=[}][%]{2}).*
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-BnEL7pZw.js";import{L as r,h as i,p as a,r as o,s}from"./chunk-DSNLSHJZ-CHEA9kYd.js";import{m as c}from"./math-BJAjkhlu.js";function l(e){this._context=e}l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function u(e){return new l(e)}var d=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function f(e){return new d(e,!0)}function ee(e){return new d(e,!1)}function p(){}function m(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function h(e){this._context=e}h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:m(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:m(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function te(e){return new h(e)}function ne(e){this._context=e}ne.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:m(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function re(e){return new ne(e)}function ie(e){this._context=e}ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:m(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ae(e){return new ie(e)}function oe(e,t){this._basis=new h(e),this._beta=t}oe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var se=(function e(t){function n(e){return t===1?new h(e):new oe(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function g(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _(e,t){this._context=e,this._k=(1-t)/6}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:g(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:g(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ce=(function e(t){function n(e){return new _(e,t)}return n.tension=function(t){return e(+t)},n})(0);function v(e,t){this._context=e,this._k=(1-t)/6}v.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:g(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var le=(function e(t){function n(e){return new v(e,t)}return n.tension=function(t){return e(+t)},n})(0);function y(e,t){this._context=e,this._k=(1-t)/6}y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:g(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ue=(function e(t){function n(e){return new y(e,t)}return n.tension=function(t){return e(+t)},n})(0);function b(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function de(e,t){this._context=e,this._alpha=t}de.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:b(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var x=(function e(t){function n(e){return t?new de(e,t):new _(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function S(e,t){this._context=e,this._alpha=t}S.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:b(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var fe=(function e(t){function n(e){return t?new S(e,t):new v(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function pe(e,t){this._context=e,this._alpha=t}pe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:b(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var me=(function e(t){function n(e){return t?new pe(e,t):new y(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function he(e){this._context=e}he.prototype={areaStart:p,areaEnd:p,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ge(e){return new he(e)}function _e(e){return e<0?-1:1}function ve(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(_e(a)+_e(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ye(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function C(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function w(e){this._context=e}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:C(this,this._t0,ye(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,C(this,ye(this,n=ve(this,e,t)),n);break;default:C(this,this._t0,n=ve(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function be(e){this._context=new xe(e)}(be.prototype=Object.create(w.prototype)).point=function(e,t){w.prototype.point.call(this,t,e)};function xe(e){this._context=e}xe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Se(e){return new w(e)}function Ce(e){return new be(e)}function we(e){this._context=e}we.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Te(e),i=Te(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Te(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Ee(e){return new we(e)}function T(e,t){this._context=e,this._t=t}T.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function De(e){return new T(e,.5)}function Oe(e){return new T(e,0)}function ke(e){return new T(e,1)}function E(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ae(){}function D(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function O(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var k=`[object RegExp]`,A=`[object String]`,j=`[object Number]`,M=`[object Boolean]`,N=`[object Arguments]`,je=`[object Symbol]`,Me=`[object Date]`,Ne=`[object Map]`,Pe=`[object Set]`,Fe=`[object Array]`,Ie=`[object ArrayBuffer]`,Le=`[object Object]`,Re=`[object DataView]`,ze=`[object Uint8Array]`,Be=`[object Uint8ClampedArray]`,Ve=`[object Uint16Array]`,He=`[object Uint32Array]`,Ue=`[object Int8Array]`,We=`[object Int16Array]`,P=`[object Int32Array]`,Ge=`[object Float32Array]`,Ke=`[object Float64Array]`,qe=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function F(e){return qe.Buffer!==void 0&&qe.Buffer.isBuffer(e)}function Je(e){return Number.isSafeInteger(e)&&e>=0}function Ye(e){return e!=null&&typeof e!=`function`&&Je(e.length)}function Xe(e){return e===`__proto__`}function I(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function L(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ze(e,t){return R(e,void 0,e,new Map,t)}function R(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(I(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=R(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,R(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(R(a,void 0,n,r,i));return t}if(F(e))return e.subarray();if(L(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=R(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),z(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),z(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),z(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,z(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),z(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),z(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),z(t,e,n,r,i),t}if(typeof e==`object`&&Qe(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),z(t,e,n,r,i),t}return e}function z(e,t,n=e,r,i){let a=[...Object.keys(t),...D(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=R(t[s],s,n,r,i))}}function Qe(e){switch(O(e)){case N:case Fe:case Ie:case Re:case M:case Me:case Ge:case Ke:case Ue:case We:case P:case Ne:case j:case Le:case k:case Pe:case A:case je:case ze:case Be:case Ve:case He:return!0;default:return!1}}function $e(e,t){return Ze(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(O(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),z(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case j:case A:case M:{let t=new e.constructor(e?.valueOf());return z(t,e),t}case N:{let t={};return z(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function et(e){return $e(e)}function B(e){return typeof e==`object`&&!!e&&O(e)===`[object Arguments]`}function V(e){return typeof e==`object`&&!!e}function tt(e){return V(e)&&Ye(e)}function H(e){return L(e)}function U(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(U.Cache||Map),n}U.Cache=Map;function nt(e){if(I(e))return e;if(Array.isArray(e)||L(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function rt(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=W(i,t,r,new Map)}return i}function W(e,t,n,r){if(I(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return nt(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)e in t||(t[e]=void 0)}let i=[...Object.keys(t),...D(t)];for(let a=0;a<i.length;a++){let o=i[a];if(Xe(o))continue;let s=t[o],c=e[o];if(B(s)&&(s={...s}),B(c)&&(c={...c}),F(s)&&(s=et(s)),Array.isArray(s)){if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(tt(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[]}let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||V(c)&&V(s)&&(E(c)||E(s)||H(c)||H(s))?e[o]=W(c,s,n,r):c==null&&E(s)?e[o]=W({},s,n,r):c==null&&H(s)?e[o]=et(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function it(e,...t){return rt(e,...t,Ae)}var at=c(),ot={curveBasis:te,curveBasisClosed:re,curveBasisOpen:ae,curveBumpX:f,curveBumpY:ee,curveBundle:se,curveCardinalClosed:le,curveCardinalOpen:ue,curveCardinal:ce,curveCatmullRomClosed:fe,curveCatmullRomOpen:me,curveCatmullRom:x,curveLinear:u,curveLinearClosed:ge,curveMonotoneX:Se,curveMonotoneY:Ce,curveNatural:Ee,curveStep:De,curveStepAfter:ke,curveStepBefore:Oe},st=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ct=e(function(e,t){let n=lt(e,/(?:init\b)|(?:initialize\b)/),i={};if(Array.isArray(n)){let e=n.map(e=>e.args);r(e),i=o(i,[...e])}else i=n.args;if(!i)return;let s=a(e,t),c=`config`;return i[c]!==void 0&&(s===`flowchart-v2`&&(s=`flowchart`),i[s]=i[c],delete i[c]),i},`detectInit`),lt=e(function(e,n=null){try{let r=RegExp(`[%]{2}(?![{]${st.source})(?=[}][%]{2}).*
2
2
  `,`ig`);e=e.trim().replace(r,``).replace(/'/gm,`"`),t.debug(`Detecting diagram directive${n===null?``:` type:`+n} based on the text:${e}`);let a,o=[];for(;(a=i.exec(e))!==null;)if(a.index===i.lastIndex&&i.lastIndex++,a&&!n||n&&a[1]?.match(n)||n&&a[2]?.match(n)){let e=a[1]?a[1]:a[2],t=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;o.push({type:e,args:t})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return t.error(`ERROR: ${r.message} - Unable to parse directive type: '${n}' based on the text: '${e}'`),{type:void 0,args:null}}},`detectDirective`),ut=e(function(e){return e.replace(i,``)},`removeDirectives`),dt=e(function(e,t){for(let[n,r]of t.entries())if(r.match(e))return n;return-1},`isSubstringInArray`);function G(e,t){return e?ot[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}e(G,`interpolateToCurve`);function ft(e,t){let n=e.trim();if(n)return t.securityLevel===`loose`?n:(0,at.sanitizeUrl)(n)}e(ft,`formatUrl`);var pt=e((e,...n)=>{let r=e.split(`.`),i=r.length-1,a=r[i],o=window;for(let n=0;n<i;n++)if(o=o[r[n]],!o){t.error(`Function name: ${e} not found in window`);return}o[a](...n)},`runFunc`);function K(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}e(K,`distance`);function mt(e){let t,n=0;return e.forEach(e=>{n+=K(e,t),t=e}),q(e,n/2)}e(mt,`traverseEdge`);function ht(e){return e.length===1?e[0]:mt(e)}e(ht,`calcLabelPosition`);var gt=e((e,t=2)=>{let n=10**t;return Math.round(e*n)/n},`roundNumber`),q=e((e,t)=>{let n,r=t;for(let t of e){if(n){let e=K(t,n);if(e===0)return n;if(e<r)r-=e;else{let i=r/e;if(i<=0)return n;if(i>=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:gt((1-i)*n.x+i*t.x,5),y:gt((1-i)*n.y+i*t.y,5)}}}n=t}throw Error(`Could not find a suitable point for the given distance`)},`calculatePoint`),_t=e((e,n,r)=>{t.info(`our points ${JSON.stringify(n)}`),n[0]!==r&&(n=n.reverse());let i=q(n,25),a=e?10:5,o=Math.atan2(n[0].y-i.y,n[0].x-i.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(n[0].x+i.x)/2,s.y=-Math.cos(o)*a+(n[0].y+i.y)/2,s},`calcCardinalityPosition`);function vt(e,n,r){let i=structuredClone(r);t.info(`our points`,i),n!==`start_left`&&n!==`start_right`&&i.reverse();let a=q(i,25+e),o=10+e*.5,s=Math.atan2(i[0].y-a.y,i[0].x-a.x),c={x:0,y:0};return n===`start_left`?(c.x=Math.sin(s+Math.PI)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s+Math.PI)*o+(i[0].y+a.y)/2):n===`end_right`?(c.x=Math.sin(s-Math.PI)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s-Math.PI)*o+(i[0].y+a.y)/2):(c.x=Math.sin(s)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s)*o+(i[0].y+a.y)/2),c}e(vt,`calcTerminalLabelPosition`);function J(e){let t=``,n=``;for(let r of e)r!==void 0&&(r.startsWith(`color:`)||r.startsWith(`text-align:`)?n=n+r+`;`:t=t+r+`;`);return{style:t,labelStyle:n}}e(J,`getStylesFromArray`);var yt=0,bt=e(()=>(yt++,`id-`+Math.random().toString(36).substr(2,12)+`-`+yt),`generateId`);function xt(e){let t=``;for(let n=0;n<e;n++)t+=`0123456789abcdef`.charAt(Math.floor(Math.random()*16));return t}e(xt,`makeRandomHex`);var St=e(e=>xt(e.length),`random`),Ct=e(function(){return{x:0,y:0,fill:void 0,anchor:`start`,style:`#666`,width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:``}},`getTextObj`),wt=e(function(e,t){let n=t.text.replace(s.lineBreakRegex,` `),[,r]=Q(t.fontSize),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.style(`text-anchor`,t.anchor),i.style(`font-family`,t.fontFamily),i.style(`font-size`,r),i.style(`font-weight`,t.fontWeight),i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.attr(`fill`,t.fill),a.text(n),i},`drawSimpleText`),Tt=U((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,joinWith:`<br/>`},n),s.hasBreaks(e)))return e;let r=e.split(` `).filter(Boolean),i=[],a=``;return r.forEach((e,o)=>{let s=Y(`${e} `,n),c=Y(a,n);if(s>t){let{hyphenatedStrings:r,remainingWord:o}=Et(e,t,`-`,n);i.push(a,...r),a=o}else c+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(` `);o+1===r.length&&i.push(a)}),i.filter(e=>e!==``).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),Et=U((e,t,n=`-`,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,margin:0},r);let i=[...e],a=[],o=``;return i.forEach((e,s)=>{let c=`${o}${e}`;if(Y(c,r)>=t){let e=s+1,t=i.length===e,r=`${c}${n}`;a.push(t?c:r),o=``}else o=c}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n=`-`,r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function Dt(e,t){return X(e,t).height}e(Dt,`calculateTextHeight`);function Y(e,t){return X(e,t).width}e(Y,`calculateTextWidth`);var X=U((e,t)=>{let{fontSize:r=12,fontFamily:i=`Arial`,fontWeight:a=400}=t;if(!e)return{width:0,height:0};let[,o]=Q(r),c=[`sans-serif`,i],l=e.split(s.lineBreakRegex),u=[],d=n(`body`);if(!d.remove)return{width:0,height:0,lineHeight:0};let f=d.append(`svg`);for(let e of c){let t=0,n={width:0,height:0,lineHeight:0};for(let r of l){let i=Ct();i.text=r||`​`;let s=wt(f,i).style(`font-size`,o).style(`font-weight`,a).style(`font-family`,e),c=(s._groups||s)[0][0].getBBox();if(c.width===0&&c.height===0)throw Error(`svg element not in render tree`);n.width=Math.round(Math.max(n.width,c.width)),t=Math.round(c.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}u.push(n)}return f.remove(),u[isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Ot=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{e(this,`InitIDGenerator`)}},Z,kt=e(function(e){return Z||=document.createElement(`div`),e=escape(e).replace(/%26/g,`&`).replace(/%23/g,`#`).replace(/%3B/g,`;`),Z.innerHTML=e,unescape(Z.textContent)},`entityDecode`);function At(e){return`str`in e}e(At,`isDetailedError`);function jt(e){return e instanceof Error?e.message:String(e)}e(jt,`getErrorMessage`);var Mt=e((e,t,n,r)=>{if(!r)return;let i=e.node()?.getBBox();i&&e.append(`text`).text(r).attr(`text-anchor`,`middle`).attr(`x`,i.x+i.width/2).attr(`y`,-n).attr(`class`,t)},`insertTitle`),Q=e(e=>{if(typeof e==`number`)return[e,e+`px`];let t=parseInt(e??``,10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+`px`]:[t,e]},`parseFontSize`);function $(e,t){return it({},e,t)}e($,`cleanAndMerge`);var Nt={assignWithDepth:o,wrapLabel:Tt,calculateTextHeight:Dt,calculateTextWidth:Y,calculateTextDimensions:X,cleanAndMerge:$,detectInit:ct,detectDirective:lt,isSubstringInArray:dt,interpolateToCurve:G,calcLabelPosition:ht,calcCardinalityPosition:_t,calcTerminalLabelPosition:vt,formatUrl:ft,getStylesFromArray:J,generateId:bt,random:St,runFunc:pt,entityDecode:kt,insertTitle:Mt,isLabelCoordinateInPath:Rt,parseFontSize:Q,InitIDGenerator:Ot},Pt=e(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){let t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?`fl°°`+t+`¶ß`:`fl°`+t+`¶ß`}),t},`encodeEntities`),Ft=e(function(e){return e.replace(/fl°°/g,`&#`).replace(/fl°/g,`&`).replace(/¶ß/g,`;`)},`decodeEntities`),It=e((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:``}${e}_${t}_${n}${i?`_${i}`:``}`,`getEdgeId`);function Lt(e){return e??null}e(Lt,`handleUndefinedAttr`);function Rt(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,e=>Math.round(parseFloat(e)).toString());return i.includes(n.toString())||i.includes(r.toString())}e(Rt,`isLabelCoordinateInPath`);export{f as $,P as A,He as B,Fe as C,Ge as D,Me as E,k as F,Oe as G,Be as H,Pe as I,Se as J,De as K,A as L,Ne as M,j as N,Ke as O,Le as P,te as Q,je as R,Ie as S,Re as T,O as U,ze as V,ke as W,x as X,Ce as Y,ce as Z,B as _,bt as a,F as b,J as c,At as d,ee as et,Q as f,H as g,Nt as h,Pt as i,Ue as j,We as k,Lt as l,ut as m,$ as n,It as o,St as p,Ee as q,Ft as r,jt as s,Y as t,u as tt,G as u,I as v,M as w,N as x,Ye as y,Ve as z};