@umami/shiso 1.12.0 → 1.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 (121) hide show
  1. package/dist/chunks/App.js +76 -49
  2. package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
  3. package/dist/chunks/arc.js +130 -0
  4. package/dist/chunks/architecture-7GRP2DOG.js +4 -0
  5. package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
  6. package/dist/chunks/array.js +8 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
  9. package/dist/chunks/channel.js +9 -0
  10. package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
  11. package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
  12. package/dist/chunks/chunk-5VM5RSS4.js +21 -0
  13. package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
  14. package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
  15. package/dist/chunks/chunk-F27PBJKO.js +95 -0
  16. package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
  17. package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
  18. package/dist/chunks/chunk-GVQU2GXP.js +58 -0
  19. package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
  20. package/dist/chunks/chunk-JWPE2WC7.js +12 -0
  21. package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
  22. package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
  23. package/dist/chunks/chunk-P2QGCYS3.js +95 -0
  24. package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
  25. package/dist/chunks/chunk-PWAF6VOD.js +467 -0
  26. package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
  27. package/dist/chunks/chunk-SVP7TREG.js +686 -0
  28. package/dist/chunks/chunk-TICWLB2K.js +3800 -0
  29. package/dist/chunks/chunk-XXDRQBXY.js +12 -0
  30. package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
  31. package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
  32. package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
  33. package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
  34. package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
  35. package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
  36. package/dist/chunks/cytoscape.esm.js +28282 -0
  37. package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
  38. package/dist/chunks/dagre.js +4235 -0
  39. package/dist/chunks/defaultLocale.js +246 -0
  40. package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
  41. package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
  42. package/dist/chunks/diagram-VSXAHHWV.js +553 -0
  43. package/dist/chunks/diagram-VX7I27RA.js +798 -0
  44. package/dist/chunks/diagram-Z3DM3KII.js +186 -0
  45. package/dist/chunks/dist.js +92 -0
  46. package/dist/chunks/docs.js +987 -91
  47. package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
  48. package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
  49. package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
  50. package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
  51. package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
  52. package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
  53. package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
  54. package/dist/chunks/graphlib.js +4194 -0
  55. package/dist/chunks/info-A6RAGUB7.js +4 -0
  56. package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
  57. package/dist/chunks/init.js +14 -0
  58. package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
  59. package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
  60. package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
  61. package/dist/chunks/katex.js +26463 -0
  62. package/dist/chunks/line.js +48 -0
  63. package/dist/chunks/linear.js +391 -0
  64. package/dist/chunks/mermaid-parser.core.js +754 -0
  65. package/dist/chunks/mermaid.core.js +4898 -0
  66. package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
  67. package/dist/chunks/ordinal.js +84 -0
  68. package/dist/chunks/packet-AYTQ26CC.js +4 -0
  69. package/dist/chunks/path.js +106 -0
  70. package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
  71. package/dist/chunks/pie-WAS4IAKB.js +4 -0
  72. package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
  73. package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
  74. package/dist/chunks/radar-RG4KPBEZ.js +4 -0
  75. package/dist/chunks/railroad-74A4TZTK.js +4 -0
  76. package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
  77. package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
  78. package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
  79. package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
  80. package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
  81. package/dist/chunks/rough.esm.js +1396 -0
  82. package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
  83. package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
  84. package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
  85. package/dist/chunks/src.js +2653 -0
  86. package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
  87. package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
  88. package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
  89. package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
  90. package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
  91. package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
  92. package/dist/chunks/treemap-WGGIJYW6.js +4 -0
  93. package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
  94. package/dist/chunks/wardley-WFR3VGLG.js +4 -0
  95. package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
  96. package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
  97. package/dist/components.js +2 -2
  98. package/dist/entry-client.js +1 -1
  99. package/dist/entry-server.js +1 -1
  100. package/docs.schema.json +1 -1
  101. package/package.json +2 -1
  102. package/scripts/expand-navigation-globs.mjs +77 -8
  103. package/src/components/CodeBlock.tsx +36 -0
  104. package/src/components/Docs.tsx +44 -21
  105. package/src/components/OpenApiOperation.tsx +28 -20
  106. package/src/components/SideNav.tsx +8 -3
  107. package/src/components/docs/Changelog.tsx +163 -0
  108. package/src/components/docs/Mermaid.tsx +164 -0
  109. package/src/components/docs/Panel.tsx +23 -0
  110. package/src/components/docs/ParamField.tsx +17 -5
  111. package/src/components/docs/PropertiesTable.tsx +2 -2
  112. package/src/components/docs/ResponseField.tsx +17 -5
  113. package/src/components/docs/Tiles.tsx +59 -0
  114. package/src/components/docs/Tree.tsx +359 -0
  115. package/src/components/docs/Update.tsx +72 -0
  116. package/src/components/docs/index.ts +7 -0
  117. package/src/components/docs/panel-context.tsx +25 -0
  118. package/src/components/docs/styles.ts +49 -0
  119. package/src/components/icons/index.ts +4 -0
  120. package/src/lib/rehype-shiki.ts +18 -1
  121. package/types/components.d.ts +79 -0
