for-humanity 0.11.0 → 0.13.0

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 (226) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +16 -9
  3. package/dist/browser.js +16 -16
  4. package/dist/cli.css +2 -941
  5. package/dist/cli.js +92 -2290
  6. package/dist/config.js +1 -0
  7. package/dist/constant/copy.d.ts +100 -0
  8. package/dist/constant/site.d.ts +20 -0
  9. package/dist/constant/status.d.ts +19 -0
  10. package/dist/copy-C1uzvEnr.js +103 -0
  11. package/dist/group-path-XAThmzvC.js +10 -0
  12. package/dist/load-site-CbpLEhwu.js +2379 -0
  13. package/dist/logger-Dv1i9xSV.js +9 -0
  14. package/dist/mermaid/THIRD-PARTY-NOTICES.txt +3134 -0
  15. package/dist/mermaid/chunk--TN-qHgG.js +2 -0
  16. package/dist/mermaid/chunk-0kM1Lv4D.js +2 -0
  17. package/dist/mermaid/chunk-3FHei3pH.js +2001 -0
  18. package/dist/mermaid/chunk-3_2p2GqN.js +2 -0
  19. package/dist/mermaid/chunk-6HLei9i0.js +84 -0
  20. package/dist/mermaid/chunk-7Sz3kAwl.js +2214 -0
  21. package/dist/mermaid/chunk-7Tarqbpa.js +18047 -0
  22. package/dist/mermaid/chunk-9kkt8lzL.js +10 -0
  23. package/dist/mermaid/chunk-B--pNBQF.js +884 -0
  24. package/dist/mermaid/chunk-B4F-pysn.js +4241 -0
  25. package/dist/mermaid/chunk-B58sEIY_.js +14 -0
  26. package/dist/mermaid/chunk-B9_UWzSH.js +1517 -0
  27. package/dist/mermaid/chunk-BB8uZHwY.js +75 -0
  28. package/dist/mermaid/chunk-BFfk0LEc.js +717 -0
  29. package/dist/mermaid/chunk-BKri0qr7.js +89 -0
  30. package/dist/mermaid/chunk-BL404pH5.js +26 -0
  31. package/dist/mermaid/chunk-BLeiQSWo.js +354 -0
  32. package/dist/mermaid/chunk-BOmH_UFd.js +2 -0
  33. package/dist/mermaid/chunk-BSej9Nhy.js +1361 -0
  34. package/dist/mermaid/chunk-BYzrzvCI.js +12 -0
  35. package/dist/mermaid/chunk-BariMtWr.js +3020 -0
  36. package/dist/mermaid/chunk-BcrBoMwH.js +2352 -0
  37. package/dist/mermaid/chunk-Bok8z-Yo.js +67 -0
  38. package/dist/mermaid/chunk-BpTHLKQM.js +1970 -0
  39. package/dist/mermaid/chunk-BqjuxRsC.js +733 -0
  40. package/dist/mermaid/chunk-BuvPd-s5.js +1073 -0
  41. package/dist/mermaid/chunk-BvVehae3.js +5069 -0
  42. package/dist/mermaid/chunk-C-JABYpd.js +3075 -0
  43. package/dist/mermaid/chunk-C9XlTm4w.js +2 -0
  44. package/dist/mermaid/chunk-CApNbSU9.js +6 -0
  45. package/dist/mermaid/chunk-CCM2AH-C.js +9 -0
  46. package/dist/mermaid/chunk-CD1E0F_N.js +2 -0
  47. package/dist/mermaid/chunk-CDWvKG7D.js +2 -0
  48. package/dist/mermaid/chunk-CEVPpC1F.js +34 -0
  49. package/dist/mermaid/chunk-CLDr12lf.js +47504 -0
  50. package/dist/mermaid/chunk-CLVYqOBI.js +61 -0
  51. package/dist/mermaid/chunk-CLeOkFb5.js +15 -0
  52. package/dist/mermaid/chunk-CLgRAtOz.js +37 -0
  53. package/dist/mermaid/chunk-CMqFNUBl.js +134 -0
  54. package/dist/mermaid/chunk-CTPaBJXB.js +2 -0
  55. package/dist/mermaid/chunk-CVi6IGBL.js +2 -0
  56. package/dist/mermaid/chunk-CWV_EN-4.js +4745 -0
  57. package/dist/mermaid/chunk-CZ0dAs3g.js +2 -0
  58. package/dist/mermaid/chunk-C_YGy4Fn.js +236 -0
  59. package/dist/mermaid/chunk-CcVH22Yt.js +100 -0
  60. package/dist/mermaid/chunk-CgG6CD9_.js +7175 -0
  61. package/dist/mermaid/chunk-CgOP6IDB.js +3397 -0
  62. package/dist/mermaid/chunk-Cgg2UTSf.js +13 -0
  63. package/dist/mermaid/chunk-ChJfJJ1A.js +214 -0
  64. package/dist/mermaid/chunk-Ck5XRA46.js +447 -0
  65. package/dist/mermaid/chunk-Ckuw16cl.js +203 -0
  66. package/dist/mermaid/chunk-CpAbRCbF.js +1880 -0
  67. package/dist/mermaid/chunk-CuYekbSv.js +2 -0
  68. package/dist/mermaid/chunk-CwS4wZ5a.js +2 -0
  69. package/dist/mermaid/chunk-D-bcrBO3.js +82 -0
  70. package/dist/mermaid/chunk-D3IEAkCW.js +76 -0
  71. package/dist/mermaid/chunk-D8XfBJ_K.js +645 -0
  72. package/dist/mermaid/chunk-D9Ddd9y4.js +2228 -0
  73. package/dist/mermaid/chunk-DBh1mIbK.js +12 -0
  74. package/dist/mermaid/chunk-DD6Df6Ic.js +5 -0
  75. package/dist/mermaid/chunk-DGVDaXjx.js +8 -0
  76. package/dist/mermaid/chunk-DK9KqIXj.js +632 -0
  77. package/dist/mermaid/chunk-DORnIAsy.js +4487 -0
  78. package/dist/mermaid/chunk-DU69_VcF.js +363 -0
  79. package/dist/mermaid/chunk-DVNvSFoz.js +2144 -0
  80. package/dist/mermaid/chunk-DZe-4kde.js +20 -0
  81. package/dist/mermaid/chunk-D_a06Rz4.js +287 -0
  82. package/dist/mermaid/chunk-DfyFJJi2.js +972 -0
  83. package/dist/mermaid/chunk-DhKYPp1Z.js +2 -0
  84. package/dist/mermaid/chunk-DjFqgNTG.js +94 -0
  85. package/dist/mermaid/chunk-DmbDDrr-.js +65 -0
  86. package/dist/mermaid/chunk-DpuxlyL_.js +696 -0
  87. package/dist/mermaid/chunk-DqGhppWe.js +2 -0
  88. package/dist/mermaid/chunk-DqPZxHXa.js +5 -0
  89. package/dist/mermaid/chunk-Dt_1Jyif.js +293 -0
  90. package/dist/mermaid/chunk-DyQBE_NW.js +1935 -0
  91. package/dist/mermaid/chunk-JckyC4mW.js +1009 -0
  92. package/dist/mermaid/chunk-K7Myuj2-.js +1334 -0
  93. package/dist/mermaid/chunk-KuPYb48V.js +275 -0
  94. package/dist/mermaid/chunk-MFVRUoO0.js +4020 -0
  95. package/dist/mermaid/chunk-MbInCS_6.js +28 -0
  96. package/dist/mermaid/chunk-MexOLyKV.js +355 -0
  97. package/dist/mermaid/chunk-NnbDtJzg.js +21856 -0
  98. package/dist/mermaid/chunk-SGpOYZbI.js +2139 -0
  99. package/dist/mermaid/chunk-TbxLDlcU.js +198 -0
  100. package/dist/mermaid/chunk-TftHqGLg.js +490 -0
  101. package/dist/mermaid/chunk-UjQ8vA_Z.js +4138 -0
  102. package/dist/mermaid/chunk-YgmVTKqc.js +16 -0
  103. package/dist/mermaid/chunk-_a9EZE1v.js +1798 -0
  104. package/dist/mermaid/chunk-dTb8jqeP.js +2 -0
  105. package/dist/mermaid/chunk-fFdMfF8S.js +2240 -0
  106. package/dist/mermaid/chunk-feYbMzBj.js +1267 -0
  107. package/dist/mermaid/chunk-g3Pn8DkW.js +46 -0
  108. package/dist/mermaid/chunk-hM77LvCb.js +19832 -0
  109. package/dist/mermaid/chunk-hUDb-eAW.js +527 -0
  110. package/dist/mermaid/chunk-tpABtZ-3.js +4252 -0
  111. package/dist/mermaid/chunk-xIbz3oFK.js +59 -0
  112. package/dist/mermaid/chunk-yBz-vst0.js +976 -0
  113. package/dist/mermaid/mermaid-BhtR3wyB.js +1145 -0
  114. package/dist/run-site-command-C80YoNOe.js +129 -0
  115. package/dist/site-config-bllORGpm.js +90 -0
  116. package/dist/site.js +1 -0
  117. package/dist/start-dev-server-C4_Lu1nZ.js +176 -0
  118. package/dist/to-change-queue-DbEnZGNK.js +34 -0
  119. package/dist/to-error-message-pF6_7wGK.js +16 -0
  120. package/dist/type/group-path.d.ts +7 -0
  121. package/dist/type/site-config.d.ts +57 -0
  122. package/package.json +34 -17
  123. package/src/component/widget/cursor-face/_constant/cursor-face.ts +0 -14
  124. package/src/component/widget/cursor-face/wg-cursor-face.css +0 -15
  125. package/src/component/widget/cursor-face/wg-cursor-face.tsx +0 -153
  126. package/src/component/widget/navigation/_constant/locale.ts +0 -9
  127. package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -33
  128. package/src/component/widget/navigation/_constant/navigation.ts +0 -9
  129. package/src/component/widget/navigation/_constant/reading-line.ts +0 -4
  130. package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +0 -59
  131. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-branches.ts +0 -15
  132. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-group-branches.ts +0 -70
  133. package/src/component/widget/navigation/_function/to-doc-groups/to-doc-groups.ts +0 -15
  134. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +0 -13
  135. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +0 -13
  136. package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +0 -18
  137. package/src/component/widget/navigation/_function/to-navigation-json.ts +0 -8
  138. package/src/component/widget/navigation/_function/to-toc-groups.ts +0 -38
  139. package/src/component/widget/navigation/_type/doc-branch.ts +0 -11
  140. package/src/component/widget/navigation/_type/doc-group.ts +0 -24
  141. package/src/component/widget/navigation/_type/navigation-data.ts +0 -75
  142. package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -17
  143. package/src/component/widget/navigation/_type/toc-group.ts +0 -39
  144. package/src/component/widget/navigation/_wg-navigation-nav-list.css +0 -48
  145. package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +0 -61
  146. package/src/component/widget/navigation/_wg-navigation-nav.css +0 -21
  147. package/src/component/widget/navigation/_wg-navigation-nav.tsx +0 -33
  148. package/src/component/widget/navigation/_wg-navigation-scroll.tsx +0 -117
  149. package/src/component/widget/navigation/_wg-navigation-toc.css +0 -91
  150. package/src/component/widget/navigation/_wg-navigation-toc.tsx +0 -114
  151. package/src/component/widget/navigation/wg-navigation.css +0 -282
  152. package/src/component/widget/navigation/wg-navigation.tsx +0 -420
  153. package/src/component/widget/prose/_constant/heading-highlight.ts +0 -4
  154. package/src/component/widget/prose/_constant/section.ts +0 -7
  155. package/src/component/widget/prose/_constant/status.ts +0 -9
  156. package/src/component/widget/prose/_function/has-block-content.ts +0 -30
  157. package/src/component/widget/prose/_function/rehype-head.ts +0 -31
  158. package/src/component/widget/prose/_function/rehype-sections/_to-section-headings.ts +0 -20
  159. package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +0 -21
  160. package/src/component/widget/prose/_function/rehype-tables.ts +0 -22
  161. package/src/component/widget/prose/_function/remark-blocks.ts +0 -112
  162. package/src/component/widget/prose/_function/remark-flow.ts +0 -26
  163. package/src/component/widget/prose/_function/remark-links.ts +0 -33
  164. package/src/component/widget/prose/_function/remark-parts.ts +0 -26
  165. package/src/component/widget/prose/_function/remark-status.ts +0 -59
  166. package/src/component/widget/prose/_function/remark-swatch.ts +0 -16
  167. package/src/component/widget/prose/_function/remark-unknown-directives.ts +0 -25
  168. package/src/component/widget/prose/wg-prose.css +0 -454
  169. package/src/component/widget/prose/wg-prose.tsx +0 -43
  170. package/src/component/widget/shell/wg-shell.css +0 -63
  171. package/src/component/widget/shell/wg-shell.tsx +0 -88
  172. package/src/component/widget/shell-controls/wg-shell-controls.css +0 -4
  173. package/src/component/widget/shell-controls/wg-shell-controls.tsx +0 -170
  174. package/src/constant/asset.ts +0 -63
  175. package/src/constant/copy.ts +0 -133
  176. package/src/constant/doc.ts +0 -13
  177. package/src/constant/font.ts +0 -34
  178. package/src/constant/site.ts +0 -24
  179. package/src/constant/status.ts +0 -15
  180. package/src/entry/browser/browser.tsx +0 -22
  181. package/src/entry/cli/_constant/cli.ts +0 -19
  182. package/src/entry/cli/_constant/crawling.ts +0 -14
  183. package/src/entry/cli/_constant/snippet.ts +0 -21
  184. package/src/entry/cli/_function/create-app.tsx +0 -57
  185. package/src/entry/cli/_function/create-dev-app.ts +0 -87
  186. package/src/entry/cli/_function/create-processor/_rehype-assets.ts +0 -70
  187. package/src/entry/cli/_function/create-processor/_rehype-heading-ids.ts +0 -34
  188. package/src/entry/cli/_function/create-processor/_remark-report.ts +0 -15
  189. package/src/entry/cli/_function/create-processor/_remark-snippets.ts +0 -117
  190. package/src/entry/cli/_function/create-processor/_shiki-transformers.ts +0 -55
  191. package/src/entry/cli/_function/create-processor/create-processor.ts +0 -64
  192. package/src/entry/cli/_function/read-docs.ts +0 -128
  193. package/src/entry/cli/_function/read-home.ts +0 -32
  194. package/src/entry/cli/_function/to-crawling-app.ts +0 -42
  195. package/src/entry/cli/cli.test.ts +0 -782
  196. package/src/entry/cli/cli.ts +0 -206
  197. package/src/env.d.ts +0 -6
  198. package/src/page/doc/pg-doc.tsx +0 -35
  199. package/src/page/home/pg-home.tsx +0 -40
  200. package/src/store/navigation/create-navigation-stores.test.ts +0 -74
  201. package/src/store/navigation/create-navigation-stores.ts +0 -59
  202. package/src/store/navigation/navigation-state.ts +0 -36
  203. package/src/store/navigation/navigation-storage.ts +0 -9
  204. package/src/store/navigation/to-navigation-scroll-state.ts +0 -42
  205. package/src/style/base.css +0 -28
  206. package/src/style/token.css +0 -186
  207. package/src/type/doc-content.ts +0 -15
  208. package/src/type/doc-data.ts +0 -38
  209. package/src/type/doc-file-data.ts +0 -21
  210. package/src/type/doc-heading.ts +0 -17
  211. package/src/type/doc-outline.ts +0 -16
  212. package/src/type/doc-section.ts +0 -9
  213. package/src/type/doc.ts +0 -20
  214. package/src/type/group-path.ts +0 -7
  215. package/src/type/site-assets.ts +0 -25
  216. package/src/type/site-config.ts +0 -73
  217. package/src/type/vfile-data.d.ts +0 -10
  218. package/src/util/async/to-change-queue.test.ts +0 -58
  219. package/src/util/async/to-change-queue.ts +0 -43
  220. package/src/util/dom/find-hash-target.ts +0 -18
  221. package/src/util/dom/reveal-hash-target.ts +0 -15
  222. package/src/util/error/to-error-message.ts +0 -10
  223. package/src/util/file/to-asset-path.ts +0 -26
  224. package/src/util/font/to-font-css.test.ts +0 -41
  225. package/src/util/font/to-font-css.ts +0 -28
  226. package/src/util/mermaid/render-flow.js +0 -321
