@readme/markdown 7.7.1 → 7.7.3

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.
package/dist/150.js DELETED
@@ -1,1888 +0,0 @@
1
- "use strict";
2
- (self["webpackChunk_readme_markdown"] = self["webpackChunk_readme_markdown"] || []).push([[150],{
3
-
4
- /***/ 7134:
5
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
-
7
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8
- /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
9
- /* harmony export */ });
10
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4090);
11
-
12
-
13
- /** Used to compose bitmasks for cloning. */
14
- var CLONE_SYMBOLS_FLAG = 4;
15
-
16
- /**
17
- * Creates a shallow clone of `value`.
18
- *
19
- * **Note:** This method is loosely based on the
20
- * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
21
- * and supports cloning arrays, array buffers, booleans, date objects, maps,
22
- * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
23
- * arrays. The own enumerable properties of `arguments` objects are cloned
24
- * as plain objects. An empty object is returned for uncloneable values such
25
- * as error objects, functions, DOM nodes, and WeakMaps.
26
- *
27
- * @static
28
- * @memberOf _
29
- * @since 0.1.0
30
- * @category Lang
31
- * @param {*} value The value to clone.
32
- * @returns {*} Returns the cloned value.
33
- * @see _.cloneDeep
34
- * @example
35
- *
36
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
37
- *
38
- * var shallow = _.clone(objects);
39
- * console.log(shallow[0] === objects[0]);
40
- * // => true
41
- */
42
- function clone(value) {
43
- return (0,_baseClone_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value, CLONE_SYMBOLS_FLAG);
44
- }
45
-
46
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);
47
-
48
-
49
- /***/ }),
50
-
51
- /***/ 2927:
52
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
53
-
54
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
55
- /* harmony export */ DA: () => (/* binding */ createLabel_default),
56
- /* harmony export */ IU: () => (/* binding */ clear),
57
- /* harmony export */ Jo: () => (/* binding */ insertEdge),
58
- /* harmony export */ T_: () => (/* binding */ positionEdgeLabel),
59
- /* harmony export */ U7: () => (/* binding */ setNodeElem),
60
- /* harmony export */ U_: () => (/* binding */ positionNode),
61
- /* harmony export */ g0: () => (/* binding */ markers_default),
62
- /* harmony export */ gh: () => (/* binding */ clear2),
63
- /* harmony export */ jP: () => (/* binding */ insertEdgeLabel),
64
- /* harmony export */ lC: () => (/* binding */ updateNodeBounds),
65
- /* harmony export */ nM: () => (/* binding */ intersect_rect_default),
66
- /* harmony export */ on: () => (/* binding */ insertNode)
67
- /* harmony export */ });
68
- /* harmony import */ var _chunk_I3FGKTZ5_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6971);
69
- /* harmony import */ var _chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5449);
70
- /* harmony import */ var _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2843);
71
- /* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6322);
72
- /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8066);
73
-
74
-
75
-
76
-
77
-
78
- // src/dagre-wrapper/markers.js
79
- var insertMarkers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, markerArray, type, id) => {
80
- markerArray.forEach((markerName) => {
81
- markers[markerName](elem, type, id);
82
- });
83
- }, "insertMarkers");
84
- var extension = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
85
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.trace("Making markers for ", id);
86
- elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionStart").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
87
- 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").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
88
- }, "extension");
89
- var composition = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
90
- 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").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
91
- 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").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
92
- }, "composition");
93
- var aggregation = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
94
- 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").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
95
- 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").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
96
- }, "aggregation");
97
- var dependency = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
98
- 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").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
99
- 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").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
100
- }, "dependency");
101
- var lollipop = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
102
- 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").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
103
- 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").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
104
- }, "lollipop");
105
- var point = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
106
- elem.append("marker").attr("id", id + "_" + type + "-pointEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).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");
107
- 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", 12).attr("markerHeight", 12).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");
108
- }, "point");
109
- var circle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
110
- 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");
111
- 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");
112
- }, "circle");
113
- var cross = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
114
- 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");
115
- 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");
116
- }, "cross");
117
- var barb = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
118
- 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 L9,13 L14,7 L9,1 Z");
119
- }, "barb");
120
- var markers = {
121
- extension,
122
- composition,
123
- aggregation,
124
- dependency,
125
- lollipop,
126
- point,
127
- circle,
128
- cross,
129
- barb
130
- };
131
- var markers_default = insertMarkers;
132
-
133
- // src/dagre-wrapper/createLabel.js
134
-
135
- function applyStyle(dom, styleFn) {
136
- if (styleFn) {
137
- dom.attr("style", styleFn);
138
- }
139
- }
140
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(applyStyle, "applyStyle");
141
- function addHtmlLabel(node) {
142
- const fo = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
143
- const div = fo.append("xhtml:div");
144
- const label = node.label;
145
- const labelClass = node.isNode ? "nodeLabel" : "edgeLabel";
146
- const span = div.append("span");
147
- span.html(label);
148
- applyStyle(span, node.labelStyle);
149
- span.attr("class", labelClass);
150
- applyStyle(div, node.labelStyle);
151
- div.style("display", "inline-block");
152
- div.style("white-space", "nowrap");
153
- div.attr("xmlns", "http://www.w3.org/1999/xhtml");
154
- return fo.node();
155
- }
156
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(addHtmlLabel, "addHtmlLabel");
157
- var createLabel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((_vertexText, style, isTitle, isNode) => {
158
- let vertexText = _vertexText || "";
159
- if (typeof vertexText === "object") {
160
- vertexText = vertexText[0];
161
- }
162
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
163
- vertexText = vertexText.replace(/\\n|\n/g, "<br />");
164
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("vertexText" + vertexText);
165
- const node = {
166
- isNode,
167
- label: (0,_chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .replaceIconSubstring */ .hE)((0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .decodeEntities */ .Sm)(vertexText)),
168
- labelStyle: style.replace("fill:", "color:")
169
- };
170
- let vertexNode = addHtmlLabel(node);
171
- return vertexNode;
172
- } else {
173
- const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
174
- svgLabel.setAttribute("style", style.replace("color:", "fill:"));
175
- let rows = [];
176
- if (typeof vertexText === "string") {
177
- rows = vertexText.split(/\\n|\n|<br\s*\/?>/gi);
178
- } else if (Array.isArray(vertexText)) {
179
- rows = vertexText;
180
- } else {
181
- rows = [];
182
- }
183
- for (const row of rows) {
184
- const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
185
- tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
186
- tspan.setAttribute("dy", "1em");
187
- tspan.setAttribute("x", "0");
188
- if (isTitle) {
189
- tspan.setAttribute("class", "title-row");
190
- } else {
191
- tspan.setAttribute("class", "row");
192
- }
193
- tspan.textContent = row.trim();
194
- svgLabel.appendChild(tspan);
195
- }
196
- return svgLabel;
197
- }
198
- }, "createLabel");
199
- var createLabel_default = createLabel;
200
-
201
- // src/dagre-wrapper/shapes/util.js
202
-
203
- var labelHelper = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node, _classes, isNode) => {
204
- const config = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)();
205
- let classes;
206
- const useHtmlLabels = node.useHtmlLabels || (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)(config.flowchart.htmlLabels);
207
- if (!_classes) {
208
- classes = "node default";
209
- } else {
210
- classes = _classes;
211
- }
212
- const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId || node.id);
213
- const label = shapeSvg.insert("g").attr("class", "label").attr("style", node.labelStyle);
214
- let labelText;
215
- if (node.labelText === void 0) {
216
- labelText = "";
217
- } else {
218
- labelText = typeof node.labelText === "string" ? node.labelText : node.labelText[0];
219
- }
220
- const textNode = label.node();
221
- let text;
222
- if (node.labelType === "markdown") {
223
- text = (0,_chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createText */ .GZ)(
224
- label,
225
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)((0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .decodeEntities */ .Sm)(labelText), config),
226
- {
227
- useHtmlLabels,
228
- width: node.width || config.flowchart.wrappingWidth,
229
- classes: "markdown-node-label"
230
- },
231
- config
232
- );
233
- } else {
234
- text = textNode.appendChild(
235
- createLabel_default((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)((0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .decodeEntities */ .Sm)(labelText), config), node.labelStyle, false, isNode)
236
- );
237
- }
238
- let bbox = text.getBBox();
239
- const halfPadding = node.padding / 2;
240
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)(config.flowchart.htmlLabels)) {
241
- const div = text.children[0];
242
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(text);
243
- const images = div.getElementsByTagName("img");
244
- if (images) {
245
- const noImgText = labelText.replace(/<img[^>]*>/g, "").trim() === "";
246
- await Promise.all(
247
- [...images].map(
248
- (img) => new Promise((res) => {
249
- function setupImage() {
250
- img.style.display = "flex";
251
- img.style.flexDirection = "column";
252
- if (noImgText) {
253
- const bodyFontSize = config.fontSize ? config.fontSize : window.getComputedStyle(document.body).fontSize;
254
- const enlargingFactor = 5;
255
- const width = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
256
- img.style.minWidth = width;
257
- img.style.maxWidth = width;
258
- } else {
259
- img.style.width = "100%";
260
- }
261
- res(img);
262
- }
263
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setupImage, "setupImage");
264
- setTimeout(() => {
265
- if (img.complete) {
266
- setupImage();
267
- }
268
- });
269
- img.addEventListener("error", setupImage);
270
- img.addEventListener("load", setupImage);
271
- })
272
- )
273
- );
274
- }
275
- bbox = div.getBoundingClientRect();
276
- dv.attr("width", bbox.width);
277
- dv.attr("height", bbox.height);
278
- }
279
- if (useHtmlLabels) {
280
- label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
281
- } else {
282
- label.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
283
- }
284
- if (node.centerLabel) {
285
- label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
286
- }
287
- label.insert("rect", ":first-child");
288
- return { shapeSvg, bbox, halfPadding, label };
289
- }, "labelHelper");
290
- var updateNodeBounds = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, element) => {
291
- const bbox = element.node().getBBox();
292
- node.width = bbox.width;
293
- node.height = bbox.height;
294
- }, "updateNodeBounds");
295
- function insertPolygonShape(parent, w, h, points) {
296
- return parent.insert("polygon", ":first-child").attr(
297
- "points",
298
- points.map(function(d) {
299
- return d.x + "," + d.y;
300
- }).join(" ")
301
- ).attr("class", "label-container").attr("transform", "translate(" + -w / 2 + "," + h / 2 + ")");
302
- }
303
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(insertPolygonShape, "insertPolygonShape");
304
-
305
- // src/dagre-wrapper/nodes.js
306
-
307
-
308
- // src/dagre-wrapper/blockArrowHelper.ts
309
- var expandAndDeduplicateDirections = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((directions) => {
310
- const uniqueDirections = /* @__PURE__ */ new Set();
311
- for (const direction of directions) {
312
- switch (direction) {
313
- case "x":
314
- uniqueDirections.add("right");
315
- uniqueDirections.add("left");
316
- break;
317
- case "y":
318
- uniqueDirections.add("up");
319
- uniqueDirections.add("down");
320
- break;
321
- default:
322
- uniqueDirections.add(direction);
323
- break;
324
- }
325
- }
326
- return uniqueDirections;
327
- }, "expandAndDeduplicateDirections");
328
- var getArrowPoints = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((duplicatedDirections, bbox, node) => {
329
- const directions = expandAndDeduplicateDirections(duplicatedDirections);
330
- const f = 2;
331
- const height = bbox.height + 2 * node.padding;
332
- const midpoint = height / f;
333
- const width = bbox.width + 2 * midpoint + node.padding;
334
- const padding = node.padding / 2;
335
- if (directions.has("right") && directions.has("left") && directions.has("up") && directions.has("down")) {
336
- return [
337
- // Bottom
338
- { x: 0, y: 0 },
339
- { x: midpoint, y: 0 },
340
- { x: width / 2, y: 2 * padding },
341
- { x: width - midpoint, y: 0 },
342
- { x: width, y: 0 },
343
- // Right
344
- { x: width, y: -height / 3 },
345
- { x: width + 2 * padding, y: -height / 2 },
346
- { x: width, y: -2 * height / 3 },
347
- { x: width, y: -height },
348
- // Top
349
- { x: width - midpoint, y: -height },
350
- { x: width / 2, y: -height - 2 * padding },
351
- { x: midpoint, y: -height },
352
- // Left
353
- { x: 0, y: -height },
354
- { x: 0, y: -2 * height / 3 },
355
- { x: -2 * padding, y: -height / 2 },
356
- { x: 0, y: -height / 3 }
357
- ];
358
- }
359
- if (directions.has("right") && directions.has("left") && directions.has("up")) {
360
- return [
361
- { x: midpoint, y: 0 },
362
- { x: width - midpoint, y: 0 },
363
- { x: width, y: -height / 2 },
364
- { x: width - midpoint, y: -height },
365
- { x: midpoint, y: -height },
366
- { x: 0, y: -height / 2 }
367
- ];
368
- }
369
- if (directions.has("right") && directions.has("left") && directions.has("down")) {
370
- return [
371
- { x: 0, y: 0 },
372
- { x: midpoint, y: -height },
373
- { x: width - midpoint, y: -height },
374
- { x: width, y: 0 }
375
- ];
376
- }
377
- if (directions.has("right") && directions.has("up") && directions.has("down")) {
378
- return [
379
- { x: 0, y: 0 },
380
- { x: width, y: -midpoint },
381
- { x: width, y: -height + midpoint },
382
- { x: 0, y: -height }
383
- ];
384
- }
385
- if (directions.has("left") && directions.has("up") && directions.has("down")) {
386
- return [
387
- { x: width, y: 0 },
388
- { x: 0, y: -midpoint },
389
- { x: 0, y: -height + midpoint },
390
- { x: width, y: -height }
391
- ];
392
- }
393
- if (directions.has("right") && directions.has("left")) {
394
- return [
395
- { x: midpoint, y: 0 },
396
- { x: midpoint, y: -padding },
397
- { x: width - midpoint, y: -padding },
398
- { x: width - midpoint, y: 0 },
399
- { x: width, y: -height / 2 },
400
- { x: width - midpoint, y: -height },
401
- { x: width - midpoint, y: -height + padding },
402
- { x: midpoint, y: -height + padding },
403
- { x: midpoint, y: -height },
404
- { x: 0, y: -height / 2 }
405
- ];
406
- }
407
- if (directions.has("up") && directions.has("down")) {
408
- return [
409
- // Bottom center
410
- { x: width / 2, y: 0 },
411
- // Left pont of bottom arrow
412
- { x: 0, y: -padding },
413
- { x: midpoint, y: -padding },
414
- // Left top over vertical section
415
- { x: midpoint, y: -height + padding },
416
- { x: 0, y: -height + padding },
417
- // Top of arrow
418
- { x: width / 2, y: -height },
419
- { x: width, y: -height + padding },
420
- // Top of right vertical bar
421
- { x: width - midpoint, y: -height + padding },
422
- { x: width - midpoint, y: -padding },
423
- { x: width, y: -padding }
424
- ];
425
- }
426
- if (directions.has("right") && directions.has("up")) {
427
- return [
428
- { x: 0, y: 0 },
429
- { x: width, y: -midpoint },
430
- { x: 0, y: -height }
431
- ];
432
- }
433
- if (directions.has("right") && directions.has("down")) {
434
- return [
435
- { x: 0, y: 0 },
436
- { x: width, y: 0 },
437
- { x: 0, y: -height }
438
- ];
439
- }
440
- if (directions.has("left") && directions.has("up")) {
441
- return [
442
- { x: width, y: 0 },
443
- { x: 0, y: -midpoint },
444
- { x: width, y: -height }
445
- ];
446
- }
447
- if (directions.has("left") && directions.has("down")) {
448
- return [
449
- { x: width, y: 0 },
450
- { x: 0, y: 0 },
451
- { x: width, y: -height }
452
- ];
453
- }
454
- if (directions.has("right")) {
455
- return [
456
- { x: midpoint, y: -padding },
457
- { x: midpoint, y: -padding },
458
- { x: width - midpoint, y: -padding },
459
- { x: width - midpoint, y: 0 },
460
- { x: width, y: -height / 2 },
461
- { x: width - midpoint, y: -height },
462
- { x: width - midpoint, y: -height + padding },
463
- // top left corner of arrow
464
- { x: midpoint, y: -height + padding },
465
- { x: midpoint, y: -height + padding }
466
- ];
467
- }
468
- if (directions.has("left")) {
469
- return [
470
- { x: midpoint, y: 0 },
471
- { x: midpoint, y: -padding },
472
- // Two points, the right corners
473
- { x: width - midpoint, y: -padding },
474
- { x: width - midpoint, y: -height + padding },
475
- { x: midpoint, y: -height + padding },
476
- { x: midpoint, y: -height },
477
- { x: 0, y: -height / 2 }
478
- ];
479
- }
480
- if (directions.has("up")) {
481
- return [
482
- // Bottom center
483
- { x: midpoint, y: -padding },
484
- // Left top over vertical section
485
- { x: midpoint, y: -height + padding },
486
- { x: 0, y: -height + padding },
487
- // Top of arrow
488
- { x: width / 2, y: -height },
489
- { x: width, y: -height + padding },
490
- // Top of right vertical bar
491
- { x: width - midpoint, y: -height + padding },
492
- { x: width - midpoint, y: -padding }
493
- ];
494
- }
495
- if (directions.has("down")) {
496
- return [
497
- // Bottom center
498
- { x: width / 2, y: 0 },
499
- // Left pont of bottom arrow
500
- { x: 0, y: -padding },
501
- { x: midpoint, y: -padding },
502
- // Left top over vertical section
503
- { x: midpoint, y: -height + padding },
504
- { x: width - midpoint, y: -height + padding },
505
- { x: width - midpoint, y: -padding },
506
- { x: width, y: -padding }
507
- ];
508
- }
509
- return [{ x: 0, y: 0 }];
510
- }, "getArrowPoints");
511
-
512
- // src/dagre-wrapper/intersect/intersect-node.js
513
- function intersectNode(node, point2) {
514
- return node.intersect(point2);
515
- }
516
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectNode, "intersectNode");
517
- var intersect_node_default = intersectNode;
518
-
519
- // src/dagre-wrapper/intersect/intersect-ellipse.js
520
- function intersectEllipse(node, rx, ry, point2) {
521
- var cx = node.x;
522
- var cy = node.y;
523
- var px = cx - point2.x;
524
- var py = cy - point2.y;
525
- var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);
526
- var dx = Math.abs(rx * ry * px / det);
527
- if (point2.x < cx) {
528
- dx = -dx;
529
- }
530
- var dy = Math.abs(rx * ry * py / det);
531
- if (point2.y < cy) {
532
- dy = -dy;
533
- }
534
- return { x: cx + dx, y: cy + dy };
535
- }
536
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectEllipse, "intersectEllipse");
537
- var intersect_ellipse_default = intersectEllipse;
538
-
539
- // src/dagre-wrapper/intersect/intersect-circle.js
540
- function intersectCircle(node, rx, point2) {
541
- return intersect_ellipse_default(node, rx, rx, point2);
542
- }
543
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectCircle, "intersectCircle");
544
- var intersect_circle_default = intersectCircle;
545
-
546
- // src/dagre-wrapper/intersect/intersect-line.js
547
- function intersectLine(p1, p2, q1, q2) {
548
- var a1, a2, b1, b2, c1, c2;
549
- var r1, r2, r3, r4;
550
- var denom, offset, num;
551
- var x, y;
552
- a1 = p2.y - p1.y;
553
- b1 = p1.x - p2.x;
554
- c1 = p2.x * p1.y - p1.x * p2.y;
555
- r3 = a1 * q1.x + b1 * q1.y + c1;
556
- r4 = a1 * q2.x + b1 * q2.y + c1;
557
- if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {
558
- return;
559
- }
560
- a2 = q2.y - q1.y;
561
- b2 = q1.x - q2.x;
562
- c2 = q2.x * q1.y - q1.x * q2.y;
563
- r1 = a2 * p1.x + b2 * p1.y + c2;
564
- r2 = a2 * p2.x + b2 * p2.y + c2;
565
- if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {
566
- return;
567
- }
568
- denom = a1 * b2 - a2 * b1;
569
- if (denom === 0) {
570
- return;
571
- }
572
- offset = Math.abs(denom / 2);
573
- num = b1 * c2 - b2 * c1;
574
- x = num < 0 ? (num - offset) / denom : (num + offset) / denom;
575
- num = a2 * c1 - a1 * c2;
576
- y = num < 0 ? (num - offset) / denom : (num + offset) / denom;
577
- return { x, y };
578
- }
579
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectLine, "intersectLine");
580
- function sameSign(r1, r2) {
581
- return r1 * r2 > 0;
582
- }
583
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(sameSign, "sameSign");
584
- var intersect_line_default = intersectLine;
585
-
586
- // src/dagre-wrapper/intersect/intersect-polygon.js
587
- var intersect_polygon_default = intersectPolygon;
588
- function intersectPolygon(node, polyPoints, point2) {
589
- var x1 = node.x;
590
- var y1 = node.y;
591
- var intersections = [];
592
- var minX = Number.POSITIVE_INFINITY;
593
- var minY = Number.POSITIVE_INFINITY;
594
- if (typeof polyPoints.forEach === "function") {
595
- polyPoints.forEach(function(entry) {
596
- minX = Math.min(minX, entry.x);
597
- minY = Math.min(minY, entry.y);
598
- });
599
- } else {
600
- minX = Math.min(minX, polyPoints.x);
601
- minY = Math.min(minY, polyPoints.y);
602
- }
603
- var left = x1 - node.width / 2 - minX;
604
- var top = y1 - node.height / 2 - minY;
605
- for (var i = 0; i < polyPoints.length; i++) {
606
- var p1 = polyPoints[i];
607
- var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];
608
- var intersect = intersect_line_default(
609
- node,
610
- point2,
611
- { x: left + p1.x, y: top + p1.y },
612
- { x: left + p2.x, y: top + p2.y }
613
- );
614
- if (intersect) {
615
- intersections.push(intersect);
616
- }
617
- }
618
- if (!intersections.length) {
619
- return node;
620
- }
621
- if (intersections.length > 1) {
622
- intersections.sort(function(p, q) {
623
- var pdx = p.x - point2.x;
624
- var pdy = p.y - point2.y;
625
- var distp = Math.sqrt(pdx * pdx + pdy * pdy);
626
- var qdx = q.x - point2.x;
627
- var qdy = q.y - point2.y;
628
- var distq = Math.sqrt(qdx * qdx + qdy * qdy);
629
- return distp < distq ? -1 : distp === distq ? 0 : 1;
630
- });
631
- }
632
- return intersections[0];
633
- }
634
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectPolygon, "intersectPolygon");
635
-
636
- // src/dagre-wrapper/intersect/intersect-rect.js
637
- var intersectRect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, point2) => {
638
- var x = node.x;
639
- var y = node.y;
640
- var dx = point2.x - x;
641
- var dy = point2.y - y;
642
- var w = node.width / 2;
643
- var h = node.height / 2;
644
- var sx, sy;
645
- if (Math.abs(dy) * w > Math.abs(dx) * h) {
646
- if (dy < 0) {
647
- h = -h;
648
- }
649
- sx = dy === 0 ? 0 : h * dx / dy;
650
- sy = h;
651
- } else {
652
- if (dx < 0) {
653
- w = -w;
654
- }
655
- sx = w;
656
- sy = dx === 0 ? 0 : w * dy / dx;
657
- }
658
- return { x: x + sx, y: y + sy };
659
- }, "intersectRect");
660
- var intersect_rect_default = intersectRect;
661
-
662
- // src/dagre-wrapper/intersect/index.js
663
- var intersect_default = {
664
- node: intersect_node_default,
665
- circle: intersect_circle_default,
666
- ellipse: intersect_ellipse_default,
667
- polygon: intersect_polygon_default,
668
- rect: intersect_rect_default
669
- };
670
-
671
- // src/dagre-wrapper/shapes/note.js
672
- var note = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
673
- const useHtmlLabels = node.useHtmlLabels || (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels;
674
- if (!useHtmlLabels) {
675
- node.centerLabel = true;
676
- }
677
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
678
- parent,
679
- node,
680
- "node " + node.classes,
681
- true
682
- );
683
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Classes = ", node.classes);
684
- const rect2 = shapeSvg.insert("rect", ":first-child");
685
- rect2.attr("rx", node.rx).attr("ry", node.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
686
- updateNodeBounds(node, rect2);
687
- node.intersect = function(point2) {
688
- return intersect_default.rect(node, point2);
689
- };
690
- return shapeSvg;
691
- }, "note");
692
- var note_default = note;
693
-
694
- // src/dagre-wrapper/nodes.js
695
- var formatClass = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((str) => {
696
- if (str) {
697
- return " " + str;
698
- }
699
- return "";
700
- }, "formatClass");
701
- var getClassesFromNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, otherClasses) => {
702
- return `${otherClasses ? otherClasses : "node default"}${formatClass(node.classes)} ${formatClass(
703
- node.class
704
- )}`;
705
- }, "getClassesFromNode");
706
- var question = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
707
- const { shapeSvg, bbox } = await labelHelper(
708
- parent,
709
- node,
710
- getClassesFromNode(node, void 0),
711
- true
712
- );
713
- const w = bbox.width + node.padding;
714
- const h = bbox.height + node.padding;
715
- const s = w + h;
716
- const points = [
717
- { x: s / 2, y: 0 },
718
- { x: s, y: -s / 2 },
719
- { x: s / 2, y: -s },
720
- { x: 0, y: -s / 2 }
721
- ];
722
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Question main (Circle)");
723
- const questionElem = insertPolygonShape(shapeSvg, s, s, points);
724
- questionElem.attr("style", node.style);
725
- updateNodeBounds(node, questionElem);
726
- node.intersect = function(point2) {
727
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn("Intersect called");
728
- return intersect_default.polygon(node, points, point2);
729
- };
730
- return shapeSvg;
731
- }, "question");
732
- var choice = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
733
- const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
734
- const s = 28;
735
- const points = [
736
- { x: 0, y: s / 2 },
737
- { x: s / 2, y: 0 },
738
- { x: 0, y: -s / 2 },
739
- { x: -s / 2, y: 0 }
740
- ];
741
- const choice2 = shapeSvg.insert("polygon", ":first-child").attr(
742
- "points",
743
- points.map(function(d) {
744
- return d.x + "," + d.y;
745
- }).join(" ")
746
- );
747
- choice2.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28);
748
- node.width = 28;
749
- node.height = 28;
750
- node.intersect = function(point2) {
751
- return intersect_default.circle(node, 14, point2);
752
- };
753
- return shapeSvg;
754
- }, "choice");
755
- var hexagon = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
756
- const { shapeSvg, bbox } = await labelHelper(
757
- parent,
758
- node,
759
- getClassesFromNode(node, void 0),
760
- true
761
- );
762
- const f = 4;
763
- const h = bbox.height + node.padding;
764
- const m = h / f;
765
- const w = bbox.width + 2 * m + node.padding;
766
- const points = [
767
- { x: m, y: 0 },
768
- { x: w - m, y: 0 },
769
- { x: w, y: -h / 2 },
770
- { x: w - m, y: -h },
771
- { x: m, y: -h },
772
- { x: 0, y: -h / 2 }
773
- ];
774
- const hex = insertPolygonShape(shapeSvg, w, h, points);
775
- hex.attr("style", node.style);
776
- updateNodeBounds(node, hex);
777
- node.intersect = function(point2) {
778
- return intersect_default.polygon(node, points, point2);
779
- };
780
- return shapeSvg;
781
- }, "hexagon");
782
- var block_arrow = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
783
- const { shapeSvg, bbox } = await labelHelper(parent, node, void 0, true);
784
- const f = 2;
785
- const h = bbox.height + 2 * node.padding;
786
- const m = h / f;
787
- const w = bbox.width + 2 * m + node.padding;
788
- const points = getArrowPoints(node.directions, bbox, node);
789
- const blockArrow = insertPolygonShape(shapeSvg, w, h, points);
790
- blockArrow.attr("style", node.style);
791
- updateNodeBounds(node, blockArrow);
792
- node.intersect = function(point2) {
793
- return intersect_default.polygon(node, points, point2);
794
- };
795
- return shapeSvg;
796
- }, "block_arrow");
797
- var rect_left_inv_arrow = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
798
- const { shapeSvg, bbox } = await labelHelper(
799
- parent,
800
- node,
801
- getClassesFromNode(node, void 0),
802
- true
803
- );
804
- const w = bbox.width + node.padding;
805
- const h = bbox.height + node.padding;
806
- const points = [
807
- { x: -h / 2, y: 0 },
808
- { x: w, y: 0 },
809
- { x: w, y: -h },
810
- { x: -h / 2, y: -h },
811
- { x: 0, y: -h / 2 }
812
- ];
813
- const el = insertPolygonShape(shapeSvg, w, h, points);
814
- el.attr("style", node.style);
815
- node.width = w + h;
816
- node.height = h;
817
- node.intersect = function(point2) {
818
- return intersect_default.polygon(node, points, point2);
819
- };
820
- return shapeSvg;
821
- }, "rect_left_inv_arrow");
822
- var lean_right = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
823
- const { shapeSvg, bbox } = await labelHelper(parent, node, getClassesFromNode(node), true);
824
- const w = bbox.width + node.padding;
825
- const h = bbox.height + node.padding;
826
- const points = [
827
- { x: -2 * h / 6, y: 0 },
828
- { x: w - h / 6, y: 0 },
829
- { x: w + 2 * h / 6, y: -h },
830
- { x: h / 6, y: -h }
831
- ];
832
- const el = insertPolygonShape(shapeSvg, w, h, points);
833
- el.attr("style", node.style);
834
- updateNodeBounds(node, el);
835
- node.intersect = function(point2) {
836
- return intersect_default.polygon(node, points, point2);
837
- };
838
- return shapeSvg;
839
- }, "lean_right");
840
- var lean_left = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
841
- const { shapeSvg, bbox } = await labelHelper(
842
- parent,
843
- node,
844
- getClassesFromNode(node, void 0),
845
- true
846
- );
847
- const w = bbox.width + node.padding;
848
- const h = bbox.height + node.padding;
849
- const points = [
850
- { x: 2 * h / 6, y: 0 },
851
- { x: w + h / 6, y: 0 },
852
- { x: w - 2 * h / 6, y: -h },
853
- { x: -h / 6, y: -h }
854
- ];
855
- const el = insertPolygonShape(shapeSvg, w, h, points);
856
- el.attr("style", node.style);
857
- updateNodeBounds(node, el);
858
- node.intersect = function(point2) {
859
- return intersect_default.polygon(node, points, point2);
860
- };
861
- return shapeSvg;
862
- }, "lean_left");
863
- var trapezoid = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
864
- const { shapeSvg, bbox } = await labelHelper(
865
- parent,
866
- node,
867
- getClassesFromNode(node, void 0),
868
- true
869
- );
870
- const w = bbox.width + node.padding;
871
- const h = bbox.height + node.padding;
872
- const points = [
873
- { x: -2 * h / 6, y: 0 },
874
- { x: w + 2 * h / 6, y: 0 },
875
- { x: w - h / 6, y: -h },
876
- { x: h / 6, y: -h }
877
- ];
878
- const el = insertPolygonShape(shapeSvg, w, h, points);
879
- el.attr("style", node.style);
880
- updateNodeBounds(node, el);
881
- node.intersect = function(point2) {
882
- return intersect_default.polygon(node, points, point2);
883
- };
884
- return shapeSvg;
885
- }, "trapezoid");
886
- var inv_trapezoid = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
887
- const { shapeSvg, bbox } = await labelHelper(
888
- parent,
889
- node,
890
- getClassesFromNode(node, void 0),
891
- true
892
- );
893
- const w = bbox.width + node.padding;
894
- const h = bbox.height + node.padding;
895
- const points = [
896
- { x: h / 6, y: 0 },
897
- { x: w - h / 6, y: 0 },
898
- { x: w + 2 * h / 6, y: -h },
899
- { x: -2 * h / 6, y: -h }
900
- ];
901
- const el = insertPolygonShape(shapeSvg, w, h, points);
902
- el.attr("style", node.style);
903
- updateNodeBounds(node, el);
904
- node.intersect = function(point2) {
905
- return intersect_default.polygon(node, points, point2);
906
- };
907
- return shapeSvg;
908
- }, "inv_trapezoid");
909
- var rect_right_inv_arrow = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
910
- const { shapeSvg, bbox } = await labelHelper(
911
- parent,
912
- node,
913
- getClassesFromNode(node, void 0),
914
- true
915
- );
916
- const w = bbox.width + node.padding;
917
- const h = bbox.height + node.padding;
918
- const points = [
919
- { x: 0, y: 0 },
920
- { x: w + h / 2, y: 0 },
921
- { x: w, y: -h / 2 },
922
- { x: w + h / 2, y: -h },
923
- { x: 0, y: -h }
924
- ];
925
- const el = insertPolygonShape(shapeSvg, w, h, points);
926
- el.attr("style", node.style);
927
- updateNodeBounds(node, el);
928
- node.intersect = function(point2) {
929
- return intersect_default.polygon(node, points, point2);
930
- };
931
- return shapeSvg;
932
- }, "rect_right_inv_arrow");
933
- var cylinder = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
934
- const { shapeSvg, bbox } = await labelHelper(
935
- parent,
936
- node,
937
- getClassesFromNode(node, void 0),
938
- true
939
- );
940
- const w = bbox.width + node.padding;
941
- const rx = w / 2;
942
- const ry = rx / (2.5 + w / 50);
943
- const h = bbox.height + ry + node.padding;
944
- const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w + " 0 a " + rx + "," + ry + " 0,0,0 " + -w + " 0 l 0," + h + " a " + rx + "," + ry + " 0,0,0 " + w + " 0 l 0," + -h;
945
- const el = shapeSvg.attr("label-offset-y", ry).insert("path", ":first-child").attr("style", node.style).attr("d", shape).attr("transform", "translate(" + -w / 2 + "," + -(h / 2 + ry) + ")");
946
- updateNodeBounds(node, el);
947
- node.intersect = function(point2) {
948
- const pos = intersect_default.rect(node, point2);
949
- const x = pos.x - node.x;
950
- if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) {
951
- let y = ry * ry * (1 - x * x / (rx * rx));
952
- if (y != 0) {
953
- y = Math.sqrt(y);
954
- }
955
- y = ry - y;
956
- if (point2.y - node.y > 0) {
957
- y = -y;
958
- }
959
- pos.y += y;
960
- }
961
- return pos;
962
- };
963
- return shapeSvg;
964
- }, "cylinder");
965
- var rect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
966
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
967
- parent,
968
- node,
969
- "node " + node.classes + " " + node.class,
970
- true
971
- );
972
- const rect2 = shapeSvg.insert("rect", ":first-child");
973
- const totalWidth = node.positioned ? node.width : bbox.width + node.padding;
974
- const totalHeight = node.positioned ? node.height : bbox.height + node.padding;
975
- const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
976
- const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
977
- rect2.attr("class", "basic label-container").attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", totalWidth).attr("height", totalHeight);
978
- if (node.props) {
979
- const propKeys = new Set(Object.keys(node.props));
980
- if (node.props.borders) {
981
- applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
982
- propKeys.delete("borders");
983
- }
984
- propKeys.forEach((propKey) => {
985
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
986
- });
987
- }
988
- updateNodeBounds(node, rect2);
989
- node.intersect = function(point2) {
990
- return intersect_default.rect(node, point2);
991
- };
992
- return shapeSvg;
993
- }, "rect");
994
- var composite = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
995
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
996
- parent,
997
- node,
998
- "node " + node.classes,
999
- true
1000
- );
1001
- const rect2 = shapeSvg.insert("rect", ":first-child");
1002
- const totalWidth = node.positioned ? node.width : bbox.width + node.padding;
1003
- const totalHeight = node.positioned ? node.height : bbox.height + node.padding;
1004
- const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
1005
- const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
1006
- rect2.attr("class", "basic cluster composite label-container").attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", totalWidth).attr("height", totalHeight);
1007
- if (node.props) {
1008
- const propKeys = new Set(Object.keys(node.props));
1009
- if (node.props.borders) {
1010
- applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
1011
- propKeys.delete("borders");
1012
- }
1013
- propKeys.forEach((propKey) => {
1014
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
1015
- });
1016
- }
1017
- updateNodeBounds(node, rect2);
1018
- node.intersect = function(point2) {
1019
- return intersect_default.rect(node, point2);
1020
- };
1021
- return shapeSvg;
1022
- }, "composite");
1023
- var labelRect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
1024
- const { shapeSvg } = await labelHelper(parent, node, "label", true);
1025
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.trace("Classes = ", node.class);
1026
- const rect2 = shapeSvg.insert("rect", ":first-child");
1027
- const totalWidth = 0;
1028
- const totalHeight = 0;
1029
- rect2.attr("width", totalWidth).attr("height", totalHeight);
1030
- shapeSvg.attr("class", "label edgeLabel");
1031
- if (node.props) {
1032
- const propKeys = new Set(Object.keys(node.props));
1033
- if (node.props.borders) {
1034
- applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
1035
- propKeys.delete("borders");
1036
- }
1037
- propKeys.forEach((propKey) => {
1038
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
1039
- });
1040
- }
1041
- updateNodeBounds(node, rect2);
1042
- node.intersect = function(point2) {
1043
- return intersect_default.rect(node, point2);
1044
- };
1045
- return shapeSvg;
1046
- }, "labelRect");
1047
- function applyNodePropertyBorders(rect2, borders, totalWidth, totalHeight) {
1048
- const strokeDashArray = [];
1049
- const addBorder = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((length) => {
1050
- strokeDashArray.push(length, 0);
1051
- }, "addBorder");
1052
- const skipBorder = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((length) => {
1053
- strokeDashArray.push(0, length);
1054
- }, "skipBorder");
1055
- if (borders.includes("t")) {
1056
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add top border");
1057
- addBorder(totalWidth);
1058
- } else {
1059
- skipBorder(totalWidth);
1060
- }
1061
- if (borders.includes("r")) {
1062
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add right border");
1063
- addBorder(totalHeight);
1064
- } else {
1065
- skipBorder(totalHeight);
1066
- }
1067
- if (borders.includes("b")) {
1068
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add bottom border");
1069
- addBorder(totalWidth);
1070
- } else {
1071
- skipBorder(totalWidth);
1072
- }
1073
- if (borders.includes("l")) {
1074
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add left border");
1075
- addBorder(totalHeight);
1076
- } else {
1077
- skipBorder(totalHeight);
1078
- }
1079
- rect2.attr("stroke-dasharray", strokeDashArray.join(" "));
1080
- }
1081
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(applyNodePropertyBorders, "applyNodePropertyBorders");
1082
- var rectWithTitle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
1083
- let classes;
1084
- if (!node.classes) {
1085
- classes = "node default";
1086
- } else {
1087
- classes = "node " + node.classes;
1088
- }
1089
- const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId || node.id);
1090
- const rect2 = shapeSvg.insert("rect", ":first-child");
1091
- const innerLine = shapeSvg.insert("line");
1092
- const label = shapeSvg.insert("g").attr("class", "label");
1093
- const text2 = node.labelText.flat ? node.labelText.flat() : node.labelText;
1094
- let title = "";
1095
- if (typeof text2 === "object") {
1096
- title = text2[0];
1097
- } else {
1098
- title = text2;
1099
- }
1100
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Label text abc79", title, text2, typeof text2 === "object");
1101
- const text = label.node().appendChild(createLabel_default(title, node.labelStyle, true, true));
1102
- let bbox = { width: 0, height: 0 };
1103
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
1104
- const div = text.children[0];
1105
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(text);
1106
- bbox = div.getBoundingClientRect();
1107
- dv.attr("width", bbox.width);
1108
- dv.attr("height", bbox.height);
1109
- }
1110
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Text 2", text2);
1111
- const textRows = text2.slice(1, text2.length);
1112
- let titleBox = text.getBBox();
1113
- const descr = label.node().appendChild(
1114
- createLabel_default(textRows.join ? textRows.join("<br/>") : textRows, node.labelStyle, true, true)
1115
- );
1116
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
1117
- const div = descr.children[0];
1118
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(descr);
1119
- bbox = div.getBoundingClientRect();
1120
- dv.attr("width", bbox.width);
1121
- dv.attr("height", bbox.height);
1122
- }
1123
- const halfPadding = node.padding / 2;
1124
- (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(descr).attr(
1125
- "transform",
1126
- "translate( " + // (titleBox.width - bbox.width) / 2 +
1127
- (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
1128
- );
1129
- (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(text).attr(
1130
- "transform",
1131
- "translate( " + // (titleBox.width - bbox.width) / 2 +
1132
- (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
1133
- );
1134
- bbox = label.node().getBBox();
1135
- label.attr(
1136
- "transform",
1137
- "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
1138
- );
1139
- rect2.attr("class", "outer title-state").attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
1140
- innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);
1141
- updateNodeBounds(node, rect2);
1142
- node.intersect = function(point2) {
1143
- return intersect_default.rect(node, point2);
1144
- };
1145
- return shapeSvg;
1146
- }, "rectWithTitle");
1147
- var stadium = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
1148
- const { shapeSvg, bbox } = await labelHelper(
1149
- parent,
1150
- node,
1151
- getClassesFromNode(node, void 0),
1152
- true
1153
- );
1154
- const h = bbox.height + node.padding;
1155
- const w = bbox.width + h / 4 + node.padding;
1156
- const rect2 = shapeSvg.insert("rect", ":first-child").attr("style", node.style).attr("rx", h / 2).attr("ry", h / 2).attr("x", -w / 2).attr("y", -h / 2).attr("width", w).attr("height", h);
1157
- updateNodeBounds(node, rect2);
1158
- node.intersect = function(point2) {
1159
- return intersect_default.rect(node, point2);
1160
- };
1161
- return shapeSvg;
1162
- }, "stadium");
1163
- var circle2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
1164
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
1165
- parent,
1166
- node,
1167
- getClassesFromNode(node, void 0),
1168
- true
1169
- );
1170
- const circle3 = shapeSvg.insert("circle", ":first-child");
1171
- circle3.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
1172
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Circle main");
1173
- updateNodeBounds(node, circle3);
1174
- node.intersect = function(point2) {
1175
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Circle intersect", node, bbox.width / 2 + halfPadding, point2);
1176
- return intersect_default.circle(node, bbox.width / 2 + halfPadding, point2);
1177
- };
1178
- return shapeSvg;
1179
- }, "circle");
1180
- var doublecircle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
1181
- const { shapeSvg, bbox, halfPadding } = await labelHelper(
1182
- parent,
1183
- node,
1184
- getClassesFromNode(node, void 0),
1185
- true
1186
- );
1187
- const gap = 5;
1188
- const circleGroup = shapeSvg.insert("g", ":first-child");
1189
- const outerCircle = circleGroup.insert("circle");
1190
- const innerCircle = circleGroup.insert("circle");
1191
- circleGroup.attr("class", node.class);
1192
- outerCircle.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding + gap).attr("width", bbox.width + node.padding + gap * 2).attr("height", bbox.height + node.padding + gap * 2);
1193
- innerCircle.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
1194
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("DoubleCircle main");
1195
- updateNodeBounds(node, outerCircle);
1196
- node.intersect = function(point2) {
1197
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("DoubleCircle intersect", node, bbox.width / 2 + halfPadding + gap, point2);
1198
- return intersect_default.circle(node, bbox.width / 2 + halfPadding + gap, point2);
1199
- };
1200
- return shapeSvg;
1201
- }, "doublecircle");
1202
- var subroutine = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
1203
- const { shapeSvg, bbox } = await labelHelper(
1204
- parent,
1205
- node,
1206
- getClassesFromNode(node, void 0),
1207
- true
1208
- );
1209
- const w = bbox.width + node.padding;
1210
- const h = bbox.height + node.padding;
1211
- const points = [
1212
- { x: 0, y: 0 },
1213
- { x: w, y: 0 },
1214
- { x: w, y: -h },
1215
- { x: 0, y: -h },
1216
- { x: 0, y: 0 },
1217
- { x: -8, y: 0 },
1218
- { x: w + 8, y: 0 },
1219
- { x: w + 8, y: -h },
1220
- { x: -8, y: -h },
1221
- { x: -8, y: 0 }
1222
- ];
1223
- const el = insertPolygonShape(shapeSvg, w, h, points);
1224
- el.attr("style", node.style);
1225
- updateNodeBounds(node, el);
1226
- node.intersect = function(point2) {
1227
- return intersect_default.polygon(node, points, point2);
1228
- };
1229
- return shapeSvg;
1230
- }, "subroutine");
1231
- var start = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
1232
- const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
1233
- const circle3 = shapeSvg.insert("circle", ":first-child");
1234
- circle3.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
1235
- updateNodeBounds(node, circle3);
1236
- node.intersect = function(point2) {
1237
- return intersect_default.circle(node, 7, point2);
1238
- };
1239
- return shapeSvg;
1240
- }, "start");
1241
- var forkJoin = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node, dir) => {
1242
- const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
1243
- let width = 70;
1244
- let height = 10;
1245
- if (dir === "LR") {
1246
- width = 10;
1247
- height = 70;
1248
- }
1249
- const shape = shapeSvg.append("rect").attr("x", -1 * width / 2).attr("y", -1 * height / 2).attr("width", width).attr("height", height).attr("class", "fork-join");
1250
- updateNodeBounds(node, shape);
1251
- node.height = node.height + node.padding / 2;
1252
- node.width = node.width + node.padding / 2;
1253
- node.intersect = function(point2) {
1254
- return intersect_default.rect(node, point2);
1255
- };
1256
- return shapeSvg;
1257
- }, "forkJoin");
1258
- var end = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
1259
- const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
1260
- const innerCircle = shapeSvg.insert("circle", ":first-child");
1261
- const circle3 = shapeSvg.insert("circle", ":first-child");
1262
- circle3.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
1263
- innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10);
1264
- updateNodeBounds(node, circle3);
1265
- node.intersect = function(point2) {
1266
- return intersect_default.circle(node, 7, point2);
1267
- };
1268
- return shapeSvg;
1269
- }, "end");
1270
- var class_box = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
1271
- const halfPadding = node.padding / 2;
1272
- const rowPadding = 4;
1273
- const lineHeight = 8;
1274
- let classes;
1275
- if (!node.classes) {
1276
- classes = "node default";
1277
- } else {
1278
- classes = "node " + node.classes;
1279
- }
1280
- const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId || node.id);
1281
- const rect2 = shapeSvg.insert("rect", ":first-child");
1282
- const topLine = shapeSvg.insert("line");
1283
- const bottomLine = shapeSvg.insert("line");
1284
- let maxWidth = 0;
1285
- let maxHeight = rowPadding;
1286
- const labelContainer = shapeSvg.insert("g").attr("class", "label");
1287
- let verticalPos = 0;
1288
- const hasInterface = node.classData.annotations?.[0];
1289
- const interfaceLabelText = node.classData.annotations[0] ? "\xAB" + node.classData.annotations[0] + "\xBB" : "";
1290
- const interfaceLabel = labelContainer.node().appendChild(createLabel_default(interfaceLabelText, node.labelStyle, true, true));
1291
- let interfaceBBox = interfaceLabel.getBBox();
1292
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
1293
- const div = interfaceLabel.children[0];
1294
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(interfaceLabel);
1295
- interfaceBBox = div.getBoundingClientRect();
1296
- dv.attr("width", interfaceBBox.width);
1297
- dv.attr("height", interfaceBBox.height);
1298
- }
1299
- if (node.classData.annotations[0]) {
1300
- maxHeight += interfaceBBox.height + rowPadding;
1301
- maxWidth += interfaceBBox.width;
1302
- }
1303
- let classTitleString = node.classData.label;
1304
- if (node.classData.type !== void 0 && node.classData.type !== "") {
1305
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
1306
- classTitleString += "&lt;" + node.classData.type + "&gt;";
1307
- } else {
1308
- classTitleString += "<" + node.classData.type + ">";
1309
- }
1310
- }
1311
- const classTitleLabel = labelContainer.node().appendChild(createLabel_default(classTitleString, node.labelStyle, true, true));
1312
- (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(classTitleLabel).attr("class", "classTitle");
1313
- let classTitleBBox = classTitleLabel.getBBox();
1314
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
1315
- const div = classTitleLabel.children[0];
1316
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(classTitleLabel);
1317
- classTitleBBox = div.getBoundingClientRect();
1318
- dv.attr("width", classTitleBBox.width);
1319
- dv.attr("height", classTitleBBox.height);
1320
- }
1321
- maxHeight += classTitleBBox.height + rowPadding;
1322
- if (classTitleBBox.width > maxWidth) {
1323
- maxWidth = classTitleBBox.width;
1324
- }
1325
- const classAttributes = [];
1326
- node.classData.members.forEach((member) => {
1327
- const parsedInfo = member.getDisplayDetails();
1328
- let parsedText = parsedInfo.displayText;
1329
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
1330
- parsedText = parsedText.replace(/</g, "&lt;").replace(/>/g, "&gt;");
1331
- }
1332
- const lbl = labelContainer.node().appendChild(
1333
- createLabel_default(
1334
- parsedText,
1335
- parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,
1336
- true,
1337
- true
1338
- )
1339
- );
1340
- let bbox = lbl.getBBox();
1341
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
1342
- const div = lbl.children[0];
1343
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl);
1344
- bbox = div.getBoundingClientRect();
1345
- dv.attr("width", bbox.width);
1346
- dv.attr("height", bbox.height);
1347
- }
1348
- if (bbox.width > maxWidth) {
1349
- maxWidth = bbox.width;
1350
- }
1351
- maxHeight += bbox.height + rowPadding;
1352
- classAttributes.push(lbl);
1353
- });
1354
- maxHeight += lineHeight;
1355
- const classMethods = [];
1356
- node.classData.methods.forEach((member) => {
1357
- const parsedInfo = member.getDisplayDetails();
1358
- let displayText = parsedInfo.displayText;
1359
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
1360
- displayText = displayText.replace(/</g, "&lt;").replace(/>/g, "&gt;");
1361
- }
1362
- const lbl = labelContainer.node().appendChild(
1363
- createLabel_default(
1364
- displayText,
1365
- parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,
1366
- true,
1367
- true
1368
- )
1369
- );
1370
- let bbox = lbl.getBBox();
1371
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
1372
- const div = lbl.children[0];
1373
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl);
1374
- bbox = div.getBoundingClientRect();
1375
- dv.attr("width", bbox.width);
1376
- dv.attr("height", bbox.height);
1377
- }
1378
- if (bbox.width > maxWidth) {
1379
- maxWidth = bbox.width;
1380
- }
1381
- maxHeight += bbox.height + rowPadding;
1382
- classMethods.push(lbl);
1383
- });
1384
- maxHeight += lineHeight;
1385
- if (hasInterface) {
1386
- let diffX2 = (maxWidth - interfaceBBox.width) / 2;
1387
- (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(interfaceLabel).attr(
1388
- "transform",
1389
- "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")"
1390
- );
1391
- verticalPos = interfaceBBox.height + rowPadding;
1392
- }
1393
- let diffX = (maxWidth - classTitleBBox.width) / 2;
1394
- (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(classTitleLabel).attr(
1395
- "transform",
1396
- "translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
1397
- );
1398
- verticalPos += classTitleBBox.height + rowPadding;
1399
- topLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
1400
- verticalPos += lineHeight;
1401
- classAttributes.forEach((lbl) => {
1402
- (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl).attr(
1403
- "transform",
1404
- "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")"
1405
- );
1406
- const memberBBox = lbl?.getBBox();
1407
- verticalPos += (memberBBox?.height ?? 0) + rowPadding;
1408
- });
1409
- verticalPos += lineHeight;
1410
- bottomLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
1411
- verticalPos += lineHeight;
1412
- classMethods.forEach((lbl) => {
1413
- (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl).attr(
1414
- "transform",
1415
- "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
1416
- );
1417
- const memberBBox = lbl?.getBBox();
1418
- verticalPos += (memberBBox?.height ?? 0) + rowPadding;
1419
- });
1420
- rect2.attr("style", node.style).attr("class", "outer title-state").attr("x", -maxWidth / 2 - halfPadding).attr("y", -(maxHeight / 2) - halfPadding).attr("width", maxWidth + node.padding).attr("height", maxHeight + node.padding);
1421
- updateNodeBounds(node, rect2);
1422
- node.intersect = function(point2) {
1423
- return intersect_default.rect(node, point2);
1424
- };
1425
- return shapeSvg;
1426
- }, "class_box");
1427
- var shapes = {
1428
- rhombus: question,
1429
- composite,
1430
- question,
1431
- rect,
1432
- labelRect,
1433
- rectWithTitle,
1434
- choice,
1435
- circle: circle2,
1436
- doublecircle,
1437
- stadium,
1438
- hexagon,
1439
- block_arrow,
1440
- rect_left_inv_arrow,
1441
- lean_right,
1442
- lean_left,
1443
- trapezoid,
1444
- inv_trapezoid,
1445
- rect_right_inv_arrow,
1446
- cylinder,
1447
- start,
1448
- end,
1449
- note: note_default,
1450
- subroutine,
1451
- fork: forkJoin,
1452
- join: forkJoin,
1453
- class_box
1454
- };
1455
- var nodeElems = {};
1456
- var insertNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (elem, node, renderOptions) => {
1457
- let newEl;
1458
- let el;
1459
- if (node.link) {
1460
- let target;
1461
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().securityLevel === "sandbox") {
1462
- target = "_top";
1463
- } else if (node.linkTarget) {
1464
- target = node.linkTarget || "_blank";
1465
- }
1466
- newEl = elem.insert("svg:a").attr("xlink:href", node.link).attr("target", target);
1467
- el = await shapes[node.shape](newEl, node, renderOptions);
1468
- } else {
1469
- el = await shapes[node.shape](elem, node, renderOptions);
1470
- newEl = el;
1471
- }
1472
- if (node.tooltip) {
1473
- el.attr("title", node.tooltip);
1474
- }
1475
- if (node.class) {
1476
- el.attr("class", "node default " + node.class);
1477
- }
1478
- nodeElems[node.id] = newEl;
1479
- if (node.haveCallback) {
1480
- nodeElems[node.id].attr("class", nodeElems[node.id].attr("class") + " clickable");
1481
- }
1482
- return newEl;
1483
- }, "insertNode");
1484
- var setNodeElem = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, node) => {
1485
- nodeElems[node.id] = elem;
1486
- }, "setNodeElem");
1487
- var clear = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => {
1488
- nodeElems = {};
1489
- }, "clear");
1490
- var positionNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node) => {
1491
- const el = nodeElems[node.id];
1492
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.trace(
1493
- "Transforming node",
1494
- node.diff,
1495
- node,
1496
- "translate(" + (node.x - node.width / 2 - 5) + ", " + node.width / 2 + ")"
1497
- );
1498
- const padding = 8;
1499
- const diff = node.diff || 0;
1500
- if (node.clusterNode) {
1501
- el.attr(
1502
- "transform",
1503
- "translate(" + (node.x + diff - node.width / 2) + ", " + (node.y - node.height / 2 - padding) + ")"
1504
- );
1505
- } else {
1506
- el.attr("transform", "translate(" + node.x + ", " + node.y + ")");
1507
- }
1508
- return diff;
1509
- }, "positionNode");
1510
-
1511
- // src/dagre-wrapper/edges.js
1512
-
1513
-
1514
- // src/dagre-wrapper/edgeMarker.ts
1515
- var addEdgeMarkers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((svgPath, edge, url, id, diagramType) => {
1516
- if (edge.arrowTypeStart) {
1517
- addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id, diagramType);
1518
- }
1519
- if (edge.arrowTypeEnd) {
1520
- addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id, diagramType);
1521
- }
1522
- }, "addEdgeMarkers");
1523
- var arrowTypesMap = {
1524
- arrow_cross: "cross",
1525
- arrow_point: "point",
1526
- arrow_barb: "barb",
1527
- arrow_circle: "circle",
1528
- aggregation: "aggregation",
1529
- extension: "extension",
1530
- composition: "composition",
1531
- dependency: "dependency",
1532
- lollipop: "lollipop"
1533
- };
1534
- var addEdgeMarker = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((svgPath, position, arrowType, url, id, diagramType) => {
1535
- const endMarkerType = arrowTypesMap[arrowType];
1536
- if (!endMarkerType) {
1537
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown arrow type: ${arrowType}`);
1538
- return;
1539
- }
1540
- const suffix = position === "start" ? "Start" : "End";
1541
- svgPath.attr(`marker-${position}`, `url(${url}#${id}_${diagramType}-${endMarkerType}${suffix})`);
1542
- }, "addEdgeMarker");
1543
-
1544
- // src/dagre-wrapper/edges.js
1545
- var edgeLabels = {};
1546
- var terminalLabels = {};
1547
- var clear2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => {
1548
- edgeLabels = {};
1549
- terminalLabels = {};
1550
- }, "clear");
1551
- var insertEdgeLabel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, edge) => {
1552
- const config = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)();
1553
- const useHtmlLabels = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)(config.flowchart.htmlLabels);
1554
- const labelElement = edge.labelType === "markdown" ? (0,_chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createText */ .GZ)(
1555
- elem,
1556
- edge.label,
1557
- {
1558
- style: edge.labelStyle,
1559
- useHtmlLabels,
1560
- addSvgBackground: true
1561
- },
1562
- config
1563
- ) : createLabel_default(edge.label, edge.labelStyle);
1564
- const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
1565
- const label = edgeLabel.insert("g").attr("class", "label");
1566
- label.node().appendChild(labelElement);
1567
- let bbox = labelElement.getBBox();
1568
- if (useHtmlLabels) {
1569
- const div = labelElement.children[0];
1570
- const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(labelElement);
1571
- bbox = div.getBoundingClientRect();
1572
- dv.attr("width", bbox.width);
1573
- dv.attr("height", bbox.height);
1574
- }
1575
- label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
1576
- edgeLabels[edge.id] = edgeLabel;
1577
- edge.width = bbox.width;
1578
- edge.height = bbox.height;
1579
- let fo;
1580
- if (edge.startLabelLeft) {
1581
- const startLabelElement = createLabel_default(edge.startLabelLeft, edge.labelStyle);
1582
- const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
1583
- const inner = startEdgeLabelLeft.insert("g").attr("class", "inner");
1584
- fo = inner.node().appendChild(startLabelElement);
1585
- const slBox = startLabelElement.getBBox();
1586
- inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
1587
- if (!terminalLabels[edge.id]) {
1588
- terminalLabels[edge.id] = {};
1589
- }
1590
- terminalLabels[edge.id].startLeft = startEdgeLabelLeft;
1591
- setTerminalWidth(fo, edge.startLabelLeft);
1592
- }
1593
- if (edge.startLabelRight) {
1594
- const startLabelElement = createLabel_default(edge.startLabelRight, edge.labelStyle);
1595
- const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
1596
- const inner = startEdgeLabelRight.insert("g").attr("class", "inner");
1597
- fo = startEdgeLabelRight.node().appendChild(startLabelElement);
1598
- inner.node().appendChild(startLabelElement);
1599
- const slBox = startLabelElement.getBBox();
1600
- inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
1601
- if (!terminalLabels[edge.id]) {
1602
- terminalLabels[edge.id] = {};
1603
- }
1604
- terminalLabels[edge.id].startRight = startEdgeLabelRight;
1605
- setTerminalWidth(fo, edge.startLabelRight);
1606
- }
1607
- if (edge.endLabelLeft) {
1608
- const endLabelElement = createLabel_default(edge.endLabelLeft, edge.labelStyle);
1609
- const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
1610
- const inner = endEdgeLabelLeft.insert("g").attr("class", "inner");
1611
- fo = inner.node().appendChild(endLabelElement);
1612
- const slBox = endLabelElement.getBBox();
1613
- inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
1614
- endEdgeLabelLeft.node().appendChild(endLabelElement);
1615
- if (!terminalLabels[edge.id]) {
1616
- terminalLabels[edge.id] = {};
1617
- }
1618
- terminalLabels[edge.id].endLeft = endEdgeLabelLeft;
1619
- setTerminalWidth(fo, edge.endLabelLeft);
1620
- }
1621
- if (edge.endLabelRight) {
1622
- const endLabelElement = createLabel_default(edge.endLabelRight, edge.labelStyle);
1623
- const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
1624
- const inner = endEdgeLabelRight.insert("g").attr("class", "inner");
1625
- fo = inner.node().appendChild(endLabelElement);
1626
- const slBox = endLabelElement.getBBox();
1627
- inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
1628
- endEdgeLabelRight.node().appendChild(endLabelElement);
1629
- if (!terminalLabels[edge.id]) {
1630
- terminalLabels[edge.id] = {};
1631
- }
1632
- terminalLabels[edge.id].endRight = endEdgeLabelRight;
1633
- setTerminalWidth(fo, edge.endLabelRight);
1634
- }
1635
- return labelElement;
1636
- }, "insertEdgeLabel");
1637
- function setTerminalWidth(fo, value) {
1638
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels && fo) {
1639
- fo.style.width = value.length * 9 + "px";
1640
- fo.style.height = "12px";
1641
- }
1642
- }
1643
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setTerminalWidth, "setTerminalWidth");
1644
- var positionEdgeLabel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((edge, paths) => {
1645
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels[edge.id], paths);
1646
- let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
1647
- const siteConfig = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)();
1648
- const { subGraphTitleTotalMargin } = (0,_chunk_I3FGKTZ5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getSubGraphTitleMargins */ .O)(siteConfig);
1649
- if (edge.label) {
1650
- const el = edgeLabels[edge.id];
1651
- let x = edge.x;
1652
- let y = edge.y;
1653
- if (path) {
1654
- const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcLabelPosition(path);
1655
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(
1656
- "Moving label " + edge.label + " from (",
1657
- x,
1658
- ",",
1659
- y,
1660
- ") to (",
1661
- pos.x,
1662
- ",",
1663
- pos.y,
1664
- ") abc88"
1665
- );
1666
- if (paths.updatedPath) {
1667
- x = pos.x;
1668
- y = pos.y;
1669
- }
1670
- }
1671
- el.attr("transform", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);
1672
- }
1673
- if (edge.startLabelLeft) {
1674
- const el = terminalLabels[edge.id].startLeft;
1675
- let x = edge.x;
1676
- let y = edge.y;
1677
- if (path) {
1678
- const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path);
1679
- x = pos.x;
1680
- y = pos.y;
1681
- }
1682
- el.attr("transform", `translate(${x}, ${y})`);
1683
- }
1684
- if (edge.startLabelRight) {
1685
- const el = terminalLabels[edge.id].startRight;
1686
- let x = edge.x;
1687
- let y = edge.y;
1688
- if (path) {
1689
- const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(
1690
- edge.arrowTypeStart ? 10 : 0,
1691
- "start_right",
1692
- path
1693
- );
1694
- x = pos.x;
1695
- y = pos.y;
1696
- }
1697
- el.attr("transform", `translate(${x}, ${y})`);
1698
- }
1699
- if (edge.endLabelLeft) {
1700
- const el = terminalLabels[edge.id].endLeft;
1701
- let x = edge.x;
1702
- let y = edge.y;
1703
- if (path) {
1704
- const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path);
1705
- x = pos.x;
1706
- y = pos.y;
1707
- }
1708
- el.attr("transform", `translate(${x}, ${y})`);
1709
- }
1710
- if (edge.endLabelRight) {
1711
- const el = terminalLabels[edge.id].endRight;
1712
- let x = edge.x;
1713
- let y = edge.y;
1714
- if (path) {
1715
- const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path);
1716
- x = pos.x;
1717
- y = pos.y;
1718
- }
1719
- el.attr("transform", `translate(${x}, ${y})`);
1720
- }
1721
- }, "positionEdgeLabel");
1722
- var outsideNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, point2) => {
1723
- const x = node.x;
1724
- const y = node.y;
1725
- const dx = Math.abs(point2.x - x);
1726
- const dy = Math.abs(point2.y - y);
1727
- const w = node.width / 2;
1728
- const h = node.height / 2;
1729
- if (dx >= w || dy >= h) {
1730
- return true;
1731
- }
1732
- return false;
1733
- }, "outsideNode");
1734
- var intersection = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, outsidePoint, insidePoint) => {
1735
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`intersection calc abc89:
1736
- outsidePoint: ${JSON.stringify(outsidePoint)}
1737
- insidePoint : ${JSON.stringify(insidePoint)}
1738
- node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);
1739
- const x = node.x;
1740
- const y = node.y;
1741
- const dx = Math.abs(x - insidePoint.x);
1742
- const w = node.width / 2;
1743
- let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;
1744
- const h = node.height / 2;
1745
- const Q = Math.abs(outsidePoint.y - insidePoint.y);
1746
- const R = Math.abs(outsidePoint.x - insidePoint.x);
1747
- if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
1748
- let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
1749
- r = R * q / Q;
1750
- const res = {
1751
- x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,
1752
- y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q
1753
- };
1754
- if (r === 0) {
1755
- res.x = outsidePoint.x;
1756
- res.y = outsidePoint.y;
1757
- }
1758
- if (R === 0) {
1759
- res.x = outsidePoint.x;
1760
- }
1761
- if (Q === 0) {
1762
- res.y = outsidePoint.y;
1763
- }
1764
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
1765
- return res;
1766
- } else {
1767
- if (insidePoint.x < outsidePoint.x) {
1768
- r = outsidePoint.x - w - x;
1769
- } else {
1770
- r = x - w - outsidePoint.x;
1771
- }
1772
- let q = Q * r / R;
1773
- let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;
1774
- let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;
1775
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });
1776
- if (r === 0) {
1777
- _x = outsidePoint.x;
1778
- _y = outsidePoint.y;
1779
- }
1780
- if (R === 0) {
1781
- _x = outsidePoint.x;
1782
- }
1783
- if (Q === 0) {
1784
- _y = outsidePoint.y;
1785
- }
1786
- return { x: _x, y: _y };
1787
- }
1788
- }, "intersection");
1789
- var cutPathAtIntersect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((_points, boundaryNode) => {
1790
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("abc88 cutPathAtIntersect", _points, boundaryNode);
1791
- let points = [];
1792
- let lastPointOutside = _points[0];
1793
- let isInside = false;
1794
- _points.forEach((point2) => {
1795
- if (!outsideNode(boundaryNode, point2) && !isInside) {
1796
- const inter = intersection(boundaryNode, lastPointOutside, point2);
1797
- let pointPresent = false;
1798
- points.forEach((p) => {
1799
- pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;
1800
- });
1801
- if (!points.some((e) => e.x === inter.x && e.y === inter.y)) {
1802
- points.push(inter);
1803
- }
1804
- isInside = true;
1805
- } else {
1806
- lastPointOutside = point2;
1807
- if (!isInside) {
1808
- points.push(point2);
1809
- }
1810
- }
1811
- });
1812
- return points;
1813
- }, "cutPathAtIntersect");
1814
- var insertEdge = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, e, edge, clusterDb, diagramType, graph, id) {
1815
- let points = edge.points;
1816
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("abc88 InsertEdge: edge=", edge, "e=", e);
1817
- let pointsHasChanged = false;
1818
- const tail = graph.node(e.v);
1819
- var head = graph.node(e.w);
1820
- if (head?.intersect && tail?.intersect) {
1821
- points = points.slice(1, edge.points.length - 1);
1822
- points.unshift(tail.intersect(points[0]));
1823
- points.push(head.intersect(points[points.length - 1]));
1824
- }
1825
- if (edge.toCluster) {
1826
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("to cluster abc88", clusterDb[edge.toCluster]);
1827
- points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node);
1828
- pointsHasChanged = true;
1829
- }
1830
- if (edge.fromCluster) {
1831
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("from cluster abc88", clusterDb[edge.fromCluster]);
1832
- points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse();
1833
- pointsHasChanged = true;
1834
- }
1835
- const lineData = points.filter((p) => !Number.isNaN(p.y));
1836
- let curve = d3__WEBPACK_IMPORTED_MODULE_4__/* .curveBasis */ .qrM;
1837
- if (edge.curve && (diagramType === "graph" || diagramType === "flowchart")) {
1838
- curve = edge.curve;
1839
- }
1840
- const { x, y } = (0,_chunk_I3FGKTZ5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getLineFunctionsWithOffset */ .R)(edge);
1841
- const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .line */ .n8j)().x(x).y(y).curve(curve);
1842
- let strokeClasses;
1843
- switch (edge.thickness) {
1844
- case "normal":
1845
- strokeClasses = "edge-thickness-normal";
1846
- break;
1847
- case "thick":
1848
- strokeClasses = "edge-thickness-thick";
1849
- break;
1850
- case "invisible":
1851
- strokeClasses = "edge-thickness-thick";
1852
- break;
1853
- default:
1854
- strokeClasses = "";
1855
- }
1856
- switch (edge.pattern) {
1857
- case "solid":
1858
- strokeClasses += " edge-pattern-solid";
1859
- break;
1860
- case "dotted":
1861
- strokeClasses += " edge-pattern-dotted";
1862
- break;
1863
- case "dashed":
1864
- strokeClasses += " edge-pattern-dashed";
1865
- break;
1866
- }
1867
- const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style);
1868
- let url = "";
1869
- if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.arrowMarkerAbsolute || (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().state.arrowMarkerAbsolute) {
1870
- url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
1871
- url = url.replace(/\(/g, "\\(");
1872
- url = url.replace(/\)/g, "\\)");
1873
- }
1874
- addEdgeMarkers(svgPath, edge, url, id, diagramType);
1875
- let paths = {};
1876
- if (pointsHasChanged) {
1877
- paths.updatedPath = points;
1878
- }
1879
- paths.originalPath = edge.points;
1880
- return paths;
1881
- }, "insertEdge");
1882
-
1883
-
1884
-
1885
-
1886
- /***/ })
1887
-
1888
- }]);