@@ -0,0 +1,1029 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY.js";
2
+ import { m as log, p as select_default } from "./src.js";
3
+ import { T as getEffectiveHtmlLabels, b as getConfig, x as getConfig2 } from "./chunk-DU6HZSFF.js";
4
+ import { $ as cardinal_default, J as step_default, K as stepAfter, Q as catmullRom_default, X as monotoneX, Y as natural_default, Z as monotoneY, et as basis_default, g as utils_default, nt as bumpY, q as stepBefore, rt as linear_default, tt as bumpX, u as handleUndefinedAttr } from "./chunk-75Z2AOVW.js";
5
+ import { t as line_default } from "./line.js";
6
+ import { n as createText, r as fastdom_default } from "./chunk-GMAD6QVW.js";
7
+ import { i as styles2String, n as isLabelStyle } from "./chunk-P2QGCYS3.js";
8
+ import { t as at } from "./rough.esm.js";
9
+ import { t as createLabel_default } from "./chunk-4HAMMTFA.js";
10
+ import { n as getSubGraphTitleMargins } from "./chunk-GVQU2GXP.js";
11
+
12
+ //#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OSK3NFVY.mjs
13
+ var computeLabelTransform = /* @__PURE__ */ __name((bbox, useHtmlLabels) => {
14
+ if (useHtmlLabels) return "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")";
15
+ const x = bbox.x ?? 0;
16
+ const y = bbox.y ?? 0;
17
+ return "translate(" + -(x + bbox.width / 2) + ", " + -(y + bbox.height / 2) + ")";
18
+ }, "computeLabelTransform");
19
+ var markerOffsets = {
20
+ aggregation: 17.25,
21
+ extension: 17.25,
22
+ composition: 17.25,
23
+ dependency: 6,
24
+ lollipop: 13.5,
25
+ arrow_point: 4,
26
+ arrow_barb: 0,
27
+ arrow_barb_neo: 5.5
28
+ };
29
+ var markerOffsets2 = {
30
+ arrow_point: 4,
31
+ arrow_cross: 12.5,
32
+ arrow_circle: 12.5
33
+ };
34
+ function calculateDeltaAndAngle(point1, point2) {
35
+ if (point1 === void 0 || point2 === void 0) return {
36
+ angle: 0,
37
+ deltaX: 0,
38
+ deltaY: 0
39
+ };
40
+ point1 = pointTransformer(point1);
41
+ point2 = pointTransformer(point2);
42
+ const [x1, y1] = [point1.x, point1.y];
43
+ const [x2, y2] = [point2.x, point2.y];
44
+ const deltaX = x2 - x1;
45
+ const deltaY = y2 - y1;
46
+ return {
47
+ angle: Math.atan(deltaY / deltaX),
48
+ deltaX,
49
+ deltaY
50
+ };
51
+ }
52
+ __name(calculateDeltaAndAngle, "calculateDeltaAndAngle");
53
+ var pointTransformer = /* @__PURE__ */ __name((data) => {
54
+ if (Array.isArray(data)) return {
55
+ x: data[0],
56
+ y: data[1]
57
+ };
58
+ return data;
59
+ }, "pointTransformer");
60
+ var getLineFunctionsWithOffset = /* @__PURE__ */ __name((edge) => {
61
+ return {
62
+ x: /* @__PURE__ */ __name(function(d, i, data) {
63
+ let offset = 0;
64
+ const DIRECTION = pointTransformer(data[0]).x < pointTransformer(data[data.length - 1]).x ? "left" : "right";
65
+ if (i === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
66
+ const { angle, deltaX } = calculateDeltaAndAngle(data[0], data[1]);
67
+ offset = markerOffsets[edge.arrowTypeStart] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1);
68
+ } else if (i === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
69
+ const { angle, deltaX } = calculateDeltaAndAngle(data[data.length - 1], data[data.length - 2]);
70
+ offset = markerOffsets[edge.arrowTypeEnd] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1);
71
+ }
72
+ const differenceToEnd = Math.abs(pointTransformer(d).x - pointTransformer(data[data.length - 1]).x);
73
+ const differenceInYEnd = Math.abs(pointTransformer(d).y - pointTransformer(data[data.length - 1]).y);
74
+ const differenceToStart = Math.abs(pointTransformer(d).x - pointTransformer(data[0]).x);
75
+ const differenceInYStart = Math.abs(pointTransformer(d).y - pointTransformer(data[0]).y);
76
+ const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
77
+ const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
78
+ const extraRoom = 1;
79
+ if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInYEnd < endMarkerHeight) {
80
+ let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
81
+ adjustment *= DIRECTION === "right" ? -1 : 1;
82
+ offset -= adjustment;
83
+ }
84
+ if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInYStart < startMarkerHeight) {
85
+ let adjustment = startMarkerHeight + extraRoom - differenceToStart;
86
+ adjustment *= DIRECTION === "right" ? -1 : 1;
87
+ offset += adjustment;
88
+ }
89
+ return pointTransformer(d).x + offset;
90
+ }, "x"),
91
+ y: /* @__PURE__ */ __name(function(d, i, data) {
92
+ let offset = 0;
93
+ const DIRECTION = pointTransformer(data[0]).y < pointTransformer(data[data.length - 1]).y ? "down" : "up";
94
+ if (i === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
95
+ const { angle, deltaY } = calculateDeltaAndAngle(data[0], data[1]);
96
+ offset = markerOffsets[edge.arrowTypeStart] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1);
97
+ } else if (i === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
98
+ const { angle, deltaY } = calculateDeltaAndAngle(data[data.length - 1], data[data.length - 2]);
99
+ offset = markerOffsets[edge.arrowTypeEnd] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1);
100
+ }
101
+ const differenceToEnd = Math.abs(pointTransformer(d).y - pointTransformer(data[data.length - 1]).y);
102
+ const differenceInXEnd = Math.abs(pointTransformer(d).x - pointTransformer(data[data.length - 1]).x);
103
+ const differenceToStart = Math.abs(pointTransformer(d).y - pointTransformer(data[0]).y);
104
+ const differenceInXStart = Math.abs(pointTransformer(d).x - pointTransformer(data[0]).x);
105
+ const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
106
+ const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
107
+ const extraRoom = 1;
108
+ if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInXEnd < endMarkerHeight) {
109
+ let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
110
+ adjustment *= DIRECTION === "up" ? -1 : 1;
111
+ offset -= adjustment;
112
+ }
113
+ if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInXStart < startMarkerHeight) {
114
+ let adjustment = startMarkerHeight + extraRoom - differenceToStart;
115
+ adjustment *= DIRECTION === "up" ? -1 : 1;
116
+ offset += adjustment;
117
+ }
118
+ return pointTransformer(d).y + offset;
119
+ }, "y")
120
+ };
121
+ }, "getLineFunctionsWithOffset");
122
+ var addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id, diagramType, useMargin = false, strokeColor) => {
123
+ if (edge.arrowTypeStart) addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id, diagramType, useMargin, strokeColor);
124
+ if (edge.arrowTypeEnd) addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id, diagramType, useMargin, strokeColor);
125
+ }, "addEdgeMarkers");
126
+ var arrowTypesMap = {
127
+ arrow_cross: {
128
+ type: "cross",
129
+ fill: false
130
+ },
131
+ arrow_point: {
132
+ type: "point",
133
+ fill: true
134
+ },
135
+ arrow_barb: {
136
+ type: "barb",
137
+ fill: true
138
+ },
139
+ arrow_barb_neo: {
140
+ type: "barb",
141
+ fill: true
142
+ },
143
+ arrow_circle: {
144
+ type: "circle",
145
+ fill: false
146
+ },
147
+ aggregation: {
148
+ type: "aggregation",
149
+ fill: false
150
+ },
151
+ extension: {
152
+ type: "extension",
153
+ fill: false
154
+ },
155
+ composition: {
156
+ type: "composition",
157
+ fill: true
158
+ },
159
+ dependency: {
160
+ type: "dependency",
161
+ fill: true
162
+ },
163
+ lollipop: {
164
+ type: "lollipop",
165
+ fill: false
166
+ },
167
+ only_one: {
168
+ type: "onlyOne",
169
+ fill: false
170
+ },
171
+ zero_or_one: {
172
+ type: "zeroOrOne",
173
+ fill: false
174
+ },
175
+ one_or_more: {
176
+ type: "oneOrMore",
177
+ fill: false
178
+ },
179
+ zero_or_more: {
180
+ type: "zeroOrMore",
181
+ fill: false
182
+ },
183
+ requirement_arrow: {
184
+ type: "requirement_arrow",
185
+ fill: false
186
+ },
187
+ requirement_contains: {
188
+ type: "requirement_contains",
189
+ fill: false
190
+ }
191
+ };
192
+ var arrowTypesWithMarginSupport = [
193
+ "cross",
194
+ "point",
195
+ "circle",
196
+ "lollipop",
197
+ "aggregation",
198
+ "extension",
199
+ "composition",
200
+ "dependency",
201
+ "barb"
202
+ ];
203
+ var addEdgeMarker = /* @__PURE__ */ __name((svgPath, position, arrowType, url, id, diagramType, useMargin = false, strokeColor) => {
204
+ if (!arrowType || arrowType === "none") return;
205
+ const arrowTypeInfo = arrowTypesMap[arrowType];
206
+ const marginSupport = arrowTypeInfo && arrowTypesWithMarginSupport.includes(arrowTypeInfo.type);
207
+ if (!arrowTypeInfo) {
208
+ log.warn(`Unknown arrow type: ${arrowType}`);
209
+ return;
210
+ }
211
+ const originalMarkerId = `${id}_${diagramType}-${arrowTypeInfo.type}${position === "start" ? "Start" : "End"}${useMargin && marginSupport ? "-margin" : ""}`;
212
+ if (strokeColor && strokeColor.trim() !== "") {
213
+ const coloredMarkerId = `${originalMarkerId}_${strokeColor.replace(/[^\dA-Za-z]/g, "_")}`;
214
+ if (!document.getElementById(coloredMarkerId)) {
215
+ const originalMarker = document.getElementById(originalMarkerId);
216
+ if (originalMarker) {
217
+ const coloredMarker = originalMarker.cloneNode(true);
218
+ coloredMarker.id = coloredMarkerId;
219
+ coloredMarker.querySelectorAll("path, circle, line").forEach((path) => {
220
+ path.setAttribute("stroke", strokeColor);
221
+ if (arrowTypeInfo.fill) path.setAttribute("fill", strokeColor);
222
+ });
223
+ originalMarker.parentNode?.appendChild(coloredMarker);
224
+ }
225
+ }
226
+ svgPath.attr(`marker-${position}`, `url(${url}#${coloredMarkerId})`);
227
+ } else svgPath.attr(`marker-${position}`, `url(${url}#${originalMarkerId})`);
228
+ }, "addEdgeMarker");
229
+ var resolveEdgeCurveType = /* @__PURE__ */ __name((edgeCurve) => {
230
+ return typeof edgeCurve === "string" ? edgeCurve : getConfig2()?.flowchart?.curve;
231
+ }, "resolveEdgeCurveType");
232
+ var edgeLabels = /* @__PURE__ */ new Map();
233
+ var terminalLabels = /* @__PURE__ */ new Map();
234
+ var clear = /* @__PURE__ */ __name(() => {
235
+ edgeLabels.clear();
236
+ terminalLabels.clear();
237
+ }, "clear");
238
+ var hasEdgeLabel = /* @__PURE__ */ __name((edge) => Boolean(edge.label || edge.startLabelLeft || edge.startLabelRight || edge.endLabelLeft || edge.endLabelRight), "hasEdgeLabel");
239
+ var getLabelStyles = /* @__PURE__ */ __name((styleArray) => {
240
+ if (!styleArray) return "";
241
+ if (typeof styleArray === "string") return styleArray;
242
+ return styleArray.reduce((acc, style) => acc + ";" + style, "");
243
+ }, "getLabelStyles");
244
+ var insertEdgeLabel = /* @__PURE__ */ __name(async (elem, edge) => {
245
+ const config = getConfig2();
246
+ let useHtmlLabels = getEffectiveHtmlLabels(config);
247
+ const { labelStyles } = styles2String(edge);
248
+ edge.labelStyle = labelStyles;
249
+ const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
250
+ const label = edgeLabel.insert("g").attr("class", "label").attr("data-id", edge.id);
251
+ const isMarkdown = edge.labelType === "markdown";
252
+ const labelElement = await createText(elem, edge.label, {
253
+ style: getLabelStyles(edge.labelStyle),
254
+ useHtmlLabels,
255
+ addSvgBackground: true,
256
+ isNode: false,
257
+ markdown: isMarkdown,
258
+ width: isMarkdown ? void 0 : void 0
259
+ }, config);
260
+ label.node().appendChild(labelElement);
261
+ log.info("abc82", edge, edge.labelType);
262
+ let bbox;
263
+ let transformBbox;
264
+ if (useHtmlLabels) {
265
+ const div = labelElement.children[0];
266
+ const dv = select_default(labelElement);
267
+ bbox = await fastdom_default.measure(() => div.getBoundingClientRect());
268
+ transformBbox = bbox;
269
+ dv.attr("width", bbox.width);
270
+ dv.attr("height", bbox.height);
271
+ } else {
272
+ const textEl = select_default(labelElement).select("text").node();
273
+ await fastdom_default.measure(() => {
274
+ bbox = labelElement.getBBox();
275
+ if (textEl && typeof textEl.getBBox === "function") transformBbox = textEl.getBBox();
276
+ else transformBbox = bbox;
277
+ });
278
+ }
279
+ label.attr("transform", computeLabelTransform(transformBbox, useHtmlLabels));
280
+ edgeLabels.set(edge.id, edgeLabel);
281
+ edge.width = bbox.width;
282
+ edge.height = bbox.height;
283
+ let fo;
284
+ if (edge.startLabelLeft) {
285
+ const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
286
+ const inner = startEdgeLabelLeft.insert("g").attr("class", "inner");
287
+ const startLabelElement = await createLabel_default(inner, edge.startLabelLeft, getLabelStyles(edge.labelStyle) || "", false, false);
288
+ fo = startLabelElement;
289
+ let slBox = startLabelElement.getBBox();
290
+ if (useHtmlLabels) {
291
+ const div = startLabelElement.children[0];
292
+ const dv = select_default(startLabelElement);
293
+ slBox = div.getBoundingClientRect();
294
+ dv.attr("width", slBox.width);
295
+ dv.attr("height", slBox.height);
296
+ }
297
+ inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
298
+ if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
299
+ terminalLabels.get(edge.id).startLeft = startEdgeLabelLeft;
300
+ setTerminalWidth(fo, edge.startLabelLeft);
301
+ }
302
+ if (edge.startLabelRight) {
303
+ const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
304
+ const inner = startEdgeLabelRight.insert("g").attr("class", "inner");
305
+ const startLabelElement = await createLabel_default(inner, edge.startLabelRight, getLabelStyles(edge.labelStyle) || "", false, false);
306
+ fo = startLabelElement;
307
+ let slBox = startLabelElement.getBBox();
308
+ if (useHtmlLabels) {
309
+ const div = startLabelElement.children[0];
310
+ const dv = select_default(startLabelElement);
311
+ slBox = div.getBoundingClientRect();
312
+ dv.attr("width", slBox.width);
313
+ dv.attr("height", slBox.height);
314
+ }
315
+ inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
316
+ if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
317
+ terminalLabels.get(edge.id).startRight = startEdgeLabelRight;
318
+ setTerminalWidth(fo, edge.startLabelRight);
319
+ }
320
+ if (edge.endLabelLeft) {
321
+ const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
322
+ const inner = endEdgeLabelLeft.insert("g").attr("class", "inner");
323
+ const endLabelElement = await createLabel_default(endEdgeLabelLeft, edge.endLabelLeft, getLabelStyles(edge.labelStyle) || "", false, false);
324
+ fo = endLabelElement;
325
+ let slBox = endLabelElement.getBBox();
326
+ if (useHtmlLabels) {
327
+ const div = endLabelElement.children[0];
328
+ const dv = select_default(endLabelElement);
329
+ slBox = div.getBoundingClientRect();
330
+ dv.attr("width", slBox.width);
331
+ dv.attr("height", slBox.height);
332
+ }
333
+ inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
334
+ if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
335
+ terminalLabels.get(edge.id).endLeft = endEdgeLabelLeft;
336
+ setTerminalWidth(fo, edge.endLabelLeft);
337
+ }
338
+ if (edge.endLabelRight) {
339
+ const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
340
+ const inner = endEdgeLabelRight.insert("g").attr("class", "inner");
341
+ const endLabelElement = await createLabel_default(endEdgeLabelRight, edge.endLabelRight, getLabelStyles(edge.labelStyle) || "", false, false);
342
+ fo = endLabelElement;
343
+ let slBox = endLabelElement.getBBox();
344
+ if (useHtmlLabels) {
345
+ const div = endLabelElement.children[0];
346
+ const dv = select_default(endLabelElement);
347
+ slBox = div.getBoundingClientRect();
348
+ dv.attr("width", slBox.width);
349
+ dv.attr("height", slBox.height);
350
+ }
351
+ inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
352
+ if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
353
+ terminalLabels.get(edge.id).endRight = endEdgeLabelRight;
354
+ setTerminalWidth(fo, edge.endLabelRight);
355
+ }
356
+ return labelElement;
357
+ }, "insertEdgeLabel");
358
+ function setTerminalWidth(fo, value) {
359
+ if (getEffectiveHtmlLabels(getConfig2()) && fo) {
360
+ fo.style.width = value.length * 9 + "px";
361
+ fo.style.height = "12px";
362
+ }
363
+ }
364
+ __name(setTerminalWidth, "setTerminalWidth");
365
+ var positionEdgeLabel = /* @__PURE__ */ __name((edge, paths) => {
366
+ log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels.get(edge.id), paths);
367
+ let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
368
+ const siteConfig = getConfig2();
369
+ const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);
370
+ if (edge.label) {
371
+ const el = edgeLabels.get(edge.id);
372
+ let x = edge.x;
373
+ let y = edge.y;
374
+ if (path) {
375
+ const pos = utils_default.calcLabelPosition(path);
376
+ log.debug("Moving label " + edge.label + " from (", x, ",", y, ") to (", pos.x, ",", pos.y, ") abc88");
377
+ if (paths.updatedPath) {
378
+ x = pos.x;
379
+ y = pos.y;
380
+ }
381
+ }
382
+ el.attr("transform", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);
383
+ }
384
+ if (edge.startLabelLeft) {
385
+ const el = terminalLabels.get(edge.id).startLeft;
386
+ let x = edge.x;
387
+ let y = edge.y;
388
+ if (path) {
389
+ const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path);
390
+ x = pos.x;
391
+ y = pos.y;
392
+ }
393
+ el.attr("transform", `translate(${x}, ${y})`);
394
+ }
395
+ if (edge.startLabelRight) {
396
+ const el = terminalLabels.get(edge.id).startRight;
397
+ let x = edge.x;
398
+ let y = edge.y;
399
+ if (path) {
400
+ const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_right", path);
401
+ x = pos.x;
402
+ y = pos.y;
403
+ }
404
+ el.attr("transform", `translate(${x}, ${y})`);
405
+ }
406
+ if (edge.endLabelLeft) {
407
+ const el = terminalLabels.get(edge.id).endLeft;
408
+ let x = edge.x;
409
+ let y = edge.y;
410
+ if (path) {
411
+ const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path);
412
+ x = pos.x;
413
+ y = pos.y;
414
+ }
415
+ el.attr("transform", `translate(${x}, ${y})`);
416
+ }
417
+ if (edge.endLabelRight) {
418
+ const el = terminalLabels.get(edge.id).endRight;
419
+ let x = edge.x;
420
+ let y = edge.y;
421
+ if (path) {
422
+ const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path);
423
+ x = pos.x;
424
+ y = pos.y;
425
+ }
426
+ el.attr("transform", `translate(${x}, ${y})`);
427
+ }
428
+ }, "positionEdgeLabel");
429
+ var orthogonalizeToLabelClippedPoints = /* @__PURE__ */ __name((edge, points) => {
430
+ if (!edge?.isLabelEdge || !edge?.id?.endsWith("-to-label") || !Array.isArray(points)) return points;
431
+ if (points.length !== 2) return points;
432
+ const [start, end] = points;
433
+ const dx = Math.abs(end.x - start.x);
434
+ const dy = Math.abs(end.y - start.y);
435
+ if (dx < .001 || dy < .001) return points;
436
+ if (dy >= dx) return [
437
+ start,
438
+ {
439
+ x: start.x,
440
+ y: end.y
441
+ },
442
+ end
443
+ ];
444
+ return [
445
+ start,
446
+ {
447
+ x: end.x,
448
+ y: start.y
449
+ },
450
+ end
451
+ ];
452
+ }, "orthogonalizeToLabelClippedPoints");
453
+ var outsideNode = /* @__PURE__ */ __name((node, point2) => {
454
+ const x = node.x;
455
+ const y = node.y;
456
+ const dx = Math.abs(point2.x - x);
457
+ const dy = Math.abs(point2.y - y);
458
+ const w = node.width / 2;
459
+ const h = node.height / 2;
460
+ return dx >= w || dy >= h;
461
+ }, "outsideNode");
462
+ var intersection = /* @__PURE__ */ __name((node, outsidePoint, insidePoint) => {
463
+ log.debug(`intersection calc abc89:
464
+ outsidePoint: ${JSON.stringify(outsidePoint)}
465
+ insidePoint : ${JSON.stringify(insidePoint)}
466
+ node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);
467
+ const x = node.x;
468
+ const y = node.y;
469
+ const dx = Math.abs(x - insidePoint.x);
470
+ const w = node.width / 2;
471
+ let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;
472
+ const h = node.height / 2;
473
+ const Q = Math.abs(outsidePoint.y - insidePoint.y);
474
+ const R = Math.abs(outsidePoint.x - insidePoint.x);
475
+ if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
476
+ let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
477
+ r = R * q / Q;
478
+ const res = {
479
+ x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,
480
+ y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q
481
+ };
482
+ if (r === 0) {
483
+ res.x = outsidePoint.x;
484
+ res.y = outsidePoint.y;
485
+ }
486
+ if (R === 0) res.x = outsidePoint.x;
487
+ if (Q === 0) res.y = outsidePoint.y;
488
+ log.debug(`abc89 top/bottom calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
489
+ return res;
490
+ } else {
491
+ if (insidePoint.x < outsidePoint.x) r = outsidePoint.x - w - x;
492
+ else r = x - w - outsidePoint.x;
493
+ let q = Q * r / R;
494
+ let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;
495
+ let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;
496
+ log.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, {
497
+ _x,
498
+ _y
499
+ });
500
+ if (r === 0) {
501
+ _x = outsidePoint.x;
502
+ _y = outsidePoint.y;
503
+ }
504
+ if (R === 0) _x = outsidePoint.x;
505
+ if (Q === 0) _y = outsidePoint.y;
506
+ return {
507
+ x: _x,
508
+ y: _y
509
+ };
510
+ }
511
+ }, "intersection");
512
+ var cutPathAtIntersect = /* @__PURE__ */ __name((_points, boundaryNode) => {
513
+ log.warn("abc88 cutPathAtIntersect", _points, boundaryNode);
514
+ let points = [];
515
+ let lastPointOutside = _points[0];
516
+ let isInside = false;
517
+ _points.forEach((point2) => {
518
+ log.info("abc88 checking point", point2, boundaryNode);
519
+ if (!outsideNode(boundaryNode, point2) && !isInside) {
520
+ const inter = intersection(boundaryNode, lastPointOutside, point2);
521
+ log.debug("abc88 inside", point2, lastPointOutside, inter);
522
+ log.debug("abc88 intersection", inter, boundaryNode);
523
+ let pointPresent = false;
524
+ points.forEach((p) => {
525
+ pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;
526
+ });
527
+ if (!points.some((e) => e.x === inter.x && e.y === inter.y)) points.push(inter);
528
+ else log.warn("abc88 no intersect", inter, points);
529
+ isInside = true;
530
+ } else {
531
+ log.warn("abc88 outside", point2, lastPointOutside);
532
+ lastPointOutside = point2;
533
+ if (!isInside) points.push(point2);
534
+ }
535
+ });
536
+ log.debug("returning points", points);
537
+ return points;
538
+ }, "cutPathAtIntersect");
539
+ function extractCornerPoints(points) {
540
+ const cornerPoints = [];
541
+ const cornerPointPositions = [];
542
+ for (let i = 1; i < points.length - 1; i++) {
543
+ const prev = points[i - 1];
544
+ const curr = points[i];
545
+ const next = points[i + 1];
546
+ if (prev.x === curr.x && curr.y === next.y && Math.abs(curr.x - next.x) > 5 && Math.abs(curr.y - prev.y) > 5) {
547
+ cornerPoints.push(curr);
548
+ cornerPointPositions.push(i);
549
+ } else if (prev.y === curr.y && curr.x === next.x && Math.abs(curr.x - prev.x) > 5 && Math.abs(curr.y - next.y) > 5) {
550
+ cornerPoints.push(curr);
551
+ cornerPointPositions.push(i);
552
+ }
553
+ }
554
+ return {
555
+ cornerPoints,
556
+ cornerPointPositions
557
+ };
558
+ }
559
+ __name(extractCornerPoints, "extractCornerPoints");
560
+ var findAdjacentPoint = /* @__PURE__ */ __name(function(pointA, pointB, distance) {
561
+ const xDiff = pointB.x - pointA.x;
562
+ const yDiff = pointB.y - pointA.y;
563
+ const ratio = distance / Math.sqrt(xDiff * xDiff + yDiff * yDiff);
564
+ return {
565
+ x: pointB.x - ratio * xDiff,
566
+ y: pointB.y - ratio * yDiff
567
+ };
568
+ }, "findAdjacentPoint");
569
+ var fixCorners = /* @__PURE__ */ __name(function(lineData) {
570
+ const { cornerPointPositions } = extractCornerPoints(lineData);
571
+ const newLineData = [];
572
+ for (let i = 0; i < lineData.length; i++) if (cornerPointPositions.includes(i)) {
573
+ const prevPoint = lineData[i - 1];
574
+ const nextPoint = lineData[i + 1];
575
+ const cornerPoint = lineData[i];
576
+ const newPrevPoint = findAdjacentPoint(prevPoint, cornerPoint, 5);
577
+ const newNextPoint = findAdjacentPoint(nextPoint, cornerPoint, 5);
578
+ const xDiff = newNextPoint.x - newPrevPoint.x;
579
+ const yDiff = newNextPoint.y - newPrevPoint.y;
580
+ newLineData.push(newPrevPoint);
581
+ const a = Math.sqrt(2) * 2;
582
+ let newCornerPoint = {
583
+ x: cornerPoint.x,
584
+ y: cornerPoint.y
585
+ };
586
+ if (Math.abs(nextPoint.x - prevPoint.x) > 10 && Math.abs(nextPoint.y - prevPoint.y) >= 10) {
587
+ log.debug("Corner point fixing", Math.abs(nextPoint.x - prevPoint.x), Math.abs(nextPoint.y - prevPoint.y));
588
+ const r = 5;
589
+ if (cornerPoint.x === newPrevPoint.x) newCornerPoint = {
590
+ x: xDiff < 0 ? newPrevPoint.x - r + a : newPrevPoint.x + r - a,
591
+ y: yDiff < 0 ? newPrevPoint.y - a : newPrevPoint.y + a
592
+ };
593
+ else newCornerPoint = {
594
+ x: xDiff < 0 ? newPrevPoint.x - a : newPrevPoint.x + a,
595
+ y: yDiff < 0 ? newPrevPoint.y - r + a : newPrevPoint.y + r - a
596
+ };
597
+ } else log.debug("Corner point skipping fixing", Math.abs(nextPoint.x - prevPoint.x), Math.abs(nextPoint.y - prevPoint.y));
598
+ newLineData.push(newCornerPoint, newNextPoint);
599
+ } else newLineData.push(lineData[i]);
600
+ return newLineData;
601
+ }, "fixCorners");
602
+ var generateDashArray = /* @__PURE__ */ __name((len, oValueS, oValueE) => {
603
+ const middleLength = len - oValueS - oValueE;
604
+ const dashLength = 2;
605
+ const gapLength = 2;
606
+ const rawPairs = Math.floor(middleLength / 4);
607
+ return `0 ${oValueS} ${Array(Number.isFinite(rawPairs) ? Math.max(0, rawPairs) : 0).fill(`${dashLength} ${gapLength}`).join(" ")} ${oValueE}`;
608
+ }, "generateDashArray");
609
+ var insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb, diagramType, startNode, endNode, diagramId, skipIntersect = false) {
610
+ if (!diagramId) throw new Error(`insertEdge: missing diagramId for edge "${edge.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);
611
+ const { handDrawnSeed, layout } = getConfig2();
612
+ let points = edge.points;
613
+ let pointsHasChanged = false;
614
+ const tail = startNode;
615
+ var head = endNode;
616
+ const edgeClassStyles = [];
617
+ for (const key in edge.cssCompiledStyles) {
618
+ if (isLabelStyle(key)) continue;
619
+ edgeClassStyles.push(edge.cssCompiledStyles[key]);
620
+ }
621
+ if (layout === "swimlane") {
622
+ if (head.intersect && tail.intersect && Array.isArray(points) && points.length >= 2) if (points.length === 2) points = [tail.intersect(points[0]), head.intersect(points[1])];
623
+ else {
624
+ const innerPoints = points.slice(1, -1);
625
+ const firstInner = innerPoints[0];
626
+ const lastInner = innerPoints[innerPoints.length - 1];
627
+ const TOLERANCE = .5;
628
+ const lastIsPinned = Math.abs(points[points.length - 1].x - lastInner.x) < TOLERANCE && Math.abs(points[points.length - 1].y - lastInner.y) < TOLERANCE;
629
+ const newFirst = tail.intersect(firstInner);
630
+ const newLast = lastIsPinned ? lastInner : head.intersect(lastInner);
631
+ const lastIsDuplicate = Math.abs(newLast.x - lastInner.x) < TOLERANCE && Math.abs(newLast.y - lastInner.y) < TOLERANCE;
632
+ const startPoints = Math.abs(newFirst.x - firstInner.x) < TOLERANCE && Math.abs(newFirst.y - firstInner.y) < TOLERANCE ? [] : [newFirst];
633
+ const endPoints = lastIsDuplicate ? [] : [newLast];
634
+ points = [
635
+ ...startPoints,
636
+ ...innerPoints,
637
+ ...endPoints
638
+ ];
639
+ }
640
+ points = orthogonalizeToLabelClippedPoints(edge, points);
641
+ } else if (head.intersect && tail.intersect && !skipIntersect) {
642
+ points = points.slice(1, edge.points.length - 1);
643
+ points.unshift(tail.intersect(points[0]));
644
+ points.push(head.intersect(points[points.length - 1]));
645
+ }
646
+ const pointsStr = btoa(JSON.stringify(points));
647
+ if (edge.toCluster) {
648
+ log.info("to cluster abc88", clusterDb.get(edge.toCluster));
649
+ points = cutPathAtIntersect(edge.points, clusterDb.get(edge.toCluster).node);
650
+ pointsHasChanged = true;
651
+ }
652
+ if (edge.fromCluster) {
653
+ log.debug("from cluster abc88", clusterDb.get(edge.fromCluster), JSON.stringify(points, null, 2));
654
+ points = cutPathAtIntersect(points.reverse(), clusterDb.get(edge.fromCluster).node).reverse();
655
+ pointsHasChanged = true;
656
+ }
657
+ let lineData = points.filter((p) => !Number.isNaN(p.y));
658
+ const edgeCurveType = resolveEdgeCurveType(edge.curve);
659
+ if (edgeCurveType !== "rounded") lineData = fixCorners(lineData);
660
+ let curve = linear_default;
661
+ switch (edgeCurveType) {
662
+ case "linear":
663
+ curve = linear_default;
664
+ break;
665
+ case "basis":
666
+ curve = basis_default;
667
+ break;
668
+ case "cardinal":
669
+ curve = cardinal_default;
670
+ break;
671
+ case "bumpX":
672
+ curve = bumpX;
673
+ break;
674
+ case "bumpY":
675
+ curve = bumpY;
676
+ break;
677
+ case "catmullRom":
678
+ curve = catmullRom_default;
679
+ break;
680
+ case "monotoneX":
681
+ curve = monotoneX;
682
+ break;
683
+ case "monotoneY":
684
+ curve = monotoneY;
685
+ break;
686
+ case "natural":
687
+ curve = natural_default;
688
+ break;
689
+ case "step":
690
+ curve = step_default;
691
+ break;
692
+ case "stepAfter":
693
+ curve = stepAfter;
694
+ break;
695
+ case "stepBefore":
696
+ curve = stepBefore;
697
+ break;
698
+ case "rounded":
699
+ curve = linear_default;
700
+ break;
701
+ default: curve = basis_default;
702
+ }
703
+ const { x, y } = getLineFunctionsWithOffset(edge);
704
+ const lineFunction = line_default().x(x).y(y).curve(curve);
705
+ let strokeClasses;
706
+ switch (edge.thickness) {
707
+ case "normal":
708
+ strokeClasses = "edge-thickness-normal";
709
+ break;
710
+ case "thick":
711
+ strokeClasses = "edge-thickness-thick";
712
+ break;
713
+ case "invisible":
714
+ strokeClasses = "edge-thickness-invisible";
715
+ break;
716
+ default: strokeClasses = "edge-thickness-normal";
717
+ }
718
+ switch (edge.pattern) {
719
+ case "solid":
720
+ strokeClasses += " edge-pattern-solid";
721
+ break;
722
+ case "dotted":
723
+ strokeClasses += " edge-pattern-dotted";
724
+ break;
725
+ case "dashed":
726
+ strokeClasses += " edge-pattern-dashed";
727
+ break;
728
+ default: strokeClasses += " edge-pattern-solid";
729
+ }
730
+ let svgPath;
731
+ let linePath = edgeCurveType === "rounded" ? generateRoundedPath(applyMarkerOffsetsToPoints(lineData, edge), 5) : lineFunction(lineData);
732
+ const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
733
+ let strokeColor = edgeStyles.find((style) => style?.startsWith("stroke:"));
734
+ let animationClass = "";
735
+ if (edge.animate) animationClass = "edge-animation-fast";
736
+ if (edge.animation) animationClass = "edge-animation-" + edge.animation;
737
+ let animatedEdge = false;
738
+ if (edge.look === "handDrawn") {
739
+ const rc = at.svg(elem);
740
+ Object.assign([], lineData);
741
+ const svgPathNode = rc.path(linePath, {
742
+ roughness: .3,
743
+ seed: handDrawnSeed
744
+ });
745
+ strokeClasses += " transition";
746
+ svgPath = select_default(svgPathNode).select("path").attr("id", `${diagramId}-${edge.id}`).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ? " " + animationClass : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style) => acc + ";" + style, "") : "");
747
+ let d = svgPath.attr("d");
748
+ svgPath.attr("d", d);
749
+ elem.node().appendChild(svgPath.node());
750
+ } else {
751
+ const stylesFromClasses = edgeClassStyles.join(";");
752
+ const styles = edgeStyles ? edgeStyles.reduce((acc, style) => acc + style + ";", "") : "";
753
+ const pathStyle = (stylesFromClasses ? stylesFromClasses + ";" + styles + ";" : styles) + ";" + (edgeStyles ? edgeStyles.reduce((acc, style) => acc + ";" + style, "") : "");
754
+ svgPath = elem.append("path").attr("d", linePath).attr("id", `${diagramId}-${edge.id}`).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ? " " + animationClass : "")).attr("style", pathStyle);
755
+ strokeColor = pathStyle.match(/stroke:([^;]+)/)?.[1];
756
+ animatedEdge = edge.animate === true || !!edge.animation || stylesFromClasses.includes("animation");
757
+ const pathNode = svgPath.node();
758
+ const len = typeof pathNode.getTotalLength === "function" ? pathNode.getTotalLength() : 0;
759
+ const oValueS = markerOffsets2[edge.arrowTypeStart] || 0;
760
+ const oValueE = markerOffsets2[edge.arrowTypeEnd] || 0;
761
+ if (edge.look === "neo" && !animatedEdge) {
762
+ const mOffset = `stroke-dasharray: ${edge.pattern === "dotted" || edge.pattern === "dashed" ? generateDashArray(len, oValueS, oValueE) : `0 ${oValueS} ${len - oValueS - oValueE} ${oValueE}`}; stroke-dashoffset: 0;`;
763
+ svgPath.attr("style", mOffset + svgPath.attr("style"));
764
+ }
765
+ }
766
+ svgPath.attr("data-edge", true);
767
+ svgPath.attr("data-et", "edge");
768
+ svgPath.attr("data-id", edge.id);
769
+ svgPath.attr("data-points", pointsStr);
770
+ svgPath.attr("data-look", handleUndefinedAttr(edge.look));
771
+ if (edge.showPoints) lineData.forEach((point3) => {
772
+ elem.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", point3.x).attr("cy", point3.y);
773
+ });
774
+ let url = "";
775
+ if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {
776
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
777
+ url = url.replace(/\(/g, "\\(").replace(/\)/g, "\\)");
778
+ }
779
+ log.info("arrowTypeStart", edge.arrowTypeStart);
780
+ log.info("arrowTypeEnd", edge.arrowTypeEnd);
781
+ const useMargin = !animatedEdge && edge?.look === "neo";
782
+ addEdgeMarkers(svgPath, edge, url, diagramId, diagramType, useMargin, strokeColor);
783
+ const midIndex = Math.floor(points.length / 2);
784
+ const point2 = points[midIndex];
785
+ if (!utils_default.isLabelCoordinateInPath(point2, svgPath.attr("d"))) pointsHasChanged = true;
786
+ let paths = {};
787
+ if (pointsHasChanged) paths.updatedPath = points;
788
+ paths.originalPath = edge.points;
789
+ return paths;
790
+ }, "insertEdge");
791
+ function generateRoundedPath(points, radius) {
792
+ if (points.length < 2) return "";
793
+ let path = "";
794
+ const size = points.length;
795
+ const epsilon = 1e-5;
796
+ for (let i = 0; i < size; i++) {
797
+ const currPoint = points[i];
798
+ const prevPoint = points[i - 1];
799
+ const nextPoint = points[i + 1];
800
+ if (i === 0) path += `M${currPoint.x},${currPoint.y}`;
801
+ else if (i === size - 1) path += `L${currPoint.x},${currPoint.y}`;
802
+ else {
803
+ const dx1 = currPoint.x - prevPoint.x;
804
+ const dy1 = currPoint.y - prevPoint.y;
805
+ const dx2 = nextPoint.x - currPoint.x;
806
+ const dy2 = nextPoint.y - currPoint.y;
807
+ const len1 = Math.hypot(dx1, dy1);
808
+ const len2 = Math.hypot(dx2, dy2);
809
+ if (len1 < epsilon || len2 < epsilon) {
810
+ path += `L${currPoint.x},${currPoint.y}`;
811
+ continue;
812
+ }
813
+ const nx1 = dx1 / len1;
814
+ const ny1 = dy1 / len1;
815
+ const nx2 = dx2 / len2;
816
+ const ny2 = dy2 / len2;
817
+ const dot = nx1 * nx2 + ny1 * ny2;
818
+ const angle = Math.acos(Math.max(-1, Math.min(1, dot)));
819
+ if (angle < epsilon || Math.abs(Math.PI - angle) < epsilon) {
820
+ path += `L${currPoint.x},${currPoint.y}`;
821
+ continue;
822
+ }
823
+ const cutLen = Math.min(radius / Math.sin(angle / 2), len1 / 2, len2 / 2);
824
+ const startX = currPoint.x - nx1 * cutLen;
825
+ const startY = currPoint.y - ny1 * cutLen;
826
+ const endX = currPoint.x + nx2 * cutLen;
827
+ const endY = currPoint.y + ny2 * cutLen;
828
+ path += `L${startX},${startY}`;
829
+ path += `Q${currPoint.x},${currPoint.y} ${endX},${endY}`;
830
+ }
831
+ }
832
+ return path;
833
+ }
834
+ __name(generateRoundedPath, "generateRoundedPath");
835
+ function calculateDeltaAndAngle2(point1, point2) {
836
+ if (!point1 || !point2) return {
837
+ angle: 0,
838
+ deltaX: 0,
839
+ deltaY: 0
840
+ };
841
+ const deltaX = point2.x - point1.x;
842
+ const deltaY = point2.y - point1.y;
843
+ return {
844
+ angle: Math.atan2(deltaY, deltaX),
845
+ deltaX,
846
+ deltaY
847
+ };
848
+ }
849
+ __name(calculateDeltaAndAngle2, "calculateDeltaAndAngle");
850
+ function applyMarkerOffsetsToPoints(points, edge) {
851
+ const newPoints = points.map((point2) => ({ ...point2 }));
852
+ if (points.length >= 2 && markerOffsets[edge.arrowTypeStart]) {
853
+ const offsetValue = markerOffsets[edge.arrowTypeStart];
854
+ const point1 = points[0];
855
+ const point2 = points[1];
856
+ const { angle } = calculateDeltaAndAngle2(point1, point2);
857
+ const offsetX = offsetValue * Math.cos(angle);
858
+ const offsetY = offsetValue * Math.sin(angle);
859
+ newPoints[0].x = point1.x + offsetX;
860
+ newPoints[0].y = point1.y + offsetY;
861
+ }
862
+ const n = points.length;
863
+ if (n >= 2 && markerOffsets[edge.arrowTypeEnd]) {
864
+ const offsetValue = markerOffsets[edge.arrowTypeEnd];
865
+ const point1 = points[n - 1];
866
+ const point2 = points[n - 2];
867
+ const { angle } = calculateDeltaAndAngle2(point2, point1);
868
+ const offsetX = offsetValue * Math.cos(angle);
869
+ const offsetY = offsetValue * Math.sin(angle);
870
+ newPoints[n - 1].x = point1.x - offsetX;
871
+ newPoints[n - 1].y = point1.y - offsetY;
872
+ }
873
+ return newPoints;
874
+ }
875
+ __name(applyMarkerOffsetsToPoints, "applyMarkerOffsetsToPoints");
876
+ var insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type, id) => {
877
+ markerArray.forEach((markerName) => {
878
+ markers[markerName](elem, type, id);
879
+ });
880
+ }, "insertMarkers");
881
+ var markers = {
882
+ extension: /* @__PURE__ */ __name((elem, type, id) => {
883
+ log.trace("Making markers for ", id);
884
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionStart").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
885
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd").attr("class", "marker extension " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
886
+ elem.append("marker").attr("id", id + "_" + type + "-extensionStart-margin").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,7 18,13 18,1").style("stroke-width", 2).style("stroke-dasharray", "0");
887
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd-margin").attr("class", "marker extension " + type).attr("refX", 9).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,1 10,13 18,7").style("stroke-width", 2).style("stroke-dasharray", "0");
888
+ }, "extension"),
889
+ composition: /* @__PURE__ */ __name((elem, type, id) => {
890
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart").attr("class", "marker composition " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
891
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd").attr("class", "marker composition " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
892
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart-margin").attr("class", "marker composition " + type).attr("refX", 15).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("viewBox", "0 0 15 15").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
893
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd-margin").attr("class", "marker composition " + type).attr("refX", 3.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
894
+ }, "composition"),
895
+ aggregation: /* @__PURE__ */ __name((elem, type, id) => {
896
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart").attr("class", "marker aggregation " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
897
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
898
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart-margin").attr("class", "marker aggregation " + type).attr("refX", 15).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 2).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
899
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd-margin").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 2).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
900
+ }, "aggregation"),
901
+ dependency: /* @__PURE__ */ __name((elem, type, id) => {
902
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart").attr("class", "marker dependency " + type).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
903
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd").attr("class", "marker dependency " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
904
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart-margin").attr("class", "marker dependency " + type).attr("refX", 4).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
905
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd-margin").attr("class", "marker dependency " + type).attr("refX", 16).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
906
+ }, "dependency"),
907
+ lollipop: /* @__PURE__ */ __name((elem, type, id) => {
908
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
909
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
910
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart-margin").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6).attr("stroke-width", 2);
911
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd-margin").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6).attr("stroke-width", 2);
912
+ }, "lollipop"),
913
+ point: /* @__PURE__ */ __name((elem, type, id) => {
914
+ elem.append("marker").attr("id", id + "_" + type + "-pointEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
915
+ elem.append("marker").attr("id", id + "_" + type + "-pointStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
916
+ elem.append("marker").attr("id", id + "_" + type + "-pointEnd-margin").attr("class", "marker " + type).attr("viewBox", "0 0 11.5 14").attr("refX", 11.5).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 10.5).attr("markerHeight", 14).attr("orient", "auto").append("path").attr("d", "M 0 0 L 11.5 7 L 0 14 z").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
917
+ elem.append("marker").attr("id", id + "_" + type + "-pointStart-margin").attr("class", "marker " + type).attr("viewBox", "0 0 11.5 14").attr("refX", 1).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11.5).attr("markerHeight", 14).attr("orient", "auto").append("polygon").attr("points", "0,7 11.5,14 11.5,0").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
918
+ }, "point"),
919
+ circle: /* @__PURE__ */ __name((elem, type, id) => {
920
+ elem.append("marker").attr("id", id + "_" + type + "-circleEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
921
+ elem.append("marker").attr("id", id + "_" + type + "-circleStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
922
+ elem.append("marker").attr("id", id + "_" + type + "-circleEnd-margin").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refY", 5).attr("refX", 12.25).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 14).attr("markerHeight", 14).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
923
+ elem.append("marker").attr("id", id + "_" + type + "-circleStart-margin").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -2).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 14).attr("markerHeight", 14).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
924
+ }, "circle"),
925
+ cross: /* @__PURE__ */ __name((elem, type, id) => {
926
+ elem.append("marker").attr("id", id + "_" + type + "-crossEnd").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
927
+ elem.append("marker").attr("id", id + "_" + type + "-crossStart").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
928
+ elem.append("marker").attr("id", id + "_" + type + "-crossEnd-margin").attr("class", "marker cross " + type).attr("viewBox", "0 0 15 15").attr("refX", 17.7).attr("refY", 7.5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 1,1 L 14,14 M 1,14 L 14,1").attr("class", "arrowMarkerPath").style("stroke-width", 2.5);
929
+ elem.append("marker").attr("id", id + "_" + type + "-crossStart-margin").attr("class", "marker cross " + type).attr("viewBox", "0 0 15 15").attr("refX", -3.5).attr("refY", 7.5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 1,1 L 14,14 M 1,14 L 14,1").attr("class", "arrowMarkerPath").style("stroke-width", 2.5).style("stroke-dasharray", "1,0");
930
+ }, "cross"),
931
+ barb: /* @__PURE__ */ __name((elem, type, id) => {
932
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
933
+ }, "barb"),
934
+ barbNeo: /* @__PURE__ */ __name((elem, type, id) => {
935
+ const { themeVariables } = getConfig();
936
+ const { transitionColor } = themeVariables;
937
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z");
938
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd-margin").attr("refX", 17).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z").attr("fill", `${transitionColor}`);
939
+ }, "barbNeo"),
940
+ only_one: /* @__PURE__ */ __name((elem, type, id) => {
941
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneStart").attr("class", "marker onlyOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18");
942
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneEnd").attr("class", "marker onlyOne " + type).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
943
+ }, "only_one"),
944
+ zero_or_one: /* @__PURE__ */ __name((elem, type, id) => {
945
+ const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
946
+ startMarker.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
947
+ startMarker.append("path").attr("d", "M9,0 L9,18");
948
+ const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
949
+ endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
950
+ endMarker.append("path").attr("d", "M21,0 L21,18");
951
+ }, "zero_or_one"),
952
+ one_or_more: /* @__PURE__ */ __name((elem, type, id) => {
953
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
954
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
955
+ }, "one_or_more"),
956
+ zero_or_more: /* @__PURE__ */ __name((elem, type, id) => {
957
+ const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
958
+ startMarker.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
959
+ startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
960
+ const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
961
+ endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
962
+ endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
963
+ }, "zero_or_more"),
964
+ only_one_neo: /* @__PURE__ */ __name((elem, type, id) => {
965
+ const { themeVariables } = getConfig();
966
+ const { strokeWidth } = themeVariables;
967
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneStart").attr("class", "marker onlyOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18").attr("stroke-width", `${strokeWidth}`);
968
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneEnd").attr("class", "marker onlyOne " + type).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18").attr("stroke-width", `${strokeWidth}`);
969
+ }, "only_one_neo"),
970
+ zero_or_one_neo: /* @__PURE__ */ __name((elem, type, id) => {
971
+ const { themeVariables } = getConfig();
972
+ const { strokeWidth, mainBkg } = themeVariables;
973
+ const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
974
+ startMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 21).attr("cy", 9).attr("stroke-width", `${strokeWidth}`).attr("r", 6);
975
+ startMarker.append("path").attr("d", "M9,0 L9,18").attr("stroke-width", `${strokeWidth}`);
976
+ const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
977
+ endMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 9).attr("cy", 9).attr("stroke-width", `${strokeWidth}`).attr("r", 6);
978
+ endMarker.append("path").attr("d", "M21,0 L21,18").attr("stroke-width", `${strokeWidth}`);
979
+ }, "zero_or_one_neo"),
980
+ one_or_more_neo: /* @__PURE__ */ __name((elem, type, id) => {
981
+ const { themeVariables } = getConfig();
982
+ const { strokeWidth } = themeVariables;
983
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width", `${strokeWidth}`);
984
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width", `${strokeWidth}`);
985
+ }, "one_or_more_neo"),
986
+ zero_or_more_neo: /* @__PURE__ */ __name((elem, type, id) => {
987
+ const { themeVariables } = getConfig();
988
+ const { strokeWidth, mainBkg } = themeVariables;
989
+ const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
990
+ startMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 45.5).attr("cy", 18).attr("r", 6).attr("stroke-width", `${strokeWidth}`);
991
+ startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width", `${strokeWidth}`);
992
+ const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
993
+ endMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 11).attr("cy", 18).attr("r", 6).attr("stroke-width", `${strokeWidth}`);
994
+ endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width", `${strokeWidth}`);
995
+ }, "zero_or_more_neo"),
996
+ requirement_arrow: /* @__PURE__ */ __name((elem, type, id) => {
997
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr("d", `M0,0
998
+ L20,10
999
+ M20,10
1000
+ L0,20`);
1001
+ }, "requirement_arrow"),
1002
+ requirement_contains: /* @__PURE__ */ __name((elem, type, id) => {
1003
+ const containsNode = elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
1004
+ containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
1005
+ containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
1006
+ containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
1007
+ }, "requirement_contains"),
1008
+ requirement_arrow_neo: /* @__PURE__ */ __name((elem, type, id) => {
1009
+ const { themeVariables } = getConfig();
1010
+ const { strokeWidth } = themeVariables;
1011
+ elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("stroke-width", `${strokeWidth}`).attr("viewBox", "0 0 25 20").append("path").attr("d", `M0,0
1012
+ L20,10
1013
+ M20,10
1014
+ L0,20`).attr("stroke-linejoin", "miter");
1015
+ }, "requirement_arrow_neo"),
1016
+ requirement_contains_neo: /* @__PURE__ */ __name((elem, type, id) => {
1017
+ const { themeVariables } = getConfig();
1018
+ const { strokeWidth } = themeVariables;
1019
+ const containsNode = elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("g");
1020
+ containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
1021
+ containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
1022
+ containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
1023
+ containsNode.selectAll("*").attr("stroke-width", `${strokeWidth}`);
1024
+ }, "requirement_contains_neo")
1025
+ };
1026
+ var markers_default = insertMarkers;
1027
+
1028
+ //#endregion
1029
+ export { insertEdgeLabel as a, positionEdgeLabel as c, insertEdge as i, terminalLabels as l, edgeLabels as n, markerOffsets as o, hasEdgeLabel as r, markers_default as s, clear as t };