@@ -0,0 +1,4487 @@
1
+ import { m as e, p as t } from "./chunk-DVNvSFoz.js";
2
+ import { n } from "./chunk-BYzrzvCI.js";
3
+ import { B as r, M as i, b as a, f as o, g as s, k as c, w as l, y as u, z as d } from "./chunk-MFVRUoO0.js";
4
+ import { a as f, d as p, m, r as h } from "./chunk-K7Myuj2-.js";
5
+ import { a as g, i as _, r as v, t as y } from "./chunk-Bok8z-Yo.js";
6
+ import { n as b, t as x } from "./chunk-KuPYb48V.js";
7
+ import { n as S, r as C } from "./chunk-_a9EZE1v.js";
8
+ import { s as w } from "./chunk-DBh1mIbK.js";
9
+ import { t as T } from "./chunk-BSej9Nhy.js";
10
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HAGFOTED.mjs
11
+ var E = 1, D = 3;
12
+ async function O(e) {
13
+ let t = e.getElementsByTagName("img");
14
+ if (!t || t.length === 0) return;
15
+ let r = !k(e);
16
+ await Promise.all([...t].map((e) => new Promise((t) => {
17
+ function i() {
18
+ if (e.style.display = "flex", e.style.flexDirection = "column", r) {
19
+ let t = a().fontSize ? a().fontSize : window.getComputedStyle(document.body).fontSize, [n = o.fontSize] = m(t), r = n * 5 + "px";
20
+ e.style.minWidth = r, e.style.maxWidth = r;
21
+ } else e.style.width = "100%";
22
+ t(e);
23
+ }
24
+ n(i, "setupImage"), setTimeout(() => {
25
+ e.complete && i();
26
+ }), e.addEventListener("error", i), e.addEventListener("load", i);
27
+ })));
28
+ }
29
+ n(O, "configureLabelImages");
30
+ function k(e) {
31
+ return e.nodeType === D ? e.textContent?.trim() !== "" : e.nodeType !== E || e.tagName.toLowerCase() === "img" ? !1 : [...e.childNodes].some(k);
32
+ }
33
+ n(k, "hasTextBesidesImages");
34
+ var A = 3, j = 32, M = /* @__PURE__ */ n(async (e, n, r) => {
35
+ let i = a(), o = e.insert("g").attr("class", r ?? "node default").attr("id", n.domId || n.id), s = o.insert("g").attr("class", "label").attr("style", p(n.labelStyle)), c = [
36
+ {
37
+ text: typeof n.label == "string" ? n.label : n.label?.[0] ?? "",
38
+ cssClass: "c4-name"
39
+ },
40
+ {
41
+ text: n.stereotype,
42
+ cssClass: "c4-type"
43
+ },
44
+ ...(n.description ?? []).map((e) => ({
45
+ text: e,
46
+ cssClass: "c4-descr"
47
+ }))
48
+ ].filter((e) => e.text), l = n.width ? Math.max(n.width - 2 * (n.padding ?? 0), j) : a().flowchart?.wrappingWidth ?? 200, u = i.c4?.wrap ?? !0 ? l : Infinity, m = await Promise.all(c.map(async (e) => {
49
+ let r = s.append("g").attr("class", e.cssClass), a = await S(r, d(f(e.text ?? ""), i), {
50
+ useHtmlLabels: !1,
51
+ markdown: !1,
52
+ isNode: !0,
53
+ width: u,
54
+ style: n.labelStyle
55
+ }, i);
56
+ return t(a).selectAll("tspan.text-outer-tspan").attr("text-anchor", "middle"), t(a).selectAll("tspan.text-inner-tspan").attr("font-weight", null).attr("font-style", null), {
57
+ el: r,
58
+ box: r.node().getBBox()
59
+ };
60
+ })), h = Math.max(...m.map(({ box: e }) => e.width), 0), g = 0;
61
+ for (let { el: e, box: t } of m) e.attr("transform", `translate(${h / 2 - t.x - t.width / 2}, ${g - t.y})`), g += t.height + A;
62
+ let _ = m.length > 0 ? g - A : 0;
63
+ return s.insert("rect", ":first-child"), s.attr("transform", `translate(${-h / 2}, ${-_ / 2})`), {
64
+ shapeSvg: o,
65
+ bbox: s.node().getBBox(),
66
+ halfPadding: (n.padding ?? 0) / 2,
67
+ label: s
68
+ };
69
+ }, "c4LabelHelper"), N = /* @__PURE__ */ n((e, t) => {
70
+ let { x: r, y: i, width: a, height: o } = e;
71
+ return a >= t ? e : "left" in e ? {
72
+ x: r,
73
+ y: i,
74
+ width: t,
75
+ height: o,
76
+ top: i,
77
+ left: r,
78
+ bottom: i + o,
79
+ right: r + t,
80
+ toJSON: /* @__PURE__ */ n(() => ({}), "toJSON")
81
+ } : {
82
+ x: r - (t - a) / 2,
83
+ y: i,
84
+ width: t,
85
+ height: o
86
+ };
87
+ }, "withMinWidth"), P = /* @__PURE__ */ n(async (e, n, r, { ignoreMinWidth: i = !1 } = {}) => {
88
+ if (n.stereotype !== void 0) return M(e, n, r);
89
+ let o, c = n.useHtmlLabels || s(a()?.htmlLabels);
90
+ o = r || "node default";
91
+ let l = e.insert("g").attr("class", o).attr("id", n.domId || n.id), u = l.insert("g").attr("class", "label").attr("style", p(n.labelStyle)), m;
92
+ m = n.label === void 0 ? "" : typeof n.label == "string" ? n.label : n.label[0];
93
+ let h = !!n.icon || !!n.img, g = n.labelType === "markdown", _ = m && !n.width && !i ? n.minWidth ?? 0 : 0, v = await S(u, d(f(m), a()), {
94
+ useHtmlLabels: c,
95
+ width: n.width || n.wrappingWidth || a().flowchart?.wrappingWidth,
96
+ minWidth: _,
97
+ classes: g ? "markdown-node-label" : "",
98
+ style: n.labelStyle,
99
+ addSvgBackground: h,
100
+ markdown: g
101
+ }, a()), y = (n?.padding ?? 0) / 2, b;
102
+ if (c) {
103
+ let e = v.children[0], n = t(v);
104
+ await O(e), b = await C.measure(() => e.getBoundingClientRect()), b = N(b, _), n.attr("width", b.width), n.attr("height", b.height);
105
+ } else b = await C.measure(() => v.getBBox()), b = N(b, _);
106
+ return c ? u.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")") : u.attr("transform", "translate(0, " + -b.height / 2 + ")"), n.centerLabel && u.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), u.insert("rect", ":first-child"), {
107
+ shapeSvg: l,
108
+ bbox: b,
109
+ halfPadding: y,
110
+ label: u
111
+ };
112
+ }, "labelHelper"), F = /* @__PURE__ */ n(async (e, n, r) => {
113
+ let i = r.useHtmlLabels ?? l(a()), o = e.insert("g").attr("class", "label").attr("style", r.labelStyle || ""), s = await S(o, d(f(n), a()), {
114
+ useHtmlLabels: i,
115
+ width: r.width || a()?.flowchart?.wrappingWidth,
116
+ style: r.labelStyle,
117
+ addSvgBackground: !!r.icon || !!r.img
118
+ }), c = r.padding / 2, u;
119
+ if (l(a())) {
120
+ let e = s.children[0], n = t(s);
121
+ u = await C.measure(() => e.getBoundingClientRect()), n.attr("width", u.width), n.attr("height", u.height);
122
+ } else u = await C.measure(() => s.getBBox());
123
+ return i ? o.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")") : o.attr("transform", "translate(0, " + -u.height / 2 + ")"), r.centerLabel && o.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")"), o.insert("rect", ":first-child"), {
124
+ shapeSvg: e,
125
+ bbox: u,
126
+ halfPadding: c,
127
+ label: o
128
+ };
129
+ }, "insertLabel"), I = /* @__PURE__ */ n((e, t, n) => {
130
+ if (n) {
131
+ e.width = n.width, e.height = n.height;
132
+ return;
133
+ }
134
+ let r = t.node().getBBox();
135
+ e.width = r.width, e.height = r.height;
136
+ }, "updateNodeBounds"), L = /* @__PURE__ */ n((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
137
+ function R(e) {
138
+ let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
139
+ return t.push("Z"), t.join(" ");
140
+ }
141
+ n(R, "createPathFromPoints");
142
+ function z(e, t, n, r, i, a) {
143
+ let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
144
+ for (let t = 0; t <= 50; t++) {
145
+ let n = e + t / 50 * s, r = d + i * Math.sin(u * (n - e));
146
+ o.push({
147
+ x: n,
148
+ y: r
149
+ });
150
+ }
151
+ return o;
152
+ }
153
+ n(z, "generateFullSineWavePoints");
154
+ function B(e, t, n, r, i, a) {
155
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
156
+ for (let i = 0; i < r; i++) {
157
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
158
+ o.push({
159
+ x: -a,
160
+ y: -l
161
+ });
162
+ }
163
+ return o;
164
+ }
165
+ n(B, "generateCirclePoints");
166
+ function ee(e) {
167
+ let t = Array.from(e.childNodes).filter((e) => e.tagName === "path"), r = document.createElementNS("http://www.w3.org/2000/svg", "path"), i = t.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
168
+ r.setAttribute("d", i);
169
+ let a = t.find((e) => e.getAttribute("fill") !== "none"), o = t.find((e) => e.getAttribute("stroke") !== "none"), s = /* @__PURE__ */ n((e, t) => e?.getAttribute(t) ?? void 0, "getAttr");
170
+ if (a) {
171
+ let e = {
172
+ fill: s(a, "fill"),
173
+ "fill-opacity": s(a, "fill-opacity") ?? "1"
174
+ };
175
+ Object.entries(e).forEach(([e, t]) => {
176
+ t && r.setAttribute(e, t);
177
+ });
178
+ }
179
+ if (o) {
180
+ let e = {
181
+ stroke: s(o, "stroke"),
182
+ "stroke-width": s(o, "stroke-width") ?? "1",
183
+ "stroke-opacity": s(o, "stroke-opacity") ?? "1"
184
+ };
185
+ Object.entries(e).forEach(([e, t]) => {
186
+ t && r.setAttribute(e, t);
187
+ });
188
+ }
189
+ let c = document.createElementNS("http://www.w3.org/2000/svg", "g");
190
+ return c.appendChild(r), c;
191
+ }
192
+ n(ee, "mergePaths");
193
+ var V = /* @__PURE__ */ n((e, t) => {
194
+ var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
195
+ return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
196
+ x: n + c,
197
+ y: r + l
198
+ };
199
+ }, "intersectRect");
200
+ function te(e, t) {
201
+ return e.intersect(t);
202
+ }
203
+ n(te, "intersectNode");
204
+ var H = te;
205
+ function U(e, t, n, r) {
206
+ var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
207
+ r.x < i && (l = -l);
208
+ var u = Math.abs(t * n * s / c);
209
+ return r.y < a && (u = -u), {
210
+ x: i + l,
211
+ y: a + u
212
+ };
213
+ }
214
+ n(U, "intersectEllipse");
215
+ var ne = U;
216
+ function re(e, t, n) {
217
+ return ne(e, t, t, n);
218
+ }
219
+ n(re, "intersectCircle");
220
+ var ie = re;
221
+ function W(e, t, n, r) {
222
+ {
223
+ let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o, l = 1e-6;
224
+ if (s !== 0 && c !== 0 && G(s, c)) return;
225
+ let u = r.y - n.y, d = n.x - r.x, f = r.x * n.y - n.x * r.y, p = u * e.x + d * e.y + f, m = u * t.x + d * t.y + f;
226
+ if (Math.abs(p) < l && Math.abs(m) < l && G(p, m)) return;
227
+ let h = i * d - u * a;
228
+ return h === 0 ? void 0 : {
229
+ x: (a * f - d * o) / h,
230
+ y: (u * o - i * f) / h
231
+ };
232
+ }
233
+ }
234
+ n(W, "intersectLine");
235
+ function G(e, t) {
236
+ return e * t > 0;
237
+ }
238
+ n(G, "sameSign");
239
+ var ae = W;
240
+ function oe(e, t, n) {
241
+ let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
242
+ typeof t.forEach == "function" ? t.forEach(function(e) {
243
+ o = Math.min(o, e.x), s = Math.min(s, e.y);
244
+ }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
245
+ let c = r - e.width / 2 - o, l = i - e.height / 2 - s;
246
+ for (let r = 0; r < t.length; r++) {
247
+ let i = t[r], o = t[r < t.length - 1 ? r + 1 : 0], s = ae(e, n, {
248
+ x: c + i.x,
249
+ y: l + i.y
250
+ }, {
251
+ x: c + o.x,
252
+ y: l + o.y
253
+ });
254
+ s && a.push(s);
255
+ }
256
+ return a.length ? (a.length > 1 && a.sort(function(e, t) {
257
+ let r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
258
+ return a < c ? -1 : a === c ? 0 : 1;
259
+ }), a[0]) : e;
260
+ }
261
+ n(oe, "intersectPolygon");
262
+ var K = {
263
+ node: H,
264
+ circle: ie,
265
+ ellipse: ne,
266
+ polygon: oe,
267
+ rect: V
268
+ }, q = /* @__PURE__ */ n((e, t, n, r, i) => [
269
+ "M",
270
+ e + i,
271
+ t,
272
+ "H",
273
+ e + n - i,
274
+ "A",
275
+ i,
276
+ i,
277
+ 0,
278
+ 0,
279
+ 1,
280
+ e + n,
281
+ t + i,
282
+ "V",
283
+ t + r - i,
284
+ "A",
285
+ i,
286
+ i,
287
+ 0,
288
+ 0,
289
+ 1,
290
+ e + n - i,
291
+ t + r,
292
+ "H",
293
+ e + i,
294
+ "A",
295
+ i,
296
+ i,
297
+ 0,
298
+ 0,
299
+ 1,
300
+ e,
301
+ t + r - i,
302
+ "V",
303
+ t + i,
304
+ "A",
305
+ i,
306
+ i,
307
+ 0,
308
+ 0,
309
+ 1,
310
+ e + i,
311
+ t,
312
+ "Z"
313
+ ].join(" "), "createRoundedRectPathD"), se = /* @__PURE__ */ n(async (e, t, n, r = !1, i = !1) => {
314
+ let o = t || "";
315
+ typeof o == "object" && (o = o[0]);
316
+ let s = a(), c = l(s);
317
+ return await S(e, o, {
318
+ style: n,
319
+ isTitle: r,
320
+ useHtmlLabels: c,
321
+ markdown: !1,
322
+ isNode: i,
323
+ width: Infinity
324
+ }, s);
325
+ }, "createLabel");
326
+ function ce(t, n) {
327
+ let { labelStyles: r } = _(n);
328
+ n.labelStyle = r;
329
+ let i = L(n), a = i;
330
+ i || (a = "anchor");
331
+ let o = t.insert("g").attr("class", a).attr("id", n.domId || n.id), { cssStyles: s } = n, c = T.svg(o), l = g(n, {
332
+ fill: "black",
333
+ stroke: "none",
334
+ fillStyle: "solid"
335
+ });
336
+ n.look !== "handDrawn" && (l.roughness = 0);
337
+ let u = c.circle(0, 0, 2, l), d = o.insert(() => u, ":first-child");
338
+ return d.attr("class", "anchor").attr("style", p(s)), I(n, d), n.intersect = function(t) {
339
+ return e.info("Circle intersect", n, 1, t), K.circle(n, 1, t);
340
+ }, o;
341
+ }
342
+ n(ce, "anchor");
343
+ function le(e, t, n, r, i, a, o) {
344
+ let s = (e + n) / 2, c = (t + r) / 2, l = Math.atan2(r - t, n - e), u = (n - e) / 2, d = (r - t) / 2, f = u / i, p = d / a, m = Math.sqrt(f ** 2 + p ** 2);
345
+ if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
346
+ let h = Math.sqrt(1 - m ** 2), g = s + h * a * Math.sin(l) * (o ? -1 : 1), _ = c - h * i * Math.cos(l) * (o ? -1 : 1), v = Math.atan2((t - _) / a, (e - g) / i), y = Math.atan2((r - _) / a, (n - g) / i) - v;
347
+ o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
348
+ let b = [];
349
+ for (let e = 0; e < 20; e++) {
350
+ let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
351
+ b.push({
352
+ x: n,
353
+ y: r
354
+ });
355
+ }
356
+ return b;
357
+ }
358
+ n(le, "generateArcPoints");
359
+ function ue(e, t, n) {
360
+ let [r, i] = [t, n].sort((e, t) => t - e);
361
+ return i * (1 - Math.sqrt(1 - (e / r / 2) ** 2));
362
+ }
363
+ n(ue, "calculateArcSagitta");
364
+ async function de(e, t) {
365
+ let { labelStyles: r, nodeStyles: i } = _(t);
366
+ t.labelStyle = r;
367
+ let a = t.padding ?? 0, o = t.look === "neo" ? 16 : a, s = t.look === "neo" ? 12 : a, c = /* @__PURE__ */ n((e) => e + s, "calcTotalHeight"), l = /* @__PURE__ */ n((e) => {
368
+ let t = e / 2;
369
+ return [t / (2.5 + e / 50), t];
370
+ }, "calcEllipseRadius"), { shapeSvg: u, bbox: d } = await P(e, t, L(t)), f = c(t?.height ? t?.height : d.height), [p, m] = l(f), h = ue(f, p, m), v = (t?.width ? t?.width : d.width) + o * 2 + h - h, y = f, { cssStyles: b } = t, x = [
371
+ {
372
+ x: v / 2,
373
+ y: -y / 2
374
+ },
375
+ {
376
+ x: -v / 2,
377
+ y: -y / 2
378
+ },
379
+ ...le(-v / 2, -y / 2, -v / 2, y / 2, p, m, !1),
380
+ {
381
+ x: v / 2,
382
+ y: y / 2
383
+ },
384
+ ...le(v / 2, y / 2, v / 2, -y / 2, p, m, !0)
385
+ ], S = T.svg(u), C = g(t, {});
386
+ t.look !== "handDrawn" && (C.roughness = 0, C.fillStyle = "solid");
387
+ let w = R(x), E = S.path(w, C), D = u.insert(() => E, ":first-child");
388
+ return D.attr("class", "basic label-container outer-path"), b && t.look !== "handDrawn" && D.selectAll("path").attr("style", b), i && t.look !== "handDrawn" && D.selectAll("path").attr("style", i), D.attr("transform", `translate(${p / 2}, 0)`), I(t, D), t.intersect = function(e) {
389
+ return K.polygon(t, x, e);
390
+ }, u;
391
+ }
392
+ n(de, "bowTieRect");
393
+ async function fe(e, t, { config: { themeVariables: r } }) {
394
+ let { labelStyles: i, nodeStyles: a } = _(t);
395
+ t.labelStyle = i;
396
+ let { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = r?.nodeBorder ?? r?.lineColor ?? "currentColor", u = t.padding ?? 12, d = Math.max(s.width + u * 2, t.width ?? 0, 80), f = Math.max(Math.min(d * .08, 12), 5), p = Math.max(s.height + u * 2 + f, t.height ?? 0), m = -p / 2 + f, h = p / 2, v = d * .72, y = [
397
+ `M${-d / 2},${m}`,
398
+ `L${-v / 2},${h}`,
399
+ `A${v / 2},${f} 0 0 0 ${v / 2},${h}`,
400
+ `L${d / 2},${m}`,
401
+ `A${d / 2},${f} 0 0 0 ${-d / 2},${m}`,
402
+ "Z"
403
+ ].join(" "), { cssStyles: b } = t, x = o.insert("g", ":first-child").attr("class", "basic label-container");
404
+ if (t.look === "handDrawn") {
405
+ let e = T.svg(o).path(y, g(t, {}));
406
+ x.node()?.appendChild(e), b && x.attr("style", b);
407
+ } else x.append("path").attr("d", y).attr("style", a);
408
+ x.append("ellipse").attr("cx", 0).attr("cy", m).attr("rx", d / 2).attr("ry", f).attr("style", `fill:none;stroke:${l};stroke-width:1px`), I(t, x);
409
+ let S = m + (h - m) / 2;
410
+ c.attr("transform", `translate(${-(s.width / 2) - (s.x - (s.left ?? 0))}, ${S - s.height / 2 - (s.y - (s.top ?? 0))})`);
411
+ let C = /* @__PURE__ */ n((e, t, n) => Array.from({ length: 13 }, (r, i) => {
412
+ let a = Math.PI - i * Math.PI / 12;
413
+ return {
414
+ x: e * Math.cos(a),
415
+ y: t + n * f * Math.sin(a)
416
+ };
417
+ }), "arc"), w = [...C(d / 2, m, -1), ...C(v / 2, h, 1).reverse()];
418
+ return t.intersect = function(e) {
419
+ return K.polygon(t, w, e);
420
+ }, o;
421
+ }
422
+ n(fe, "bucket");
423
+ var pe = 20, me = 8, he = 80, ge = 8;
424
+ function _e(e) {
425
+ let { themeVariables: t } = a(), n = t.clusterBkg, r = t.clusterBorder;
426
+ switch (e) {
427
+ case "flow": return {
428
+ rx: 10,
429
+ fill: "none",
430
+ stroke: t.flowContainerStroke || t.secondaryBorderColor,
431
+ strokeWidth: .75,
432
+ cssClass: "flow-collapsed"
433
+ };
434
+ default: return {
435
+ rx: ge,
436
+ fill: n,
437
+ stroke: r,
438
+ cssClass: "collapsed-group"
439
+ };
440
+ }
441
+ }
442
+ n(_e, "getCollapsedStyle");
443
+ async function ve(e, t) {
444
+ let n = _e(t.metadata?.containerType), { fill: r, stroke: i } = n, { nodeStyles: o } = _(t), { shapeSvg: s, bbox: c } = await P(e, t, L(t)), { theme: u, themeVariables: d } = a();
445
+ w(s, t.colorIndex, u, d.borderColorArray);
446
+ let f = t.padding ?? 8, m = c.height, h = Math.max(c.width + f * 2, he, t?.width ?? 0), v = Math.max(m + me + pe + f * 2, t?.height ?? 0), y = -h / 2, b = -v / 2, x = -(me + pe) / 2, S = s.select(".label");
447
+ S && (t.useHtmlLabels ?? l(a()) ? S.attr("transform", `translate(${-c.width / 2}, ${-c.height / 2 + x})`) : S.attr("transform", `translate(0, ${-c.height / 2 + x})`));
448
+ let C;
449
+ if (t.look === "handDrawn") {
450
+ let e = T.svg(s), a = g(t, {
451
+ fill: r,
452
+ stroke: i,
453
+ ...n.strokeWidth === void 0 ? {} : { strokeWidth: n.strokeWidth },
454
+ ...r === "none" ? { fillWeight: 0 } : { fillStyle: "solid" }
455
+ }), o = e.path(q(y, b, h, v, n.rx), a);
456
+ C = s.insert(() => o, ":first-child"), C.attr("class", "basic label-container " + n.cssClass).attr("style", p(t.cssStyles));
457
+ } else C = s.insert("rect", ":first-child"), C.attr("class", "basic label-container " + n.cssClass).attr("style", o).attr("rx", n.rx).attr("ry", n.rx).attr("x", y).attr("y", b).attr("width", h).attr("height", v).attr("fill", r).attr("stroke", i), n.strokeWidth !== void 0 && C.attr("stroke-width", n.strokeWidth + "px");
458
+ let E = b + f + m + me;
459
+ s.append("line").attr("class", "collapsed-separator").attr("x1", y + 8).attr("y1", E).attr("x2", y + h - 8).attr("y2", E).attr("stroke", i).attr("stroke-dasharray", "3, 3");
460
+ let D = E + pe / 2;
461
+ for (let e = -1; e <= 1; e++) s.append("circle").attr("class", "collapsed-indicator").attr("cx", e * 10).attr("cy", D).attr("r", 2.5).attr("fill", i);
462
+ return I(t, C), t.calcIntersect = function(e, t) {
463
+ return K.rect(e, t);
464
+ }, t.intersect = function(e) {
465
+ return K.rect(t, e);
466
+ }, s;
467
+ }
468
+ n(ve, "collapsedGroup");
469
+ function J(e, t, n, r) {
470
+ return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
471
+ return e.x + "," + e.y;
472
+ }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
473
+ }
474
+ n(J, "insertPolygonShape");
475
+ var ye = [
476
+ "right",
477
+ "left",
478
+ "up",
479
+ "down"
480
+ ], be = "point", xe = /* @__PURE__ */ n((e) => {
481
+ let t = /* @__PURE__ */ new Set();
482
+ for (let n of e) switch (n) {
483
+ case "x":
484
+ t.add("right"), t.add("left");
485
+ break;
486
+ case "y":
487
+ t.add("up"), t.add("down");
488
+ break;
489
+ default: t.add(n);
490
+ }
491
+ return t;
492
+ }, "expandAndDeduplicateDirections"), Se = /* @__PURE__ */ n((e) => ye.filter((t) => e.has(t)).join("|") || be, "getDirectionKey"), Ce = {
493
+ "right|left|up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
494
+ {
495
+ x: 0,
496
+ y: 0
497
+ },
498
+ {
499
+ x: t,
500
+ y: 0
501
+ },
502
+ {
503
+ x: r / 2,
504
+ y: 2 * n
505
+ },
506
+ {
507
+ x: r - t,
508
+ y: 0
509
+ },
510
+ {
511
+ x: r,
512
+ y: 0
513
+ },
514
+ {
515
+ x: r,
516
+ y: -e / 3
517
+ },
518
+ {
519
+ x: r + 2 * n,
520
+ y: -e / 2
521
+ },
522
+ {
523
+ x: r,
524
+ y: -2 * e / 3
525
+ },
526
+ {
527
+ x: r,
528
+ y: -e
529
+ },
530
+ {
531
+ x: r - t,
532
+ y: -e
533
+ },
534
+ {
535
+ x: r / 2,
536
+ y: -e - 2 * n
537
+ },
538
+ {
539
+ x: t,
540
+ y: -e
541
+ },
542
+ {
543
+ x: 0,
544
+ y: -e
545
+ },
546
+ {
547
+ x: 0,
548
+ y: -2 * e / 3
549
+ },
550
+ {
551
+ x: -2 * n,
552
+ y: -e / 2
553
+ },
554
+ {
555
+ x: 0,
556
+ y: -e / 3
557
+ }
558
+ ], "right|left|up|down"),
559
+ "right|left|up": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
560
+ {
561
+ x: t,
562
+ y: 0
563
+ },
564
+ {
565
+ x: n - t,
566
+ y: 0
567
+ },
568
+ {
569
+ x: n,
570
+ y: -e / 2
571
+ },
572
+ {
573
+ x: n - t,
574
+ y: -e
575
+ },
576
+ {
577
+ x: t,
578
+ y: -e
579
+ },
580
+ {
581
+ x: 0,
582
+ y: -e / 2
583
+ }
584
+ ], "right|left|up"),
585
+ "right|left|down": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
586
+ {
587
+ x: 0,
588
+ y: 0
589
+ },
590
+ {
591
+ x: t,
592
+ y: -e
593
+ },
594
+ {
595
+ x: n - t,
596
+ y: -e
597
+ },
598
+ {
599
+ x: n,
600
+ y: 0
601
+ }
602
+ ], "right|left|down"),
603
+ "right|up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
604
+ {
605
+ x: 0,
606
+ y: 0
607
+ },
608
+ {
609
+ x: n,
610
+ y: -t
611
+ },
612
+ {
613
+ x: n,
614
+ y: -e + t
615
+ },
616
+ {
617
+ x: 0,
618
+ y: -e
619
+ }
620
+ ], "right|up|down"),
621
+ "left|up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
622
+ {
623
+ x: n,
624
+ y: 0
625
+ },
626
+ {
627
+ x: 0,
628
+ y: -t
629
+ },
630
+ {
631
+ x: 0,
632
+ y: -e + t
633
+ },
634
+ {
635
+ x: n,
636
+ y: -e
637
+ }
638
+ ], "left|up|down"),
639
+ "right|left": /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
640
+ {
641
+ x: t,
642
+ y: 0
643
+ },
644
+ {
645
+ x: t,
646
+ y: -n
647
+ },
648
+ {
649
+ x: r - t,
650
+ y: -n
651
+ },
652
+ {
653
+ x: r - t,
654
+ y: 0
655
+ },
656
+ {
657
+ x: r,
658
+ y: -e / 2
659
+ },
660
+ {
661
+ x: r - t,
662
+ y: -e
663
+ },
664
+ {
665
+ x: r - t,
666
+ y: -e + n
667
+ },
668
+ {
669
+ x: t,
670
+ y: -e + n
671
+ },
672
+ {
673
+ x: t,
674
+ y: -e
675
+ },
676
+ {
677
+ x: 0,
678
+ y: -e / 2
679
+ }
680
+ ], "right|left"),
681
+ "up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
682
+ {
683
+ x: r / 2,
684
+ y: 0
685
+ },
686
+ {
687
+ x: 0,
688
+ y: -n
689
+ },
690
+ {
691
+ x: t,
692
+ y: -n
693
+ },
694
+ {
695
+ x: t,
696
+ y: -e + n
697
+ },
698
+ {
699
+ x: 0,
700
+ y: -e + n
701
+ },
702
+ {
703
+ x: r / 2,
704
+ y: -e
705
+ },
706
+ {
707
+ x: r,
708
+ y: -e + n
709
+ },
710
+ {
711
+ x: r - t,
712
+ y: -e + n
713
+ },
714
+ {
715
+ x: r - t,
716
+ y: -n
717
+ },
718
+ {
719
+ x: r,
720
+ y: -n
721
+ }
722
+ ], "up|down"),
723
+ "right|up": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
724
+ {
725
+ x: 0,
726
+ y: 0
727
+ },
728
+ {
729
+ x: n,
730
+ y: -t
731
+ },
732
+ {
733
+ x: 0,
734
+ y: -e
735
+ }
736
+ ], "right|up"),
737
+ "right|down": /* @__PURE__ */ n(({ height: e, width: t }) => [
738
+ {
739
+ x: 0,
740
+ y: 0
741
+ },
742
+ {
743
+ x: t,
744
+ y: 0
745
+ },
746
+ {
747
+ x: 0,
748
+ y: -e
749
+ }
750
+ ], "right|down"),
751
+ "left|up": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
752
+ {
753
+ x: n,
754
+ y: 0
755
+ },
756
+ {
757
+ x: 0,
758
+ y: -t
759
+ },
760
+ {
761
+ x: n,
762
+ y: -e
763
+ }
764
+ ], "left|up"),
765
+ "left|down": /* @__PURE__ */ n(({ height: e, width: t }) => [
766
+ {
767
+ x: t,
768
+ y: 0
769
+ },
770
+ {
771
+ x: 0,
772
+ y: 0
773
+ },
774
+ {
775
+ x: t,
776
+ y: -e
777
+ }
778
+ ], "left|down"),
779
+ right: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
780
+ {
781
+ x: t,
782
+ y: -n
783
+ },
784
+ {
785
+ x: t,
786
+ y: -n
787
+ },
788
+ {
789
+ x: r - t,
790
+ y: -n
791
+ },
792
+ {
793
+ x: r - t,
794
+ y: 0
795
+ },
796
+ {
797
+ x: r,
798
+ y: -e / 2
799
+ },
800
+ {
801
+ x: r - t,
802
+ y: -e
803
+ },
804
+ {
805
+ x: r - t,
806
+ y: -e + n
807
+ },
808
+ {
809
+ x: t,
810
+ y: -e + n
811
+ },
812
+ {
813
+ x: t,
814
+ y: -e + n
815
+ }
816
+ ], "right"),
817
+ left: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
818
+ {
819
+ x: t,
820
+ y: 0
821
+ },
822
+ {
823
+ x: t,
824
+ y: -n
825
+ },
826
+ {
827
+ x: r - t,
828
+ y: -n
829
+ },
830
+ {
831
+ x: r - t,
832
+ y: -e + n
833
+ },
834
+ {
835
+ x: t,
836
+ y: -e + n
837
+ },
838
+ {
839
+ x: t,
840
+ y: -e
841
+ },
842
+ {
843
+ x: 0,
844
+ y: -e / 2
845
+ }
846
+ ], "left"),
847
+ up: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
848
+ {
849
+ x: t,
850
+ y: -n
851
+ },
852
+ {
853
+ x: t,
854
+ y: -e + n
855
+ },
856
+ {
857
+ x: 0,
858
+ y: -e + n
859
+ },
860
+ {
861
+ x: r / 2,
862
+ y: -e
863
+ },
864
+ {
865
+ x: r,
866
+ y: -e + n
867
+ },
868
+ {
869
+ x: r - t,
870
+ y: -e + n
871
+ },
872
+ {
873
+ x: r - t,
874
+ y: -n
875
+ }
876
+ ], "up"),
877
+ down: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
878
+ {
879
+ x: r / 2,
880
+ y: 0
881
+ },
882
+ {
883
+ x: 0,
884
+ y: -n
885
+ },
886
+ {
887
+ x: t,
888
+ y: -n
889
+ },
890
+ {
891
+ x: t,
892
+ y: -e + n
893
+ },
894
+ {
895
+ x: r - t,
896
+ y: -e + n
897
+ },
898
+ {
899
+ x: r - t,
900
+ y: -n
901
+ },
902
+ {
903
+ x: r,
904
+ y: -n
905
+ }
906
+ ], "down"),
907
+ [be]: () => [{
908
+ x: 0,
909
+ y: 0
910
+ }]
911
+ }, we = /* @__PURE__ */ n((e, t, n, r) => {
912
+ let i = xe(e), a = (n.padding ?? 0) / 2, o = t.height + 4 * a, s = o / 2, c = r ?? t.width + 2 * s + 2 * a;
913
+ return (Ce[Se(i)] ?? Ce[be])({
914
+ height: o,
915
+ midpoint: s,
916
+ padding: a,
917
+ width: c
918
+ });
919
+ }, "getArrowPoints");
920
+ async function Te(e, t) {
921
+ let n = t, { shapeSvg: r, bbox: i } = await P(e, n, L(n)), a = n.padding ?? 0, o = i.height + 2 * a, s = o / 2, c = i.width + 2 * s + a, l = n.width ?? 0, u = n.positioned && (n.widthInColumns ?? 1) > 1 && l > c ? l : c, d = we(n.directions ?? [], i, n, u), f = J(r, u, o, d);
922
+ return f.attr("style", n.style ?? null), I(n, f), n.intersect = function(e) {
923
+ return K.polygon(n, d, e);
924
+ }, r;
925
+ }
926
+ n(Te, "block_arrow");
927
+ async function Ee(e, t, { config: { themeVariables: n } }) {
928
+ let { labelStyles: r, nodeStyles: i } = _(t);
929
+ t.labelStyle = r;
930
+ let { shapeSvg: a, bbox: o, label: s } = await P(e, t, L(t)), c = n?.nodeBorder ?? n?.lineColor ?? "currentColor", l = t.padding ?? 12, u = Math.max(o.width + l * 2, t.width ?? 0, 90), d = Math.max(o.height + l * 2 + 18, t.height ?? 0), f = -d / 2, { cssStyles: p } = t, m = a.insert("g", ":first-child").attr("class", "basic label-container");
931
+ if (t.look === "handDrawn") {
932
+ let e = T.svg(a).path(q(-u / 2, f, u, d, 12), g(t, {}));
933
+ m.node()?.appendChild(e), p && m.attr("style", p);
934
+ } else m.append("rect").attr("x", -u / 2).attr("y", f).attr("width", u).attr("height", d).attr("rx", 12).attr("ry", 12).attr("style", i);
935
+ m.append("line").attr("x1", -u / 2).attr("y1", f + 18).attr("x2", u / 2).attr("y2", f + 18).attr("style", `stroke:${c};stroke-width:1px`);
936
+ for (let e = 0; e < 3; e++) m.append("circle").attr("cx", -u / 2 + 12 + e * 9).attr("cy", f + 9).attr("r", 2.5).attr("style", `fill:${c};stroke:none`);
937
+ m.append("rect").attr("class", "browser-address-bar").attr("x", -u / 2 + 44).attr("y", f + 4).attr("width", Math.max(u - 56, 10)).attr("height", 10).attr("rx", 3).attr("ry", 3).attr("style", `fill:none;stroke:${c};stroke-width:1px;opacity:0.6`), I(t, m);
938
+ let h = f + 18 + (d - 18) / 2;
939
+ return s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${h - o.height / 2 - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
940
+ return K.rect(t, e);
941
+ }, a;
942
+ }
943
+ n(Ee, "browser");
944
+ var De = 12;
945
+ async function Oe(e, t) {
946
+ let { labelStyles: n, nodeStyles: r } = _(t);
947
+ t.labelStyle = n;
948
+ let i = t.padding ?? 0, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 24 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.width ?? c.width) + (t.look === "neo" ? a * 2 : a + De), u = (t?.height ?? c.height) + (t.look === "neo" ? o * 2 : o), d = l, f = -u, p = [
949
+ {
950
+ x: 0 + De,
951
+ y: f
952
+ },
953
+ {
954
+ x: d,
955
+ y: f
956
+ },
957
+ {
958
+ x: d,
959
+ y: 0
960
+ },
961
+ {
962
+ x: 0,
963
+ y: 0
964
+ },
965
+ {
966
+ x: 0,
967
+ y: f + De
968
+ },
969
+ {
970
+ x: 0 + De,
971
+ y: f
972
+ }
973
+ ], m, { cssStyles: h } = t;
974
+ if (t.look === "handDrawn") {
975
+ let e = T.svg(s), n = g(t, {}), r = R(p), i = e.path(r, n);
976
+ m = s.insert(() => i, ":first-child").attr("transform", `translate(${-l / 2}, ${u / 2})`), h && m.attr("style", h);
977
+ } else m = J(s, l, u, p);
978
+ return r && m.attr("style", r), I(t, m), t.intersect = function(e) {
979
+ return K.polygon(t, p, e);
980
+ }, s;
981
+ }
982
+ n(Oe, "card");
983
+ function ke(e, t) {
984
+ let { nodeStyles: n } = _(t);
985
+ t.label = "";
986
+ let r = e.insert("g").attr("class", L(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t, a = Math.max(28, t.width ?? 0), o = [
987
+ {
988
+ x: 0,
989
+ y: a / 2
990
+ },
991
+ {
992
+ x: a / 2,
993
+ y: 0
994
+ },
995
+ {
996
+ x: 0,
997
+ y: -a / 2
998
+ },
999
+ {
1000
+ x: -a / 2,
1001
+ y: 0
1002
+ }
1003
+ ], s = T.svg(r), c = g(t, {});
1004
+ t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
1005
+ let l = R(o), u = s.path(l, c), d = r.insert(() => u, ":first-child");
1006
+ return i && t.look !== "handDrawn" && d.selectAll("path").attr("style", i), n && t.look !== "handDrawn" && d.selectAll("path").attr("style", n), t.width = 28, t.height = 28, t.intersect = function(e) {
1007
+ return K.polygon(t, o, e);
1008
+ }, r;
1009
+ }
1010
+ n(ke, "choice");
1011
+ async function Ae(t, n, r) {
1012
+ let { labelStyles: i, nodeStyles: a } = _(n);
1013
+ n.labelStyle = i;
1014
+ let { shapeSvg: o, bbox: s, halfPadding: c } = await P(t, n, L(n), { ignoreMinWidth: !0 }), l = r?.padding ?? c, u = Math.sqrt(s.width ** 2 + s.height ** 2) / 2, d = n.look === "neo" ? u + 16 : u + l, f, { cssStyles: m } = n;
1015
+ if (n.look === "handDrawn") {
1016
+ let e = T.svg(o), t = g(n, {}), r = e.circle(0, 0, d * 2, t);
1017
+ f = o.insert(() => r, ":first-child"), f.attr("class", "basic label-container").attr("style", p(m));
1018
+ } else f = o.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", a).attr("r", d).attr("cx", 0).attr("cy", 0);
1019
+ return I(n, f), n.calcIntersect = function(e, t) {
1020
+ let n = e.width / 2;
1021
+ return K.circle(e, n, t);
1022
+ }, n.intersect = function(t) {
1023
+ return e.info("Circle intersect", n, d, t), K.circle(n, d, t);
1024
+ }, o;
1025
+ }
1026
+ n(Ae, "circle");
1027
+ async function je(e, t) {
1028
+ let n = t, { shapeSvg: r, bbox: i, halfPadding: a } = await P(e, n, [
1029
+ "node",
1030
+ n.cssClasses,
1031
+ n.class
1032
+ ].filter(Boolean).join(" ")), o = r.insert("rect", ":first-child"), s = n.padding ?? 0, c = n.positioned ? n.width ?? 0 : i.width + s, l = n.positioned ? n.height ?? 0 : i.height + s, u = n.positioned ? -c / 2 : -i.width / 2 - a, d = n.positioned ? -l / 2 : -i.height / 2 - a;
1033
+ return o.attr("class", "basic cluster composite label-container").attr("style", n.style ?? null).attr("rx", n.rx ?? null).attr("ry", n.ry ?? null).attr("x", u).attr("y", d).attr("width", c).attr("height", l), I(n, o), n.intersect = function(e) {
1034
+ return K.rect(n, e);
1035
+ }, r;
1036
+ }
1037
+ n(je, "composite");
1038
+ async function Me(e, t, { config: { themeVariables: n } }) {
1039
+ let { labelStyles: r, nodeStyles: i } = _(t);
1040
+ t.labelStyle = r;
1041
+ let { shapeSvg: a, bbox: o, label: s } = await P(e, t, L(t)), c = n?.nodeBorder ?? n?.lineColor ?? "currentColor", l = t.padding ?? 12, u = Math.max(o.width + l * 2, t.width ?? 0, 90), d = Math.max(o.height + l * 2 + 20, t.height ?? 0), f = -d / 2, { cssStyles: p } = t, m = a.insert("g", ":first-child").attr("class", "basic label-container");
1042
+ if (t.look === "handDrawn") {
1043
+ let e = T.svg(a).path(q(-u / 2, f, u, d, 12), g(t, {}));
1044
+ m.node()?.appendChild(e), p && m.attr("style", p);
1045
+ } else m.append("rect").attr("x", -u / 2).attr("y", f).attr("width", u).attr("height", d).attr("rx", 12).attr("ry", 12).attr("style", i);
1046
+ m.append("text").attr("x", -u / 2 + 12).attr("y", f + 16).attr("class", "console-glyph").attr("style", `font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(">_"), I(t, m);
1047
+ let h = f + 20 + (d - 20) / 2;
1048
+ return s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${h - o.height / 2 - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
1049
+ return K.rect(t, e);
1050
+ }, a;
1051
+ }
1052
+ n(Me, "consoleWindow");
1053
+ function Ne(e) {
1054
+ let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
1055
+ x: r / 2 * t,
1056
+ y: r / 2 * n
1057
+ }, a = {
1058
+ x: -(r / 2) * t,
1059
+ y: r / 2 * n
1060
+ }, o = {
1061
+ x: -(r / 2) * t,
1062
+ y: -(r / 2) * n
1063
+ }, s = {
1064
+ x: r / 2 * t,
1065
+ y: -(r / 2) * n
1066
+ };
1067
+ return `M ${a.x},${a.y} L ${s.x},${s.y}
1068
+ M ${i.x},${i.y} L ${o.x},${o.y}`;
1069
+ }
1070
+ n(Ne, "createLine");
1071
+ function Pe(t, n) {
1072
+ let { labelStyles: r, nodeStyles: i } = _(n);
1073
+ n.labelStyle = r, n.label = "";
1074
+ let a = t.insert("g").attr("class", L(n)).attr("id", n.domId ?? n.id), o = Math.max(30, n?.width ?? 0), { cssStyles: s } = n, c = T.svg(a), l = g(n, {});
1075
+ n.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
1076
+ let u = c.circle(0, 0, o * 2, l), d = Ne(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
1077
+ return p.insert(() => f), p.attr("class", "outer-path"), s && n.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && n.look !== "handDrawn" && p.selectAll("path").attr("style", i), I(n, p), n.intersect = function(t) {
1078
+ return e.info("crossedCircle intersect", n, {
1079
+ radius: o,
1080
+ point: t
1081
+ }), K.circle(n, o, t);
1082
+ }, a;
1083
+ }
1084
+ n(Pe, "crossedCircle");
1085
+ function Y(e, t, n, r = 100, i = 0, a = 180) {
1086
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1087
+ for (let i = 0; i < r; i++) {
1088
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1089
+ o.push({
1090
+ x: -a,
1091
+ y: -l
1092
+ });
1093
+ }
1094
+ return o;
1095
+ }
1096
+ n(Y, "generateCirclePoints");
1097
+ async function Fe(e, t) {
1098
+ let { labelStyles: n, nodeStyles: r } = _(t);
1099
+ t.labelStyle = n;
1100
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + s, u = a.height + c, d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1101
+ ...Y(l / 2, -u / 2, d, 30, -90, 0),
1102
+ {
1103
+ x: -l / 2 - d,
1104
+ y: d
1105
+ },
1106
+ ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
1107
+ ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
1108
+ {
1109
+ x: -l / 2 - d,
1110
+ y: -u / 2
1111
+ },
1112
+ ...Y(l / 2, u / 2, d, 20, 0, 90)
1113
+ ], m = [
1114
+ {
1115
+ x: l / 2,
1116
+ y: -u / 2 - d
1117
+ },
1118
+ {
1119
+ x: -l / 2,
1120
+ y: -u / 2 - d
1121
+ },
1122
+ ...Y(l / 2, -u / 2, d, 20, -90, 0),
1123
+ {
1124
+ x: -l / 2 - d,
1125
+ y: -d
1126
+ },
1127
+ ...Y(l / 2 + l * .1, -d, d, 20, -180, -270),
1128
+ ...Y(l / 2 + l * .1, d, d, 20, -90, -180),
1129
+ {
1130
+ x: -l / 2 - d,
1131
+ y: u / 2
1132
+ },
1133
+ ...Y(l / 2, u / 2, d, 20, 0, 90),
1134
+ {
1135
+ x: -l / 2,
1136
+ y: u / 2 + d
1137
+ },
1138
+ {
1139
+ x: l / 2,
1140
+ y: u / 2 + d
1141
+ }
1142
+ ], h = T.svg(i), v = g(t, { fill: "none" });
1143
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1144
+ let y = R(p).replace("Z", ""), b = h.path(y, v), x = R(m), S = h.path(x, { ...v }), C = i.insert("g", ":first-child");
1145
+ return C.insert(() => S, ":first-child").attr("stroke-opacity", 0), C.insert(() => b, ":first-child"), C.attr("class", "text"), f && t.look !== "handDrawn" && C.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), C.attr("transform", `translate(${d}, 0)`), o.attr("transform", `translate(${-l / 2 + d - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), I(t, C), t.intersect = function(e) {
1146
+ return K.polygon(t, m, e);
1147
+ }, i;
1148
+ }
1149
+ n(Fe, "curlyBraceLeft");
1150
+ function X(e, t, n, r = 100, i = 0, a = 180) {
1151
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1152
+ for (let i = 0; i < r; i++) {
1153
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1154
+ o.push({
1155
+ x: a,
1156
+ y: l
1157
+ });
1158
+ }
1159
+ return o;
1160
+ }
1161
+ n(X, "generateCirclePoints");
1162
+ async function Ie(e, t) {
1163
+ let { labelStyles: n, nodeStyles: r } = _(t);
1164
+ t.labelStyle = n;
1165
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1166
+ ...X(l / 2, -u / 2, d, 20, -90, 0),
1167
+ {
1168
+ x: l / 2 + d,
1169
+ y: -d
1170
+ },
1171
+ ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
1172
+ ...X(l / 2 + d * 2, d, d, 20, -90, -180),
1173
+ {
1174
+ x: l / 2 + d,
1175
+ y: u / 2
1176
+ },
1177
+ ...X(l / 2, u / 2, d, 20, 0, 90)
1178
+ ], m = [
1179
+ {
1180
+ x: -l / 2,
1181
+ y: -u / 2 - d
1182
+ },
1183
+ {
1184
+ x: l / 2,
1185
+ y: -u / 2 - d
1186
+ },
1187
+ ...X(l / 2, -u / 2, d, 20, -90, 0),
1188
+ {
1189
+ x: l / 2 + d,
1190
+ y: -d
1191
+ },
1192
+ ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
1193
+ ...X(l / 2 + d * 2, d, d, 20, -90, -180),
1194
+ {
1195
+ x: l / 2 + d,
1196
+ y: u / 2
1197
+ },
1198
+ ...X(l / 2, u / 2, d, 20, 0, 90),
1199
+ {
1200
+ x: l / 2,
1201
+ y: u / 2 + d
1202
+ },
1203
+ {
1204
+ x: -l / 2,
1205
+ y: u / 2 + d
1206
+ }
1207
+ ], h = T.svg(i), v = g(t, { fill: "none" });
1208
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1209
+ let y = R(p).replace("Z", ""), b = h.path(y, v), x = R(m), S = h.path(x, { ...v }), C = i.insert("g", ":first-child");
1210
+ return C.insert(() => S, ":first-child").attr("stroke-opacity", 0), C.insert(() => b, ":first-child"), C.attr("class", "text"), f && t.look !== "handDrawn" && C.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), C.attr("transform", `translate(${-d}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), I(t, C), t.intersect = function(e) {
1211
+ return K.polygon(t, m, e);
1212
+ }, i;
1213
+ }
1214
+ n(Ie, "curlyBraceRight");
1215
+ function Z(e, t, n, r = 100, i = 0, a = 180) {
1216
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1217
+ for (let i = 0; i < r; i++) {
1218
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1219
+ o.push({
1220
+ x: -a,
1221
+ y: -l
1222
+ });
1223
+ }
1224
+ return o;
1225
+ }
1226
+ n(Z, "generateCirclePoints");
1227
+ async function Le(e, t) {
1228
+ let { labelStyles: n, nodeStyles: r } = _(t);
1229
+ t.labelStyle = n;
1230
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1231
+ ...Z(l / 2, -u / 2, d, 30, -90, 0),
1232
+ {
1233
+ x: -l / 2 - d,
1234
+ y: d
1235
+ },
1236
+ ...Z(l / 2 + d * 2, -d, d, 20, -180, -270),
1237
+ ...Z(l / 2 + d * 2, d, d, 20, -90, -180),
1238
+ {
1239
+ x: -l / 2 - d,
1240
+ y: -u / 2
1241
+ },
1242
+ ...Z(l / 2, u / 2, d, 20, 0, 90)
1243
+ ], m = [
1244
+ ...Z(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
1245
+ {
1246
+ x: l / 2 - d / 2,
1247
+ y: d
1248
+ },
1249
+ ...Z(-l / 2 - d / 2, -d, d, 20, 0, 90),
1250
+ ...Z(-l / 2 - d / 2, d, d, 20, -90, 0),
1251
+ {
1252
+ x: l / 2 - d / 2,
1253
+ y: -d
1254
+ },
1255
+ ...Z(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
1256
+ ], h = [
1257
+ {
1258
+ x: l / 2,
1259
+ y: -u / 2 - d
1260
+ },
1261
+ {
1262
+ x: -l / 2,
1263
+ y: -u / 2 - d
1264
+ },
1265
+ ...Z(l / 2, -u / 2, d, 20, -90, 0),
1266
+ {
1267
+ x: -l / 2 - d,
1268
+ y: -d
1269
+ },
1270
+ ...Z(l / 2 + d * 2, -d, d, 20, -180, -270),
1271
+ ...Z(l / 2 + d * 2, d, d, 20, -90, -180),
1272
+ {
1273
+ x: -l / 2 - d,
1274
+ y: u / 2
1275
+ },
1276
+ ...Z(l / 2, u / 2, d, 20, 0, 90),
1277
+ {
1278
+ x: -l / 2,
1279
+ y: u / 2 + d
1280
+ },
1281
+ {
1282
+ x: l / 2 - d - d / 2,
1283
+ y: u / 2 + d
1284
+ },
1285
+ ...Z(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
1286
+ {
1287
+ x: l / 2 - d / 2,
1288
+ y: d
1289
+ },
1290
+ ...Z(-l / 2 - d / 2, -d, d, 20, 0, 90),
1291
+ ...Z(-l / 2 - d / 2, d, d, 20, -90, 0),
1292
+ {
1293
+ x: l / 2 - d / 2,
1294
+ y: -d
1295
+ },
1296
+ ...Z(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
1297
+ ], v = T.svg(i), y = g(t, { fill: "none" });
1298
+ t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
1299
+ let b = R(p).replace("Z", ""), x = v.path(b, y), S = R(m).replace("Z", ""), C = v.path(S, y), w = R(h), E = v.path(w, { ...y }), D = i.insert("g", ":first-child");
1300
+ return D.insert(() => E, ":first-child").attr("stroke-opacity", 0), D.insert(() => x, ":first-child"), D.insert(() => C, ":first-child"), D.attr("class", "text"), f && t.look !== "handDrawn" && D.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), D.attr("transform", `translate(${d - d / 4}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), I(t, D), t.intersect = function(e) {
1301
+ return K.polygon(t, h, e);
1302
+ }, i;
1303
+ }
1304
+ n(Le, "curlyBraces");
1305
+ async function Re(e, t) {
1306
+ let { labelStyles: n, nodeStyles: r } = _(t);
1307
+ t.labelStyle = n;
1308
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(5, c.height + o * 2, t?.height ?? 0), u = l / 2, d = u - Math.sqrt(Math.max(0, u ** 2 - (c.height / 2) ** 2)), f = Math.max(l / 4, d), p = Math.max(20, c.width + a * 2 + f * 2, (c.width + a * 2) * 1.25, t?.width ?? 0), { cssStyles: m } = t, h = T.svg(s), v = g(t, {});
1309
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1310
+ let y = p, b = l, x = y - u, S = b / 4, C = [
1311
+ {
1312
+ x,
1313
+ y: 0
1314
+ },
1315
+ {
1316
+ x: S,
1317
+ y: 0
1318
+ },
1319
+ {
1320
+ x: 0,
1321
+ y: b / 2
1322
+ },
1323
+ {
1324
+ x: S,
1325
+ y: b
1326
+ },
1327
+ {
1328
+ x,
1329
+ y: b
1330
+ },
1331
+ ...B(-x, -b / 2, u, 50, 270, 90)
1332
+ ], w = R(C), E = h.path(w, v), D = s.insert(() => E, ":first-child");
1333
+ return D.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && D.selectChildren("path").attr("style", m), r && t.look !== "handDrawn" && D.selectChildren("path").attr("style", r), D.attr("transform", `translate(${-p / 2}, ${-l / 2})`), I(t, D), t.intersect = function(e) {
1334
+ return K.polygon(t, C, e);
1335
+ }, s;
1336
+ }
1337
+ n(Re, "curvedTrapezoid");
1338
+ async function ze(e, t) {
1339
+ let { labelStyles: n, nodeStyles: r } = _(t);
1340
+ t.labelStyle = n;
1341
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.padding ?? 20, c = Math.max(a.width + s * 2, t.width ?? 0, 100), l = Math.min(Math.max(c * .23, 16), 56), u = l * .27, d = Math.max(a.height + s * 2, t.height ? t.height - (2 * l - u) : 0), f = Math.min(c * .177, d * .45), p = d + 2 * l - u, m = -p / 2, h = m + 2 * l - u, v = i.insert("g", ":first-child").attr("class", "basic label-container"), { cssStyles: y } = t;
1342
+ if (t.look === "handDrawn") {
1343
+ let e = T.svg(i), n = g(t, {}), r = e.path(q(-c / 2, h, c, d, f), n), a = e.circle(0, m + l, l * 2, n);
1344
+ v.insert(() => a, ":first-child"), v.insert(() => r, ":first-child"), y && v.attr("style", y);
1345
+ } else v.append("rect").attr("x", -c / 2).attr("y", h).attr("width", c).attr("height", d).attr("rx", f).attr("ry", f).attr("style", r), v.append("circle").attr("cx", 0).attr("cy", m + l).attr("r", l).attr("style", r);
1346
+ I(t, v);
1347
+ let b = h + d / 2;
1348
+ o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${b - a.height / 2 - (a.y - (a.top ?? 0))})`);
1349
+ let x = m + l, S = Math.asin(Math.min(1, (h - x) / l)) * 180 / Math.PI, C = [
1350
+ ...B(0, -x, l, 24, 180 + S, -S),
1351
+ ...B(-(-c / 2 + f), -(h + f), f, 12, 90, 0),
1352
+ ...B(-(-c / 2 + f), -(p / 2 - f), f, 12, 360, 270),
1353
+ ...B(-(c / 2 - f), -(p / 2 - f), f, 12, 270, 180),
1354
+ ...B(-(c / 2 - f), -(h + f), f, 12, 180, 90)
1355
+ ];
1356
+ return t.intersect = function(e) {
1357
+ return K.polygon(t, C, e);
1358
+ }, i;
1359
+ }
1360
+ n(ze, "person");
1361
+ var Be = /* @__PURE__ */ n((e, t, n, r, i, a) => [
1362
+ `M${e},${t + a}`,
1363
+ `a${i},${a} 0,0,0 ${n},0`,
1364
+ `a${i},${a} 0,0,0 ${-n},0`,
1365
+ `l0,${r}`,
1366
+ `a${i},${a} 0,0,0 ${n},0`,
1367
+ `l0,${-r}`
1368
+ ].join(" "), "createCylinderPathD"), Ve = /* @__PURE__ */ n((e, t, n, r, i, a) => [
1369
+ `M${e},${t + a}`,
1370
+ `M${e + n},${t + a}`,
1371
+ `a${i},${a} 0,0,0 ${-n},0`,
1372
+ `l0,${r}`,
1373
+ `a${i},${a} 0,0,0 ${n},0`,
1374
+ `l0,${-r}`
1375
+ ].join(" "), "createOuterCylinderPathD"), He = /* @__PURE__ */ n((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), Ue = 8, We = 8;
1376
+ async function Ge(e, t) {
1377
+ let { labelStyles: n, nodeStyles: r } = _(t);
1378
+ t.labelStyle = n;
1379
+ let i = t.padding ?? 0, a = t.look === "neo" ? 24 : i, o = t.look === "neo" ? 24 : i, s = t.width ?? 0;
1380
+ if (t.width && (t.width -= o, t.width < We && (t.width = We)), t.height) {
1381
+ let e = s / 2 / (2.5 + s / 50);
1382
+ t.height = t.height - a - e * 3, t.height < Ue && (t.height = Ue);
1383
+ }
1384
+ let { shapeSvg: c, bbox: l, label: u } = await P(e, t, L(t)), d = Math.max(t.width ?? 0, l.width) + o, f = d / 2, m = f / (2.5 + d / 50), h = Math.max(t.height ?? 0, l.height) + a + m, v, { cssStyles: y } = t;
1385
+ if (t.look === "handDrawn") {
1386
+ let e = T.svg(c), n = Ve(0, 0, d, h, f, m), r = He(0, m, d, h, f, m), i = g(t, {}), a = e.path(n, i), o = e.path(r, g(t, { fill: "none" }));
1387
+ v = c.insert(() => o, ":first-child"), v = c.insert(() => a, ":first-child"), v.attr("class", "basic label-container"), y && v.attr("style", y);
1388
+ } else {
1389
+ let e = Be(0, 0, d, h, f, m);
1390
+ v = c.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", p(y)).attr("style", r);
1391
+ }
1392
+ return v.attr("label-offset-y", m), v.attr("transform", `translate(${-d / 2}, ${-(h / 2 + m)})`), I(t, v), u.attr("transform", `translate(${-(l.width / 2) - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + (t.padding ?? 0) / 1.5 - (l.y - (l.top ?? 0))})`), t.intersect = function(e) {
1393
+ let n = K.rect(t, e), r = n.x - (t.x ?? 0);
1394
+ if (f != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - m)) {
1395
+ let i = m * m * (1 - r * r / (f * f));
1396
+ i > 0 && (i = Math.sqrt(i)), i = m - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
1397
+ }
1398
+ return n;
1399
+ }, c;
1400
+ }
1401
+ n(Ge, "cylinder");
1402
+ async function Ke(e, t, n) {
1403
+ let { labelStyles: r, nodeStyles: i } = _(t);
1404
+ t.labelStyle = r;
1405
+ let { shapeSvg: a, bbox: o } = await P(e, t, L(t)), s = Math.max(o.width + n.labelPaddingX * 2, t?.width || 0), c = Math.max(o.height + n.labelPaddingY * 2, t?.height || 0), l = -s / 2, u = -c / 2, d, { rx: f, ry: m } = t, { cssStyles: h } = t;
1406
+ if (n?.rx && n.ry && (f = n.rx, m = n.ry), t.look === "handDrawn") {
1407
+ let e = T.svg(a), n = g(t, {}), r = f || m ? e.path(q(l, u, s, c, f || 0), n) : e.rectangle(l, u, s, c, n);
1408
+ d = a.insert(() => r, ":first-child"), d.attr("class", "basic label-container").attr("style", p(h));
1409
+ } else d = a.insert("rect", ":first-child"), d.attr("class", "basic label-container").attr("style", i).attr("rx", p(f)).attr("ry", p(m)).attr("x", l).attr("y", u).attr("width", s).attr("height", c);
1410
+ return I(t, d, t.look === "handDrawn" ? void 0 : {
1411
+ width: s,
1412
+ height: c
1413
+ }), t.calcIntersect = function(e, t) {
1414
+ return K.rect(e, t);
1415
+ }, t.intersect = function(e) {
1416
+ return K.rect(t, e);
1417
+ }, a;
1418
+ }
1419
+ n(Ke, "drawRect");
1420
+ async function qe(e, t) {
1421
+ let { cssClasses: n, labelPaddingX: r, labelPaddingY: i, padding: a, width: o, height: s } = t, c = await Ke(e, t, {
1422
+ rx: 0,
1423
+ ry: 0,
1424
+ classes: n ?? "",
1425
+ labelPaddingX: r ?? (a ?? 0) * 2,
1426
+ labelPaddingY: i ?? a ?? 0
1427
+ });
1428
+ if (t.look === "handDrawn") {
1429
+ let e = T.svg(c), n = g(t, {}), r = c.select(".basic.label-container > path:nth-child(2)"), i = r.node();
1430
+ if (!i) return c;
1431
+ let a = null;
1432
+ if (i instanceof SVGGraphicsElement) a = i.getBBox();
1433
+ else return c;
1434
+ return c.insert(() => e.line(a.x, a.y, a.x + a.width, a.y, n), ".basic.label-container g.label"), c.insert(() => e.line(a.x, a.y + a.height, a.x + a.width, a.y + a.height, n), ".basic.label-container g.label"), r.remove(), c;
1435
+ }
1436
+ let l = c.select(".basic.label-container"), u = (Number(l.attr("width")) || o) ?? 0, d = (Number(l.attr("height")) || s) ?? 0;
1437
+ return u > 0 && d > 0 && l.attr("stroke-dasharray", `${u} ${d}`), c;
1438
+ }
1439
+ n(qe, "datastore");
1440
+ async function Je(e, t) {
1441
+ let { labelStyles: n, nodeStyles: r } = _(t);
1442
+ t.labelStyle = n;
1443
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 16 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = s.width + i, u = s.height + a, d = u * .2, f = -l / 2, p = -u / 2 - d / 2, { cssStyles: m } = t, h = T.svg(o), v = g(t, {});
1444
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1445
+ let y = [
1446
+ {
1447
+ x: f,
1448
+ y: p + d
1449
+ },
1450
+ {
1451
+ x: -f,
1452
+ y: p + d
1453
+ },
1454
+ {
1455
+ x: -f,
1456
+ y: -p
1457
+ },
1458
+ {
1459
+ x: f,
1460
+ y: -p
1461
+ },
1462
+ {
1463
+ x: f,
1464
+ y: p
1465
+ },
1466
+ {
1467
+ x: -f,
1468
+ y: p
1469
+ },
1470
+ {
1471
+ x: -f,
1472
+ y: p + d
1473
+ }
1474
+ ], b = h.polygon(y.map((e) => [e.x, e.y]), v), x = o.insert(() => b, ":first-child");
1475
+ return x.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && x.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), c.attr("transform", `translate(${f + (t.padding ?? 0) / 2 - (s.x - (s.left ?? 0))}, ${p + d + (t.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`), I(t, x), t.intersect = function(e) {
1476
+ return K.rect(t, e);
1477
+ }, o;
1478
+ }
1479
+ n(Je, "dividedRectangle");
1480
+ async function Ye(t, n) {
1481
+ let { labelStyles: r, nodeStyles: i } = _(n), a = n.look === "neo" ? 12 : 5;
1482
+ n.labelStyle = r;
1483
+ let o = n.padding ?? 0, s = n.look === "neo" ? 16 : o, { shapeSvg: c, bbox: l } = await P(t, n, L(n), { ignoreMinWidth: !0 }), u = Math.sqrt(l.width ** 2 + l.height ** 2) / 2, d = (n?.width ? n?.width / 2 : u) + (s ?? 0), f = d + a, m, { cssStyles: h } = n;
1484
+ if (n.look === "handDrawn") {
1485
+ let e = T.svg(c), t = g(n, {
1486
+ roughness: .2,
1487
+ strokeWidth: 2.5
1488
+ }), r = g(n, {
1489
+ roughness: .2,
1490
+ strokeWidth: 1.5
1491
+ }), i = e.circle(0, 0, f * 2, t), a = e.circle(0, 0, d * 2, r);
1492
+ m = c.insert("g", ":first-child"), m.attr("class", p(n.cssClasses)).attr("style", p(h)), m.node()?.appendChild(i), m.node()?.appendChild(a);
1493
+ } else {
1494
+ m = c.insert("g", ":first-child");
1495
+ let e = m.insert("circle", ":first-child"), t = m.insert("circle");
1496
+ m.attr("class", "basic label-container").attr("style", i), e.attr("class", "outer-circle").attr("style", i).attr("r", f).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", i).attr("r", d).attr("cx", 0).attr("cy", 0);
1497
+ }
1498
+ return I(n, m), n.intersect = function(t) {
1499
+ return e.info("DoubleCircle intersect", n, f, t), K.circle(n, f, t);
1500
+ }, c;
1501
+ }
1502
+ n(Ye, "doublecircle");
1503
+ async function Xe(e, t) {
1504
+ let { labelStyles: n, nodeStyles: r } = _(t);
1505
+ t.labelStyle = n;
1506
+ let { shapeSvg: i, bbox: o, halfPadding: s } = await P(e, t, L(t)), { theme: c, themeVariables: l } = a();
1507
+ w(i, t.colorIndex, c, l.borderColorArray);
1508
+ let u = s ?? 10, d = o.width / 2 + u * 2, f = o.height / 2 + u * 2, p, { cssStyles: m } = t;
1509
+ if (t.look === "handDrawn") {
1510
+ let e = T.svg(i), n = g(t, {}), r = e.ellipse(0, 0, d * 2, f * 2, n);
1511
+ p = i.insert(() => r, ":first-child"), p.attr("class", "basic label-container"), m && p.attr("style", m);
1512
+ } else p = i.insert("ellipse", ":first-child").attr("class", "basic label-container").attr("style", r).attr("rx", d).attr("ry", f).attr("cx", 0).attr("cy", 0);
1513
+ return t.width = d * 2, t.height = f * 2, I(t, p), t.calcIntersect = function(e, t) {
1514
+ let n = e.width / 2, r = e.height / 2;
1515
+ return K.ellipse(e, n, r, t);
1516
+ }, t.intersect = function(e) {
1517
+ return K.ellipse(t, d, f, e);
1518
+ }, i;
1519
+ }
1520
+ n(Xe, "usecaseEllipse");
1521
+ function Ze(t, n, { config: { themeVariables: r } }) {
1522
+ let { labelStyles: i, nodeStyles: a } = _(n);
1523
+ n.label = "", n.labelStyle = i;
1524
+ let o = t.insert("g").attr("class", L(n)).attr("id", n.domId ?? n.id), { cssStyles: s } = n, c = T.svg(o), { nodeBorder: l } = r, u = g(n, { fillStyle: "solid" });
1525
+ n.look !== "handDrawn" && (u.roughness = 0);
1526
+ let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
1527
+ return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && n.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && n.look !== "handDrawn" && f.selectAll("path").attr("style", a), I(n, f), n.intersect = function(t) {
1528
+ return e.info("filledCircle intersect", n, {
1529
+ radius: 7,
1530
+ point: t
1531
+ }), K.circle(n, 7, t);
1532
+ }, o;
1533
+ }
1534
+ n(Ze, "filledCircle");
1535
+ var Qe = 10, $e = 10;
1536
+ async function et(t, n) {
1537
+ let { labelStyles: r, nodeStyles: i } = _(n);
1538
+ n.labelStyle = r;
1539
+ let a = n.padding ?? 0, o = n.look === "neo" ? a * 2 : a;
1540
+ (n.width || n.height) && (n.height = n?.height ?? 0, n.height < Qe && (n.height = Qe), n.width = (n?.width ?? 0) - o - o / 2, n.width < $e && (n.width = $e));
1541
+ let { shapeSvg: s, bbox: c, label: l } = await P(t, n, L(n)), u = (n?.width ? n?.width : c.width) + (o ?? 0), d = n?.height ? n?.height : u + c.height, f = d, p = [
1542
+ {
1543
+ x: 0,
1544
+ y: -d
1545
+ },
1546
+ {
1547
+ x: f,
1548
+ y: -d
1549
+ },
1550
+ {
1551
+ x: f / 2,
1552
+ y: 0
1553
+ }
1554
+ ], { cssStyles: m } = n, h = T.svg(s), v = g(n, {});
1555
+ n.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1556
+ let y = R(p), b = h.path(y, v), x = s.insert(() => b, ":first-child").attr("transform", `translate(${-d / 2}, ${d / 2})`).attr("class", "outer-path");
1557
+ return m && n.look !== "handDrawn" && x.selectChildren("path").attr("style", m), i && n.look !== "handDrawn" && x.selectChildren("path").attr("style", i), n.width = u, n.height = d, I(n, x), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${-d / 2 + (n.padding ?? 0) / 2 + (c.y - (c.top ?? 0))})`), n.intersect = function(t) {
1558
+ return e.info("Triangle intersect", n, p, t), K.polygon(n, p, t);
1559
+ }, s;
1560
+ }
1561
+ n(et, "flippedTriangle");
1562
+ async function tt(e, t) {
1563
+ let { labelStyles: n, nodeStyles: r } = _(t);
1564
+ t.labelStyle = n;
1565
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.padding ?? 12, c = Math.max(a.width + s * 2, t.width ?? 0, 90), l = a.height + s * 2, u = Math.max(Math.min(l * .16, 14), 8), d = Math.max(l + u, t.height ?? 0), f = d - u, p = Math.max(c * .38, 28), m = -d / 2, h = [
1566
+ {
1567
+ x: -c / 2,
1568
+ y: m
1569
+ },
1570
+ {
1571
+ x: -c / 2 + p,
1572
+ y: m
1573
+ },
1574
+ {
1575
+ x: -c / 2 + p,
1576
+ y: m + u
1577
+ },
1578
+ {
1579
+ x: c / 2,
1580
+ y: m + u
1581
+ },
1582
+ {
1583
+ x: c / 2,
1584
+ y: d / 2
1585
+ },
1586
+ {
1587
+ x: -c / 2,
1588
+ y: d / 2
1589
+ }
1590
+ ], v = [
1591
+ `M${h[0].x},${h[0].y}`,
1592
+ ...h.slice(1).map((e) => `L${e.x},${e.y}`),
1593
+ "Z"
1594
+ ].join(" "), { cssStyles: y } = t, b;
1595
+ if (t.look === "handDrawn") {
1596
+ let e = T.svg(i).path(v, g(t, {}));
1597
+ b = i.insert(() => e, ":first-child").attr("class", "basic label-container"), y && b.attr("style", y);
1598
+ } else b = i.insert("path", ":first-child").attr("d", v).attr("class", "basic label-container").attr("style", r);
1599
+ t.look === "handDrawn" ? I(t, b) : I(t, b, {
1600
+ width: c,
1601
+ height: d
1602
+ });
1603
+ let x = m + u + f / 2;
1604
+ return o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${x - a.height / 2 - (a.y - (a.top ?? 0))})`), t.intersect = function(e) {
1605
+ return K.polygon(t, h, e);
1606
+ }, i;
1607
+ }
1608
+ n(tt, "folder");
1609
+ function nt(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
1610
+ let { nodeStyles: a } = _(t);
1611
+ t.label = "";
1612
+ let o = e.insert("g").attr("class", L(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = Math.max(70, t?.width ?? 0), l = Math.max(10, t?.height ?? 0);
1613
+ (n === "LR" || n === "RL") && (c = Math.max(10, t?.width ?? 0), l = Math.max(70, t?.height ?? 0));
1614
+ let u = -1 * c / 2, d = -1 * l / 2, f = T.svg(o), p = g(t, {
1615
+ stroke: i.lineColor,
1616
+ fill: i.lineColor
1617
+ });
1618
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
1619
+ let m = f.rectangle(u, d, c, l, p), h = o.insert(() => m, ":first-child");
1620
+ s && t.look !== "handDrawn" && h.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && h.selectAll("path").attr("style", a), I(t, h);
1621
+ let v = r?.padding ?? 0;
1622
+ return t.width && t.height && (t.width += v / 2 || 0, t.height += v / 2 || 0), t.intersect = function(e) {
1623
+ return K.rect(t, e);
1624
+ }, o;
1625
+ }
1626
+ n(nt, "forkJoin");
1627
+ async function rt(t, n) {
1628
+ let { labelStyles: r, nodeStyles: i } = _(n);
1629
+ n.labelStyle = r;
1630
+ let a = n.look === "neo" ? 16 : n.padding ?? 0, o = n.look === "neo" ? 12 : n.padding ?? 0;
1631
+ (n.width || n.height) && (n.height = (n?.height ?? 0) - o * 2, n.height < 10 && (n.height = 10), n.width = (n?.width ?? 0) - a * 2, n.width < 15 && (n.width = 15));
1632
+ let { shapeSvg: s, bbox: c } = await P(t, n, L(n)), l = (n?.height ? n?.height : Math.max(10, c.height)) + o * 2, u = l / 2, d = u - Math.sqrt(Math.max(0, u ** 2 - (c.height / 2) ** 2)), f = (n?.width ? n?.width : Math.max(15, c.width) + d * 2) + a * 2, { cssStyles: p } = n, m = T.svg(s), h = g(n, {});
1633
+ n.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
1634
+ let v = [
1635
+ {
1636
+ x: -f / 2,
1637
+ y: -l / 2
1638
+ },
1639
+ {
1640
+ x: f / 2 - u,
1641
+ y: -l / 2
1642
+ },
1643
+ ...B(-f / 2 + u, 0, u, 50, 90, 270),
1644
+ {
1645
+ x: f / 2 - u,
1646
+ y: l / 2
1647
+ },
1648
+ {
1649
+ x: -f / 2,
1650
+ y: l / 2
1651
+ }
1652
+ ], y = R(v), b = m.path(y, h), x = s.insert(() => b, ":first-child");
1653
+ return x.attr("class", "basic label-container outer-path"), p && n.look !== "handDrawn" && x.selectChildren("path").attr("style", p), i && n.look !== "handDrawn" && x.selectChildren("path").attr("style", i), I(n, x), n.intersect = function(t) {
1654
+ return e.info("Pill intersect", n, {
1655
+ radius: u,
1656
+ point: t
1657
+ }), K.polygon(n, v, t);
1658
+ }, s;
1659
+ }
1660
+ n(rt, "halfRoundedRectangle");
1661
+ var it = /* @__PURE__ */ n((e, t, n, r, i) => [
1662
+ `M${e + i},${t}`,
1663
+ `L${e + n - i},${t}`,
1664
+ `L${e + n},${t - r / 2}`,
1665
+ `L${e + n - i},${t - r}`,
1666
+ `L${e + i},${t - r}`,
1667
+ `L${e},${t - r / 2}`,
1668
+ "Z"
1669
+ ].join(" "), "createHexagonPathD");
1670
+ async function at(e, t) {
1671
+ let { labelStyles: n, nodeStyles: r } = _(t), i = t.look === "neo" ? 3.5 : 4;
1672
+ t.labelStyle = n;
1673
+ let a = t.padding ?? 0, o = t.look === "neo" ? 70 : a, s = t.look === "neo" ? 32 : a;
1674
+ if (t.width || t.height) {
1675
+ let e = (t.height ?? 0) / i;
1676
+ t.width = (t?.width ?? 0) - 2 * e - s, t.height = (t.height ?? 0) - o;
1677
+ }
1678
+ let { shapeSvg: c, bbox: l } = await P(e, t, L(t)), u = (t?.height ? t?.height : l.height) + o, d = u / i, f = (t?.width ? t?.width : l.width) + 2 * d + s, p = [
1679
+ {
1680
+ x: d,
1681
+ y: 0
1682
+ },
1683
+ {
1684
+ x: f - d,
1685
+ y: 0
1686
+ },
1687
+ {
1688
+ x: f,
1689
+ y: -u / 2
1690
+ },
1691
+ {
1692
+ x: f - d,
1693
+ y: -u
1694
+ },
1695
+ {
1696
+ x: d,
1697
+ y: -u
1698
+ },
1699
+ {
1700
+ x: 0,
1701
+ y: -u / 2
1702
+ }
1703
+ ], m, { cssStyles: h } = t;
1704
+ if (t.look === "handDrawn") {
1705
+ let e = T.svg(c), n = g(t, {}), r = it(0, 0, f, u, d), i = e.path(r, n);
1706
+ m = c.insert(() => i, ":first-child").attr("transform", `translate(${-f / 2}, ${u / 2})`), h && m.attr("style", h);
1707
+ } else m = J(c, f, u, p);
1708
+ return r && m.attr("style", r), t.width = f, t.height = u, I(t, m), t.intersect = function(e) {
1709
+ return K.polygon(t, p, e);
1710
+ }, c;
1711
+ }
1712
+ n(at, "hexagon");
1713
+ async function ot(t, n) {
1714
+ let { labelStyles: r, nodeStyles: i } = _(n);
1715
+ n.label = "", n.labelStyle = r;
1716
+ let { shapeSvg: a } = await P(t, n, L(n)), o = Math.max(30, n?.width ?? 0), s = Math.max(30, n?.height ?? 0), { cssStyles: c } = n, l = T.svg(a), u = g(n, {});
1717
+ n.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
1718
+ let d = [
1719
+ {
1720
+ x: 0,
1721
+ y: 0
1722
+ },
1723
+ {
1724
+ x: o,
1725
+ y: 0
1726
+ },
1727
+ {
1728
+ x: 0,
1729
+ y: s
1730
+ },
1731
+ {
1732
+ x: o,
1733
+ y: s
1734
+ }
1735
+ ], f = R(d), p = l.path(f, u), m = a.insert(() => p, ":first-child");
1736
+ return m.attr("class", "basic label-container outer-path"), c && n.look !== "handDrawn" && m.selectChildren("path").attr("style", c), i && n.look !== "handDrawn" && m.selectChildren("path").attr("style", i), m.attr("transform", `translate(${-o / 2}, ${-s / 2})`), I(n, m), n.intersect = function(t) {
1737
+ return e.info("Pill intersect", n, { points: d }), K.polygon(n, d, t);
1738
+ }, a;
1739
+ }
1740
+ n(ot, "hourglass");
1741
+ async function st(t, n, { config: { themeVariables: r, flowchart: i } }) {
1742
+ let { labelStyles: a } = _(n);
1743
+ n.labelStyle = a;
1744
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1745
+ n.width = Math.max(c, l ?? 0);
1746
+ let { shapeSvg: u, bbox: d, label: f } = await P(t, n, "icon-shape default"), p = n.pos === "t", m = c, h = c, { nodeBorder: v } = r, { stylesMap: b } = y(n), S = -h / 2, C = -m / 2, w = n.label ? 8 : 0, E = T.svg(u), D = g(n, {
1747
+ stroke: "none",
1748
+ fill: "none"
1749
+ });
1750
+ n.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
1751
+ let O = E.rectangle(S, C, h, m, D), k = Math.max(h, d.width), A = m + d.height + w, j = E.rectangle(-k / 2, -A / 2, k, A, {
1752
+ ...D,
1753
+ fill: "transparent",
1754
+ stroke: "none"
1755
+ }), M = u.insert(() => O, ":first-child"), N = u.insert(() => j);
1756
+ if (n.icon) {
1757
+ let e = u.append("g");
1758
+ e.html(`<g>${await x(n.icon, {
1759
+ height: c,
1760
+ width: c,
1761
+ fallbackPrefix: ""
1762
+ })}</g>`);
1763
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1764
+ e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + w / 2 - i / 2 - o : -d.height / 2 - w / 2 - i / 2 - o})`), e.attr("style", `color: ${b.get("stroke") ?? v};`);
1765
+ }
1766
+ return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -A / 2 : A / 2 - d.height})`), M.attr("transform", `translate(0,${p ? d.height / 2 + w / 2 : -d.height / 2 - w / 2})`), I(n, N), n.intersect = function(t) {
1767
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1768
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1769
+ return o = p ? [
1770
+ {
1771
+ x: r - d.width / 2,
1772
+ y: i - a / 2
1773
+ },
1774
+ {
1775
+ x: r + d.width / 2,
1776
+ y: i - a / 2
1777
+ },
1778
+ {
1779
+ x: r + d.width / 2,
1780
+ y: i - a / 2 + d.height + w
1781
+ },
1782
+ {
1783
+ x: r + h / 2,
1784
+ y: i - a / 2 + d.height + w
1785
+ },
1786
+ {
1787
+ x: r + h / 2,
1788
+ y: i + a / 2
1789
+ },
1790
+ {
1791
+ x: r - h / 2,
1792
+ y: i + a / 2
1793
+ },
1794
+ {
1795
+ x: r - h / 2,
1796
+ y: i - a / 2 + d.height + w
1797
+ },
1798
+ {
1799
+ x: r - d.width / 2,
1800
+ y: i - a / 2 + d.height + w
1801
+ }
1802
+ ] : [
1803
+ {
1804
+ x: r - h / 2,
1805
+ y: i - a / 2
1806
+ },
1807
+ {
1808
+ x: r + h / 2,
1809
+ y: i - a / 2
1810
+ },
1811
+ {
1812
+ x: r + h / 2,
1813
+ y: i - a / 2 + m
1814
+ },
1815
+ {
1816
+ x: r + d.width / 2,
1817
+ y: i - a / 2 + m
1818
+ },
1819
+ {
1820
+ x: r + d.width / 2 / 2,
1821
+ y: i + a / 2
1822
+ },
1823
+ {
1824
+ x: r - d.width / 2,
1825
+ y: i + a / 2
1826
+ },
1827
+ {
1828
+ x: r - d.width / 2,
1829
+ y: i - a / 2 + m
1830
+ },
1831
+ {
1832
+ x: r - h / 2,
1833
+ y: i - a / 2 + m
1834
+ }
1835
+ ], K.polygon(n, o, t);
1836
+ }, u;
1837
+ }
1838
+ n(st, "icon");
1839
+ async function ct(t, n, { config: { themeVariables: r, flowchart: i } }) {
1840
+ let { labelStyles: a } = _(n);
1841
+ n.labelStyle = a;
1842
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1843
+ n.width = Math.max(c, l ?? 0);
1844
+ let { shapeSvg: u, bbox: d, label: f } = await P(t, n, "icon-shape default"), p = n.label ? 8 : 0, m = n.pos === "t", { nodeBorder: h, mainBkg: v } = r, { stylesMap: b } = y(n), S = T.svg(u), C = g(n, {});
1845
+ n.look !== "handDrawn" && (C.roughness = 0, C.fillStyle = "solid"), C.stroke = b.get("fill") ?? v;
1846
+ let w = u.append("g");
1847
+ n.icon && w.html(`<g>${await x(n.icon, {
1848
+ height: c,
1849
+ width: c,
1850
+ fallbackPrefix: ""
1851
+ })}</g>`);
1852
+ let E = w.node().getBBox(), D = E.width, O = E.height, k = E.x, A = E.y, j = Math.max(D, O) * Math.SQRT2 + 40, M = S.circle(0, 0, j, C), N = Math.max(j, d.width), F = j + d.height + p, L = S.rectangle(-N / 2, -F / 2, N, F, {
1853
+ ...C,
1854
+ fill: "transparent",
1855
+ stroke: "none"
1856
+ }), R = u.insert(() => M, ":first-child"), z = u.insert(() => L);
1857
+ return w.attr("transform", `translate(${-D / 2 - k},${m ? d.height / 2 + p / 2 - O / 2 - A : -d.height / 2 - p / 2 - O / 2 - A})`), w.attr("style", `color: ${b.get("stroke") ?? h};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), R.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), I(n, z), n.intersect = function(t) {
1858
+ return e.info("iconSquare intersect", n, t), K.rect(n, t);
1859
+ }, u;
1860
+ }
1861
+ n(ct, "iconCircle");
1862
+ async function lt(t, n, { config: { themeVariables: r, flowchart: i } }) {
1863
+ let { labelStyles: a } = _(n);
1864
+ n.labelStyle = a;
1865
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1866
+ n.width = Math.max(c, l ?? 0);
1867
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await P(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, v = c + f * 2, { nodeBorder: b, mainBkg: S } = r, { stylesMap: C } = y(n), w = -v / 2, E = -h / 2, D = n.label ? 8 : 0, O = T.svg(u), k = g(n, {});
1868
+ n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = C.get("fill") ?? S;
1869
+ let A = O.path(q(w, E, v, h, 5), k), j = Math.max(v, d.width), M = h + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
1870
+ ...k,
1871
+ fill: "transparent",
1872
+ stroke: "none"
1873
+ }), F = u.insert(() => A, ":first-child").attr("class", "icon-shape2"), L = u.insert(() => N);
1874
+ if (n.icon) {
1875
+ let e = u.append("g");
1876
+ e.html(`<g>${await x(n.icon, {
1877
+ height: c,
1878
+ width: c,
1879
+ fallbackPrefix: ""
1880
+ })}</g>`);
1881
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1882
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${C.get("stroke") ?? b};`);
1883
+ }
1884
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -M / 2 : M / 2 - d.height})`), F.attr("transform", `translate(0,${m ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), I(n, L), n.intersect = function(t) {
1885
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1886
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1887
+ return o = m ? [
1888
+ {
1889
+ x: r - d.width / 2,
1890
+ y: i - a / 2
1891
+ },
1892
+ {
1893
+ x: r + d.width / 2,
1894
+ y: i - a / 2
1895
+ },
1896
+ {
1897
+ x: r + d.width / 2,
1898
+ y: i - a / 2 + d.height + D
1899
+ },
1900
+ {
1901
+ x: r + v / 2,
1902
+ y: i - a / 2 + d.height + D
1903
+ },
1904
+ {
1905
+ x: r + v / 2,
1906
+ y: i + a / 2
1907
+ },
1908
+ {
1909
+ x: r - v / 2,
1910
+ y: i + a / 2
1911
+ },
1912
+ {
1913
+ x: r - v / 2,
1914
+ y: i - a / 2 + d.height + D
1915
+ },
1916
+ {
1917
+ x: r - d.width / 2,
1918
+ y: i - a / 2 + d.height + D
1919
+ }
1920
+ ] : [
1921
+ {
1922
+ x: r - v / 2,
1923
+ y: i - a / 2
1924
+ },
1925
+ {
1926
+ x: r + v / 2,
1927
+ y: i - a / 2
1928
+ },
1929
+ {
1930
+ x: r + v / 2,
1931
+ y: i - a / 2 + h
1932
+ },
1933
+ {
1934
+ x: r + d.width / 2,
1935
+ y: i - a / 2 + h
1936
+ },
1937
+ {
1938
+ x: r + d.width / 2 / 2,
1939
+ y: i + a / 2
1940
+ },
1941
+ {
1942
+ x: r - d.width / 2,
1943
+ y: i + a / 2
1944
+ },
1945
+ {
1946
+ x: r - d.width / 2,
1947
+ y: i - a / 2 + h
1948
+ },
1949
+ {
1950
+ x: r - v / 2,
1951
+ y: i - a / 2 + h
1952
+ }
1953
+ ], K.polygon(n, o, t);
1954
+ }, u;
1955
+ }
1956
+ n(lt, "iconRounded");
1957
+ async function ut(t, n, { config: { themeVariables: r, flowchart: i } }) {
1958
+ let { labelStyles: a } = _(n);
1959
+ n.labelStyle = a;
1960
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1961
+ n.width = Math.max(c, l ?? 0);
1962
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await P(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, v = c + f * 2, { nodeBorder: b, mainBkg: S } = r, { stylesMap: C } = y(n), w = -v / 2, E = -h / 2, D = n.label ? 8 : 0, O = T.svg(u), k = g(n, {});
1963
+ n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = C.get("fill") ?? S;
1964
+ let A = O.path(q(w, E, v, h, .1), k), j = Math.max(v, d.width), M = h + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
1965
+ ...k,
1966
+ fill: "transparent",
1967
+ stroke: "none"
1968
+ }), F = u.insert(() => A, ":first-child"), L = u.insert(() => N);
1969
+ if (n.icon) {
1970
+ let e = u.append("g");
1971
+ e.html(`<g>${await x(n.icon, {
1972
+ height: c,
1973
+ width: c,
1974
+ fallbackPrefix: ""
1975
+ })}</g>`);
1976
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1977
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${C.get("stroke") ?? b};`);
1978
+ }
1979
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -M / 2 : M / 2 - d.height})`), F.attr("transform", `translate(0,${m ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), I(n, L), n.intersect = function(t) {
1980
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1981
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1982
+ return o = m ? [
1983
+ {
1984
+ x: r - d.width / 2,
1985
+ y: i - a / 2
1986
+ },
1987
+ {
1988
+ x: r + d.width / 2,
1989
+ y: i - a / 2
1990
+ },
1991
+ {
1992
+ x: r + d.width / 2,
1993
+ y: i - a / 2 + d.height + D
1994
+ },
1995
+ {
1996
+ x: r + v / 2,
1997
+ y: i - a / 2 + d.height + D
1998
+ },
1999
+ {
2000
+ x: r + v / 2,
2001
+ y: i + a / 2
2002
+ },
2003
+ {
2004
+ x: r - v / 2,
2005
+ y: i + a / 2
2006
+ },
2007
+ {
2008
+ x: r - v / 2,
2009
+ y: i - a / 2 + d.height + D
2010
+ },
2011
+ {
2012
+ x: r - d.width / 2,
2013
+ y: i - a / 2 + d.height + D
2014
+ }
2015
+ ] : [
2016
+ {
2017
+ x: r - v / 2,
2018
+ y: i - a / 2
2019
+ },
2020
+ {
2021
+ x: r + v / 2,
2022
+ y: i - a / 2
2023
+ },
2024
+ {
2025
+ x: r + v / 2,
2026
+ y: i - a / 2 + h
2027
+ },
2028
+ {
2029
+ x: r + d.width / 2,
2030
+ y: i - a / 2 + h
2031
+ },
2032
+ {
2033
+ x: r + d.width / 2 / 2,
2034
+ y: i + a / 2
2035
+ },
2036
+ {
2037
+ x: r - d.width / 2,
2038
+ y: i + a / 2
2039
+ },
2040
+ {
2041
+ x: r - d.width / 2,
2042
+ y: i - a / 2 + h
2043
+ },
2044
+ {
2045
+ x: r - v / 2,
2046
+ y: i - a / 2 + h
2047
+ }
2048
+ ], K.polygon(n, o, t);
2049
+ }, u;
2050
+ }
2051
+ n(ut, "iconSquare");
2052
+ async function dt(t, n, { config: { flowchart: r } }) {
2053
+ let i = new Image();
2054
+ i.src = n?.img ?? "", await i.decode();
2055
+ let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
2056
+ n.imageAspectRatio = a / o;
2057
+ let { labelStyles: s } = _(n);
2058
+ n.labelStyle = s;
2059
+ let c = r?.wrappingWidth;
2060
+ n.defaultWidth = r?.wrappingWidth;
2061
+ let l = Math.max(n.label ? c ?? 0 : 0, n?.assetWidth ?? a), u = n.constraint === "on" && n?.assetHeight ? n.assetHeight * n.imageAspectRatio : l, d = n.constraint === "on" ? u / n.imageAspectRatio : n?.assetHeight ?? o;
2062
+ n.width = Math.max(u, c ?? 0);
2063
+ let { shapeSvg: f, bbox: p, label: m } = await P(t, n, "image-shape default"), h = n.pos === "t", v = -u / 2, y = -d / 2, b = n.label ? 8 : 0, x = T.svg(f), S = g(n, {});
2064
+ n.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
2065
+ let C = x.rectangle(v, y, u, d, S), w = Math.max(u, p.width), E = d + p.height + b, D = x.rectangle(-w / 2, -E / 2, w, E, {
2066
+ ...S,
2067
+ fill: "none",
2068
+ stroke: "none"
2069
+ }), O = f.insert(() => C, ":first-child"), k = f.insert(() => D);
2070
+ if (n.img) {
2071
+ let e = f.append("image");
2072
+ e.attr("href", n.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${h ? E / 2 - d : -E / 2})`);
2073
+ }
2074
+ return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), O.attr("transform", `translate(0,${h ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), I(n, k), n.intersect = function(t) {
2075
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
2076
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
2077
+ return o = h ? [
2078
+ {
2079
+ x: r - p.width / 2,
2080
+ y: i - a / 2
2081
+ },
2082
+ {
2083
+ x: r + p.width / 2,
2084
+ y: i - a / 2
2085
+ },
2086
+ {
2087
+ x: r + p.width / 2,
2088
+ y: i - a / 2 + p.height + b
2089
+ },
2090
+ {
2091
+ x: r + u / 2,
2092
+ y: i - a / 2 + p.height + b
2093
+ },
2094
+ {
2095
+ x: r + u / 2,
2096
+ y: i + a / 2
2097
+ },
2098
+ {
2099
+ x: r - u / 2,
2100
+ y: i + a / 2
2101
+ },
2102
+ {
2103
+ x: r - u / 2,
2104
+ y: i - a / 2 + p.height + b
2105
+ },
2106
+ {
2107
+ x: r - p.width / 2,
2108
+ y: i - a / 2 + p.height + b
2109
+ }
2110
+ ] : [
2111
+ {
2112
+ x: r - u / 2,
2113
+ y: i - a / 2
2114
+ },
2115
+ {
2116
+ x: r + u / 2,
2117
+ y: i - a / 2
2118
+ },
2119
+ {
2120
+ x: r + u / 2,
2121
+ y: i - a / 2 + d
2122
+ },
2123
+ {
2124
+ x: r + p.width / 2,
2125
+ y: i - a / 2 + d
2126
+ },
2127
+ {
2128
+ x: r + p.width / 2 / 2,
2129
+ y: i + a / 2
2130
+ },
2131
+ {
2132
+ x: r - p.width / 2,
2133
+ y: i + a / 2
2134
+ },
2135
+ {
2136
+ x: r - p.width / 2,
2137
+ y: i - a / 2 + d
2138
+ },
2139
+ {
2140
+ x: r - u / 2,
2141
+ y: i - a / 2 + d
2142
+ }
2143
+ ], K.polygon(n, o, t);
2144
+ }, f;
2145
+ }
2146
+ n(dt, "imageSquare");
2147
+ async function ft(e, t) {
2148
+ let { labelStyles: n, nodeStyles: r } = _(t);
2149
+ t.labelStyle = n;
2150
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a * 2, t.height ?? 0), u = Math.max(c.width + o * 2, (t.width ?? 0) - l), d = [
2151
+ {
2152
+ x: 0,
2153
+ y: 0
2154
+ },
2155
+ {
2156
+ x: u,
2157
+ y: 0
2158
+ },
2159
+ {
2160
+ x: u + 3 * l / 6,
2161
+ y: -l
2162
+ },
2163
+ {
2164
+ x: -3 * l / 6,
2165
+ y: -l
2166
+ }
2167
+ ], f, { cssStyles: p } = t;
2168
+ if (t.look === "handDrawn") {
2169
+ let e = T.svg(s), n = g(t, {}), r = R(d), i = e.path(r, n);
2170
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2171
+ } else f = J(s, u, l, d);
2172
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
2173
+ return K.polygon(t, d, e);
2174
+ }, s;
2175
+ }
2176
+ n(ft, "inv_trapezoid");
2177
+ async function pt(e, t) {
2178
+ let { shapeSvg: n, bbox: r, label: i } = await P(e, t, "label"), a = n.insert("rect", ":first-child");
2179
+ return a.attr("width", .1).attr("height", .1), n.attr("class", "label edgeLabel"), i.attr("transform", `translate(${-(r.width / 2) - (r.x - (r.left ?? 0))}, ${-(r.height / 2) - (r.y - (r.top ?? 0))})`), I(t, a), t.intersect = function(e) {
2180
+ return K.rect(t, e);
2181
+ }, n;
2182
+ }
2183
+ n(pt, "labelRect");
2184
+ async function mt(e, t) {
2185
+ let { labelStyles: n, nodeStyles: r } = _(t);
2186
+ t.labelStyle = n;
2187
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
2188
+ {
2189
+ x: 0,
2190
+ y: 0
2191
+ },
2192
+ {
2193
+ x: u + 3 * l / 6,
2194
+ y: 0
2195
+ },
2196
+ {
2197
+ x: u,
2198
+ y: -l
2199
+ },
2200
+ {
2201
+ x: -(3 * l) / 6,
2202
+ y: -l
2203
+ }
2204
+ ], f, { cssStyles: p } = t;
2205
+ if (t.look === "handDrawn") {
2206
+ let e = T.svg(s), n = g(t, {}), r = R(d), i = e.path(r, n);
2207
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2208
+ } else f = J(s, u, l, d);
2209
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
2210
+ return K.polygon(t, d, e);
2211
+ }, s;
2212
+ }
2213
+ n(mt, "lean_left");
2214
+ async function ht(e, t) {
2215
+ let { labelStyles: n, nodeStyles: r } = _(t);
2216
+ t.labelStyle = n;
2217
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
2218
+ {
2219
+ x: -3 * l / 6,
2220
+ y: 0
2221
+ },
2222
+ {
2223
+ x: u,
2224
+ y: 0
2225
+ },
2226
+ {
2227
+ x: u + 3 * l / 6,
2228
+ y: -l
2229
+ },
2230
+ {
2231
+ x: 0,
2232
+ y: -l
2233
+ }
2234
+ ], f, { cssStyles: p } = t;
2235
+ if (t.look === "handDrawn") {
2236
+ let e = T.svg(s), n = g(t, {}), r = R(d), i = e.path(r, n);
2237
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2238
+ } else f = J(s, u, l, d);
2239
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
2240
+ return K.polygon(t, d, e);
2241
+ }, s;
2242
+ }
2243
+ n(ht, "lean_right");
2244
+ function gt(t, n) {
2245
+ let { labelStyles: r, nodeStyles: i } = _(n);
2246
+ n.label = "", n.labelStyle = r;
2247
+ let a = t.insert("g").attr("class", L(n)).attr("id", n.domId ?? n.id), { cssStyles: o } = n, s = Math.max(35, n?.width ?? 0), c = Math.max(35, n?.height ?? 0), l = [
2248
+ {
2249
+ x: s,
2250
+ y: 0
2251
+ },
2252
+ {
2253
+ x: 0,
2254
+ y: c + 7 / 2
2255
+ },
2256
+ {
2257
+ x: s - 14,
2258
+ y: c + 7 / 2
2259
+ },
2260
+ {
2261
+ x: 0,
2262
+ y: 2 * c
2263
+ },
2264
+ {
2265
+ x: s,
2266
+ y: c - 7 / 2
2267
+ },
2268
+ {
2269
+ x: 14,
2270
+ y: c - 7 / 2
2271
+ }
2272
+ ], u = T.svg(a), d = g(n, {});
2273
+ n.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
2274
+ let f = R(l), p = u.path(f, d), m = a.insert(() => p, ":first-child");
2275
+ return m.attr("class", "outer-path"), o && n.look !== "handDrawn" && m.selectAll("path").attr("style", o), i && n.look !== "handDrawn" && m.selectAll("path").attr("style", i), m.attr("transform", `translate(-${s / 2},${-c})`), I(n, m), n.intersect = function(t) {
2276
+ return e.info("lightningBolt intersect", n, t), K.polygon(n, l, t);
2277
+ }, a;
2278
+ }
2279
+ n(gt, "lightningBolt");
2280
+ var _t = /* @__PURE__ */ n((e, t, n, r, i, a, o) => [
2281
+ `M${e},${t + a}`,
2282
+ `a${i},${a} 0,0,0 ${n},0`,
2283
+ `a${i},${a} 0,0,0 ${-n},0`,
2284
+ `l0,${r}`,
2285
+ `a${i},${a} 0,0,0 ${n},0`,
2286
+ `l0,${-r}`,
2287
+ `M${e},${t + a + o}`,
2288
+ `a${i},${a} 0,0,0 ${n},0`
2289
+ ].join(" "), "createCylinderPathD"), vt = /* @__PURE__ */ n((e, t, n, r, i, a, o) => [
2290
+ `M${e},${t + a}`,
2291
+ `M${e + n},${t + a}`,
2292
+ `a${i},${a} 0,0,0 ${-n},0`,
2293
+ `l0,${r}`,
2294
+ `a${i},${a} 0,0,0 ${n},0`,
2295
+ `l0,${-r}`,
2296
+ `M${e},${t + a + o}`,
2297
+ `a${i},${a} 0,0,0 ${n},0`
2298
+ ].join(" "), "createOuterCylinderPathD"), yt = /* @__PURE__ */ n((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), bt = 10, xt = 10;
2299
+ async function St(e, t) {
2300
+ let { labelStyles: n, nodeStyles: r } = _(t);
2301
+ t.labelStyle = n;
2302
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 24 : i;
2303
+ if (t.width || t.height) {
2304
+ let e = t.width ?? 0;
2305
+ t.width = (t.width ?? 0) - a, t.width < xt && (t.width = xt);
2306
+ let n = e / 2 / (2.5 + e / 50);
2307
+ t.height = (t.height ?? 0) - o - n * 3, t.height < bt && (t.height = bt);
2308
+ }
2309
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = (t?.width ? t?.width : c.width) + a * 2, d = u / 2, f = d / (2.5 + u / 50), m = (t?.height ? t?.height : c.height) + f + o * 2, h = m * .1, v, { cssStyles: y } = t;
2310
+ if (t.look === "handDrawn") {
2311
+ let e = T.svg(s), n = vt(0, 0, u, m, d, f, h), r = yt(0, f, u, m, d, f), i = g(t, {}), a = e.path(n, i), o = e.path(r, i);
2312
+ s.insert(() => o, ":first-child").attr("class", "line"), v = s.insert(() => a, ":first-child"), v.attr("class", "basic label-container"), y && v.attr("style", y);
2313
+ } else {
2314
+ let e = _t(0, 0, u, m, d, f, h);
2315
+ v = s.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", p(y)).attr("style", r);
2316
+ }
2317
+ return v.attr("label-offset-y", f), v.attr("transform", `translate(${-u / 2}, ${-(m / 2 + f)})`), I(t, v), l.attr("transform", `translate(${-(c.width / 2) - (c.x - (c.left ?? 0))}, ${-(c.height / 2) + f - (c.y - (c.top ?? 0))})`), t.intersect = function(e) {
2318
+ let n = K.rect(t, e), r = n.x - (t.x ?? 0);
2319
+ if (d != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - f)) {
2320
+ let i = f * f * (1 - r * r / (d * d));
2321
+ i > 0 && (i = Math.sqrt(i)), i = f - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
2322
+ }
2323
+ return n;
2324
+ }, s;
2325
+ }
2326
+ n(St, "linedCylinder");
2327
+ async function Ct(e, t) {
2328
+ let { labelStyles: n, nodeStyles: r } = _(t);
2329
+ t.labelStyle = n;
2330
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2331
+ (t.width || t.height) && (t.width = (t.width ?? 0) * 10 / 11 - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
2332
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = (t?.width ? t?.width : c.width) + (a ?? 0) * 2, d = (t?.height ? t?.height : c.height) + (o ?? 0) * 2, f = t.look === "neo" ? d / 4 : d / 8, p = d + f, { cssStyles: m } = t, h = T.svg(s), v = g(t, {});
2333
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
2334
+ let y = [
2335
+ {
2336
+ x: -u / 2 - u / 2 * .1,
2337
+ y: -p / 2
2338
+ },
2339
+ {
2340
+ x: -u / 2 - u / 2 * .1,
2341
+ y: p / 2
2342
+ },
2343
+ ...z(-u / 2 - u / 2 * .1, p / 2, u / 2 + u / 2 * .1, p / 2, f, .8),
2344
+ {
2345
+ x: u / 2 + u / 2 * .1,
2346
+ y: -p / 2
2347
+ },
2348
+ {
2349
+ x: -u / 2 - u / 2 * .1,
2350
+ y: -p / 2
2351
+ },
2352
+ {
2353
+ x: -u / 2,
2354
+ y: -p / 2
2355
+ },
2356
+ {
2357
+ x: -u / 2,
2358
+ y: p / 2 * 1.1
2359
+ },
2360
+ {
2361
+ x: -u / 2,
2362
+ y: -p / 2
2363
+ }
2364
+ ], b = h.polygon(y.map((e) => [e.x, e.y]), v), x = s.insert(() => b, ":first-child");
2365
+ return x.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && x.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(0,${-f / 2})`), l.attr("transform", `translate(${-u / 2 + (t.padding ?? 0) + u / 2 * .1 / 2 - (c.x - (c.left ?? 0))},${-d / 2 + (t.padding ?? 0) - f - (c.y - (c.top ?? 0))})`), I(t, x), t.intersect = function(e) {
2366
+ return K.polygon(t, y, e);
2367
+ }, s;
2368
+ }
2369
+ n(Ct, "linedWaveEdgedRect");
2370
+ var wt = 56, Tt = 72, Et = 8, Dt = 2, Ot = 8, kt = {
2371
+ normal: "usecase-actor-shape usecase-actor-normal",
2372
+ hollow: "usecase-actor-hollow",
2373
+ awesome: "usecase-actor-awesome",
2374
+ icon: "usecase-actor-icon"
2375
+ }, At = Math.PI / 3, jt = .6, Mt = /* @__PURE__ */ n((e, t) => {
2376
+ let n = t * jt, r = t * Math.sqrt(1 - jt ** 2), i = Math.cos(At), a = -Math.sin(At), o = n * -a, s = e + n * i, c = r * i, l = r * a;
2377
+ return `M ${o - c} ${s - l} L ${o + c} ${s + l}`;
2378
+ }, "businessMarkerPathForCircle"), Nt = {
2379
+ normal: Mt(-24, 12),
2380
+ hollow: Mt(-23, 9),
2381
+ awesome: Mt(-21, 13),
2382
+ icon: "M 12 -8 L 26 -26"
2383
+ }, Pt = /* @__PURE__ */ n((e, t, n) => {
2384
+ let r = (t.x ?? 0) - (t.left ?? 0), i = (t.y ?? 0) - (t.top ?? 0);
2385
+ e.attr("transform", `translate(${-t.width / 2 - r},${n - t.height / 2 - i})`);
2386
+ }, "positionLabel"), Ft = /* @__PURE__ */ n((e, t, n, r, i = !1) => {
2387
+ if (t.look === "handDrawn") {
2388
+ let a = T.svg(e).path(n, g(t, i ? { fill: "none" } : {}));
2389
+ return e.insert(() => a, ":first-child").attr("class", r);
2390
+ }
2391
+ let a = e.append("path").attr("class", r).attr("d", n);
2392
+ return i && a.attr("fill", "none"), a;
2393
+ }, "appendActorPath"), It = /* @__PURE__ */ n((e, t, n, r, i, a, o = !1) => {
2394
+ if (t.look === "handDrawn") {
2395
+ let s = T.svg(e).circle(n, r, i * 2, g(t, o ? { fill: "none" } : {}));
2396
+ return e.insert(() => s, ":first-child").attr("class", a);
2397
+ }
2398
+ let s = e.append("circle").attr("class", a).attr("cx", n).attr("cy", r).attr("r", i);
2399
+ return o && s.attr("fill", "none"), s;
2400
+ }, "appendActorCircle"), Lt = /* @__PURE__ */ n((e, t, n) => {
2401
+ t.business && e.append("path").attr("class", "usecase-business-marker usecase-actor-business-marker").attr("d", Nt[n]).attr("fill", "none").attr("style", "stroke: inherit !important; stroke-width: inherit !important");
2402
+ }, "appendBusinessActorMarker");
2403
+ async function Rt(e, t, n, r) {
2404
+ let { labelStyles: i, nodeStyles: o } = _(t);
2405
+ t.labelStyle = i;
2406
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, n === "icon" || t.stereotype !== void 0 ? {
2407
+ ...t,
2408
+ icon: n === "icon" ? void 0 : t.icon,
2409
+ stereotype: void 0
2410
+ } : t, L(t, `usecase-actor-variant usecase-actor-${n}`)), u = t.accessibleName ?? t.label;
2411
+ u && s.attr("role", "img").attr("aria-label", u), l.attr("class", "label actor-label usecase-actor-label");
2412
+ let { theme: d, themeVariables: f } = a();
2413
+ w(s, t.colorIndex, d, f.borderColorArray);
2414
+ let p, m;
2415
+ if (t.stereotype) {
2416
+ let e = await F(s, `\xAB${t.stereotype}\xBB`, {
2417
+ labelStyle: i,
2418
+ useHtmlLabels: t.useHtmlLabels,
2419
+ padding: 0,
2420
+ centerLabel: !0,
2421
+ width: t.wrappingWidth
2422
+ });
2423
+ p = e.label.attr("class", "label usecase-stereotype"), m = e.bbox;
2424
+ }
2425
+ let h = s.append("g").attr("class", `usecase-actor-glyph ${kt[n]}`).attr("style", o || null);
2426
+ await r(h, t), Lt(h, t, n);
2427
+ let g = t.padding ?? Ot, v = m?.height ?? 0, y = Tt + Et + c.height + (m ? v + Dt : 0), b = Math.max(wt, c.width, m?.width ?? 0) + g * 2, x = y + g * 2, S = -y / 2;
2428
+ h.attr("transform", `translate(0,${S + Tt / 2})`);
2429
+ let C = S + Tt + Et;
2430
+ return p && m && (C += v / 2, Pt(p, m, C), C += v / 2 + Dt), Pt(l, c, C + c.height / 2), I(t, s.insert("rect", ":first-child").attr("class", "usecase-actor-outline").attr("x", -b / 2).attr("y", -x / 2).attr("width", b).attr("height", x).attr("opacity", 0).attr("aria-hidden", "true")), t.intersect = (e) => K.rect(t, e), s;
2431
+ }
2432
+ n(Rt, "renderUsecaseActor");
2433
+ var zt = [
2434
+ "M 0 -12",
2435
+ "C 6.627 -12 12 -17.373 12 -24",
2436
+ "C 12 -30.627 6.627 -36 0 -36",
2437
+ "C -6.627 -36 -12 -30.627 -12 -24",
2438
+ "C -12 -17.373 -6.627 -12 0 -12 Z",
2439
+ "M 0 -12 V 8",
2440
+ "M -17 -5 H 17",
2441
+ "M 0 8 L -15 28",
2442
+ "M 0 8 L 15 28"
2443
+ ].join(" ");
2444
+ async function Bt(e, t) {
2445
+ return Rt(e, t, "normal", (e, t) => {
2446
+ Ft(e, t, zt, "usecase-actor-stick");
2447
+ });
2448
+ }
2449
+ n(Bt, "usecaseActor");
2450
+ var Vt = [
2451
+ "M 0 -34",
2452
+ "C 7.18 -34 13 -28.18 13 -21",
2453
+ "C 13 -13.82 7.18 -8 0 -8",
2454
+ "C -7.18 -8 -13 -13.82 -13 -21",
2455
+ "C -13 -28.18 -7.18 -34 0 -34 Z",
2456
+ "M -24 25",
2457
+ "C -24 7 -14 -3 0 -3",
2458
+ "C 14 -3 24 7 24 25",
2459
+ "C 24 28 21 30 18 30",
2460
+ "H -18",
2461
+ "C -21 30 -24 28 -24 25 Z"
2462
+ ].join(" ");
2463
+ async function Ht(e, t) {
2464
+ return Rt(e, t, "awesome", (e, t) => {
2465
+ Ft(e, t, Vt, "usecase-actor-awesome-silhouette");
2466
+ });
2467
+ }
2468
+ n(Ht, "usecaseActorAwesome");
2469
+ var Ut = [
2470
+ "M -22 -10",
2471
+ "H 22",
2472
+ "V 0",
2473
+ "H 6",
2474
+ "L 22 17",
2475
+ "L 13 28",
2476
+ "L 0 13",
2477
+ "L -13 28",
2478
+ "L -22 17",
2479
+ "L -6 0",
2480
+ "H -22",
2481
+ "Z"
2482
+ ].join(" ");
2483
+ async function Wt(e, t) {
2484
+ return Rt(e, t, "hollow", (e, t) => {
2485
+ It(e, t, 0, -23, 9, "usecase-actor-hollow-head", !0), Ft(e, t, Ut, "usecase-actor-hollow-body", !0);
2486
+ });
2487
+ }
2488
+ n(Wt, "usecaseActorHollow");
2489
+ var Gt = 52, Kt = 42, qt = -2, Jt = /* @__PURE__ */ n(async (e, t) => {
2490
+ let n = -Gt / 2, r = qt - Gt / 2;
2491
+ if (t.look === "handDrawn") {
2492
+ let i = T.svg(e).rectangle(n, r, Gt, Gt, g(t, {}));
2493
+ e.insert(() => i, ":first-child").attr("class", "usecase-actor-icon-frame");
2494
+ } else e.append("rect").attr("class", "usecase-actor-icon-frame").attr("x", n).attr("y", r).attr("width", Gt).attr("height", Gt).attr("rx", 4).attr("ry", 4);
2495
+ let i = t.icon ?? "", a = await b(i.includes(":") ? i : `fa:${i}`), o = await x(i, {
2496
+ height: Kt,
2497
+ width: Kt,
2498
+ fallbackPrefix: "fa"
2499
+ }), s = e.append("g").attr("class", `usecase-actor-icon-symbol${a ? "" : " usecase-actor-icon-fallback"}`).attr("aria-hidden", "true").html(`<g>${o}</g>`), c = s.node()?.getBBox();
2500
+ c && s.attr("transform", `translate(${-c.width / 2 - c.x},${qt - c.height / 2 - c.y})`);
2501
+ }, "drawIconActor");
2502
+ async function Yt(e, t) {
2503
+ return Rt(e, t, "icon", Jt);
2504
+ }
2505
+ n(Yt, "usecaseActorIcon");
2506
+ var Xt = /* @__PURE__ */ n((e, t, n) => {
2507
+ let r = (t.x ?? 0) - (t.left ?? 0), i = (t.y ?? 0) - (t.top ?? 0);
2508
+ e.attr("transform", `translate(${-t.width / 2 - r},${n - t.height / 2 - i})`);
2509
+ }, "positionLabel");
2510
+ async function Zt(e, t) {
2511
+ let n = t, { labelStyles: r, nodeStyles: i } = _(t);
2512
+ t.labelStyle = r;
2513
+ let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await P(e, n.stereotype ? {
2514
+ ...t,
2515
+ stereotype: void 0
2516
+ } : t, L(t, "usecase-business-shape"));
2517
+ l.attr("class", "label usecase-label");
2518
+ let { theme: u, themeVariables: d } = a();
2519
+ w(o, t.colorIndex, u, d.borderColorArray);
2520
+ let f, p;
2521
+ if (n.stereotype) {
2522
+ let e = await F(o, `\xAB${n.stereotype}\xBB`, {
2523
+ labelStyle: r,
2524
+ useHtmlLabels: t.useHtmlLabels,
2525
+ padding: 0,
2526
+ centerLabel: !0,
2527
+ width: t.wrappingWidth
2528
+ });
2529
+ f = e.label.attr("class", "label usecase-stereotype"), p = e.bbox;
2530
+ }
2531
+ let m = p ? 2 : 0, h = s.height + (p?.height ?? 0) + m, v = Math.max(s.width, p?.width ?? 0), y = c ?? 10, b = v / 2 + y * 2, x = h / 2 + y * 2, S = Math.min(Math.max(y / 5, 1), y / 2), C = v / 2 + S, E = b - S, D = C / b, O = E / b, k = x * Math.sqrt(Math.max(0, 1 - D * D)), A = -x * Math.sqrt(Math.max(0, 1 - O * O));
2532
+ f && p && Xt(f, p, -h / 2 + p.height / 2), Xt(l, s, h / 2 - s.height / 2);
2533
+ let j;
2534
+ if (t.look === "handDrawn") {
2535
+ let e = T.svg(o).ellipse(0, 0, b * 2, x * 2, g(t, {}));
2536
+ j = o.insert(() => e, ":first-child").attr("class", "basic label-container usecase-business-ellipse");
2537
+ } else j = o.insert("ellipse", ":first-child").attr("class", "basic label-container usecase-business-ellipse").attr("style", i).attr("rx", b).attr("ry", x).attr("cx", 0).attr("cy", 0);
2538
+ o.append("path").attr("class", "usecase-business-marker").attr("d", `M ${C} ${k} L ${E} ${A}`).attr("fill", "none").attr("style", i || null);
2539
+ let M = n.accessibleName ?? n.label;
2540
+ return M && o.attr("role", "img").attr("aria-label", M), I(t, j), t.calcIntersect = (e, t) => K.ellipse(e, e.width / 2, e.height / 2, t), t.intersect = (e) => K.ellipse(t, b, x, e), o;
2541
+ }
2542
+ n(Zt, "usecaseBusiness");
2543
+ var Qt = 8, $t = 4, en = 1, tn = /* @__PURE__ */ n((e, t, n, r) => {
2544
+ let i = (t.x ?? 0) - (t.left ?? 0), a = (t.y ?? 0) - (t.top ?? 0);
2545
+ e.attr("transform", `translate(${n - t.width / 2 - i},${r - t.height / 2 - a})`);
2546
+ }, "positionLabel"), nn = /* @__PURE__ */ n((e) => {
2547
+ let t = Number.parseFloat(e ?? "");
2548
+ return Number.isFinite(t) && t >= 0 ? t : en;
2549
+ }, "numericStrokeWidth");
2550
+ async function rn(e, t) {
2551
+ let r = t, { labelStyles: i, nodeStyles: a } = _(t), { stylesMap: o } = y(t);
2552
+ t.labelStyle = i;
2553
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t, "usecase-json-table"));
2554
+ s.attr("role", "img"), r.accessibleName && s.attr("aria-label", r.accessibleName), l.attr("class", "label usecase-json-title");
2555
+ let u = s.append("g").attr("class", "usecase-json-table-grid"), d = [];
2556
+ for (let e of r.jsonRows ?? []) {
2557
+ let n = await F(u, e.key, {
2558
+ labelStyle: i,
2559
+ useHtmlLabels: t.useHtmlLabels,
2560
+ padding: 0,
2561
+ centerLabel: !0
2562
+ }), r = await F(u, e.value, {
2563
+ labelStyle: i,
2564
+ useHtmlLabels: t.useHtmlLabels,
2565
+ padding: 0,
2566
+ centerLabel: !0
2567
+ });
2568
+ d.push({
2569
+ key: {
2570
+ label: n.label.attr("class", "label usecase-json-key"),
2571
+ bbox: n.bbox
2572
+ },
2573
+ value: {
2574
+ label: r.label.attr("class", "label usecase-json-value"),
2575
+ bbox: r.bbox
2576
+ }
2577
+ });
2578
+ }
2579
+ let f = Math.max(0, ...d.map(({ key: e }) => e.bbox.width)) + Qt * 2, p = Math.max(0, ...d.map(({ value: e }) => e.bbox.width)) + Qt * 2, m = c.width + Qt * 2, h = Math.max(m, f + p), v = p + Math.max(0, h - f - p), b = c.height + $t * 2, x = d.map(({ key: e, value: t }) => Math.max(e.bbox.height, t.bbox.height) + $t * 2), S = b + x.reduce((e, t) => e + t, 0), C = nn(o.get("stroke-width")), w = h + C * 2, E = S + C * 2, D = -h / 2, O = -S / 2, k = t.look === "handDrawn" ? T.svg(s) : void 0, A = k ? g(t, {}) : void 0, j = /* @__PURE__ */ n((e, t, n, r, i, o) => {
2580
+ if (k && A) {
2581
+ let a = k.rectangle(n, r, i, o, A);
2582
+ return e.insert(() => a, ":first-child").attr("class", t);
2583
+ }
2584
+ return e.insert("rect", ":first-child").attr("class", t).attr("x", n).attr("y", r).attr("width", i).attr("height", o).attr("style", a);
2585
+ }, "insertCell"), M = j(s, "label-container usecase-json-border", -w / 2, -E / 2, w, E);
2586
+ j(u, "usecase-json-cell usecase-json-title-cell", D, O, h, b), u.node()?.append(l.node()), tn(l, c, 0, O + b / 2);
2587
+ let N = O + b;
2588
+ return d.forEach(({ key: e, value: t }, n) => {
2589
+ let r = x[n], i = u.append("g").attr("class", "usecase-json-row").attr("data-row-index", n).attr("transform", `translate(0,${N})`);
2590
+ j(i, "usecase-json-cell usecase-json-key-cell", D, 0, f, r), j(i, "usecase-json-cell usecase-json-value-cell", D + f, 0, v, r), i.node()?.append(e.label.node(), t.label.node()), tn(e.label, e.bbox, D + f / 2, r / 2), tn(t.label, t.bbox, D + f + v / 2, r / 2), N += r;
2591
+ }), I(t, M), t.intersect = (e) => K.rect(t, e), s;
2592
+ }
2593
+ n(rn, "usecaseJsonTable");
2594
+ async function an(e, t) {
2595
+ let { labelStyles: n, nodeStyles: r } = _(t);
2596
+ t.labelStyle = n;
2597
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = t.look === "neo" ? 10 : 5;
2598
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2 - 2 * s, 10), t.height = Math.max((t?.height ?? 0) - o * 2 - 2 * s, 10));
2599
+ let { shapeSvg: c, bbox: l, label: u } = await P(e, t, L(t)), d = (t?.width ? t?.width : l.width) + a * 2 + 2 * s, f = (t?.height ? t?.height : l.height) + o * 2 + 2 * s, p = d - 2 * s, m = f - 2 * s, h = -p / 2, v = -m / 2, { cssStyles: y } = t, b = T.svg(c), x = g(t, {}), S = [
2600
+ {
2601
+ x: h - s,
2602
+ y: v + s
2603
+ },
2604
+ {
2605
+ x: h - s,
2606
+ y: v + m + s
2607
+ },
2608
+ {
2609
+ x: h + p - s,
2610
+ y: v + m + s
2611
+ },
2612
+ {
2613
+ x: h + p - s,
2614
+ y: v + m
2615
+ },
2616
+ {
2617
+ x: h + p,
2618
+ y: v + m
2619
+ },
2620
+ {
2621
+ x: h + p,
2622
+ y: v + m - s
2623
+ },
2624
+ {
2625
+ x: h + p + s,
2626
+ y: v + m - s
2627
+ },
2628
+ {
2629
+ x: h + p + s,
2630
+ y: v - s
2631
+ },
2632
+ {
2633
+ x: h + s,
2634
+ y: v - s
2635
+ },
2636
+ {
2637
+ x: h + s,
2638
+ y: v
2639
+ },
2640
+ {
2641
+ x: h,
2642
+ y: v
2643
+ },
2644
+ {
2645
+ x: h,
2646
+ y: v + s
2647
+ }
2648
+ ], C = [
2649
+ {
2650
+ x: h,
2651
+ y: v + s
2652
+ },
2653
+ {
2654
+ x: h + p - s,
2655
+ y: v + s
2656
+ },
2657
+ {
2658
+ x: h + p - s,
2659
+ y: v + m
2660
+ },
2661
+ {
2662
+ x: h + p,
2663
+ y: v + m
2664
+ },
2665
+ {
2666
+ x: h + p,
2667
+ y: v
2668
+ },
2669
+ {
2670
+ x: h,
2671
+ y: v
2672
+ }
2673
+ ];
2674
+ t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2675
+ let w = R(S), E = b.path(w, x), D = R(C), O = b.path(D, x);
2676
+ t.look !== "handDrawn" && (E = ee(E), O = ee(O));
2677
+ let k = c.insert("g", ":first-child");
2678
+ return k.insert(() => E), k.insert(() => O), k.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && k.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && k.selectAll("path").attr("style", r), u.attr("transform", `translate(${-(l.width / 2) - s - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + s - (l.y - (l.top ?? 0))})`), I(t, k), t.intersect = function(e) {
2679
+ return K.polygon(t, S, e);
2680
+ }, c;
2681
+ }
2682
+ n(an, "multiRect");
2683
+ async function on(e, t) {
2684
+ let { labelStyles: n, nodeStyles: r } = _(t);
2685
+ t.labelStyle = n;
2686
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.padding ?? 0, c = t.look === "neo" ? 16 : s, l = t.look === "neo" ? 12 : s, u = !0;
2687
+ (t.width || t.height) && (u = !1, t.width = (t?.width ?? 0) - c * 2, t.height = (t?.height ?? 0) - l * 3);
2688
+ let d = Math.max(a.width, t?.width ?? 0) + c * 2, f = Math.max(a.height, t?.height ?? 0) + l * 3, p = t.look === "neo" ? f / 4 : f / 8, m = f + (u ? p / 2 : -p / 2), h = -d / 2, v = -m / 2, { cssStyles: y } = t, b = z(h - 10, v + m + 10, h + d - 10, v + m + 10, p, .8), x = b?.[b.length - 1], S = [
2689
+ {
2690
+ x: h - 10,
2691
+ y: v + 10
2692
+ },
2693
+ {
2694
+ x: h - 10,
2695
+ y: v + m + 10
2696
+ },
2697
+ ...b,
2698
+ {
2699
+ x: h + d - 10,
2700
+ y: x.y - 10
2701
+ },
2702
+ {
2703
+ x: h + d,
2704
+ y: x.y - 10
2705
+ },
2706
+ {
2707
+ x: h + d,
2708
+ y: x.y - 20
2709
+ },
2710
+ {
2711
+ x: h + d + 10,
2712
+ y: x.y - 20
2713
+ },
2714
+ {
2715
+ x: h + d + 10,
2716
+ y: v - 10
2717
+ },
2718
+ {
2719
+ x: h + 10,
2720
+ y: v - 10
2721
+ },
2722
+ {
2723
+ x: h + 10,
2724
+ y: v
2725
+ },
2726
+ {
2727
+ x: h,
2728
+ y: v
2729
+ },
2730
+ {
2731
+ x: h,
2732
+ y: v + 10
2733
+ }
2734
+ ], C = [
2735
+ {
2736
+ x: h,
2737
+ y: v + 10
2738
+ },
2739
+ {
2740
+ x: h + d - 10,
2741
+ y: v + 10
2742
+ },
2743
+ {
2744
+ x: h + d - 10,
2745
+ y: x.y - 10
2746
+ },
2747
+ {
2748
+ x: h + d,
2749
+ y: x.y - 10
2750
+ },
2751
+ {
2752
+ x: h + d,
2753
+ y: v
2754
+ },
2755
+ {
2756
+ x: h,
2757
+ y: v
2758
+ }
2759
+ ], w = T.svg(i), E = g(t, {});
2760
+ t.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid");
2761
+ let D = R(S), O = w.path(D, E), k = R(C), A = w.path(k, E), j = i.insert(() => O, ":first-child");
2762
+ return j.insert(() => A), j.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && j.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && j.selectAll("path").attr("style", r), j.attr("transform", `translate(0,${-p / 2})`), o.attr("transform", `translate(${-(a.width / 2) - 10 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 10 - p - (a.y - (a.top ?? 0))})`), I(t, j), t.intersect = function(e) {
2763
+ return K.polygon(t, S, e);
2764
+ }, i;
2765
+ }
2766
+ n(on, "multiWaveEdgedRectangle");
2767
+ async function sn(e, t, { config: { themeVariables: n } }) {
2768
+ let { labelStyles: r, nodeStyles: i } = _(t);
2769
+ t.labelStyle = r, t.useHtmlLabels || l(u()) || (t.centerLabel = !0);
2770
+ let { shapeSvg: a, bbox: o, label: s } = await P(e, t, L(t)), c = Math.max(o.width + (t.padding ?? 0) * 2, t?.width ?? 0), d = Math.max(o.height + (t.padding ?? 0) * 2, t?.height ?? 0), f = -c / 2, p = -d / 2, { cssStyles: m } = t, h = T.svg(a), v = g(t, {
2771
+ fill: n.noteBkgColor,
2772
+ stroke: n.noteBorderColor
2773
+ });
2774
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
2775
+ let y = h.rectangle(f, p, c, d, v), b = a.insert(() => y, ":first-child");
2776
+ return b.attr("class", "basic label-container outer-path"), s.attr("class", "label noteLabel"), m && t.look !== "handDrawn" && b.selectAll("path").attr("style", m), i && t.look !== "handDrawn" && b.selectAll("path").attr("style", i), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), I(t, b), t.intersect = function(e) {
2777
+ return K.rect(t, e);
2778
+ }, a;
2779
+ }
2780
+ n(sn, "note");
2781
+ var cn = /* @__PURE__ */ n((e, t, n) => [
2782
+ `M${e + n / 2},${t}`,
2783
+ `L${e + n},${t - n / 2}`,
2784
+ `L${e + n / 2},${t - n}`,
2785
+ `L${e},${t - n / 2}`,
2786
+ "Z"
2787
+ ].join(" "), "createDecisionBoxPathD");
2788
+ async function ln(e, t) {
2789
+ let { labelStyles: n, nodeStyles: r } = _(t);
2790
+ t.labelStyle = n;
2791
+ let { shapeSvg: i, bbox: a } = await P(e, t, L(t)), o = a.width + (t.padding ?? 0) + (a.height + (t.padding ?? 0)), s = .5, c = [
2792
+ {
2793
+ x: o / 2,
2794
+ y: 0
2795
+ },
2796
+ {
2797
+ x: o,
2798
+ y: -o / 2
2799
+ },
2800
+ {
2801
+ x: o / 2,
2802
+ y: -o
2803
+ },
2804
+ {
2805
+ x: 0,
2806
+ y: -o / 2
2807
+ }
2808
+ ], l, { cssStyles: u } = t;
2809
+ if (t.look === "handDrawn") {
2810
+ let e = T.svg(i), n = g(t, {}), r = cn(0, 0, o), a = e.path(r, n);
2811
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2 + s}, ${o / 2})`), u && l.attr("style", u);
2812
+ } else l = J(i, o, o, c), l.attr("transform", `translate(${-o / 2 + s}, ${o / 2})`);
2813
+ return r && l.attr("style", r), I(t, l), t.calcIntersect = function(e, t) {
2814
+ let n = e.width, r = [
2815
+ {
2816
+ x: n / 2,
2817
+ y: 0
2818
+ },
2819
+ {
2820
+ x: n,
2821
+ y: -n / 2
2822
+ },
2823
+ {
2824
+ x: n / 2,
2825
+ y: -n
2826
+ },
2827
+ {
2828
+ x: 0,
2829
+ y: -n / 2
2830
+ }
2831
+ ];
2832
+ return K.polygon(e, r, t);
2833
+ }, t.intersect = function(e) {
2834
+ return this.calcIntersect(t, e);
2835
+ }, i;
2836
+ }
2837
+ n(ln, "question");
2838
+ async function un(e, t) {
2839
+ let { labelStyles: n, nodeStyles: r } = _(t);
2840
+ t.labelStyle = n;
2841
+ let i = t.padding ?? 0, a = t.look === "neo" ? 21 : i ?? 0, o = t.look === "neo" ? 12 : i ?? 0, { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = c.width + (t.look === "neo" ? a * 2 : a), d = Math.max(c.height + (t.look === "neo" ? o * 2 : o), t.height ?? 0), f = d / 4, p = -Math.max(u, (t.width ?? 0) - f) / 2, m = -d / 2, h = m / 2, v = [
2842
+ {
2843
+ x: p + h,
2844
+ y: m
2845
+ },
2846
+ {
2847
+ x: p,
2848
+ y: 0
2849
+ },
2850
+ {
2851
+ x: p + h,
2852
+ y: -m
2853
+ },
2854
+ {
2855
+ x: -p,
2856
+ y: -m
2857
+ },
2858
+ {
2859
+ x: -p,
2860
+ y: m
2861
+ }
2862
+ ], { cssStyles: y } = t, b = T.svg(s), x = g(t, {});
2863
+ t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2864
+ let S = R(v), C = b.path(S, x), w = s.insert(() => C, ":first-child");
2865
+ return w.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && w.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), w.attr("transform", `translate(${-h / 2},0)`), l.attr("transform", `translate(${-h / 2 - c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), I(t, w), t.intersect = function(e) {
2866
+ return K.polygon(t, v, e);
2867
+ }, s;
2868
+ }
2869
+ n(un, "rect_left_inv_arrow");
2870
+ async function dn(n, r) {
2871
+ let { labelStyles: i, nodeStyles: o } = _(r);
2872
+ r.labelStyle = i;
2873
+ let s;
2874
+ s = r.cssClasses ? "node " + r.cssClasses : "node default";
2875
+ let c = n.insert("g").attr("class", s).attr("id", r.domId || r.id), u = c.insert("g"), d = c.insert("g").attr("class", "label").attr("style", o), f = r.description, p = r.label, m = await se(d, p, r.labelStyle, !0, !0), h = {
2876
+ width: 0,
2877
+ height: 0
2878
+ };
2879
+ if (l(a())) {
2880
+ let e = m.children[0], n = t(m);
2881
+ h = e.getBoundingClientRect(), n.attr("width", h.width), n.attr("height", h.height);
2882
+ }
2883
+ e.info("Text 2", f);
2884
+ let v = f || [], y = m.getBBox(), b = await se(d, Array.isArray(v) ? v.join("<br/>") : v, r.labelStyle, !0, !0), x = b.children[0], S = t(b);
2885
+ h = x.getBoundingClientRect(), S.attr("width", h.width), S.attr("height", h.height);
2886
+ let C = (r.padding || 0) / 2;
2887
+ t(b).attr("transform", "translate( " + (h.width > y.width ? 0 : (y.width - h.width) / 2) + ", " + (y.height + C + 5) + ")"), t(m).attr("transform", "translate( " + (h.width < y.width ? 0 : -(y.width - h.width) / 2) + ", 0)"), h = d.node().getBBox(), d.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - C + 3) + ")");
2888
+ let w = h.width + (r.padding || 0), E = h.height + (r.padding || 0), D = -h.width / 2 - C, O = -h.height / 2 - C, k, A;
2889
+ if (r.look === "handDrawn") {
2890
+ let t = T.svg(c), n = g(r, {}), i = t.path(q(D, O, w, E, r.rx || 0), n), a = t.line(-h.width / 2 - C, -h.height / 2 - C + y.height + C, h.width / 2 + C, -h.height / 2 - C + y.height + C, n);
2891
+ A = c.insert(() => (e.debug("Rough node insert CXC", i), a), ":first-child"), k = c.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child");
2892
+ } else k = u.insert("rect", ":first-child"), A = u.insert("line"), k.attr("class", "outer title-state").attr("style", o).attr("x", -h.width / 2 - C).attr("y", -h.height / 2 - C).attr("width", h.width + (r.padding || 0)).attr("height", h.height + (r.padding || 0)), A.attr("class", "divider").attr("x1", -h.width / 2 - C).attr("x2", h.width / 2 + C).attr("y1", -h.height / 2 - C + y.height + C).attr("y2", -h.height / 2 - C + y.height + C);
2893
+ return I(r, k), r.intersect = function(e) {
2894
+ return K.rect(r, e);
2895
+ }, c;
2896
+ }
2897
+ n(dn, "rectWithTitle");
2898
+ async function fn(e, t, { config: { themeVariables: n } }) {
2899
+ let r = n?.radius ?? 5;
2900
+ return Ke(e, t, {
2901
+ rx: r,
2902
+ ry: r,
2903
+ classes: "",
2904
+ labelPaddingX: (t?.padding ?? 0) * 1,
2905
+ labelPaddingY: (t?.padding ?? 0) * 1
2906
+ });
2907
+ }
2908
+ n(fn, "roundedRect");
2909
+ var pn = 8;
2910
+ async function mn(e, t) {
2911
+ let { labelStyles: n, nodeStyles: r } = _(t);
2912
+ t.labelStyle = n;
2913
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = (t?.width ?? s.width) + i * 2 + (t.look === "neo" ? pn : pn * 2), u = (t?.height ?? s.height) + a * 2, d = l - pn, f = u, m = pn - l / 2, h = -u / 2, { cssStyles: v } = t, y = T.svg(o), b = g(t, {});
2914
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2915
+ let x = [
2916
+ {
2917
+ x: m,
2918
+ y: h
2919
+ },
2920
+ {
2921
+ x: m + d,
2922
+ y: h
2923
+ },
2924
+ {
2925
+ x: m + d,
2926
+ y: h + f
2927
+ },
2928
+ {
2929
+ x: m - pn,
2930
+ y: h + f
2931
+ },
2932
+ {
2933
+ x: m - pn,
2934
+ y: h
2935
+ },
2936
+ {
2937
+ x: m,
2938
+ y: h
2939
+ },
2940
+ {
2941
+ x: m,
2942
+ y: h + f
2943
+ }
2944
+ ], S = y.polygon(x.map((e) => [e.x, e.y]), b), C = o.insert(() => S, ":first-child");
2945
+ return C.attr("class", "basic label-container outer-path").attr("style", p(v)), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), v && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), c.attr("transform", `translate(${pn / 2 - s.width / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) - (s.y - (s.top ?? 0))})`), I(t, C), t.intersect = function(e) {
2946
+ return K.rect(t, e);
2947
+ }, o;
2948
+ }
2949
+ n(mn, "shadedProcess");
2950
+ async function hn(e, t) {
2951
+ let { labelStyles: n, nodeStyles: r } = _(t);
2952
+ t.labelStyle = n;
2953
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2954
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2, 10), t.height = Math.max((t?.height ?? 0) / 1.5 - o * 2, 10));
2955
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = (t?.width ? t?.width : c.width) + a * 2, d = ((t?.height ? t?.height : c.height) + o * 2) * 1.5, f = u, p = d / 1.5, m = -f / 2, h = -p / 2, { cssStyles: v } = t, y = T.svg(s), b = g(t, {});
2956
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2957
+ let x = [
2958
+ {
2959
+ x: m,
2960
+ y: h
2961
+ },
2962
+ {
2963
+ x: m,
2964
+ y: h + p
2965
+ },
2966
+ {
2967
+ x: m + f,
2968
+ y: h + p
2969
+ },
2970
+ {
2971
+ x: m + f,
2972
+ y: h - p / 2
2973
+ }
2974
+ ], S = R(x), C = y.path(S, b), w = s.insert(() => C, ":first-child");
2975
+ return w.attr("class", "basic label-container outer-path"), v && t.look !== "handDrawn" && w.selectChildren("path").attr("style", v), r && t.look !== "handDrawn" && w.selectChildren("path").attr("style", r), w.attr("transform", `translate(0, ${p / 4})`), l.attr("transform", `translate(${-f / 2 + (t.padding ?? 0) - (c.x - (c.left ?? 0))}, ${-p / 4 + (t.padding ?? 0) - (c.y - (c.top ?? 0))})`), I(t, w), t.intersect = function(e) {
2976
+ return K.polygon(t, x, e);
2977
+ }, s;
2978
+ }
2979
+ n(hn, "slopedRect");
2980
+ async function gn(e, t) {
2981
+ let n = t.padding ?? 0, r = t.look === "neo" ? 16 : n * 2, i = t.look === "neo" ? 12 : n, o = await Ke(e, t, {
2982
+ rx: 0,
2983
+ ry: 0,
2984
+ classes: "",
2985
+ labelPaddingX: t.labelPaddingX ?? r,
2986
+ labelPaddingY: i
2987
+ });
2988
+ if (t.colorIndex !== void 0) {
2989
+ let { theme: e, themeVariables: n } = a();
2990
+ w(o, t.colorIndex, e, n.borderColorArray);
2991
+ }
2992
+ return o;
2993
+ }
2994
+ n(gn, "squareRect");
2995
+ var _n = 50, vn = /* @__PURE__ */ n((e, t, n) => {
2996
+ let r = e.height + n, i = r * Math.cos(Math.PI / (2 * (_n - 1))), a = Math.sqrt(Math.max(0, i ** 2 - e.height ** 2));
2997
+ return {
2998
+ w: Math.max(e.width + r / 4 + t, 1.5 * r + (r - i), e.width + t + r - a),
2999
+ h: r
3000
+ };
3001
+ }, "stadiumDimensions");
3002
+ async function yn(e, t) {
3003
+ let { labelStyles: n, nodeStyles: r } = _(t);
3004
+ t.labelStyle = n;
3005
+ let i = t.padding ?? 0, a = t.look === "neo" ? 40 : i, o = t.look === "neo" ? 24 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), { w: l, h: u } = vn(c, a, o), d = u / 2, { cssStyles: f } = t, p = T.svg(s), m = g(t, {});
3006
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
3007
+ let h = [
3008
+ {
3009
+ x: -l / 2 + d,
3010
+ y: -u / 2
3011
+ },
3012
+ {
3013
+ x: l / 2 - d,
3014
+ y: -u / 2
3015
+ },
3016
+ ...B(-l / 2 + d, 0, d, _n, 90, 270),
3017
+ {
3018
+ x: l / 2 - d,
3019
+ y: u / 2
3020
+ },
3021
+ ...B(l / 2 - d, 0, d, _n, 270, 450)
3022
+ ], v = R(h), y = p.path(v, m), b = s.insert(() => y, ":first-child");
3023
+ return b.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && b.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && b.selectChildren("path").attr("style", r), I(t, b), t.intersect = function(e) {
3024
+ return K.polygon(t, h, e);
3025
+ }, s;
3026
+ }
3027
+ n(yn, "stadium");
3028
+ async function bn(e, t) {
3029
+ return Ke(e, t, {
3030
+ rx: t.look === "neo" ? 3 : 5,
3031
+ ry: t.look === "neo" ? 3 : 5,
3032
+ classes: "flowchart-node"
3033
+ });
3034
+ }
3035
+ n(bn, "state");
3036
+ function xn(e, t, { config: { themeVariables: n } }) {
3037
+ let { labelStyles: r, nodeStyles: i } = _(t);
3038
+ t.labelStyle = r;
3039
+ let { cssStyles: a } = t, { lineColor: o, stateBorder: s, nodeBorder: c, nodeShadow: l } = n;
3040
+ (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
3041
+ let u = e.insert("g").attr("class", "node default").attr("id", t.domId ?? t.id), d = T.svg(u), f = g(t, {});
3042
+ t.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
3043
+ let p = d.circle(0, 0, t.width, {
3044
+ ...f,
3045
+ stroke: o,
3046
+ strokeWidth: 2
3047
+ }), m = s ?? c, h = (t.width ?? 0) * 5 / 14, v = d.circle(0, 0, h, {
3048
+ ...f,
3049
+ fill: m,
3050
+ stroke: m,
3051
+ strokeWidth: 2,
3052
+ fillStyle: "solid"
3053
+ }), y = u.insert(() => p, ":first-child");
3054
+ if (y.insert(() => v), t.look !== "handDrawn" && y.attr("class", "outer-path"), a && y.selectAll("path").attr("style", a), i && y.selectAll("path").attr("style", i), t.width < 25 && l && t.look !== "handDrawn") {
3055
+ let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
3056
+ y.attr("style", `filter:url(#${n})`);
3057
+ }
3058
+ return I(t, y), t.intersect = function(e) {
3059
+ return K.circle(t, (t.width ?? 0) / 2, e);
3060
+ }, u;
3061
+ }
3062
+ n(xn, "stateEnd");
3063
+ function Sn(e, t, { config: { themeVariables: n } }) {
3064
+ let { lineColor: r, nodeShadow: i } = n;
3065
+ (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
3066
+ let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), o;
3067
+ if (t.look === "handDrawn") {
3068
+ let e = T.svg(a).circle(0, 0, t.width, v(r));
3069
+ o = a.insert(() => e), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
3070
+ } else o = a.insert("circle", ":first-child"), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
3071
+ if (t.width < 25 && i && t.look !== "handDrawn") {
3072
+ let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
3073
+ o.attr("style", `filter:url(#${n})`);
3074
+ }
3075
+ return I(t, o), t.intersect = function(e) {
3076
+ return K.circle(t, (t.width ?? 7) / 2, e);
3077
+ }, a;
3078
+ }
3079
+ n(Sn, "stateStart");
3080
+ var Cn = 8;
3081
+ async function wn(e, t) {
3082
+ let { labelStyles: n, nodeStyles: r } = _(t);
3083
+ t.labelStyle = n;
3084
+ let i = t?.padding ?? 8, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.width + 2 * Cn + a, t.width ?? 0), u = Math.max(c.height + o, t.height ?? 0), d = l - 2 * Cn, f = u, m = -l / 2, h = -u / 2, v = [
3085
+ {
3086
+ x: 0,
3087
+ y: 0
3088
+ },
3089
+ {
3090
+ x: d,
3091
+ y: 0
3092
+ },
3093
+ {
3094
+ x: d,
3095
+ y: -f
3096
+ },
3097
+ {
3098
+ x: 0,
3099
+ y: -f
3100
+ },
3101
+ {
3102
+ x: 0,
3103
+ y: 0
3104
+ },
3105
+ {
3106
+ x: -8,
3107
+ y: 0
3108
+ },
3109
+ {
3110
+ x: d + 8,
3111
+ y: 0
3112
+ },
3113
+ {
3114
+ x: d + 8,
3115
+ y: -f
3116
+ },
3117
+ {
3118
+ x: -8,
3119
+ y: -f
3120
+ },
3121
+ {
3122
+ x: -8,
3123
+ y: 0
3124
+ }
3125
+ ];
3126
+ if (t.look === "handDrawn") {
3127
+ let e = T.svg(s), n = g(t, {}), r = e.rectangle(m, h, d + 16, f, n), i = e.line(m + Cn, h, m + Cn, h + f, n), a = e.line(m + Cn + d, h, m + Cn + d, h + f, n);
3128
+ s.insert(() => i, ":first-child"), s.insert(() => a, ":first-child");
3129
+ let o = s.insert(() => r, ":first-child"), { cssStyles: c } = t;
3130
+ o.attr("class", "basic label-container").attr("style", p(c)), I(t, o);
3131
+ } else {
3132
+ let e = J(s, d, f, v);
3133
+ r && e.attr("style", r), I(t, e);
3134
+ }
3135
+ return t.intersect = function(e) {
3136
+ return K.polygon(t, v, e);
3137
+ }, s;
3138
+ }
3139
+ n(wn, "subroutine");
3140
+ var Tn = .2;
3141
+ async function En(e, t) {
3142
+ let { labelStyles: n, nodeStyles: r } = _(t);
3143
+ t.labelStyle = n;
3144
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
3145
+ (t.width || t.height) && (t.height = Math.max((t?.height ?? 0) - o * 2, 10), t.width = Math.max((t?.width ?? 0) - a * 2 - Tn * (t.height + o * 2), 10));
3146
+ let { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.height ? t?.height : c.height) + o * 2, u = Tn * l, d = Tn * l, f = (t?.width ? t?.width : c.width) + a * 2 + u - u, p = l, m = -f / 2, h = -p / 2, { cssStyles: v } = t, y = T.svg(s), b = g(t, {}), x = [
3147
+ {
3148
+ x: m - u / 2,
3149
+ y: h
3150
+ },
3151
+ {
3152
+ x: m + f + u / 2,
3153
+ y: h
3154
+ },
3155
+ {
3156
+ x: m + f + u / 2,
3157
+ y: h + p
3158
+ },
3159
+ {
3160
+ x: m - u / 2,
3161
+ y: h + p
3162
+ }
3163
+ ], S = [
3164
+ {
3165
+ x: m + f - u / 2,
3166
+ y: h + p
3167
+ },
3168
+ {
3169
+ x: m + f + u / 2,
3170
+ y: h + p
3171
+ },
3172
+ {
3173
+ x: m + f + u / 2,
3174
+ y: h + p - d
3175
+ }
3176
+ ];
3177
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
3178
+ let C = R(x), w = y.path(C, b), E = R(S), D = y.path(E, {
3179
+ ...b,
3180
+ fillStyle: "solid"
3181
+ }), O = s.insert(() => D, ":first-child");
3182
+ return O.insert(() => w, ":first-child"), O.attr("class", "basic label-container outer-path"), v && t.look !== "handDrawn" && O.selectAll("path").attr("style", v), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), I(t, O), t.intersect = function(e) {
3183
+ return K.polygon(t, x, e);
3184
+ }, s;
3185
+ }
3186
+ n(En, "taggedRect");
3187
+ async function Dn(e, t) {
3188
+ let { labelStyles: n, nodeStyles: r } = _(t);
3189
+ t.labelStyle = n;
3190
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 8, u = .2 * s, d = .2 * c, f = c + l, { cssStyles: p } = t, m = T.svg(i), h = g(t, {});
3191
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
3192
+ let v = [
3193
+ {
3194
+ x: -s / 2 - s / 2 * .1,
3195
+ y: f / 2
3196
+ },
3197
+ ...z(-s / 2 - s / 2 * .1, f / 2, s / 2 + s / 2 * .1, f / 2, l, .8),
3198
+ {
3199
+ x: s / 2 + s / 2 * .1,
3200
+ y: -f / 2
3201
+ },
3202
+ {
3203
+ x: -s / 2 - s / 2 * .1,
3204
+ y: -f / 2
3205
+ }
3206
+ ], y = -s / 2 + s / 2 * .1, b = -f / 2 - d * .4, x = [
3207
+ {
3208
+ x: y + s - u,
3209
+ y: (b + c) * 1.3
3210
+ },
3211
+ {
3212
+ x: y + s,
3213
+ y: b + c - d
3214
+ },
3215
+ {
3216
+ x: y + s,
3217
+ y: (b + c) * .9
3218
+ },
3219
+ ...z(y + s, (b + c) * 1.25, y + s - u, (b + c) * 1.3, -c * .02, .5)
3220
+ ], S = R(v), C = m.path(S, h), w = R(x), E = m.path(w, {
3221
+ ...h,
3222
+ fillStyle: "solid"
3223
+ }), D = i.insert(() => E, ":first-child");
3224
+ return D.insert(() => C, ":first-child"), D.attr("class", "basic label-container outer-path"), p && t.look !== "handDrawn" && D.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), D.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l / 2 - (a.y - (a.top ?? 0))})`), I(t, D), t.intersect = function(e) {
3225
+ return K.polygon(t, v, e);
3226
+ }, i;
3227
+ }
3228
+ n(Dn, "taggedWaveEdgedRectangle");
3229
+ async function On(e, t) {
3230
+ let { labelStyles: n, nodeStyles: r } = _(t);
3231
+ t.labelStyle = n;
3232
+ let { shapeSvg: i, bbox: a } = await P(e, t, L(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width || 0), s = Math.max(a.height + (t.padding ?? 0), t?.height || 0), c = -o / 2, l = -s / 2, u = i.insert("rect", ":first-child");
3233
+ return u.attr("class", "text").attr("style", r).attr("rx", 0).attr("ry", 0).attr("x", c).attr("y", l).attr("width", o).attr("height", s), I(t, u), t.intersect = function(e) {
3234
+ return K.rect(t, e);
3235
+ }, i;
3236
+ }
3237
+ n(On, "text");
3238
+ var kn = /* @__PURE__ */ n((e, t, n, r, i, a) => `M${e},${t}
3239
+ a${i},${a} 0,0,1 0,${-r}
3240
+ l${n},0
3241
+ a${i},${a} 0,0,1 0,${r}
3242
+ M${n},${-r}
3243
+ a${i},${a} 0,0,0 0,${r}
3244
+ l${-n},0`, "createCylinderPathD"), An = /* @__PURE__ */ n((e, t, n, r, i, a) => [
3245
+ `M${e},${t}`,
3246
+ `M${e + n},${t}`,
3247
+ `a${i},${a} 0,0,0 0,${-r}`,
3248
+ `l${-n},0`,
3249
+ `a${i},${a} 0,0,0 0,${r}`,
3250
+ `l${n},0`
3251
+ ].join(" "), "createOuterCylinderPathD"), jn = /* @__PURE__ */ n((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD"), Mn = 5, Nn = 10;
3252
+ async function Pn(e, t) {
3253
+ let { labelStyles: n, nodeStyles: r } = _(t);
3254
+ t.labelStyle = n;
3255
+ let i = t.padding ?? 0, a = t.look === "neo" ? 12 : i / 2, o = t.height ?? 0;
3256
+ if (t.height && (t.height -= a, t.height < Mn && (t.height = Mn)), t.width) {
3257
+ let e = o / 2 / (2.5 + o / 50);
3258
+ t.width = t.width - a - e * 3, t.width < Nn && (t.width = Nn);
3259
+ }
3260
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = Math.max(t.height ?? 0, c.height) + a, d = u / 2, f = d / (2.5 + u / 50), m = Math.max(t.width ?? 0, c.width) + f + a, { cssStyles: h } = t, v;
3261
+ if (t.look === "handDrawn") {
3262
+ let e = T.svg(s), n = An(0, 0, m, u, f, d), r = jn(0, 0, m, u, f, d), i = e.path(n, g(t, {})), a = e.path(r, g(t, { fill: "none" }));
3263
+ v = s.insert(() => a, ":first-child"), v = s.insert(() => i, ":first-child"), v.attr("class", "basic label-container"), h && v.attr("style", h);
3264
+ } else {
3265
+ let e = kn(0, 0, m, u, f, d);
3266
+ v = s.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", p(h)).attr("style", r), v.attr("class", "basic label-container outer-path"), h && v.selectAll("path").attr("style", h), r && v.selectAll("path").attr("style", r);
3267
+ }
3268
+ return v.attr("label-offset-x", f), v.attr("transform", `translate(${-m / 2}, ${u / 2} )`), l.attr("transform", `translate(${-(c.width / 2) - f - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), I(t, v), t.intersect = function(e) {
3269
+ let n = K.rect(t, e), r = n.y - (t.y ?? 0);
3270
+ if (d != 0 && (Math.abs(r) < (t.height ?? 0) / 2 || Math.abs(r) == (t.height ?? 0) / 2 && Math.abs(n.x - (t.x ?? 0)) > (t.width ?? 0) / 2 - f)) {
3271
+ let i = f * f * (1 - r * r / (d * d));
3272
+ i != 0 && (i = Math.sqrt(Math.abs(i))), i = f - i, e.x - (t.x ?? 0) > 0 && (i = -i), n.x += i;
3273
+ }
3274
+ return n;
3275
+ }, s;
3276
+ }
3277
+ n(Pn, "tiltedCylinder");
3278
+ async function Fn(e, t) {
3279
+ let { labelStyles: n, nodeStyles: r } = _(t);
3280
+ t.labelStyle = n;
3281
+ let i = t.padding ?? 0, a = (t.look, i), o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
3282
+ {
3283
+ x: -3 * l / 6,
3284
+ y: 0
3285
+ },
3286
+ {
3287
+ x: u + 3 * l / 6,
3288
+ y: 0
3289
+ },
3290
+ {
3291
+ x: u,
3292
+ y: -l
3293
+ },
3294
+ {
3295
+ x: 0,
3296
+ y: -l
3297
+ }
3298
+ ], f, { cssStyles: p } = t;
3299
+ if (t.look === "handDrawn") {
3300
+ let e = T.svg(s), n = g(t, {}), r = R(d), i = e.path(r, n);
3301
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
3302
+ } else f = J(s, u, l, d);
3303
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
3304
+ return K.polygon(t, d, e);
3305
+ }, s;
3306
+ }
3307
+ n(Fn, "trapezoid");
3308
+ async function In(e, t) {
3309
+ let { labelStyles: n, nodeStyles: r } = _(t);
3310
+ t.labelStyle = n;
3311
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
3312
+ (t.width || t.height) && (t.height = (t.height ?? 0) - o * 2, t.height < 5 && (t.height = 5), t.width = (t.width ?? 0) - a * 2, t.width < 15 && (t.width = 15));
3313
+ let { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o * 2, { cssStyles: d } = t, f = T.svg(s), p = g(t, {});
3314
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
3315
+ let m = [
3316
+ {
3317
+ x: -l / 2 * .8,
3318
+ y: -u / 2
3319
+ },
3320
+ {
3321
+ x: l / 2 * .8,
3322
+ y: -u / 2
3323
+ },
3324
+ {
3325
+ x: l / 2,
3326
+ y: -u / 2 * .6
3327
+ },
3328
+ {
3329
+ x: l / 2,
3330
+ y: u / 2
3331
+ },
3332
+ {
3333
+ x: -l / 2,
3334
+ y: u / 2
3335
+ },
3336
+ {
3337
+ x: -l / 2,
3338
+ y: -u / 2 * .6
3339
+ }
3340
+ ], h = R(m), v = f.path(h, p), y = s.insert(() => v, ":first-child");
3341
+ return y.attr("class", "basic label-container outer-path"), d && t.look !== "handDrawn" && y.selectChildren("path").attr("style", d), r && t.look !== "handDrawn" && y.selectChildren("path").attr("style", r), I(t, y), t.intersect = function(e) {
3342
+ return K.polygon(t, m, e);
3343
+ }, s;
3344
+ }
3345
+ n(In, "trapezoidalPentagon");
3346
+ var Ln = 10, Rn = 10;
3347
+ async function zn(t, n) {
3348
+ let { labelStyles: r, nodeStyles: i } = _(n);
3349
+ n.labelStyle = r;
3350
+ let o = n.padding ?? 0, c = n.look === "neo" ? o * 2 : o;
3351
+ (n.width || n.height) && (n.width = ((n?.width ?? 0) - c) / 2, n.width < Rn && (n.width = Rn), n.height = n?.height ?? 0, n.height < Ln && (n.height = Ln));
3352
+ let { shapeSvg: l, bbox: u, label: d } = await P(t, n, L(n)), f = s(a().flowchart?.htmlLabels), p = (n?.width ? n?.width : u.width) + c, m = n?.height ? n?.height : p + u.height, h = m, v = [
3353
+ {
3354
+ x: 0,
3355
+ y: 0
3356
+ },
3357
+ {
3358
+ x: h,
3359
+ y: 0
3360
+ },
3361
+ {
3362
+ x: h / 2,
3363
+ y: -m
3364
+ }
3365
+ ], { cssStyles: y } = n, b = T.svg(l), x = g(n, {});
3366
+ n.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
3367
+ let S = R(v), C = b.path(S, x), w = l.insert(() => C, ":first-child").attr("transform", `translate(${-m / 2}, ${m / 2})`).attr("class", "outer-path");
3368
+ return y && n.look !== "handDrawn" && w.selectChildren("path").attr("style", y), i && n.look !== "handDrawn" && w.selectChildren("path").attr("style", i), n.width = p, n.height = m, I(n, w), d.attr("transform", `translate(${-u.width / 2 - (u.x - (u.left ?? 0))}, ${m / 2 - (u.height + (n.padding ?? 0) / (f ? 2 : 1) - (u.y - (u.top ?? 0)))})`), n.intersect = function(t) {
3369
+ return e.info("Triangle intersect", n, v, t), K.polygon(n, v, t);
3370
+ }, l;
3371
+ }
3372
+ n(zn, "triangle");
3373
+ async function Bn(e, t) {
3374
+ let { labelStyles: n, nodeStyles: r } = _(t);
3375
+ t.labelStyle = n;
3376
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = !0;
3377
+ (t.width || t.height) && (s = !1, t.width = (t?.width ?? 0) - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
3378
+ let { shapeSvg: c, bbox: l, label: u } = await P(e, t, L(t)), d = (t?.width ? t?.width : l.width) + (a ?? 0) * 2, f = (t?.height ? t?.height : l.height) + (o ?? 0) * 2, p = t.look === "neo" ? f / 4 : f / 8, m = f + (s ? p : -p), { cssStyles: h } = t, v = 14 - d, y = v > 0 ? v / 2 : 0, b = T.svg(c), x = g(t, {});
3379
+ t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
3380
+ let S = [
3381
+ {
3382
+ x: -d / 2 - y,
3383
+ y: m / 2
3384
+ },
3385
+ ...z(-d / 2 - y, m / 2, d / 2 + y, m / 2, p, .8),
3386
+ {
3387
+ x: d / 2 + y,
3388
+ y: -m / 2
3389
+ },
3390
+ {
3391
+ x: -d / 2 - y,
3392
+ y: -m / 2
3393
+ }
3394
+ ], C = R(S), w = b.path(C, x), E = c.insert(() => w, ":first-child");
3395
+ return E.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && E.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && E.selectAll("path").attr("style", r), E.attr("transform", `translate(0,${-p / 2})`), u.attr("transform", `translate(${-d / 2 + (t.padding ?? 0) - (l.x - (l.left ?? 0))},${-f / 2 + (t.padding ?? 0) - p - (l.y - (l.top ?? 0))})`), I(t, E), t.intersect = function(e) {
3396
+ return K.polygon(t, S, e);
3397
+ }, c;
3398
+ }
3399
+ n(Bn, "waveEdgedRectangle");
3400
+ async function Vn(e, t) {
3401
+ let { labelStyles: n, nodeStyles: r } = _(t);
3402
+ t.labelStyle = n;
3403
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 20 : i;
3404
+ if (t.width || t.height) {
3405
+ t.width = t?.width ?? 0, t.width < 20 && (t.width = 20), t.height = t?.height ?? 0, t.height < 10 && (t.height = 10);
3406
+ let e = Math.min(t.height * .2, t.height / 4);
3407
+ t.height = Math.ceil(t.height - o - 20 / 9 * e), t.width -= a * 2;
3408
+ }
3409
+ let { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o, d = u / 8, f = u + d * 2, { cssStyles: p } = t, m = T.svg(s), h = g(t, {});
3410
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
3411
+ let v = [
3412
+ {
3413
+ x: -l / 2,
3414
+ y: f / 2
3415
+ },
3416
+ ...z(-l / 2, f / 2, l / 2, f / 2, d, 1),
3417
+ {
3418
+ x: l / 2,
3419
+ y: -f / 2
3420
+ },
3421
+ ...z(l / 2, -f / 2, -l / 2, -f / 2, d, -1)
3422
+ ], y = R(v), b = m.path(y, h), x = s.insert(() => b, ":first-child");
3423
+ return x.attr("class", "basic label-container"), p && t.look !== "handDrawn" && x.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), I(t, x), t.intersect = function(e) {
3424
+ return K.polygon(t, v, e);
3425
+ }, s;
3426
+ }
3427
+ n(Vn, "waveRectangle");
3428
+ var Q = 10;
3429
+ async function Hn(e, t) {
3430
+ let { labelStyles: n, nodeStyles: r } = _(t);
3431
+ t.labelStyle = n;
3432
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0;
3433
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - i * 2 - Q, 10), t.height = Math.max((t?.height ?? 0) - a * 2 - Q, 10));
3434
+ let { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = (t?.width ? t?.width : s.width) + i * 2 + Q, u = (t?.height ? t?.height : s.height) + a * 2 + Q, d = l - Q, f = u - Q, p = -d / 2, m = -f / 2, { cssStyles: h } = t, v = T.svg(o), y = g(t, {}), b = [
3435
+ {
3436
+ x: p - Q,
3437
+ y: m - Q
3438
+ },
3439
+ {
3440
+ x: p - Q,
3441
+ y: m + f
3442
+ },
3443
+ {
3444
+ x: p + d,
3445
+ y: m + f
3446
+ },
3447
+ {
3448
+ x: p + d,
3449
+ y: m - Q
3450
+ }
3451
+ ], x = `M${p - Q},${m - Q} L${p + d},${m - Q} L${p + d},${m + f} L${p - Q},${m + f} L${p - Q},${m - Q}
3452
+ M${p - Q},${m} L${p + d},${m}
3453
+ M${p},${m - Q} L${p},${m + f}`;
3454
+ t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
3455
+ let S = v.path(x, y), C = o.insert(() => S, ":first-child");
3456
+ return C.attr("transform", `translate(${Q / 2}, ${Q / 2})`), C.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && C.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), c.attr("transform", `translate(${-(s.width / 2) + Q / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + Q / 2 - (s.y - (s.top ?? 0))})`), I(t, C), t.intersect = function(e) {
3457
+ return K.polygon(t, b, e);
3458
+ }, o;
3459
+ }
3460
+ n(Hn, "windowPane");
3461
+ var Un = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Wn = /* @__PURE__ */ new Set([
3462
+ "redux",
3463
+ "redux-dark",
3464
+ "redux-color",
3465
+ "redux-dark-color"
3466
+ ]);
3467
+ async function Gn(e, n) {
3468
+ let r = n;
3469
+ r.alias && (n.label = r.alias);
3470
+ let { theme: i, themeVariables: a } = u(), { rowEven: o, rowOdd: c, nodeBorder: l, borderColorArray: d } = a;
3471
+ if (n.look === "handDrawn") {
3472
+ let { themeVariables: t } = u(), { background: r } = t;
3473
+ await Gn(e, {
3474
+ ...n,
3475
+ id: n.id + "-background",
3476
+ domId: (n.domId || n.id) + "-background",
3477
+ look: "default",
3478
+ cssStyles: ["stroke: none", `fill: ${r}`]
3479
+ });
3480
+ }
3481
+ let f = u();
3482
+ n.useHtmlLabels = f.htmlLabels;
3483
+ let p = f.er?.diagramPadding ?? 10, m = f.er?.entityPadding ?? 6, { cssStyles: v } = n, { labelStyles: y, nodeStyles: b } = _(n);
3484
+ if (r.attributes.length === 0 && n.label) {
3485
+ let t = {
3486
+ rx: 0,
3487
+ ry: 0,
3488
+ labelPaddingX: p,
3489
+ labelPaddingY: p * 1.5,
3490
+ classes: ""
3491
+ };
3492
+ h(n.label, f) + t.labelPaddingX * 2 < f.er.minEntityWidth && (n.width = f.er.minEntityWidth);
3493
+ let a = await Ke(e, n, t);
3494
+ if (i != null && Un.has(i)) {
3495
+ let e = r.colorIndex ?? 0;
3496
+ a.attr("data-color-id", `color-${e % d.length}`);
3497
+ }
3498
+ if (!s(f.htmlLabels)) {
3499
+ let e = a.select("text"), t = e.node()?.getBBox();
3500
+ e.attr("transform", `translate(${-t.width / 2}, 0)`);
3501
+ }
3502
+ return a;
3503
+ }
3504
+ f.htmlLabels || (p *= 1.25, m *= 1.25);
3505
+ let x = L(n);
3506
+ x ||= "node default";
3507
+ let S = e.insert("g").attr("class", x).attr("id", n.domId || n.id), C = await Kn(S, n.label ?? "", f, 0, 0, ["name"], y);
3508
+ C.height += m;
3509
+ let w = 0, E = [], D = [], O = 0, k = 0, A = 0, j = 0, M = !0, N = !0;
3510
+ for (let e of r.attributes) {
3511
+ let t = await Kn(S, e.type, f, 0, w, ["attribute-type"], y);
3512
+ O = Math.max(O, t.width + p);
3513
+ let n = await Kn(S, e.name, f, 0, w, ["attribute-name"], y);
3514
+ k = Math.max(k, n.width + p);
3515
+ let r = await Kn(S, e.keys.join(), f, 0, w, ["attribute-keys"], y);
3516
+ A = Math.max(A, r.width + p);
3517
+ let i = await Kn(S, e.comment, f, 0, w, ["attribute-comment"], y);
3518
+ j = Math.max(j, i.width + p);
3519
+ let a = Math.max(t.height, n.height, r.height, i.height) + m;
3520
+ D.push({
3521
+ yOffset: w,
3522
+ rowHeight: a
3523
+ }), w += a;
3524
+ }
3525
+ let P = 4;
3526
+ A <= p && (M = !1, A = 0, P--), j <= p && (N = !1, j = 0, P--);
3527
+ let F = S.node().getBBox();
3528
+ if (C.width + p * 2 - (O + k + A + j) > 0) {
3529
+ let e = C.width + p * 2 - (O + k + A + j);
3530
+ O += e / P, k += e / P, A > 0 && (A += e / P), j > 0 && (j += e / P);
3531
+ }
3532
+ let R = O + k + A + j, z = T.svg(S), B = g(n, {});
3533
+ n.look !== "handDrawn" && (B.roughness = 0, B.fillStyle = "solid");
3534
+ let ee = 0;
3535
+ D.length > 0 && (ee = D.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
3536
+ let V = Math.max(F.width + p * 2, n?.width || 0, R), te = Math.max((ee ?? 0) + C.height, n?.height || 0), H = -V / 2, U = -te / 2;
3537
+ if (S.selectAll("g:not(:first-child)").each((e, n, r) => {
3538
+ let i = t(r[n]), a = i.attr("transform"), o = 0, s = 0;
3539
+ if (a) {
3540
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
3541
+ e && (o = parseFloat(e[1]), s = parseFloat(e[2]), i.attr("class").includes("attribute-name") ? o += O : i.attr("class").includes("attribute-keys") ? o += O + k : i.attr("class").includes("attribute-comment") && (o += O + k + A));
3542
+ }
3543
+ i.attr("transform", `translate(${H + p / 2 + o}, ${s + U + C.height + m / 2})`);
3544
+ }), S.select(".name").attr("transform", "translate(" + -C.width / 2 + ", " + (U + m / 2) + ")"), i != null && Un.has(i)) {
3545
+ let e = r.colorIndex ?? 0;
3546
+ S.attr("data-color-id", `color-${e % d.length}`);
3547
+ }
3548
+ let ne = z.rectangle(H, U, V, te, B), re = S.insert(() => ne, ":first-child").attr("class", "outer-path").attr("style", v.join(""));
3549
+ E.push(0);
3550
+ for (let [e, t] of D.entries()) {
3551
+ let n = (e + 1) % 2 == 0 && t.yOffset !== 0, r = z.rectangle(H, C.height + U + t?.yOffset, V, t?.rowHeight, {
3552
+ ...B,
3553
+ fill: n ? o : c,
3554
+ stroke: l
3555
+ });
3556
+ S.insert(() => r, "g.label").attr("style", v.join("")).attr("class", `row-rect-${n ? "even" : "odd"}`);
3557
+ }
3558
+ let ie = 1e-4, W = qn(H, C.height + U, V + H, C.height + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B);
3559
+ if (S.insert(() => G).attr("class", "divider"), W = qn(O + H, C.height + U, O + H, te + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider"), M) {
3560
+ let e = O + k + H;
3561
+ W = qn(e, C.height + U, e, te + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider");
3562
+ }
3563
+ if (N) {
3564
+ let e = O + k + A + H;
3565
+ W = qn(e, C.height + U, e, te + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider");
3566
+ }
3567
+ for (let e of E) {
3568
+ let t = C.height + U + e;
3569
+ W = qn(H, t, V + H, t, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider");
3570
+ }
3571
+ if (I(n, re), b && n.look !== "handDrawn") {
3572
+ if (i != null && Wn.has(i)) S.selectAll("path").attr("style", b);
3573
+ else {
3574
+ let e = b.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
3575
+ S.selectAll("path").attr("style", e ?? ""), S.selectAll(".row-rect-even path").attr("style", b);
3576
+ }
3577
+ }
3578
+ return n.intersect = function(e) {
3579
+ return K.rect(n, e);
3580
+ }, S;
3581
+ }
3582
+ n(Gn, "erBox");
3583
+ async function Kn(e, n, r, a = 0, o = 0, c = [], l = "") {
3584
+ let u = e.insert("g").attr("class", `label ${c.join(" ")}`).attr("transform", `translate(${a}, ${o})`).attr("style", l);
3585
+ n !== i(n) && (n = i(n), n = n.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
3586
+ let d = u.node().appendChild(await S(u, n, {
3587
+ width: h(n, r) + 100,
3588
+ style: l,
3589
+ useHtmlLabels: r.htmlLabels
3590
+ }, r));
3591
+ if (n.includes("&lt;") || n.includes("&gt;")) {
3592
+ let e = d.children[0];
3593
+ for (e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
3594
+ }
3595
+ let f = d.getBBox();
3596
+ if (s(r.htmlLabels)) {
3597
+ let e = d.children[0];
3598
+ e.style.textAlign = "start";
3599
+ let n = t(d);
3600
+ f = e.getBoundingClientRect(), n.attr("width", f.width), n.attr("height", f.height);
3601
+ }
3602
+ return f;
3603
+ }
3604
+ n(Kn, "addText");
3605
+ function qn(e, t, n, r, i) {
3606
+ return e === n ? [
3607
+ {
3608
+ x: e - i / 2,
3609
+ y: t
3610
+ },
3611
+ {
3612
+ x: e + i / 2,
3613
+ y: t
3614
+ },
3615
+ {
3616
+ x: n + i / 2,
3617
+ y: r
3618
+ },
3619
+ {
3620
+ x: n - i / 2,
3621
+ y: r
3622
+ }
3623
+ ] : [
3624
+ {
3625
+ x: e,
3626
+ y: t - i / 2
3627
+ },
3628
+ {
3629
+ x: e,
3630
+ y: t + i / 2
3631
+ },
3632
+ {
3633
+ x: n,
3634
+ y: r + i / 2
3635
+ },
3636
+ {
3637
+ x: n,
3638
+ y: r - i / 2
3639
+ }
3640
+ ];
3641
+ }
3642
+ n(qn, "lineToPolygon");
3643
+ async function Jn(e, t, n, r, i = n.class.padding ?? 12) {
3644
+ let a = r ? 0 : 3, o = e.insert("g").attr("class", L(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
3645
+ if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
3646
+ let e = t.annotations[0];
3647
+ await Yn(s, { text: `\xAB${e}\xBB` }, 0), d = s.node().getBBox().height;
3648
+ }
3649
+ c = o.insert("g").attr("class", "label-group text"), await Yn(c, t, 0, ["font-weight: bolder"]);
3650
+ let m = c.node().getBBox();
3651
+ f = m.height, l = o.insert("g").attr("class", "members-group text");
3652
+ let h = 0;
3653
+ for (let e of t.members) {
3654
+ let t = await Yn(l, e, h, [e.parseClassifier()]);
3655
+ h += t + a;
3656
+ }
3657
+ p = l.node().getBBox().height, p <= 0 && (p = i / 2), u = o.insert("g").attr("class", "methods-group text");
3658
+ let g = 0;
3659
+ for (let e of t.methods) {
3660
+ let t = await Yn(u, e, g, [e.parseClassifier()]);
3661
+ g += t + a;
3662
+ }
3663
+ let _ = o.node().getBBox();
3664
+ if (s !== null) {
3665
+ let e = s.node().getBBox();
3666
+ s.attr("transform", `translate(${-e.width / 2})`);
3667
+ }
3668
+ return c.attr("transform", `translate(${-m.width / 2}, ${d})`), _ = o.node().getBBox(), l.attr("transform", `translate(0, ${d + f + i * 2})`), _ = o.node().getBBox(), u.attr("transform", `translate(0, ${d + f + (p ? p + i * 4 : i * 2)})`), _ = o.node().getBBox(), {
3669
+ shapeSvg: o,
3670
+ bbox: _
3671
+ };
3672
+ }
3673
+ n(Jn, "textHelper");
3674
+ async function Yn(e, n, i, a = []) {
3675
+ let o = e.insert("g").attr("class", "label").attr("style", a.join("; ")), l = u(), d = "useHtmlLabels" in n ? n.useHtmlLabels : s(l.htmlLabels) ?? !0, p = "";
3676
+ p = "text" in n ? n.text : n.label, !d && p.startsWith("\\") && (p = p.substring(1)), c(p) && (d = !0);
3677
+ let m = await S(o, r(f(p)), {
3678
+ width: h(p, l) + 50,
3679
+ classes: "markdown-node-label",
3680
+ useHtmlLabels: d
3681
+ }, l), g, _ = 1;
3682
+ if (d) {
3683
+ let e = m.children[0], n = t(m);
3684
+ _ = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (_ += e.innerHTML.split("<mrow>").length - 1), await O(e), g = e.getBoundingClientRect(), n.attr("width", g.width), n.attr("height", g.height);
3685
+ } else {
3686
+ a.includes("font-weight: bolder") && t(m).selectAll("tspan").attr("font-weight", ""), _ = m.children.length;
3687
+ let e = m.children[0];
3688
+ (m.textContent === "" || m.textContent.includes("&gt")) && (e.textContent = p[0] + p.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), p[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), g = m.getBBox();
3689
+ }
3690
+ return o.attr("transform", "translate(0," + (-g.height / (2 * _) + i) + ")"), g.height;
3691
+ }
3692
+ n(Yn, "addText");
3693
+ async function Xn(e, n) {
3694
+ let r = a(), { theme: i, themeVariables: o } = r, { useGradient: c, borderColorArray: l } = o, u = r.class.padding ?? 12, d = u, f = n.useHtmlLabels ?? s(r.htmlLabels) ?? !0, p = n;
3695
+ p.annotations = p.annotations ?? [], p.members = p.members ?? [], p.methods = p.methods ?? [];
3696
+ let { shapeSvg: m, bbox: h } = await Jn(e, n, r, f, d);
3697
+ w(m, n.colorIndex, i, l);
3698
+ let { labelStyles: v, nodeStyles: y } = _(n);
3699
+ n.labelStyle = v, n.cssStyles = p.styles || "";
3700
+ let b = p.styles?.join(";") || y || "";
3701
+ n.cssStyles ||= b.replaceAll("!important", "").split(";");
3702
+ let x = p.members.length === 0 && p.methods.length === 0 && !r.class?.hideEmptyMembersBox, S = T.svg(m), C = g(n, {});
3703
+ n.look !== "handDrawn" && (C.roughness = 0, C.fillStyle = "solid");
3704
+ let E = Math.max(n.width ?? 0, h.width), D = Math.max(n.height ?? 0, h.height), O = (n.height ?? 0) > h.height;
3705
+ p.members.length === 0 && p.methods.length === 0 ? D += d : p.members.length > 0 && p.methods.length === 0 && (D += d * 2);
3706
+ let k = -E / 2, A = -D / 2, j = x ? u * 2 : p.members.length === 0 && p.methods.length === 0 ? -u : 0;
3707
+ O && (j = u * 2);
3708
+ let M = S.rectangle(k - u, A - u - (x ? u : p.members.length === 0 && p.methods.length === 0 ? -u / 2 : 0), E + 2 * u, D + 2 * u + j, C), N = m.insert(() => M, ":first-child");
3709
+ N.attr("class", "basic label-container outer-path");
3710
+ let P = N.node().getBBox(), F = m.select(".annotation-group").node().getBBox().height - (x ? u / 2 : 0) || 0, L = m.select(".label-group").node().getBBox().height - (x ? u / 2 : 0) || 0, R = m.select(".members-group").node().getBBox().height - (x ? u / 2 : 0) || 0, z = (F + L + A + u - (A - u - (x ? u : p.members.length === 0 && p.methods.length === 0 ? -u / 2 : 0))) / 2;
3711
+ if (m.selectAll(".text").each((e, n, i) => {
3712
+ let a = t(i[n]), o = a.attr("transform"), s = 0;
3713
+ if (o) {
3714
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);
3715
+ e && (s = parseFloat(e[2]));
3716
+ }
3717
+ let c = s + A + u - (x ? u : p.members.length === 0 && p.methods.length === 0 ? -u / 2 : 0);
3718
+ if (a.attr("class").includes("methods-group")) {
3719
+ let e = Math.max(R, d / 2);
3720
+ c = O ? Math.max(z, F + L + e + A + d * 2 + u) + d * 2 : F + L + e + A + d * 4 + u;
3721
+ }
3722
+ p.members.length === 0 && p.methods.length === 0 && r.class?.hideEmptyMembersBox && (c = p.annotations.length > 0 ? s - d : s), f || (c -= 4);
3723
+ let l = k;
3724
+ (a.attr("class").includes("label-group") || a.attr("class").includes("annotation-group")) && (l = -a.node()?.getBBox().width / 2 || 0, m.selectAll("text").each(function(e, t, n) {
3725
+ window.getComputedStyle(n[t]).textAnchor === "middle" && (l = 0);
3726
+ })), a.attr("transform", `translate(${l}, ${c})`);
3727
+ }), p.members.length > 0 || p.methods.length > 0 || x) {
3728
+ let e = F + L + A + u, t = S.line(P.x, e, P.x + P.width, e + .001, C);
3729
+ m.insert(() => t).attr("class", `divider${n.look === "neo" && !c ? " neo-line" : ""}`).attr("style", b);
3730
+ }
3731
+ if (x || p.members.length > 0 || p.methods.length > 0) {
3732
+ let e = F + L + R + A + d * 2 + u, t = S.line(P.x, O ? Math.max(z, e) : e, P.x + P.width, (O ? Math.max(z, e) : e) + .001, C);
3733
+ m.insert(() => t).attr("class", `divider${n.look === "neo" && !c ? " neo-line" : ""}`).attr("style", b);
3734
+ }
3735
+ if (p.look !== "handDrawn" && m.selectAll("path").attr("style", b), N.select(":nth-child(2)").attr("style", b), m.selectAll(".divider").select("path").attr("style", b), n.labelStyle ? m.selectAll("span").attr("style", n.labelStyle) : m.selectAll("span").attr("style", b), !f) {
3736
+ let e = RegExp(/color\s*:\s*([^;]*)/), t = e.exec(b);
3737
+ if (t) {
3738
+ let e = t[0].replace("color", "fill");
3739
+ m.selectAll("tspan").attr("style", e);
3740
+ } else if (v) {
3741
+ let t = e.exec(v);
3742
+ if (t) {
3743
+ let e = t[0].replace("color", "fill");
3744
+ m.selectAll("tspan").attr("style", e);
3745
+ }
3746
+ }
3747
+ }
3748
+ return I(n, N), n.intersect = function(e) {
3749
+ return K.rect(n, e);
3750
+ }, m;
3751
+ }
3752
+ n(Xn, "classBox");
3753
+ async function Zn(e, n) {
3754
+ let { labelStyles: r, nodeStyles: i } = _(n);
3755
+ n.labelStyle = r;
3756
+ let o = n, s = n, c = "verifyMethod" in n, l = L(n), u = a(), { themeVariables: d } = u, { borderColorArray: f, requirementEdgeLabelBackground: p } = d, m = u.layout === "elk" ? "start" : "center", h = e.insert("g").attr("class", l).attr("id", n.domId ?? n.id), v;
3757
+ v = c ? await $(h, `&lt;&lt;${o.type}&gt;&gt;`, 0, n.labelStyle) : await $(h, "&lt;&lt;Element&gt;&gt;", 0, n.labelStyle);
3758
+ let y = v, b = await $(h, o.name, y, n.labelStyle + "; font-weight: bold;");
3759
+ if (y += b + 20, c) {
3760
+ let e = await $(h, `${o.requirementId ? `ID: ${o.requirementId}` : ""}`, y, n.labelStyle, m);
3761
+ y += e;
3762
+ let t = await $(h, `${o.text ? `Text: ${o.text}` : ""}`, y, n.labelStyle, m);
3763
+ y += t;
3764
+ let r = await $(h, `${o.risk ? `Risk: ${o.risk}` : ""}`, y, n.labelStyle, m);
3765
+ y += r, await $(h, `${o.verifyMethod ? `Verification: ${o.verifyMethod}` : ""}`, y, n.labelStyle, m);
3766
+ } else {
3767
+ let e = await $(h, `${s.type ? `Type: ${s.type}` : ""}`, y, n.labelStyle, m);
3768
+ y += e, await $(h, `${s.docRef ? `Doc Ref: ${s.docRef}` : ""}`, y, n.labelStyle, m);
3769
+ }
3770
+ let x = (h.node()?.getBBox().width ?? 200) + 20, S = (h.node()?.getBBox().height ?? 200) + 20, C = -x / 2, w = -S / 2, E = T.svg(h), D = g(n, {});
3771
+ n.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
3772
+ let O = E.rectangle(C, w, x, S, D), k = h.insert(() => O, ":first-child");
3773
+ if (k.attr("class", "basic label-container outer-path").attr("style", i), f?.length) {
3774
+ let e = n.colorIndex ?? 0;
3775
+ h.attr("data-color-id", `color-${e % f.length}`);
3776
+ }
3777
+ if (h.selectAll(".label").each((e, n, r) => {
3778
+ let i = t(r[n]), a = i.attr("transform"), o = 0, s = 0;
3779
+ if (a) {
3780
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
3781
+ e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
3782
+ }
3783
+ let c = s - S / 2, l = C + 10;
3784
+ (n === 0 || n === 1) && (l = o), i.attr("transform", `translate(${l}, ${c + 20})`);
3785
+ }), y > v + b + 20) {
3786
+ let e = w + v + b + 20, t;
3787
+ if (n.look === "neo") {
3788
+ let n = .001, r = [
3789
+ [C, e],
3790
+ [C + x, e],
3791
+ [C + x, e + n],
3792
+ [C, e + n]
3793
+ ];
3794
+ t = E.polygon(r, D);
3795
+ } else t = E.line(C, e, C + x, e, D);
3796
+ h.insert(() => t).attr("class", "divider");
3797
+ }
3798
+ return I(n, k), n.intersect = function(e) {
3799
+ return K.rect(n, e);
3800
+ }, i && n.look !== "handDrawn" && (p || f?.length) && h.selectAll("path").attr("style", i), h;
3801
+ }
3802
+ n(Zn, "requirementBox");
3803
+ async function $(e, n, i, o = "", s = "center") {
3804
+ if (n === "") return 0;
3805
+ let c = e.insert("g").attr("class", "label").attr("style", o), l = a(), u = l.htmlLabels ?? !0, d = await S(c, r(f(n)), {
3806
+ width: h(n, l) + 50,
3807
+ classes: "markdown-node-label",
3808
+ useHtmlLabels: u,
3809
+ style: o
3810
+ }, l), p;
3811
+ if (u) {
3812
+ let e = d.children[0], n = t(d);
3813
+ s === "start" && t(e).style("text-align", "left"), p = e.getBoundingClientRect(), n.attr("width", p.width), n.attr("height", p.height);
3814
+ } else {
3815
+ let e = d.children[0];
3816
+ for (let t of e.children) o && t.setAttribute("style", o);
3817
+ if (s === "start") {
3818
+ e.setAttribute("text-anchor", "start");
3819
+ for (let t of e.children) t.setAttribute("text-anchor", "start");
3820
+ }
3821
+ p = d.getBBox(), p.height += 6;
3822
+ }
3823
+ return c.attr("transform", `translate(${-p.width / 2},${-p.height / 2 + i})`), p.height;
3824
+ }
3825
+ n($, "addText");
3826
+ var Qn = /* @__PURE__ */ n((e) => {
3827
+ switch (e) {
3828
+ case "Very High": return "red";
3829
+ case "High": return "orange";
3830
+ case "Medium": return null;
3831
+ case "Low": return "blue";
3832
+ case "Very Low": return "lightblue";
3833
+ }
3834
+ }, "colorFromPriority");
3835
+ async function $n(e, t, { config: n }) {
3836
+ let { labelStyles: r, nodeStyles: i } = _(t);
3837
+ t.labelStyle = r || "";
3838
+ let a = t.width;
3839
+ t.width = (t.width ?? 200) - 10;
3840
+ let { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = t.padding || 10, u = "", d;
3841
+ "ticket" in t && t.ticket && n?.kanban?.ticketBaseUrl && (u = n?.kanban?.ticketBaseUrl.replace("#TICKET#", t.ticket), d = o.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", u).attr("target", "_blank"));
3842
+ let f = {
3843
+ useHtmlLabels: t.useHtmlLabels,
3844
+ labelStyle: t.labelStyle || "",
3845
+ width: t.width,
3846
+ img: t.img,
3847
+ padding: t.padding || 8,
3848
+ centerLabel: !1
3849
+ }, p, m;
3850
+ d ? {label: p, bbox: m} = await F(d, "ticket" in t && t.ticket || "", f) : {label: p, bbox: m} = await F(o, "ticket" in t && t.ticket || "", f);
3851
+ let { label: h, bbox: v } = await F(o, "assigned" in t && t.assigned || "", f);
3852
+ t.width = a;
3853
+ let y = t?.width || 0, b = Math.max(m.height, v.height) / 2, x = Math.max(s.height + 20, t?.height || 0) + b, S = -y / 2, C = -x / 2;
3854
+ c.attr("transform", "translate(" + (l - y / 2) + ", " + (-b - s.height / 2) + ")"), p.attr("transform", "translate(" + (l - y / 2) + ", " + (-b + s.height / 2) + ")"), h.attr("transform", "translate(" + (l + y / 2 - v.width - 20) + ", " + (-b + s.height / 2) + ")");
3855
+ let w, { rx: E, ry: D } = t, { cssStyles: O } = t;
3856
+ if (t.look === "handDrawn") {
3857
+ let e = T.svg(o), n = g(t, {}), r = E || D ? e.path(q(S, C, y, x, E || 0), n) : e.rectangle(S, C, y, x, n);
3858
+ w = o.insert(() => r, ":first-child"), w.attr("class", "basic label-container").attr("style", O || null);
3859
+ } else {
3860
+ w = o.insert("rect", ":first-child"), w.attr("class", "basic label-container __APA__").attr("style", i).attr("rx", E ?? 5).attr("ry", D ?? 5).attr("x", S).attr("y", C).attr("width", y).attr("height", x);
3861
+ let e = "priority" in t && t.priority;
3862
+ if (e) {
3863
+ let t = o.append("line"), n = S + 2, r = C + Math.floor((E ?? 0) / 2), i = C + x - Math.floor((E ?? 0) / 2);
3864
+ t.attr("x1", n).attr("y1", r).attr("x2", n).attr("y2", i).attr("stroke-width", "4").attr("stroke", Qn(e));
3865
+ }
3866
+ }
3867
+ return I(t, w), t.height = x, t.intersect = function(e) {
3868
+ return K.rect(t, e);
3869
+ }, o;
3870
+ }
3871
+ n($n, "kanbanItem");
3872
+ async function er(t, n) {
3873
+ let { labelStyles: r, nodeStyles: i } = _(n);
3874
+ n.labelStyle = r;
3875
+ let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await P(t, n, L(n)), l = o.width + 10 * s, u = o.height + 8 * s, d = .15 * l, { cssStyles: f } = n, m = o.width + 20, h = o.height + 20, v = Math.max(l, m), y = Math.max(u, h);
3876
+ c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`);
3877
+ let b, x = `M0 0
3878
+ a${d},${d} 1 0,0 ${v * .25},${-1 * y * .1}
3879
+ a${d},${d} 1 0,0 ${v * .25},0
3880
+ a${d},${d} 1 0,0 ${v * .25},0
3881
+ a${d},${d} 1 0,0 ${v * .25},${y * .1}
3882
+
3883
+ a${d},${d} 1 0,0 ${v * .15},${y * .33}
3884
+ a${d * .8},${d * .8} 1 0,0 0,${y * .34}
3885
+ a${d},${d} 1 0,0 ${-1 * v * .15},${y * .33}
3886
+
3887
+ a${d},${d} 1 0,0 ${-1 * v * .25},${y * .15}
3888
+ a${d},${d} 1 0,0 ${-1 * v * .25},0
3889
+ a${d},${d} 1 0,0 ${-1 * v * .25},0
3890
+ a${d},${d} 1 0,0 ${-1 * v * .25},${-1 * y * .15}
3891
+
3892
+ a${d},${d} 1 0,0 ${-1 * v * .1},${-1 * y * .33}
3893
+ a${d * .8},${d * .8} 1 0,0 0,${-1 * y * .34}
3894
+ a${d},${d} 1 0,0 ${v * .1},${-1 * y * .33}
3895
+ H0 V0 Z`;
3896
+ if (n.look === "handDrawn") {
3897
+ let e = T.svg(a), t = g(n, {}), r = e.path(x, t);
3898
+ b = a.insert(() => r, ":first-child"), b.attr("class", "basic label-container").attr("style", p(f));
3899
+ } else b = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", x);
3900
+ return b.attr("transform", `translate(${-v / 2}, ${-y / 2})`), I(n, b), n.calcIntersect = function(e, t) {
3901
+ return K.rect(e, t);
3902
+ }, n.intersect = function(t) {
3903
+ return e.info("Bang intersect", n, t), K.rect(n, t);
3904
+ }, a;
3905
+ }
3906
+ n(er, "bang");
3907
+ async function tr(t, n) {
3908
+ let { labelStyles: r, nodeStyles: i } = _(n);
3909
+ n.labelStyle = r;
3910
+ let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await P(t, n, L(n)), l = o.width + 2 * s, u = o.height + 2 * s, d = .15 * l, f = .25 * l, m = .35 * l, h = .2 * l, { cssStyles: v } = n, y, b = `M0 0
3911
+ a${d},${d} 0 0,1 ${l * .25},${-1 * l * .1}
3912
+ a${m},${m} 1 0,1 ${l * .4},${-1 * l * .1}
3913
+ a${f},${f} 1 0,1 ${l * .35},${l * .2}
3914
+
3915
+ a${d},${d} 1 0,1 ${l * .15},${u * .35}
3916
+ a${h},${h} 1 0,1 ${-1 * l * .15},${u * .65}
3917
+
3918
+ a${f},${d} 1 0,1 ${-1 * l * .25},${l * .15}
3919
+ a${m},${m} 1 0,1 ${-1 * l * .5},0
3920
+ a${d},${d} 1 0,1 ${-1 * l * .25},${-1 * l * .15}
3921
+
3922
+ a${d},${d} 1 0,1 ${-1 * l * .1},${-1 * u * .35}
3923
+ a${h},${h} 1 0,1 ${l * .1},${-1 * u * .65}
3924
+ H0 V0 Z`;
3925
+ if (n.look === "handDrawn") {
3926
+ let e = T.svg(a), t = g(n, {}), r = e.path(b, t);
3927
+ y = a.insert(() => r, ":first-child"), y.attr("class", "basic label-container").attr("style", p(v));
3928
+ } else y = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", b);
3929
+ return c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`), y.attr("transform", `translate(${-l / 2}, ${-u / 2})`), I(n, y), n.calcIntersect = function(e, t) {
3930
+ return K.rect(e, t);
3931
+ }, n.intersect = function(t) {
3932
+ return e.info("Cloud intersect", n, t), K.rect(n, t);
3933
+ }, a;
3934
+ }
3935
+ n(tr, "cloud");
3936
+ async function nr(e, t) {
3937
+ let { labelStyles: n, nodeStyles: r } = _(t);
3938
+ t.labelStyle = n;
3939
+ let { shapeSvg: i, bbox: a, halfPadding: o, label: s } = await P(e, t, L(t)), c = a.width + 8 * o, l = a.height + 2 * o, u = t.look === "neo" ? `
3940
+ M${-c / 2} ${l / 2 - 5}
3941
+ v${-l + 10}
3942
+ q0,-5 5,-5
3943
+ h${c - 10}
3944
+ q5,0 5,5
3945
+ v${l - 5}
3946
+ H${-c / 2}
3947
+ Z
3948
+ ` : `
3949
+ M${-c / 2} ${l / 2 - 5}
3950
+ v${-l + 10}
3951
+ q0,-5 5,-5
3952
+ h${c - 10}
3953
+ q5,0 5,5
3954
+ v${l - 10}
3955
+ q0,5 -5,5
3956
+ h${-(c - 10)}
3957
+ q-5,0 -5,-5
3958
+ Z
3959
+ `;
3960
+ if (!t.domId) throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);
3961
+ let d = i.append("path").attr("id", t.domId).attr("class", "node-bkg node-" + t.type).attr("style", r).attr("d", u);
3962
+ return i.append("line").attr("class", "node-line-").attr("x1", -c / 2).attr("y1", l / 2).attr("x2", c / 2).attr("y2", l / 2), s.attr("transform", `translate(${-a.width / 2}, ${-a.height / 2})`), i.append(() => s.node()), I(t, d), t.calcIntersect = function(e, t) {
3963
+ return K.rect(e, t);
3964
+ }, t.intersect = function(e) {
3965
+ return K.rect(t, e);
3966
+ }, i;
3967
+ }
3968
+ n(nr, "defaultMindmapNode");
3969
+ async function rr(e, t) {
3970
+ return Ae(e, t, { padding: t.padding ?? 0 });
3971
+ }
3972
+ n(rr, "mindmapCircle");
3973
+ var ir = [
3974
+ {
3975
+ semanticName: "Process",
3976
+ name: "Rectangle",
3977
+ shortName: "rect",
3978
+ description: "Standard process shape",
3979
+ aliases: [
3980
+ "proc",
3981
+ "process",
3982
+ "rectangle"
3983
+ ],
3984
+ internalAliases: ["squareRect"],
3985
+ handler: gn
3986
+ },
3987
+ {
3988
+ semanticName: "Event",
3989
+ name: "Rounded Rectangle",
3990
+ shortName: "rounded",
3991
+ description: "Represents an event",
3992
+ aliases: ["event"],
3993
+ internalAliases: ["roundedRect"],
3994
+ handler: fn
3995
+ },
3996
+ {
3997
+ semanticName: "Terminal Point",
3998
+ name: "Stadium",
3999
+ shortName: "stadium",
4000
+ description: "Terminal point",
4001
+ aliases: ["terminal", "pill"],
4002
+ handler: yn
4003
+ },
4004
+ {
4005
+ semanticName: "Subprocess",
4006
+ name: "Framed Rectangle",
4007
+ shortName: "fr-rect",
4008
+ description: "Subprocess",
4009
+ aliases: [
4010
+ "subprocess",
4011
+ "subproc",
4012
+ "framed-rectangle",
4013
+ "subroutine"
4014
+ ],
4015
+ handler: wn
4016
+ },
4017
+ {
4018
+ semanticName: "Database",
4019
+ name: "Cylinder",
4020
+ shortName: "cyl",
4021
+ description: "Database storage",
4022
+ aliases: [
4023
+ "db",
4024
+ "database",
4025
+ "cylinder"
4026
+ ],
4027
+ handler: Ge
4028
+ },
4029
+ {
4030
+ semanticName: "Data Store",
4031
+ name: "Data Store",
4032
+ shortName: "datastore",
4033
+ description: "Data flow diagram data store",
4034
+ aliases: ["data-store"],
4035
+ handler: qe
4036
+ },
4037
+ {
4038
+ semanticName: "Folder",
4039
+ name: "Folder",
4040
+ shortName: "folder",
4041
+ description: "Folder or directory",
4042
+ aliases: ["directory"],
4043
+ handler: tt
4044
+ },
4045
+ {
4046
+ semanticName: "Bucket",
4047
+ name: "Bucket",
4048
+ shortName: "bucket",
4049
+ description: "Object storage bucket",
4050
+ handler: fe
4051
+ },
4052
+ {
4053
+ semanticName: "Console",
4054
+ name: "Console (terminal window)",
4055
+ shortName: "console",
4056
+ description: "Terminal or console window",
4057
+ handler: Me
4058
+ },
4059
+ {
4060
+ semanticName: "Browser",
4061
+ name: "Browser",
4062
+ shortName: "browser",
4063
+ description: "Browser window",
4064
+ handler: Ee
4065
+ },
4066
+ {
4067
+ semanticName: "Person",
4068
+ name: "Person",
4069
+ shortName: "person",
4070
+ description: "Person (circular head above a rounded body)",
4071
+ handler: ze
4072
+ },
4073
+ {
4074
+ semanticName: "Start",
4075
+ name: "Circle",
4076
+ shortName: "circle",
4077
+ description: "Starting point",
4078
+ aliases: ["circ"],
4079
+ handler: Ae
4080
+ },
4081
+ {
4082
+ semanticName: "Bang",
4083
+ name: "Bang",
4084
+ shortName: "bang",
4085
+ description: "Bang",
4086
+ aliases: ["bang"],
4087
+ handler: er
4088
+ },
4089
+ {
4090
+ semanticName: "Cloud",
4091
+ name: "Cloud",
4092
+ shortName: "cloud",
4093
+ description: "cloud",
4094
+ aliases: ["cloud"],
4095
+ handler: tr
4096
+ },
4097
+ {
4098
+ semanticName: "Decision",
4099
+ name: "Diamond",
4100
+ shortName: "diam",
4101
+ description: "Decision-making step",
4102
+ aliases: [
4103
+ "decision",
4104
+ "diamond",
4105
+ "question"
4106
+ ],
4107
+ handler: ln
4108
+ },
4109
+ {
4110
+ semanticName: "Prepare Conditional",
4111
+ name: "Hexagon",
4112
+ shortName: "hex",
4113
+ description: "Preparation or condition step",
4114
+ aliases: ["hexagon", "prepare"],
4115
+ handler: at
4116
+ },
4117
+ {
4118
+ semanticName: "Data Input/Output",
4119
+ name: "Lean Right",
4120
+ shortName: "lean-r",
4121
+ description: "Represents input or output",
4122
+ aliases: ["lean-right", "in-out"],
4123
+ internalAliases: ["lean_right"],
4124
+ handler: ht
4125
+ },
4126
+ {
4127
+ semanticName: "Data Input/Output",
4128
+ name: "Lean Left",
4129
+ shortName: "lean-l",
4130
+ description: "Represents output or input",
4131
+ aliases: ["lean-left", "out-in"],
4132
+ internalAliases: ["lean_left"],
4133
+ handler: mt
4134
+ },
4135
+ {
4136
+ semanticName: "Priority Action",
4137
+ name: "Trapezoid Base Bottom",
4138
+ shortName: "trap-b",
4139
+ description: "Priority action",
4140
+ aliases: [
4141
+ "priority",
4142
+ "trapezoid-bottom",
4143
+ "trapezoid"
4144
+ ],
4145
+ handler: Fn
4146
+ },
4147
+ {
4148
+ semanticName: "Manual Operation",
4149
+ name: "Trapezoid Base Top",
4150
+ shortName: "trap-t",
4151
+ description: "Represents a manual task",
4152
+ aliases: [
4153
+ "manual",
4154
+ "trapezoid-top",
4155
+ "inv-trapezoid"
4156
+ ],
4157
+ internalAliases: ["inv_trapezoid"],
4158
+ handler: ft
4159
+ },
4160
+ {
4161
+ semanticName: "Stop",
4162
+ name: "Double Circle",
4163
+ shortName: "dbl-circ",
4164
+ description: "Represents a stop point",
4165
+ aliases: ["double-circle"],
4166
+ internalAliases: ["doublecircle"],
4167
+ handler: Ye
4168
+ },
4169
+ {
4170
+ semanticName: "Text Block",
4171
+ name: "Text Block",
4172
+ shortName: "text",
4173
+ description: "Text block",
4174
+ handler: On
4175
+ },
4176
+ {
4177
+ semanticName: "Card",
4178
+ name: "Notched Rectangle",
4179
+ shortName: "notch-rect",
4180
+ description: "Represents a card",
4181
+ aliases: ["card", "notched-rectangle"],
4182
+ handler: Oe
4183
+ },
4184
+ {
4185
+ semanticName: "Lined/Shaded Process",
4186
+ name: "Lined Rectangle",
4187
+ shortName: "lin-rect",
4188
+ description: "Lined process shape",
4189
+ aliases: [
4190
+ "lined-rectangle",
4191
+ "lined-process",
4192
+ "lin-proc",
4193
+ "shaded-process"
4194
+ ],
4195
+ handler: mn
4196
+ },
4197
+ {
4198
+ semanticName: "Start",
4199
+ name: "Small Circle",
4200
+ shortName: "sm-circ",
4201
+ description: "Small starting point",
4202
+ aliases: ["start", "small-circle"],
4203
+ internalAliases: ["stateStart"],
4204
+ handler: Sn
4205
+ },
4206
+ {
4207
+ semanticName: "Stop",
4208
+ name: "Framed Circle",
4209
+ shortName: "fr-circ",
4210
+ description: "Stop point",
4211
+ aliases: ["stop", "framed-circle"],
4212
+ internalAliases: ["stateEnd"],
4213
+ handler: xn
4214
+ },
4215
+ {
4216
+ semanticName: "Fork/Join",
4217
+ name: "Filled Rectangle",
4218
+ shortName: "fork",
4219
+ description: "Fork or join in process flow",
4220
+ aliases: ["join"],
4221
+ internalAliases: ["forkJoin"],
4222
+ handler: nt
4223
+ },
4224
+ {
4225
+ semanticName: "Collate",
4226
+ name: "Hourglass",
4227
+ shortName: "hourglass",
4228
+ description: "Represents a collate operation",
4229
+ aliases: ["hourglass", "collate"],
4230
+ handler: ot
4231
+ },
4232
+ {
4233
+ semanticName: "Comment",
4234
+ name: "Curly Brace",
4235
+ shortName: "brace",
4236
+ description: "Adds a comment",
4237
+ aliases: ["comment", "brace-l"],
4238
+ handler: Fe
4239
+ },
4240
+ {
4241
+ semanticName: "Comment Right",
4242
+ name: "Curly Brace",
4243
+ shortName: "brace-r",
4244
+ description: "Adds a comment",
4245
+ handler: Ie
4246
+ },
4247
+ {
4248
+ semanticName: "Comment with braces on both sides",
4249
+ name: "Curly Braces",
4250
+ shortName: "braces",
4251
+ description: "Adds a comment",
4252
+ handler: Le
4253
+ },
4254
+ {
4255
+ semanticName: "Com Link",
4256
+ name: "Lightning Bolt",
4257
+ shortName: "bolt",
4258
+ description: "Communication link",
4259
+ aliases: ["com-link", "lightning-bolt"],
4260
+ handler: gt
4261
+ },
4262
+ {
4263
+ semanticName: "Document",
4264
+ name: "Document",
4265
+ shortName: "doc",
4266
+ description: "Represents a document",
4267
+ aliases: ["doc", "document"],
4268
+ handler: Bn
4269
+ },
4270
+ {
4271
+ semanticName: "Delay",
4272
+ name: "Half-Rounded Rectangle",
4273
+ shortName: "delay",
4274
+ description: "Represents a delay",
4275
+ aliases: ["half-rounded-rectangle"],
4276
+ handler: rt
4277
+ },
4278
+ {
4279
+ semanticName: "Direct Access Storage",
4280
+ name: "Horizontal Cylinder",
4281
+ shortName: "h-cyl",
4282
+ description: "Direct access storage",
4283
+ aliases: ["das", "horizontal-cylinder"],
4284
+ handler: Pn
4285
+ },
4286
+ {
4287
+ semanticName: "Disk Storage",
4288
+ name: "Lined Cylinder",
4289
+ shortName: "lin-cyl",
4290
+ description: "Disk storage",
4291
+ aliases: ["disk", "lined-cylinder"],
4292
+ handler: St
4293
+ },
4294
+ {
4295
+ semanticName: "Display",
4296
+ name: "Curved Trapezoid",
4297
+ shortName: "curv-trap",
4298
+ description: "Represents a display",
4299
+ aliases: ["curved-trapezoid", "display"],
4300
+ handler: Re
4301
+ },
4302
+ {
4303
+ semanticName: "Divided Process",
4304
+ name: "Divided Rectangle",
4305
+ shortName: "div-rect",
4306
+ description: "Divided process shape",
4307
+ aliases: [
4308
+ "div-proc",
4309
+ "divided-rectangle",
4310
+ "divided-process"
4311
+ ],
4312
+ handler: Je
4313
+ },
4314
+ {
4315
+ semanticName: "Extract",
4316
+ name: "Triangle",
4317
+ shortName: "tri",
4318
+ description: "Extraction process",
4319
+ aliases: ["extract", "triangle"],
4320
+ handler: zn
4321
+ },
4322
+ {
4323
+ semanticName: "Internal Storage",
4324
+ name: "Window Pane",
4325
+ shortName: "win-pane",
4326
+ description: "Internal storage",
4327
+ aliases: ["internal-storage", "window-pane"],
4328
+ handler: Hn
4329
+ },
4330
+ {
4331
+ semanticName: "Junction",
4332
+ name: "Filled Circle",
4333
+ shortName: "f-circ",
4334
+ description: "Junction point",
4335
+ aliases: ["junction", "filled-circle"],
4336
+ handler: Ze
4337
+ },
4338
+ {
4339
+ semanticName: "Loop Limit",
4340
+ name: "Trapezoidal Pentagon",
4341
+ shortName: "notch-pent",
4342
+ description: "Loop limit step",
4343
+ aliases: ["loop-limit", "notched-pentagon"],
4344
+ handler: In
4345
+ },
4346
+ {
4347
+ semanticName: "Manual File",
4348
+ name: "Flipped Triangle",
4349
+ shortName: "flip-tri",
4350
+ description: "Manual file operation",
4351
+ aliases: ["manual-file", "flipped-triangle"],
4352
+ handler: et
4353
+ },
4354
+ {
4355
+ semanticName: "Manual Input",
4356
+ name: "Sloped Rectangle",
4357
+ shortName: "sl-rect",
4358
+ description: "Manual input step",
4359
+ aliases: ["manual-input", "sloped-rectangle"],
4360
+ handler: hn
4361
+ },
4362
+ {
4363
+ semanticName: "Multi-Document",
4364
+ name: "Stacked Document",
4365
+ shortName: "docs",
4366
+ description: "Multiple documents",
4367
+ aliases: [
4368
+ "documents",
4369
+ "st-doc",
4370
+ "stacked-document"
4371
+ ],
4372
+ handler: on
4373
+ },
4374
+ {
4375
+ semanticName: "Multi-Process",
4376
+ name: "Stacked Rectangle",
4377
+ shortName: "st-rect",
4378
+ description: "Multiple processes",
4379
+ aliases: [
4380
+ "procs",
4381
+ "processes",
4382
+ "stacked-rectangle"
4383
+ ],
4384
+ handler: an
4385
+ },
4386
+ {
4387
+ semanticName: "Stored Data",
4388
+ name: "Bow Tie Rectangle",
4389
+ shortName: "bow-rect",
4390
+ description: "Stored data",
4391
+ aliases: ["stored-data", "bow-tie-rectangle"],
4392
+ handler: de
4393
+ },
4394
+ {
4395
+ semanticName: "Summary",
4396
+ name: "Crossed Circle",
4397
+ shortName: "cross-circ",
4398
+ description: "Summary",
4399
+ aliases: ["summary", "crossed-circle"],
4400
+ handler: Pe
4401
+ },
4402
+ {
4403
+ semanticName: "Tagged Document",
4404
+ name: "Tagged Document",
4405
+ shortName: "tag-doc",
4406
+ description: "Tagged document",
4407
+ aliases: ["tag-doc", "tagged-document"],
4408
+ handler: Dn
4409
+ },
4410
+ {
4411
+ semanticName: "Tagged Process",
4412
+ name: "Tagged Rectangle",
4413
+ shortName: "tag-rect",
4414
+ description: "Tagged process",
4415
+ aliases: [
4416
+ "tagged-rectangle",
4417
+ "tag-proc",
4418
+ "tagged-process"
4419
+ ],
4420
+ handler: En
4421
+ },
4422
+ {
4423
+ semanticName: "Paper Tape",
4424
+ name: "Flag",
4425
+ shortName: "flag",
4426
+ description: "Paper tape",
4427
+ aliases: ["paper-tape"],
4428
+ handler: Vn
4429
+ },
4430
+ {
4431
+ semanticName: "Odd",
4432
+ name: "Odd",
4433
+ shortName: "odd",
4434
+ description: "Odd shape",
4435
+ internalAliases: ["rect_left_inv_arrow"],
4436
+ handler: un
4437
+ },
4438
+ {
4439
+ semanticName: "Lined Document",
4440
+ name: "Lined Document",
4441
+ shortName: "lin-doc",
4442
+ description: "Lined document",
4443
+ aliases: ["lined-document"],
4444
+ handler: Ct
4445
+ }
4446
+ ], ar = (/* @__PURE__ */ n(() => {
4447
+ let e = [...Object.entries({
4448
+ state: bn,
4449
+ choice: ke,
4450
+ note: sn,
4451
+ composite: je,
4452
+ rectWithTitle: dn,
4453
+ labelRect: pt,
4454
+ block_arrow: Te,
4455
+ collapsedGroup: ve,
4456
+ iconSquare: ut,
4457
+ iconCircle: ct,
4458
+ icon: st,
4459
+ iconRounded: lt,
4460
+ imageSquare: dt,
4461
+ anchor: ce,
4462
+ kanbanItem: $n,
4463
+ mindmapCircle: rr,
4464
+ defaultMindmapNode: nr,
4465
+ classBox: Xn,
4466
+ erBox: Gn,
4467
+ requirementBox: Zn,
4468
+ usecaseActor: Bt,
4469
+ usecaseActorHollow: Wt,
4470
+ usecaseActorAwesome: Ht,
4471
+ usecaseActorIcon: Yt,
4472
+ usecaseBusiness: Zt,
4473
+ usecaseEllipse: Xe,
4474
+ usecaseJsonTable: rn
4475
+ }), ...ir.flatMap((e) => [
4476
+ e.shortName,
4477
+ ..."aliases" in e ? e.aliases : [],
4478
+ ..."internalAliases" in e ? e.internalAliases : []
4479
+ ].map((t) => [t, e.handler]))];
4480
+ return Object.fromEntries(e);
4481
+ }, "generateShapeMap"))();
4482
+ function or(e) {
4483
+ return e in ar;
4484
+ }
4485
+ n(or, "isValidShape");
4486
+ //#endregion
4487
+ export { or as a, I as c, V as i, q as n, P as o, K as r, ar as s, se as t };