@readme/markdown 9.3.0 → 9.3.1

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 (122) hide show
  1. package/dist/10.node.js +20064 -19229
  2. package/dist/10.node.js.map +1 -1
  3. package/dist/122.node.js +23 -0
  4. package/dist/122.node.js.map +1 -0
  5. package/dist/{17.node.js → 135.node.js} +109 -110
  6. package/dist/135.node.js.map +1 -0
  7. package/dist/136.node.js +23 -0
  8. package/dist/136.node.js.map +1 -0
  9. package/dist/{52.node.js → 188.node.js} +211 -196
  10. package/dist/188.node.js.map +1 -0
  11. package/dist/214.node.js +1280 -0
  12. package/dist/214.node.js.map +1 -0
  13. package/dist/23.node.js +2563 -0
  14. package/dist/23.node.js.map +1 -0
  15. package/dist/{867.node.js → 311.node.js} +95 -95
  16. package/dist/{867.node.js.map → 311.node.js.map} +1 -1
  17. package/dist/{940.node.js → 339.node.js} +3 -75
  18. package/dist/339.node.js.map +1 -0
  19. package/dist/354.node.js +23 -0
  20. package/dist/354.node.js.map +1 -0
  21. package/dist/359.node.js +2001 -0
  22. package/dist/359.node.js.map +1 -0
  23. package/dist/364.node.js +4435 -0
  24. package/dist/364.node.js.map +1 -0
  25. package/dist/{429.node.js → 371.node.js} +196 -139
  26. package/dist/371.node.js.map +1 -0
  27. package/dist/{687.node.js → 38.node.js} +761 -761
  28. package/dist/38.node.js.map +1 -0
  29. package/dist/391.node.js +522 -0
  30. package/dist/391.node.js.map +1 -0
  31. package/dist/462.node.js +23 -0
  32. package/dist/462.node.js.map +1 -0
  33. package/dist/48.node.js +57 -0
  34. package/dist/48.node.js.map +1 -0
  35. package/dist/486.node.js +16267 -14851
  36. package/dist/486.node.js.map +1 -1
  37. package/dist/537.node.js +59 -0
  38. package/dist/537.node.js.map +1 -0
  39. package/dist/550.node.js +201 -1408
  40. package/dist/550.node.js.map +1 -1
  41. package/dist/{403.node.js → 572.node.js} +118 -118
  42. package/dist/572.node.js.map +1 -0
  43. package/dist/580.node.js +1324 -0
  44. package/dist/580.node.js.map +1 -0
  45. package/dist/{952.node.js → 649.node.js} +39 -39
  46. package/dist/{952.node.js.map → 649.node.js.map} +1 -1
  47. package/dist/740.node.js +23 -0
  48. package/dist/740.node.js.map +1 -0
  49. package/dist/741.node.js +23 -0
  50. package/dist/741.node.js.map +1 -0
  51. package/dist/779.node.js +57 -0
  52. package/dist/779.node.js.map +1 -0
  53. package/dist/805.node.js +1355 -0
  54. package/dist/805.node.js.map +1 -0
  55. package/dist/{246.node.js → 855.node.js} +671 -495
  56. package/dist/855.node.js.map +1 -0
  57. package/dist/{11.node.js → 870.node.js} +70 -63
  58. package/dist/870.node.js.map +1 -0
  59. package/dist/874.node.js +57 -0
  60. package/dist/874.node.js.map +1 -0
  61. package/dist/881.node.js +1344 -720
  62. package/dist/881.node.js.map +1 -1
  63. package/dist/{906.node.js → 890.node.js} +147 -147
  64. package/dist/{906.node.js.map → 890.node.js.map} +1 -1
  65. package/dist/898.node.js +361 -0
  66. package/dist/898.node.js.map +1 -0
  67. package/dist/{551.node.js → 912.node.js} +133 -133
  68. package/dist/{551.node.js.map → 912.node.js.map} +1 -1
  69. package/dist/{745.node.js → 915.node.js} +86 -85
  70. package/dist/915.node.js.map +1 -0
  71. package/dist/982.node.js +1132 -0
  72. package/dist/982.node.js.map +1 -0
  73. package/dist/995.node.js +189 -159
  74. package/dist/995.node.js.map +1 -1
  75. package/dist/lib/plain.d.ts +1 -1
  76. package/dist/main.js +1881 -331
  77. package/dist/main.node.js +1872 -332
  78. package/dist/main.node.js.map +1 -1
  79. package/package.json +1 -2
  80. package/dist/11.node.js.map +0 -1
  81. package/dist/120.node.js +0 -23
  82. package/dist/120.node.js.map +0 -1
  83. package/dist/134.node.js +0 -23
  84. package/dist/134.node.js.map +0 -1
  85. package/dist/150.node.js +0 -1892
  86. package/dist/150.node.js.map +0 -1
  87. package/dist/17.node.js.map +0 -1
  88. package/dist/246.node.js.map +0 -1
  89. package/dist/351.node.js +0 -2404
  90. package/dist/351.node.js.map +0 -1
  91. package/dist/366.node.js +0 -1185
  92. package/dist/366.node.js.map +0 -1
  93. package/dist/403.node.js.map +0 -1
  94. package/dist/429.node.js.map +0 -1
  95. package/dist/485.node.js +0 -518
  96. package/dist/485.node.js.map +0 -1
  97. package/dist/488.node.js +0 -59
  98. package/dist/488.node.js.map +0 -1
  99. package/dist/510.node.js +0 -250
  100. package/dist/510.node.js.map +0 -1
  101. package/dist/52.node.js.map +0 -1
  102. package/dist/617.node.js +0 -23
  103. package/dist/617.node.js.map +0 -1
  104. package/dist/687.node.js.map +0 -1
  105. package/dist/745.node.js.map +0 -1
  106. package/dist/775.node.js +0 -1904
  107. package/dist/775.node.js.map +0 -1
  108. package/dist/788.node.js +0 -1025
  109. package/dist/788.node.js.map +0 -1
  110. package/dist/81.node.js +0 -386
  111. package/dist/81.node.js.map +0 -1
  112. package/dist/849.node.js +0 -2590
  113. package/dist/849.node.js.map +0 -1
  114. package/dist/863.node.js +0 -23
  115. package/dist/863.node.js.map +0 -1
  116. package/dist/885.node.js +0 -52
  117. package/dist/885.node.js.map +0 -1
  118. package/dist/896.node.js +0 -1617
  119. package/dist/896.node.js.map +0 -1
  120. package/dist/91.node.js +0 -23
  121. package/dist/91.node.js.map +0 -1
  122. package/dist/940.node.js.map +0 -1
@@ -0,0 +1,4435 @@
1
+ "use strict";
2
+ exports.id = 364;
3
+ exports.ids = [364];
4
+ exports.modules = {
5
+
6
+ /***/ 8448:
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+
10
+ // EXPORTS
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ T: () => (/* binding */ Graph)
13
+ });
14
+
15
+ // EXTERNAL MODULE: ./node_modules/lodash-es/constant.js
16
+ var constant = __webpack_require__(3659);
17
+ // EXTERNAL MODULE: ./node_modules/lodash-es/isFunction.js
18
+ var isFunction = __webpack_require__(8807);
19
+ // EXTERNAL MODULE: ./node_modules/lodash-es/keys.js
20
+ var keys = __webpack_require__(7947);
21
+ // EXTERNAL MODULE: ./node_modules/lodash-es/filter.js
22
+ var filter = __webpack_require__(7133);
23
+ // EXTERNAL MODULE: ./node_modules/lodash-es/isEmpty.js
24
+ var isEmpty = __webpack_require__(4650);
25
+ // EXTERNAL MODULE: ./node_modules/lodash-es/forEach.js
26
+ var forEach = __webpack_require__(9769);
27
+ // EXTERNAL MODULE: ./node_modules/lodash-es/isUndefined.js
28
+ var isUndefined = __webpack_require__(9523);
29
+ // EXTERNAL MODULE: ./node_modules/lodash-es/_baseFlatten.js + 1 modules
30
+ var _baseFlatten = __webpack_require__(3684);
31
+ // EXTERNAL MODULE: ./node_modules/lodash-es/_baseRest.js
32
+ var _baseRest = __webpack_require__(5881);
33
+ // EXTERNAL MODULE: ./node_modules/lodash-es/_baseUniq.js + 1 modules
34
+ var _baseUniq = __webpack_require__(8170);
35
+ // EXTERNAL MODULE: ./node_modules/lodash-es/isArrayLikeObject.js
36
+ var isArrayLikeObject = __webpack_require__(654);
37
+ ;// ./node_modules/lodash-es/union.js
38
+
39
+
40
+
41
+
42
+
43
+ /**
44
+ * Creates an array of unique values, in order, from all given arrays using
45
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
46
+ * for equality comparisons.
47
+ *
48
+ * @static
49
+ * @memberOf _
50
+ * @since 0.1.0
51
+ * @category Array
52
+ * @param {...Array} [arrays] The arrays to inspect.
53
+ * @returns {Array} Returns the new array of combined values.
54
+ * @example
55
+ *
56
+ * _.union([2], [1, 2]);
57
+ * // => [2, 1]
58
+ */
59
+ var union = (0,_baseRest/* default */.A)(function(arrays) {
60
+ return (0,_baseUniq/* default */.A)((0,_baseFlatten/* default */.A)(arrays, 1, isArrayLikeObject/* default */.A, true));
61
+ });
62
+
63
+ /* harmony default export */ const lodash_es_union = (union);
64
+
65
+ // EXTERNAL MODULE: ./node_modules/lodash-es/values.js + 1 modules
66
+ var values = __webpack_require__(7888);
67
+ // EXTERNAL MODULE: ./node_modules/lodash-es/reduce.js + 2 modules
68
+ var reduce = __webpack_require__(9027);
69
+ ;// ./node_modules/dagre-d3-es/src/graphlib/graph.js
70
+
71
+
72
+ var DEFAULT_EDGE_NAME = '\x00';
73
+ var GRAPH_NODE = '\x00';
74
+ var EDGE_KEY_DELIM = '\x01';
75
+
76
+ // Implementation notes:
77
+ //
78
+ // * Node id query functions should return string ids for the nodes
79
+ // * Edge id query functions should return an "edgeObj", edge object, that is
80
+ // composed of enough information to uniquely identify an edge: {v, w, name}.
81
+ // * Internally we use an "edgeId", a stringified form of the edgeObj, to
82
+ // reference edges. This is because we need a performant way to look these
83
+ // edges up and, object properties, which have string keys, are the closest
84
+ // we're going to get to a performant hashtable in JavaScript.
85
+
86
+ // Implementation notes:
87
+ //
88
+ // * Node id query functions should return string ids for the nodes
89
+ // * Edge id query functions should return an "edgeObj", edge object, that is
90
+ // composed of enough information to uniquely identify an edge: {v, w, name}.
91
+ // * Internally we use an "edgeId", a stringified form of the edgeObj, to
92
+ // reference edges. This is because we need a performant way to look these
93
+ // edges up and, object properties, which have string keys, are the closest
94
+ // we're going to get to a performant hashtable in JavaScript.
95
+ class Graph {
96
+ constructor(opts = {}) {
97
+ this._isDirected = Object.prototype.hasOwnProperty.call(opts, 'directed')
98
+ ? opts.directed
99
+ : true;
100
+ this._isMultigraph = Object.prototype.hasOwnProperty.call(opts, 'multigraph')
101
+ ? opts.multigraph
102
+ : false;
103
+ this._isCompound = Object.prototype.hasOwnProperty.call(opts, 'compound')
104
+ ? opts.compound
105
+ : false;
106
+
107
+ // Label for the graph itself
108
+ this._label = undefined;
109
+
110
+ // Defaults to be set when creating a new node
111
+ this._defaultNodeLabelFn = constant/* default */.A(undefined);
112
+
113
+ // Defaults to be set when creating a new edge
114
+ this._defaultEdgeLabelFn = constant/* default */.A(undefined);
115
+
116
+ // v -> label
117
+ this._nodes = {};
118
+
119
+ if (this._isCompound) {
120
+ // v -> parent
121
+ this._parent = {};
122
+
123
+ // v -> children
124
+ this._children = {};
125
+ this._children[GRAPH_NODE] = {};
126
+ }
127
+
128
+ // v -> edgeObj
129
+ this._in = {};
130
+
131
+ // u -> v -> Number
132
+ this._preds = {};
133
+
134
+ // v -> edgeObj
135
+ this._out = {};
136
+
137
+ // v -> w -> Number
138
+ this._sucs = {};
139
+
140
+ // e -> edgeObj
141
+ this._edgeObjs = {};
142
+
143
+ // e -> label
144
+ this._edgeLabels = {};
145
+ }
146
+ /* === Graph functions ========= */
147
+ isDirected() {
148
+ return this._isDirected;
149
+ }
150
+ isMultigraph() {
151
+ return this._isMultigraph;
152
+ }
153
+ isCompound() {
154
+ return this._isCompound;
155
+ }
156
+ setGraph(label) {
157
+ this._label = label;
158
+ return this;
159
+ }
160
+ graph() {
161
+ return this._label;
162
+ }
163
+ /* === Node functions ========== */
164
+ setDefaultNodeLabel(newDefault) {
165
+ if (!isFunction/* default */.A(newDefault)) {
166
+ newDefault = constant/* default */.A(newDefault);
167
+ }
168
+ this._defaultNodeLabelFn = newDefault;
169
+ return this;
170
+ }
171
+ nodeCount() {
172
+ return this._nodeCount;
173
+ }
174
+ nodes() {
175
+ return keys/* default */.A(this._nodes);
176
+ }
177
+ sources() {
178
+ var self = this;
179
+ return filter/* default */.A(this.nodes(), function (v) {
180
+ return isEmpty/* default */.A(self._in[v]);
181
+ });
182
+ }
183
+ sinks() {
184
+ var self = this;
185
+ return filter/* default */.A(this.nodes(), function (v) {
186
+ return isEmpty/* default */.A(self._out[v]);
187
+ });
188
+ }
189
+ setNodes(vs, value) {
190
+ var args = arguments;
191
+ var self = this;
192
+ forEach/* default */.A(vs, function (v) {
193
+ if (args.length > 1) {
194
+ self.setNode(v, value);
195
+ } else {
196
+ self.setNode(v);
197
+ }
198
+ });
199
+ return this;
200
+ }
201
+ setNode(v, value) {
202
+ if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {
203
+ if (arguments.length > 1) {
204
+ this._nodes[v] = value;
205
+ }
206
+ return this;
207
+ }
208
+
209
+ // @ts-expect-error
210
+ this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);
211
+ if (this._isCompound) {
212
+ this._parent[v] = GRAPH_NODE;
213
+ this._children[v] = {};
214
+ this._children[GRAPH_NODE][v] = true;
215
+ }
216
+ this._in[v] = {};
217
+ this._preds[v] = {};
218
+ this._out[v] = {};
219
+ this._sucs[v] = {};
220
+ ++this._nodeCount;
221
+ return this;
222
+ }
223
+ node(v) {
224
+ return this._nodes[v];
225
+ }
226
+ hasNode(v) {
227
+ return Object.prototype.hasOwnProperty.call(this._nodes, v);
228
+ }
229
+ removeNode(v) {
230
+ if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {
231
+ var removeEdge = (e) => this.removeEdge(this._edgeObjs[e]);
232
+ delete this._nodes[v];
233
+ if (this._isCompound) {
234
+ this._removeFromParentsChildList(v);
235
+ delete this._parent[v];
236
+ forEach/* default */.A(this.children(v), (child) => {
237
+ this.setParent(child);
238
+ });
239
+ delete this._children[v];
240
+ }
241
+ forEach/* default */.A(keys/* default */.A(this._in[v]), removeEdge);
242
+ delete this._in[v];
243
+ delete this._preds[v];
244
+ forEach/* default */.A(keys/* default */.A(this._out[v]), removeEdge);
245
+ delete this._out[v];
246
+ delete this._sucs[v];
247
+ --this._nodeCount;
248
+ }
249
+ return this;
250
+ }
251
+ setParent(v, parent) {
252
+ if (!this._isCompound) {
253
+ throw new Error('Cannot set parent in a non-compound graph');
254
+ }
255
+
256
+ if (isUndefined/* default */.A(parent)) {
257
+ parent = GRAPH_NODE;
258
+ } else {
259
+ // Coerce parent to string
260
+ parent += '';
261
+ for (var ancestor = parent; !isUndefined/* default */.A(ancestor); ancestor = this.parent(ancestor)) {
262
+ if (ancestor === v) {
263
+ throw new Error('Setting ' + parent + ' as parent of ' + v + ' would create a cycle');
264
+ }
265
+ }
266
+
267
+ this.setNode(parent);
268
+ }
269
+
270
+ this.setNode(v);
271
+ this._removeFromParentsChildList(v);
272
+ this._parent[v] = parent;
273
+ this._children[parent][v] = true;
274
+ return this;
275
+ }
276
+ _removeFromParentsChildList(v) {
277
+ delete this._children[this._parent[v]][v];
278
+ }
279
+ parent(v) {
280
+ if (this._isCompound) {
281
+ var parent = this._parent[v];
282
+ if (parent !== GRAPH_NODE) {
283
+ return parent;
284
+ }
285
+ }
286
+ }
287
+ children(v) {
288
+ if (isUndefined/* default */.A(v)) {
289
+ v = GRAPH_NODE;
290
+ }
291
+
292
+ if (this._isCompound) {
293
+ var children = this._children[v];
294
+ if (children) {
295
+ return keys/* default */.A(children);
296
+ }
297
+ } else if (v === GRAPH_NODE) {
298
+ return this.nodes();
299
+ } else if (this.hasNode(v)) {
300
+ return [];
301
+ }
302
+ }
303
+ predecessors(v) {
304
+ var predsV = this._preds[v];
305
+ if (predsV) {
306
+ return keys/* default */.A(predsV);
307
+ }
308
+ }
309
+ successors(v) {
310
+ var sucsV = this._sucs[v];
311
+ if (sucsV) {
312
+ return keys/* default */.A(sucsV);
313
+ }
314
+ }
315
+ neighbors(v) {
316
+ var preds = this.predecessors(v);
317
+ if (preds) {
318
+ return lodash_es_union(preds, this.successors(v));
319
+ }
320
+ }
321
+ isLeaf(v) {
322
+ var neighbors;
323
+ if (this.isDirected()) {
324
+ neighbors = this.successors(v);
325
+ } else {
326
+ neighbors = this.neighbors(v);
327
+ }
328
+ return neighbors.length === 0;
329
+ }
330
+ filterNodes(filter) {
331
+ // @ts-expect-error
332
+ var copy = new this.constructor({
333
+ directed: this._isDirected,
334
+ multigraph: this._isMultigraph,
335
+ compound: this._isCompound,
336
+ });
337
+
338
+ copy.setGraph(this.graph());
339
+
340
+ var self = this;
341
+ forEach/* default */.A(this._nodes, function (value, v) {
342
+ if (filter(v)) {
343
+ copy.setNode(v, value);
344
+ }
345
+ });
346
+
347
+ forEach/* default */.A(this._edgeObjs, function (e) {
348
+ // @ts-expect-error
349
+ if (copy.hasNode(e.v) && copy.hasNode(e.w)) {
350
+ copy.setEdge(e, self.edge(e));
351
+ }
352
+ });
353
+
354
+ var parents = {};
355
+ function findParent(v) {
356
+ var parent = self.parent(v);
357
+ if (parent === undefined || copy.hasNode(parent)) {
358
+ parents[v] = parent;
359
+ return parent;
360
+ } else if (parent in parents) {
361
+ return parents[parent];
362
+ } else {
363
+ return findParent(parent);
364
+ }
365
+ }
366
+
367
+ if (this._isCompound) {
368
+ forEach/* default */.A(copy.nodes(), function (v) {
369
+ copy.setParent(v, findParent(v));
370
+ });
371
+ }
372
+
373
+ return copy;
374
+ }
375
+ /* === Edge functions ========== */
376
+ setDefaultEdgeLabel(newDefault) {
377
+ if (!isFunction/* default */.A(newDefault)) {
378
+ newDefault = constant/* default */.A(newDefault);
379
+ }
380
+ this._defaultEdgeLabelFn = newDefault;
381
+ return this;
382
+ }
383
+ edgeCount() {
384
+ return this._edgeCount;
385
+ }
386
+ edges() {
387
+ return values/* default */.A(this._edgeObjs);
388
+ }
389
+ setPath(vs, value) {
390
+ var self = this;
391
+ var args = arguments;
392
+ reduce/* default */.A(vs, function (v, w) {
393
+ if (args.length > 1) {
394
+ self.setEdge(v, w, value);
395
+ } else {
396
+ self.setEdge(v, w);
397
+ }
398
+ return w;
399
+ });
400
+ return this;
401
+ }
402
+ /*
403
+ * setEdge(v, w, [value, [name]])
404
+ * setEdge({ v, w, [name] }, [value])
405
+ */
406
+ setEdge() {
407
+ var v, w, name, value;
408
+ var valueSpecified = false;
409
+ var arg0 = arguments[0];
410
+
411
+ if (typeof arg0 === 'object' && arg0 !== null && 'v' in arg0) {
412
+ v = arg0.v;
413
+ w = arg0.w;
414
+ name = arg0.name;
415
+ if (arguments.length === 2) {
416
+ value = arguments[1];
417
+ valueSpecified = true;
418
+ }
419
+ } else {
420
+ v = arg0;
421
+ w = arguments[1];
422
+ name = arguments[3];
423
+ if (arguments.length > 2) {
424
+ value = arguments[2];
425
+ valueSpecified = true;
426
+ }
427
+ }
428
+
429
+ v = '' + v;
430
+ w = '' + w;
431
+ if (!isUndefined/* default */.A(name)) {
432
+ name = '' + name;
433
+ }
434
+
435
+ var e = edgeArgsToId(this._isDirected, v, w, name);
436
+ if (Object.prototype.hasOwnProperty.call(this._edgeLabels, e)) {
437
+ if (valueSpecified) {
438
+ this._edgeLabels[e] = value;
439
+ }
440
+ return this;
441
+ }
442
+
443
+ if (!isUndefined/* default */.A(name) && !this._isMultigraph) {
444
+ throw new Error('Cannot set a named edge when isMultigraph = false');
445
+ }
446
+
447
+ // It didn't exist, so we need to create it.
448
+ // First ensure the nodes exist.
449
+ this.setNode(v);
450
+ this.setNode(w);
451
+
452
+ // @ts-expect-error
453
+ this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);
454
+
455
+ var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);
456
+ // Ensure we add undirected edges in a consistent way.
457
+ v = edgeObj.v;
458
+ w = edgeObj.w;
459
+
460
+ Object.freeze(edgeObj);
461
+ this._edgeObjs[e] = edgeObj;
462
+ incrementOrInitEntry(this._preds[w], v);
463
+ incrementOrInitEntry(this._sucs[v], w);
464
+ this._in[w][e] = edgeObj;
465
+ this._out[v][e] = edgeObj;
466
+ this._edgeCount++;
467
+ return this;
468
+ }
469
+ edge(v, w, name) {
470
+ var e =
471
+ arguments.length === 1
472
+ ? edgeObjToId(this._isDirected, arguments[0])
473
+ : edgeArgsToId(this._isDirected, v, w, name);
474
+ return this._edgeLabels[e];
475
+ }
476
+ hasEdge(v, w, name) {
477
+ var e =
478
+ arguments.length === 1
479
+ ? edgeObjToId(this._isDirected, arguments[0])
480
+ : edgeArgsToId(this._isDirected, v, w, name);
481
+ return Object.prototype.hasOwnProperty.call(this._edgeLabels, e);
482
+ }
483
+ removeEdge(v, w, name) {
484
+ var e =
485
+ arguments.length === 1
486
+ ? edgeObjToId(this._isDirected, arguments[0])
487
+ : edgeArgsToId(this._isDirected, v, w, name);
488
+ var edge = this._edgeObjs[e];
489
+ if (edge) {
490
+ v = edge.v;
491
+ w = edge.w;
492
+ delete this._edgeLabels[e];
493
+ delete this._edgeObjs[e];
494
+ decrementOrRemoveEntry(this._preds[w], v);
495
+ decrementOrRemoveEntry(this._sucs[v], w);
496
+ delete this._in[w][e];
497
+ delete this._out[v][e];
498
+ this._edgeCount--;
499
+ }
500
+ return this;
501
+ }
502
+ inEdges(v, u) {
503
+ var inV = this._in[v];
504
+ if (inV) {
505
+ var edges = values/* default */.A(inV);
506
+ if (!u) {
507
+ return edges;
508
+ }
509
+ return filter/* default */.A(edges, function (edge) {
510
+ return edge.v === u;
511
+ });
512
+ }
513
+ }
514
+ outEdges(v, w) {
515
+ var outV = this._out[v];
516
+ if (outV) {
517
+ var edges = values/* default */.A(outV);
518
+ if (!w) {
519
+ return edges;
520
+ }
521
+ return filter/* default */.A(edges, function (edge) {
522
+ return edge.w === w;
523
+ });
524
+ }
525
+ }
526
+ nodeEdges(v, w) {
527
+ var inEdges = this.inEdges(v, w);
528
+ if (inEdges) {
529
+ return inEdges.concat(this.outEdges(v, w));
530
+ }
531
+ }
532
+ }
533
+
534
+ /* Number of nodes in the graph. Should only be changed by the implementation. */
535
+ Graph.prototype._nodeCount = 0;
536
+
537
+ /* Number of edges in the graph. Should only be changed by the implementation. */
538
+ Graph.prototype._edgeCount = 0;
539
+
540
+ function incrementOrInitEntry(map, k) {
541
+ if (map[k]) {
542
+ map[k]++;
543
+ } else {
544
+ map[k] = 1;
545
+ }
546
+ }
547
+
548
+ function decrementOrRemoveEntry(map, k) {
549
+ if (!--map[k]) {
550
+ delete map[k];
551
+ }
552
+ }
553
+
554
+ function edgeArgsToId(isDirected, v_, w_, name) {
555
+ var v = '' + v_;
556
+ var w = '' + w_;
557
+ if (!isDirected && v > w) {
558
+ var tmp = v;
559
+ v = w;
560
+ w = tmp;
561
+ }
562
+ return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + (isUndefined/* default */.A(name) ? DEFAULT_EDGE_NAME : name);
563
+ }
564
+
565
+ function edgeArgsToObj(isDirected, v_, w_, name) {
566
+ var v = '' + v_;
567
+ var w = '' + w_;
568
+ if (!isDirected && v > w) {
569
+ var tmp = v;
570
+ v = w;
571
+ w = tmp;
572
+ }
573
+ var edgeObj = { v: v, w: w };
574
+ if (name) {
575
+ edgeObj.name = name;
576
+ }
577
+ return edgeObj;
578
+ }
579
+
580
+ function edgeObjToId(isDirected, edgeObj) {
581
+ return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);
582
+ }
583
+
584
+
585
+ /***/ }),
586
+
587
+ /***/ 4416:
588
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
589
+
590
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
591
+ /* harmony export */ T: () => (/* reexport safe */ _graph_js__WEBPACK_IMPORTED_MODULE_0__.T)
592
+ /* harmony export */ });
593
+ /* unused harmony export version */
594
+ /* harmony import */ var _graph_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8448);
595
+ // Includes only the "core" of graphlib
596
+
597
+
598
+
599
+ const version = '2.1.9-pre';
600
+
601
+
602
+
603
+
604
+ /***/ }),
605
+
606
+ /***/ 7574:
607
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
608
+
609
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
610
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
611
+ /* harmony export */ });
612
+ /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1404);
613
+ /* harmony import */ var _color_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9569);
614
+ /* IMPORT */
615
+
616
+
617
+ /* MAIN */
618
+ const channel = (color, channel) => {
619
+ return _utils_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.lang.round(_color_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.parse(color)[channel]);
620
+ };
621
+ /* EXPORT */
622
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (channel);
623
+
624
+
625
+ /***/ }),
626
+
627
+ /***/ 7134:
628
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
629
+
630
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
631
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
632
+ /* harmony export */ });
633
+ /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4090);
634
+
635
+
636
+ /** Used to compose bitmasks for cloning. */
637
+ var CLONE_SYMBOLS_FLAG = 4;
638
+
639
+ /**
640
+ * Creates a shallow clone of `value`.
641
+ *
642
+ * **Note:** This method is loosely based on the
643
+ * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
644
+ * and supports cloning arrays, array buffers, booleans, date objects, maps,
645
+ * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
646
+ * arrays. The own enumerable properties of `arguments` objects are cloned
647
+ * as plain objects. An empty object is returned for uncloneable values such
648
+ * as error objects, functions, DOM nodes, and WeakMaps.
649
+ *
650
+ * @static
651
+ * @memberOf _
652
+ * @since 0.1.0
653
+ * @category Lang
654
+ * @param {*} value The value to clone.
655
+ * @returns {*} Returns the cloned value.
656
+ * @see _.cloneDeep
657
+ * @example
658
+ *
659
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
660
+ *
661
+ * var shallow = _.clone(objects);
662
+ * console.log(shallow[0] === objects[0]);
663
+ * // => true
664
+ */
665
+ function clone(value) {
666
+ return (0,_baseClone_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value, CLONE_SYMBOLS_FLAG);
667
+ }
668
+
669
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);
670
+
671
+
672
+ /***/ }),
673
+
674
+ /***/ 6364:
675
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
676
+
677
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
678
+ /* harmony export */ diagram: () => (/* binding */ diagram)
679
+ /* harmony export */ });
680
+ /* harmony import */ var _chunk_VV3M67IP_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4746);
681
+ /* harmony import */ var _chunk_K557N5IZ_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7590);
682
+ /* harmony import */ var _chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6499);
683
+ /* harmony import */ var _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8430);
684
+ /* harmony import */ var _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3804);
685
+ /* harmony import */ var lodash_es_clone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7134);
686
+ /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7574);
687
+ /* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3635);
688
+ /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8066);
689
+ /* harmony import */ var dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4416);
690
+
691
+
692
+
693
+
694
+
695
+
696
+ // src/diagrams/block/parser/block.jison
697
+ var parser = function() {
698
+ var o = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(k, v, o2, l) {
699
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
700
+ return o2;
701
+ }, "o"), $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49];
702
+ var parser2 = {
703
+ trace: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function trace() {
704
+ }, "trace"),
705
+ yy: {},
706
+ symbols_: { "error": 2, "spaceLines": 3, "SPACELINE": 4, "NL": 5, "separator": 6, "SPACE": 7, "EOF": 8, "start": 9, "BLOCK_DIAGRAM_KEY": 10, "document": 11, "stop": 12, "statement": 13, "link": 14, "LINK": 15, "START_LINK": 16, "LINK_LABEL": 17, "STR": 18, "nodeStatement": 19, "columnsStatement": 20, "SPACE_BLOCK": 21, "blockStatement": 22, "classDefStatement": 23, "cssClassStatement": 24, "styleStatement": 25, "node": 26, "SIZE": 27, "COLUMNS": 28, "id-block": 29, "end": 30, "block": 31, "NODE_ID": 32, "nodeShapeNLabel": 33, "dirList": 34, "DIR": 35, "NODE_DSTART": 36, "NODE_DEND": 37, "BLOCK_ARROW_START": 38, "BLOCK_ARROW_END": 39, "classDef": 40, "CLASSDEF_ID": 41, "CLASSDEF_STYLEOPTS": 42, "DEFAULT": 43, "class": 44, "CLASSENTITY_IDS": 45, "STYLECLASS": 46, "style": 47, "STYLE_ENTITY_IDS": 48, "STYLE_DEFINITION_DATA": 49, "$accept": 0, "$end": 1 },
707
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
708
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
709
+ performAction: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
710
+ var $0 = $$.length - 1;
711
+ switch (yystate) {
712
+ case 4:
713
+ yy.getLogger().debug("Rule: separator (NL) ");
714
+ break;
715
+ case 5:
716
+ yy.getLogger().debug("Rule: separator (Space) ");
717
+ break;
718
+ case 6:
719
+ yy.getLogger().debug("Rule: separator (EOF) ");
720
+ break;
721
+ case 7:
722
+ yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]);
723
+ yy.setHierarchy($$[$0 - 1]);
724
+ break;
725
+ case 8:
726
+ yy.getLogger().debug("Stop NL ");
727
+ break;
728
+ case 9:
729
+ yy.getLogger().debug("Stop EOF ");
730
+ break;
731
+ case 10:
732
+ yy.getLogger().debug("Stop NL2 ");
733
+ break;
734
+ case 11:
735
+ yy.getLogger().debug("Stop EOF2 ");
736
+ break;
737
+ case 12:
738
+ yy.getLogger().debug("Rule: statement: ", $$[$0]);
739
+ typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]];
740
+ break;
741
+ case 13:
742
+ yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]);
743
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
744
+ break;
745
+ case 14:
746
+ yy.getLogger().debug("Rule: link: ", $$[$0], yytext);
747
+ this.$ = { edgeTypeStr: $$[$0], label: "" };
748
+ break;
749
+ case 15:
750
+ yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]);
751
+ this.$ = { edgeTypeStr: $$[$0], label: $$[$0 - 1] };
752
+ break;
753
+ case 18:
754
+ const num = parseInt($$[$0]);
755
+ const spaceId = yy.generateId();
756
+ this.$ = { id: spaceId, type: "space", label: "", width: num, children: [] };
757
+ break;
758
+ case 23:
759
+ yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr);
760
+ const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr);
761
+ this.$ = [
762
+ { id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions },
763
+ { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" },
764
+ { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions }
765
+ ];
766
+ break;
767
+ case 24:
768
+ yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]);
769
+ this.$ = { id: $$[$0 - 1].id, label: $$[$0 - 1].label, type: yy.typeStr2Type($$[$0 - 1].typeStr), directions: $$[$0 - 1].directions, widthInColumns: parseInt($$[$0], 10) };
770
+ break;
771
+ case 25:
772
+ yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]);
773
+ this.$ = { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions, widthInColumns: 1 };
774
+ break;
775
+ case 26:
776
+ yy.getLogger().debug("APA123", this ? this : "na");
777
+ yy.getLogger().debug("COLUMNS: ", $$[$0]);
778
+ this.$ = { type: "column-setting", columns: $$[$0] === "auto" ? -1 : parseInt($$[$0]) };
779
+ break;
780
+ case 27:
781
+ yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]);
782
+ const id2 = yy.generateId();
783
+ this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] };
784
+ break;
785
+ case 28:
786
+ yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
787
+ const id = yy.generateId();
788
+ this.$ = { id, type: "composite", label: "", children: $$[$0 - 1] };
789
+ break;
790
+ case 29:
791
+ yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]);
792
+ this.$ = { id: $$[$0] };
793
+ break;
794
+ case 30:
795
+ yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]);
796
+ this.$ = { id: $$[$0 - 1], label: $$[$0].label, typeStr: $$[$0].typeStr, directions: $$[$0].directions };
797
+ break;
798
+ case 31:
799
+ yy.getLogger().debug("Rule: dirList: ", $$[$0]);
800
+ this.$ = [$$[$0]];
801
+ break;
802
+ case 32:
803
+ yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]);
804
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
805
+ break;
806
+ case 33:
807
+ yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
808
+ this.$ = { typeStr: $$[$0 - 2] + $$[$0], label: $$[$0 - 1] };
809
+ break;
810
+ case 34:
811
+ yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]);
812
+ this.$ = { typeStr: $$[$0 - 3] + $$[$0], label: $$[$0 - 2], directions: $$[$0 - 1] };
813
+ break;
814
+ case 35:
815
+ case 36:
816
+ this.$ = { type: "classDef", id: $$[$0 - 1].trim(), css: $$[$0].trim() };
817
+ break;
818
+ case 37:
819
+ this.$ = { type: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
820
+ break;
821
+ case 38:
822
+ this.$ = { type: "applyStyles", id: $$[$0 - 1].trim(), stylesStr: $$[$0].trim() };
823
+ break;
824
+ }
825
+ }, "anonymous"),
826
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 8: [1, 20] }, o($V8, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: $V0, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }), o($V9, [2, 16], { 14: 22, 15: $Va, 16: $Vb }), o($V9, [2, 17]), o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), o($V9, [2, 21]), o($V9, [2, 22]), o($Vc, [2, 25], { 27: [1, 25] }), o($V9, [2, 26]), { 19: 26, 26: 12, 32: $V4 }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, o($Vd, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, o($V8, [2, 13]), { 26: 35, 32: $V4 }, { 32: [2, 14] }, { 17: [1, 36] }, o($Vc, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: $Va, 16: $Vb, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, o($Vd, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, o($Vc, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, o($V9, [2, 28]), o($V9, [2, 35]), o($V9, [2, 36]), o($V9, [2, 37]), o($V9, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: $Ve }, { 15: [1, 50] }, o($V9, [2, 27]), o($Vd, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: $Ve, 39: [2, 31] }, { 32: [2, 15] }, o($Vd, [2, 34]), { 39: [2, 32] }],
827
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
828
+ parseError: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function parseError(str, hash) {
829
+ if (hash.recoverable) {
830
+ this.trace(str);
831
+ } else {
832
+ var error = new Error(str);
833
+ error.hash = hash;
834
+ throw error;
835
+ }
836
+ }, "parseError"),
837
+ parse: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function parse(input) {
838
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
839
+ var args = lstack.slice.call(arguments, 1);
840
+ var lexer2 = Object.create(this.lexer);
841
+ var sharedState = { yy: {} };
842
+ for (var k in this.yy) {
843
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
844
+ sharedState.yy[k] = this.yy[k];
845
+ }
846
+ }
847
+ lexer2.setInput(input, sharedState.yy);
848
+ sharedState.yy.lexer = lexer2;
849
+ sharedState.yy.parser = this;
850
+ if (typeof lexer2.yylloc == "undefined") {
851
+ lexer2.yylloc = {};
852
+ }
853
+ var yyloc = lexer2.yylloc;
854
+ lstack.push(yyloc);
855
+ var ranges = lexer2.options && lexer2.options.ranges;
856
+ if (typeof sharedState.yy.parseError === "function") {
857
+ this.parseError = sharedState.yy.parseError;
858
+ } else {
859
+ this.parseError = Object.getPrototypeOf(this).parseError;
860
+ }
861
+ function popStack(n) {
862
+ stack.length = stack.length - 2 * n;
863
+ vstack.length = vstack.length - n;
864
+ lstack.length = lstack.length - n;
865
+ }
866
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(popStack, "popStack");
867
+ function lex() {
868
+ var token;
869
+ token = tstack.pop() || lexer2.lex() || EOF;
870
+ if (typeof token !== "number") {
871
+ if (token instanceof Array) {
872
+ tstack = token;
873
+ token = tstack.pop();
874
+ }
875
+ token = self.symbols_[token] || token;
876
+ }
877
+ return token;
878
+ }
879
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(lex, "lex");
880
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
881
+ while (true) {
882
+ state = stack[stack.length - 1];
883
+ if (this.defaultActions[state]) {
884
+ action = this.defaultActions[state];
885
+ } else {
886
+ if (symbol === null || typeof symbol == "undefined") {
887
+ symbol = lex();
888
+ }
889
+ action = table[state] && table[state][symbol];
890
+ }
891
+ if (typeof action === "undefined" || !action.length || !action[0]) {
892
+ var errStr = "";
893
+ expected = [];
894
+ for (p in table[state]) {
895
+ if (this.terminals_[p] && p > TERROR) {
896
+ expected.push("'" + this.terminals_[p] + "'");
897
+ }
898
+ }
899
+ if (lexer2.showPosition) {
900
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
901
+ } else {
902
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
903
+ }
904
+ this.parseError(errStr, {
905
+ text: lexer2.match,
906
+ token: this.terminals_[symbol] || symbol,
907
+ line: lexer2.yylineno,
908
+ loc: yyloc,
909
+ expected
910
+ });
911
+ }
912
+ if (action[0] instanceof Array && action.length > 1) {
913
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
914
+ }
915
+ switch (action[0]) {
916
+ case 1:
917
+ stack.push(symbol);
918
+ vstack.push(lexer2.yytext);
919
+ lstack.push(lexer2.yylloc);
920
+ stack.push(action[1]);
921
+ symbol = null;
922
+ if (!preErrorSymbol) {
923
+ yyleng = lexer2.yyleng;
924
+ yytext = lexer2.yytext;
925
+ yylineno = lexer2.yylineno;
926
+ yyloc = lexer2.yylloc;
927
+ if (recovering > 0) {
928
+ recovering--;
929
+ }
930
+ } else {
931
+ symbol = preErrorSymbol;
932
+ preErrorSymbol = null;
933
+ }
934
+ break;
935
+ case 2:
936
+ len = this.productions_[action[1]][1];
937
+ yyval.$ = vstack[vstack.length - len];
938
+ yyval._$ = {
939
+ first_line: lstack[lstack.length - (len || 1)].first_line,
940
+ last_line: lstack[lstack.length - 1].last_line,
941
+ first_column: lstack[lstack.length - (len || 1)].first_column,
942
+ last_column: lstack[lstack.length - 1].last_column
943
+ };
944
+ if (ranges) {
945
+ yyval._$.range = [
946
+ lstack[lstack.length - (len || 1)].range[0],
947
+ lstack[lstack.length - 1].range[1]
948
+ ];
949
+ }
950
+ r = this.performAction.apply(yyval, [
951
+ yytext,
952
+ yyleng,
953
+ yylineno,
954
+ sharedState.yy,
955
+ action[1],
956
+ vstack,
957
+ lstack
958
+ ].concat(args));
959
+ if (typeof r !== "undefined") {
960
+ return r;
961
+ }
962
+ if (len) {
963
+ stack = stack.slice(0, -1 * len * 2);
964
+ vstack = vstack.slice(0, -1 * len);
965
+ lstack = lstack.slice(0, -1 * len);
966
+ }
967
+ stack.push(this.productions_[action[1]][0]);
968
+ vstack.push(yyval.$);
969
+ lstack.push(yyval._$);
970
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
971
+ stack.push(newState);
972
+ break;
973
+ case 3:
974
+ return true;
975
+ }
976
+ }
977
+ return true;
978
+ }, "parse")
979
+ };
980
+ var lexer = /* @__PURE__ */ function() {
981
+ var lexer2 = {
982
+ EOF: 1,
983
+ parseError: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function parseError(str, hash) {
984
+ if (this.yy.parser) {
985
+ this.yy.parser.parseError(str, hash);
986
+ } else {
987
+ throw new Error(str);
988
+ }
989
+ }, "parseError"),
990
+ // resets the lexer, sets new input
991
+ setInput: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(input, yy) {
992
+ this.yy = yy || this.yy || {};
993
+ this._input = input;
994
+ this._more = this._backtrack = this.done = false;
995
+ this.yylineno = this.yyleng = 0;
996
+ this.yytext = this.matched = this.match = "";
997
+ this.conditionStack = ["INITIAL"];
998
+ this.yylloc = {
999
+ first_line: 1,
1000
+ first_column: 0,
1001
+ last_line: 1,
1002
+ last_column: 0
1003
+ };
1004
+ if (this.options.ranges) {
1005
+ this.yylloc.range = [0, 0];
1006
+ }
1007
+ this.offset = 0;
1008
+ return this;
1009
+ }, "setInput"),
1010
+ // consumes and returns one char from the input
1011
+ input: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1012
+ var ch = this._input[0];
1013
+ this.yytext += ch;
1014
+ this.yyleng++;
1015
+ this.offset++;
1016
+ this.match += ch;
1017
+ this.matched += ch;
1018
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
1019
+ if (lines) {
1020
+ this.yylineno++;
1021
+ this.yylloc.last_line++;
1022
+ } else {
1023
+ this.yylloc.last_column++;
1024
+ }
1025
+ if (this.options.ranges) {
1026
+ this.yylloc.range[1]++;
1027
+ }
1028
+ this._input = this._input.slice(1);
1029
+ return ch;
1030
+ }, "input"),
1031
+ // unshifts one char (or a string) into the input
1032
+ unput: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(ch) {
1033
+ var len = ch.length;
1034
+ var lines = ch.split(/(?:\r\n?|\n)/g);
1035
+ this._input = ch + this._input;
1036
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
1037
+ this.offset -= len;
1038
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1039
+ this.match = this.match.substr(0, this.match.length - 1);
1040
+ this.matched = this.matched.substr(0, this.matched.length - 1);
1041
+ if (lines.length - 1) {
1042
+ this.yylineno -= lines.length - 1;
1043
+ }
1044
+ var r = this.yylloc.range;
1045
+ this.yylloc = {
1046
+ first_line: this.yylloc.first_line,
1047
+ last_line: this.yylineno + 1,
1048
+ first_column: this.yylloc.first_column,
1049
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
1050
+ };
1051
+ if (this.options.ranges) {
1052
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1053
+ }
1054
+ this.yyleng = this.yytext.length;
1055
+ return this;
1056
+ }, "unput"),
1057
+ // When called from action, caches matched text and appends it on next action
1058
+ more: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1059
+ this._more = true;
1060
+ return this;
1061
+ }, "more"),
1062
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
1063
+ reject: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1064
+ if (this.options.backtrack_lexer) {
1065
+ this._backtrack = true;
1066
+ } else {
1067
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
1068
+ text: "",
1069
+ token: null,
1070
+ line: this.yylineno
1071
+ });
1072
+ }
1073
+ return this;
1074
+ }, "reject"),
1075
+ // retain first n characters of the match
1076
+ less: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(n) {
1077
+ this.unput(this.match.slice(n));
1078
+ }, "less"),
1079
+ // displays already matched input, i.e. for error messages
1080
+ pastInput: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1081
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
1082
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
1083
+ }, "pastInput"),
1084
+ // displays upcoming input, i.e. for error messages
1085
+ upcomingInput: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1086
+ var next = this.match;
1087
+ if (next.length < 20) {
1088
+ next += this._input.substr(0, 20 - next.length);
1089
+ }
1090
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
1091
+ }, "upcomingInput"),
1092
+ // displays the character position where the lexing error occurred, i.e. for error messages
1093
+ showPosition: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1094
+ var pre = this.pastInput();
1095
+ var c = new Array(pre.length + 1).join("-");
1096
+ return pre + this.upcomingInput() + "\n" + c + "^";
1097
+ }, "showPosition"),
1098
+ // test the lexed token: return FALSE when not a match, otherwise return token
1099
+ test_match: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(match, indexed_rule) {
1100
+ var token, lines, backup;
1101
+ if (this.options.backtrack_lexer) {
1102
+ backup = {
1103
+ yylineno: this.yylineno,
1104
+ yylloc: {
1105
+ first_line: this.yylloc.first_line,
1106
+ last_line: this.last_line,
1107
+ first_column: this.yylloc.first_column,
1108
+ last_column: this.yylloc.last_column
1109
+ },
1110
+ yytext: this.yytext,
1111
+ match: this.match,
1112
+ matches: this.matches,
1113
+ matched: this.matched,
1114
+ yyleng: this.yyleng,
1115
+ offset: this.offset,
1116
+ _more: this._more,
1117
+ _input: this._input,
1118
+ yy: this.yy,
1119
+ conditionStack: this.conditionStack.slice(0),
1120
+ done: this.done
1121
+ };
1122
+ if (this.options.ranges) {
1123
+ backup.yylloc.range = this.yylloc.range.slice(0);
1124
+ }
1125
+ }
1126
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
1127
+ if (lines) {
1128
+ this.yylineno += lines.length;
1129
+ }
1130
+ this.yylloc = {
1131
+ first_line: this.yylloc.last_line,
1132
+ last_line: this.yylineno + 1,
1133
+ first_column: this.yylloc.last_column,
1134
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
1135
+ };
1136
+ this.yytext += match[0];
1137
+ this.match += match[0];
1138
+ this.matches = match;
1139
+ this.yyleng = this.yytext.length;
1140
+ if (this.options.ranges) {
1141
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
1142
+ }
1143
+ this._more = false;
1144
+ this._backtrack = false;
1145
+ this._input = this._input.slice(match[0].length);
1146
+ this.matched += match[0];
1147
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1148
+ if (this.done && this._input) {
1149
+ this.done = false;
1150
+ }
1151
+ if (token) {
1152
+ return token;
1153
+ } else if (this._backtrack) {
1154
+ for (var k in backup) {
1155
+ this[k] = backup[k];
1156
+ }
1157
+ return false;
1158
+ }
1159
+ return false;
1160
+ }, "test_match"),
1161
+ // return next match in input
1162
+ next: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1163
+ if (this.done) {
1164
+ return this.EOF;
1165
+ }
1166
+ if (!this._input) {
1167
+ this.done = true;
1168
+ }
1169
+ var token, match, tempMatch, index;
1170
+ if (!this._more) {
1171
+ this.yytext = "";
1172
+ this.match = "";
1173
+ }
1174
+ var rules = this._currentRules();
1175
+ for (var i = 0; i < rules.length; i++) {
1176
+ tempMatch = this._input.match(this.rules[rules[i]]);
1177
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1178
+ match = tempMatch;
1179
+ index = i;
1180
+ if (this.options.backtrack_lexer) {
1181
+ token = this.test_match(tempMatch, rules[i]);
1182
+ if (token !== false) {
1183
+ return token;
1184
+ } else if (this._backtrack) {
1185
+ match = false;
1186
+ continue;
1187
+ } else {
1188
+ return false;
1189
+ }
1190
+ } else if (!this.options.flex) {
1191
+ break;
1192
+ }
1193
+ }
1194
+ }
1195
+ if (match) {
1196
+ token = this.test_match(match, rules[index]);
1197
+ if (token !== false) {
1198
+ return token;
1199
+ }
1200
+ return false;
1201
+ }
1202
+ if (this._input === "") {
1203
+ return this.EOF;
1204
+ } else {
1205
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1206
+ text: "",
1207
+ token: null,
1208
+ line: this.yylineno
1209
+ });
1210
+ }
1211
+ }, "next"),
1212
+ // return next match that has a token
1213
+ lex: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function lex() {
1214
+ var r = this.next();
1215
+ if (r) {
1216
+ return r;
1217
+ } else {
1218
+ return this.lex();
1219
+ }
1220
+ }, "lex"),
1221
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1222
+ begin: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function begin(condition) {
1223
+ this.conditionStack.push(condition);
1224
+ }, "begin"),
1225
+ // pop the previously active lexer condition state off the condition stack
1226
+ popState: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function popState() {
1227
+ var n = this.conditionStack.length - 1;
1228
+ if (n > 0) {
1229
+ return this.conditionStack.pop();
1230
+ } else {
1231
+ return this.conditionStack[0];
1232
+ }
1233
+ }, "popState"),
1234
+ // produce the lexer rule set which is active for the currently active lexer condition state
1235
+ _currentRules: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function _currentRules() {
1236
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1237
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1238
+ } else {
1239
+ return this.conditions["INITIAL"].rules;
1240
+ }
1241
+ }, "_currentRules"),
1242
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1243
+ topState: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function topState(n) {
1244
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1245
+ if (n >= 0) {
1246
+ return this.conditionStack[n];
1247
+ } else {
1248
+ return "INITIAL";
1249
+ }
1250
+ }, "topState"),
1251
+ // alias for begin(condition)
1252
+ pushState: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function pushState(condition) {
1253
+ this.begin(condition);
1254
+ }, "pushState"),
1255
+ // return the number of states currently on the stack
1256
+ stateStackSize: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function stateStackSize() {
1257
+ return this.conditionStack.length;
1258
+ }, "stateStackSize"),
1259
+ options: {},
1260
+ performAction: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1261
+ var YYSTATE = YY_START;
1262
+ switch ($avoiding_name_collisions) {
1263
+ case 0:
1264
+ return 10;
1265
+ break;
1266
+ case 1:
1267
+ yy.getLogger().debug("Found space-block");
1268
+ return 31;
1269
+ break;
1270
+ case 2:
1271
+ yy.getLogger().debug("Found nl-block");
1272
+ return 31;
1273
+ break;
1274
+ case 3:
1275
+ yy.getLogger().debug("Found space-block");
1276
+ return 29;
1277
+ break;
1278
+ case 4:
1279
+ yy.getLogger().debug(".", yy_.yytext);
1280
+ break;
1281
+ case 5:
1282
+ yy.getLogger().debug("_", yy_.yytext);
1283
+ break;
1284
+ case 6:
1285
+ return 5;
1286
+ break;
1287
+ case 7:
1288
+ yy_.yytext = -1;
1289
+ return 28;
1290
+ break;
1291
+ case 8:
1292
+ yy_.yytext = yy_.yytext.replace(/columns\s+/, "");
1293
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
1294
+ return 28;
1295
+ break;
1296
+ case 9:
1297
+ this.pushState("md_string");
1298
+ break;
1299
+ case 10:
1300
+ return "MD_STR";
1301
+ break;
1302
+ case 11:
1303
+ this.popState();
1304
+ break;
1305
+ case 12:
1306
+ this.pushState("string");
1307
+ break;
1308
+ case 13:
1309
+ yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext);
1310
+ this.popState();
1311
+ break;
1312
+ case 14:
1313
+ yy.getLogger().debug("LEX: STR end:", yy_.yytext);
1314
+ return "STR";
1315
+ break;
1316
+ case 15:
1317
+ yy_.yytext = yy_.yytext.replace(/space\:/, "");
1318
+ yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext);
1319
+ return 21;
1320
+ break;
1321
+ case 16:
1322
+ yy_.yytext = "1";
1323
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
1324
+ return 21;
1325
+ break;
1326
+ case 17:
1327
+ return 43;
1328
+ break;
1329
+ case 18:
1330
+ return "LINKSTYLE";
1331
+ break;
1332
+ case 19:
1333
+ return "INTERPOLATE";
1334
+ break;
1335
+ case 20:
1336
+ this.pushState("CLASSDEF");
1337
+ return 40;
1338
+ break;
1339
+ case 21:
1340
+ this.popState();
1341
+ this.pushState("CLASSDEFID");
1342
+ return "DEFAULT_CLASSDEF_ID";
1343
+ break;
1344
+ case 22:
1345
+ this.popState();
1346
+ this.pushState("CLASSDEFID");
1347
+ return 41;
1348
+ break;
1349
+ case 23:
1350
+ this.popState();
1351
+ return 42;
1352
+ break;
1353
+ case 24:
1354
+ this.pushState("CLASS");
1355
+ return 44;
1356
+ break;
1357
+ case 25:
1358
+ this.popState();
1359
+ this.pushState("CLASS_STYLE");
1360
+ return 45;
1361
+ break;
1362
+ case 26:
1363
+ this.popState();
1364
+ return 46;
1365
+ break;
1366
+ case 27:
1367
+ this.pushState("STYLE_STMNT");
1368
+ return 47;
1369
+ break;
1370
+ case 28:
1371
+ this.popState();
1372
+ this.pushState("STYLE_DEFINITION");
1373
+ return 48;
1374
+ break;
1375
+ case 29:
1376
+ this.popState();
1377
+ return 49;
1378
+ break;
1379
+ case 30:
1380
+ this.pushState("acc_title");
1381
+ return "acc_title";
1382
+ break;
1383
+ case 31:
1384
+ this.popState();
1385
+ return "acc_title_value";
1386
+ break;
1387
+ case 32:
1388
+ this.pushState("acc_descr");
1389
+ return "acc_descr";
1390
+ break;
1391
+ case 33:
1392
+ this.popState();
1393
+ return "acc_descr_value";
1394
+ break;
1395
+ case 34:
1396
+ this.pushState("acc_descr_multiline");
1397
+ break;
1398
+ case 35:
1399
+ this.popState();
1400
+ break;
1401
+ case 36:
1402
+ return "acc_descr_multiline_value";
1403
+ break;
1404
+ case 37:
1405
+ return 30;
1406
+ break;
1407
+ case 38:
1408
+ this.popState();
1409
+ yy.getLogger().debug("Lex: ((");
1410
+ return "NODE_DEND";
1411
+ break;
1412
+ case 39:
1413
+ this.popState();
1414
+ yy.getLogger().debug("Lex: ((");
1415
+ return "NODE_DEND";
1416
+ break;
1417
+ case 40:
1418
+ this.popState();
1419
+ yy.getLogger().debug("Lex: ))");
1420
+ return "NODE_DEND";
1421
+ break;
1422
+ case 41:
1423
+ this.popState();
1424
+ yy.getLogger().debug("Lex: ((");
1425
+ return "NODE_DEND";
1426
+ break;
1427
+ case 42:
1428
+ this.popState();
1429
+ yy.getLogger().debug("Lex: ((");
1430
+ return "NODE_DEND";
1431
+ break;
1432
+ case 43:
1433
+ this.popState();
1434
+ yy.getLogger().debug("Lex: (-");
1435
+ return "NODE_DEND";
1436
+ break;
1437
+ case 44:
1438
+ this.popState();
1439
+ yy.getLogger().debug("Lex: -)");
1440
+ return "NODE_DEND";
1441
+ break;
1442
+ case 45:
1443
+ this.popState();
1444
+ yy.getLogger().debug("Lex: ((");
1445
+ return "NODE_DEND";
1446
+ break;
1447
+ case 46:
1448
+ this.popState();
1449
+ yy.getLogger().debug("Lex: ]]");
1450
+ return "NODE_DEND";
1451
+ break;
1452
+ case 47:
1453
+ this.popState();
1454
+ yy.getLogger().debug("Lex: (");
1455
+ return "NODE_DEND";
1456
+ break;
1457
+ case 48:
1458
+ this.popState();
1459
+ yy.getLogger().debug("Lex: ])");
1460
+ return "NODE_DEND";
1461
+ break;
1462
+ case 49:
1463
+ this.popState();
1464
+ yy.getLogger().debug("Lex: /]");
1465
+ return "NODE_DEND";
1466
+ break;
1467
+ case 50:
1468
+ this.popState();
1469
+ yy.getLogger().debug("Lex: /]");
1470
+ return "NODE_DEND";
1471
+ break;
1472
+ case 51:
1473
+ this.popState();
1474
+ yy.getLogger().debug("Lex: )]");
1475
+ return "NODE_DEND";
1476
+ break;
1477
+ case 52:
1478
+ this.popState();
1479
+ yy.getLogger().debug("Lex: )");
1480
+ return "NODE_DEND";
1481
+ break;
1482
+ case 53:
1483
+ this.popState();
1484
+ yy.getLogger().debug("Lex: ]>");
1485
+ return "NODE_DEND";
1486
+ break;
1487
+ case 54:
1488
+ this.popState();
1489
+ yy.getLogger().debug("Lex: ]");
1490
+ return "NODE_DEND";
1491
+ break;
1492
+ case 55:
1493
+ yy.getLogger().debug("Lexa: -)");
1494
+ this.pushState("NODE");
1495
+ return 36;
1496
+ break;
1497
+ case 56:
1498
+ yy.getLogger().debug("Lexa: (-");
1499
+ this.pushState("NODE");
1500
+ return 36;
1501
+ break;
1502
+ case 57:
1503
+ yy.getLogger().debug("Lexa: ))");
1504
+ this.pushState("NODE");
1505
+ return 36;
1506
+ break;
1507
+ case 58:
1508
+ yy.getLogger().debug("Lexa: )");
1509
+ this.pushState("NODE");
1510
+ return 36;
1511
+ break;
1512
+ case 59:
1513
+ yy.getLogger().debug("Lex: (((");
1514
+ this.pushState("NODE");
1515
+ return 36;
1516
+ break;
1517
+ case 60:
1518
+ yy.getLogger().debug("Lexa: )");
1519
+ this.pushState("NODE");
1520
+ return 36;
1521
+ break;
1522
+ case 61:
1523
+ yy.getLogger().debug("Lexa: )");
1524
+ this.pushState("NODE");
1525
+ return 36;
1526
+ break;
1527
+ case 62:
1528
+ yy.getLogger().debug("Lexa: )");
1529
+ this.pushState("NODE");
1530
+ return 36;
1531
+ break;
1532
+ case 63:
1533
+ yy.getLogger().debug("Lexc: >");
1534
+ this.pushState("NODE");
1535
+ return 36;
1536
+ break;
1537
+ case 64:
1538
+ yy.getLogger().debug("Lexa: ([");
1539
+ this.pushState("NODE");
1540
+ return 36;
1541
+ break;
1542
+ case 65:
1543
+ yy.getLogger().debug("Lexa: )");
1544
+ this.pushState("NODE");
1545
+ return 36;
1546
+ break;
1547
+ case 66:
1548
+ this.pushState("NODE");
1549
+ return 36;
1550
+ break;
1551
+ case 67:
1552
+ this.pushState("NODE");
1553
+ return 36;
1554
+ break;
1555
+ case 68:
1556
+ this.pushState("NODE");
1557
+ return 36;
1558
+ break;
1559
+ case 69:
1560
+ this.pushState("NODE");
1561
+ return 36;
1562
+ break;
1563
+ case 70:
1564
+ this.pushState("NODE");
1565
+ return 36;
1566
+ break;
1567
+ case 71:
1568
+ this.pushState("NODE");
1569
+ return 36;
1570
+ break;
1571
+ case 72:
1572
+ this.pushState("NODE");
1573
+ return 36;
1574
+ break;
1575
+ case 73:
1576
+ yy.getLogger().debug("Lexa: [");
1577
+ this.pushState("NODE");
1578
+ return 36;
1579
+ break;
1580
+ case 74:
1581
+ this.pushState("BLOCK_ARROW");
1582
+ yy.getLogger().debug("LEX ARR START");
1583
+ return 38;
1584
+ break;
1585
+ case 75:
1586
+ yy.getLogger().debug("Lex: NODE_ID", yy_.yytext);
1587
+ return 32;
1588
+ break;
1589
+ case 76:
1590
+ yy.getLogger().debug("Lex: EOF", yy_.yytext);
1591
+ return 8;
1592
+ break;
1593
+ case 77:
1594
+ this.pushState("md_string");
1595
+ break;
1596
+ case 78:
1597
+ this.pushState("md_string");
1598
+ break;
1599
+ case 79:
1600
+ return "NODE_DESCR";
1601
+ break;
1602
+ case 80:
1603
+ this.popState();
1604
+ break;
1605
+ case 81:
1606
+ yy.getLogger().debug("Lex: Starting string");
1607
+ this.pushState("string");
1608
+ break;
1609
+ case 82:
1610
+ yy.getLogger().debug("LEX ARR: Starting string");
1611
+ this.pushState("string");
1612
+ break;
1613
+ case 83:
1614
+ yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext);
1615
+ return "NODE_DESCR";
1616
+ break;
1617
+ case 84:
1618
+ yy.getLogger().debug("LEX POPPING");
1619
+ this.popState();
1620
+ break;
1621
+ case 85:
1622
+ yy.getLogger().debug("Lex: =>BAE");
1623
+ this.pushState("ARROW_DIR");
1624
+ break;
1625
+ case 86:
1626
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1627
+ yy.getLogger().debug("Lex (right): dir:", yy_.yytext);
1628
+ return "DIR";
1629
+ break;
1630
+ case 87:
1631
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1632
+ yy.getLogger().debug("Lex (left):", yy_.yytext);
1633
+ return "DIR";
1634
+ break;
1635
+ case 88:
1636
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1637
+ yy.getLogger().debug("Lex (x):", yy_.yytext);
1638
+ return "DIR";
1639
+ break;
1640
+ case 89:
1641
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1642
+ yy.getLogger().debug("Lex (y):", yy_.yytext);
1643
+ return "DIR";
1644
+ break;
1645
+ case 90:
1646
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1647
+ yy.getLogger().debug("Lex (up):", yy_.yytext);
1648
+ return "DIR";
1649
+ break;
1650
+ case 91:
1651
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1652
+ yy.getLogger().debug("Lex (down):", yy_.yytext);
1653
+ return "DIR";
1654
+ break;
1655
+ case 92:
1656
+ yy_.yytext = "]>";
1657
+ yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext);
1658
+ this.popState();
1659
+ this.popState();
1660
+ return "BLOCK_ARROW_END";
1661
+ break;
1662
+ case 93:
1663
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
1664
+ return 15;
1665
+ break;
1666
+ case 94:
1667
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1668
+ return 15;
1669
+ break;
1670
+ case 95:
1671
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1672
+ return 15;
1673
+ break;
1674
+ case 96:
1675
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1676
+ return 15;
1677
+ break;
1678
+ case 97:
1679
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
1680
+ this.pushState("LLABEL");
1681
+ return 16;
1682
+ break;
1683
+ case 98:
1684
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
1685
+ this.pushState("LLABEL");
1686
+ return 16;
1687
+ break;
1688
+ case 99:
1689
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
1690
+ this.pushState("LLABEL");
1691
+ return 16;
1692
+ break;
1693
+ case 100:
1694
+ this.pushState("md_string");
1695
+ break;
1696
+ case 101:
1697
+ yy.getLogger().debug("Lex: Starting string");
1698
+ this.pushState("string");
1699
+ return "LINK_LABEL";
1700
+ break;
1701
+ case 102:
1702
+ this.popState();
1703
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
1704
+ return 15;
1705
+ break;
1706
+ case 103:
1707
+ this.popState();
1708
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1709
+ return 15;
1710
+ break;
1711
+ case 104:
1712
+ this.popState();
1713
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1714
+ return 15;
1715
+ break;
1716
+ case 105:
1717
+ yy.getLogger().debug("Lex: COLON", yy_.yytext);
1718
+ yy_.yytext = yy_.yytext.slice(1);
1719
+ return 27;
1720
+ break;
1721
+ }
1722
+ }, "anonymous"),
1723
+ rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
1724
+ conditions: { "STYLE_DEFINITION": { "rules": [29], "inclusive": false }, "STYLE_STMNT": { "rules": [28], "inclusive": false }, "CLASSDEFID": { "rules": [23], "inclusive": false }, "CLASSDEF": { "rules": [21, 22], "inclusive": false }, "CLASS_STYLE": { "rules": [26], "inclusive": false }, "CLASS": { "rules": [25], "inclusive": false }, "LLABEL": { "rules": [100, 101, 102, 103, 104], "inclusive": false }, "ARROW_DIR": { "rules": [86, 87, 88, 89, 90, 91, 92], "inclusive": false }, "BLOCK_ARROW": { "rules": [77, 82, 85], "inclusive": false }, "NODE": { "rules": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], "inclusive": false }, "md_string": { "rules": [10, 11, 79, 80], "inclusive": false }, "space": { "rules": [], "inclusive": false }, "string": { "rules": [13, 14, 83, 84], "inclusive": false }, "acc_descr_multiline": { "rules": [35, 36], "inclusive": false }, "acc_descr": { "rules": [33], "inclusive": false }, "acc_title": { "rules": [31], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], "inclusive": true } }
1725
+ };
1726
+ return lexer2;
1727
+ }();
1728
+ parser2.lexer = lexer;
1729
+ function Parser() {
1730
+ this.yy = {};
1731
+ }
1732
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(Parser, "Parser");
1733
+ Parser.prototype = parser2;
1734
+ parser2.Parser = Parser;
1735
+ return new Parser();
1736
+ }();
1737
+ parser.parser = parser;
1738
+ var block_default = parser;
1739
+
1740
+ // src/diagrams/block/blockDB.ts
1741
+
1742
+ var blockDatabase = /* @__PURE__ */ new Map();
1743
+ var edgeList = [];
1744
+ var edgeCount = /* @__PURE__ */ new Map();
1745
+ var COLOR_KEYWORD = "color";
1746
+ var FILL_KEYWORD = "fill";
1747
+ var BG_FILL = "bgFill";
1748
+ var STYLECLASS_SEP = ",";
1749
+ var config = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)();
1750
+ var classes = /* @__PURE__ */ new Map();
1751
+ var sanitizeText2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((txt) => _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .common_default */ .Y2.sanitizeText(txt, config), "sanitizeText");
1752
+ var addStyleClass = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(id, styleAttributes = "") {
1753
+ let foundClass = classes.get(id);
1754
+ if (!foundClass) {
1755
+ foundClass = { id, styles: [], textStyles: [] };
1756
+ classes.set(id, foundClass);
1757
+ }
1758
+ if (styleAttributes !== void 0 && styleAttributes !== null) {
1759
+ styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
1760
+ const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
1761
+ if (RegExp(COLOR_KEYWORD).exec(attrib)) {
1762
+ const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
1763
+ const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
1764
+ foundClass.textStyles.push(newStyle2);
1765
+ }
1766
+ foundClass.styles.push(fixedAttrib);
1767
+ });
1768
+ }
1769
+ }, "addStyleClass");
1770
+ var addStyle2Node = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(id, styles = "") {
1771
+ const foundBlock = blockDatabase.get(id);
1772
+ if (styles !== void 0 && styles !== null) {
1773
+ foundBlock.styles = styles.split(STYLECLASS_SEP);
1774
+ }
1775
+ }, "addStyle2Node");
1776
+ var setCssClass = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(itemIds, cssClassName) {
1777
+ itemIds.split(",").forEach(function(id) {
1778
+ let foundBlock = blockDatabase.get(id);
1779
+ if (foundBlock === void 0) {
1780
+ const trimmedId = id.trim();
1781
+ foundBlock = { id: trimmedId, type: "na", children: [] };
1782
+ blockDatabase.set(trimmedId, foundBlock);
1783
+ }
1784
+ if (!foundBlock.classes) {
1785
+ foundBlock.classes = [];
1786
+ }
1787
+ foundBlock.classes.push(cssClassName);
1788
+ });
1789
+ }, "setCssClass");
1790
+ var populateBlockDatabase = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((_blockList, parent) => {
1791
+ const blockList = _blockList.flat();
1792
+ const children = [];
1793
+ for (const block of blockList) {
1794
+ if (block.label) {
1795
+ block.label = sanitizeText2(block.label);
1796
+ }
1797
+ if (block.type === "classDef") {
1798
+ addStyleClass(block.id, block.css);
1799
+ continue;
1800
+ }
1801
+ if (block.type === "applyClass") {
1802
+ setCssClass(block.id, block?.styleClass ?? "");
1803
+ continue;
1804
+ }
1805
+ if (block.type === "applyStyles") {
1806
+ if (block?.stylesStr) {
1807
+ addStyle2Node(block.id, block?.stylesStr);
1808
+ }
1809
+ continue;
1810
+ }
1811
+ if (block.type === "column-setting") {
1812
+ parent.columns = block.columns ?? -1;
1813
+ } else if (block.type === "edge") {
1814
+ const count = (edgeCount.get(block.id) ?? 0) + 1;
1815
+ edgeCount.set(block.id, count);
1816
+ block.id = count + "-" + block.id;
1817
+ edgeList.push(block);
1818
+ } else {
1819
+ if (!block.label) {
1820
+ if (block.type === "composite") {
1821
+ block.label = "";
1822
+ } else {
1823
+ block.label = block.id;
1824
+ }
1825
+ }
1826
+ const existingBlock = blockDatabase.get(block.id);
1827
+ if (existingBlock === void 0) {
1828
+ blockDatabase.set(block.id, block);
1829
+ } else {
1830
+ if (block.type !== "na") {
1831
+ existingBlock.type = block.type;
1832
+ }
1833
+ if (block.label !== block.id) {
1834
+ existingBlock.label = block.label;
1835
+ }
1836
+ }
1837
+ if (block.children) {
1838
+ populateBlockDatabase(block.children, block);
1839
+ }
1840
+ if (block.type === "space") {
1841
+ const w = block.width ?? 1;
1842
+ for (let j = 0; j < w; j++) {
1843
+ const newBlock = (0,lodash_es_clone_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(block);
1844
+ newBlock.id = newBlock.id + "-" + j;
1845
+ blockDatabase.set(newBlock.id, newBlock);
1846
+ children.push(newBlock);
1847
+ }
1848
+ } else if (existingBlock === void 0) {
1849
+ children.push(block);
1850
+ }
1851
+ }
1852
+ }
1853
+ parent.children = children;
1854
+ }, "populateBlockDatabase");
1855
+ var blocks = [];
1856
+ var rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
1857
+ var clear2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(() => {
1858
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("Clear called");
1859
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .clear */ .IU)();
1860
+ rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
1861
+ blockDatabase = /* @__PURE__ */ new Map([["root", rootBlock]]);
1862
+ blocks = [];
1863
+ classes = /* @__PURE__ */ new Map();
1864
+ edgeList = [];
1865
+ edgeCount = /* @__PURE__ */ new Map();
1866
+ }, "clear");
1867
+ function typeStr2Type(typeStr) {
1868
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("typeStr2Type", typeStr);
1869
+ switch (typeStr) {
1870
+ case "[]":
1871
+ return "square";
1872
+ case "()":
1873
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("we have a round");
1874
+ return "round";
1875
+ case "(())":
1876
+ return "circle";
1877
+ case ">]":
1878
+ return "rect_left_inv_arrow";
1879
+ case "{}":
1880
+ return "diamond";
1881
+ case "{{}}":
1882
+ return "hexagon";
1883
+ case "([])":
1884
+ return "stadium";
1885
+ case "[[]]":
1886
+ return "subroutine";
1887
+ case "[()]":
1888
+ return "cylinder";
1889
+ case "((()))":
1890
+ return "doublecircle";
1891
+ case "[//]":
1892
+ return "lean_right";
1893
+ case "[\\\\]":
1894
+ return "lean_left";
1895
+ case "[/\\]":
1896
+ return "trapezoid";
1897
+ case "[\\/]":
1898
+ return "inv_trapezoid";
1899
+ case "<[]>":
1900
+ return "block_arrow";
1901
+ default:
1902
+ return "na";
1903
+ }
1904
+ }
1905
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(typeStr2Type, "typeStr2Type");
1906
+ function edgeTypeStr2Type(typeStr) {
1907
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("typeStr2Type", typeStr);
1908
+ switch (typeStr) {
1909
+ case "==":
1910
+ return "thick";
1911
+ default:
1912
+ return "normal";
1913
+ }
1914
+ }
1915
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(edgeTypeStr2Type, "edgeTypeStr2Type");
1916
+ function edgeStrToEdgeData(typeStr) {
1917
+ switch (typeStr.trim()) {
1918
+ case "--x":
1919
+ return "arrow_cross";
1920
+ case "--o":
1921
+ return "arrow_circle";
1922
+ default:
1923
+ return "arrow_point";
1924
+ }
1925
+ }
1926
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(edgeStrToEdgeData, "edgeStrToEdgeData");
1927
+ var cnt = 0;
1928
+ var generateId = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(() => {
1929
+ cnt++;
1930
+ return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
1931
+ }, "generateId");
1932
+ var setHierarchy = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((block) => {
1933
+ rootBlock.children = block;
1934
+ populateBlockDatabase(block, rootBlock);
1935
+ blocks = rootBlock.children;
1936
+ }, "setHierarchy");
1937
+ var getColumns = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((blockId) => {
1938
+ const block = blockDatabase.get(blockId);
1939
+ if (!block) {
1940
+ return -1;
1941
+ }
1942
+ if (block.columns) {
1943
+ return block.columns;
1944
+ }
1945
+ if (!block.children) {
1946
+ return -1;
1947
+ }
1948
+ return block.children.length;
1949
+ }, "getColumns");
1950
+ var getBlocksFlat = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(() => {
1951
+ return [...blockDatabase.values()];
1952
+ }, "getBlocksFlat");
1953
+ var getBlocks = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(() => {
1954
+ return blocks || [];
1955
+ }, "getBlocks");
1956
+ var getEdges = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(() => {
1957
+ return edgeList;
1958
+ }, "getEdges");
1959
+ var getBlock = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((id) => {
1960
+ return blockDatabase.get(id);
1961
+ }, "getBlock");
1962
+ var setBlock = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((block) => {
1963
+ blockDatabase.set(block.id, block);
1964
+ }, "setBlock");
1965
+ var getLogger = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(() => console, "getLogger");
1966
+ var getClasses = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function() {
1967
+ return classes;
1968
+ }, "getClasses");
1969
+ var db = {
1970
+ getConfig: /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(() => (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .zj)().block, "getConfig"),
1971
+ typeStr2Type,
1972
+ edgeTypeStr2Type,
1973
+ edgeStrToEdgeData,
1974
+ getLogger,
1975
+ getBlocksFlat,
1976
+ getBlocks,
1977
+ getEdges,
1978
+ setHierarchy,
1979
+ getBlock,
1980
+ setBlock,
1981
+ getColumns,
1982
+ getClasses,
1983
+ clear: clear2,
1984
+ generateId
1985
+ };
1986
+ var blockDB_default = db;
1987
+
1988
+ // src/diagrams/block/styles.ts
1989
+
1990
+ var fade = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((color, opacity) => {
1991
+ const channel2 = khroma__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A;
1992
+ const r = channel2(color, "r");
1993
+ const g = channel2(color, "g");
1994
+ const b = channel2(color, "b");
1995
+ return khroma__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A(r, g, b, opacity);
1996
+ }, "fade");
1997
+ var getStyles = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((options) => `.label {
1998
+ font-family: ${options.fontFamily};
1999
+ color: ${options.nodeTextColor || options.textColor};
2000
+ }
2001
+ .cluster-label text {
2002
+ fill: ${options.titleColor};
2003
+ }
2004
+ .cluster-label span,p {
2005
+ color: ${options.titleColor};
2006
+ }
2007
+
2008
+
2009
+
2010
+ .label text,span,p {
2011
+ fill: ${options.nodeTextColor || options.textColor};
2012
+ color: ${options.nodeTextColor || options.textColor};
2013
+ }
2014
+
2015
+ .node rect,
2016
+ .node circle,
2017
+ .node ellipse,
2018
+ .node polygon,
2019
+ .node path {
2020
+ fill: ${options.mainBkg};
2021
+ stroke: ${options.nodeBorder};
2022
+ stroke-width: 1px;
2023
+ }
2024
+ .flowchart-label text {
2025
+ text-anchor: middle;
2026
+ }
2027
+ // .flowchart-label .text-outer-tspan {
2028
+ // text-anchor: middle;
2029
+ // }
2030
+ // .flowchart-label .text-inner-tspan {
2031
+ // text-anchor: start;
2032
+ // }
2033
+
2034
+ .node .label {
2035
+ text-align: center;
2036
+ }
2037
+ .node.clickable {
2038
+ cursor: pointer;
2039
+ }
2040
+
2041
+ .arrowheadPath {
2042
+ fill: ${options.arrowheadColor};
2043
+ }
2044
+
2045
+ .edgePath .path {
2046
+ stroke: ${options.lineColor};
2047
+ stroke-width: 2.0px;
2048
+ }
2049
+
2050
+ .flowchart-link {
2051
+ stroke: ${options.lineColor};
2052
+ fill: none;
2053
+ }
2054
+
2055
+ .edgeLabel {
2056
+ background-color: ${options.edgeLabelBackground};
2057
+ rect {
2058
+ opacity: 0.5;
2059
+ background-color: ${options.edgeLabelBackground};
2060
+ fill: ${options.edgeLabelBackground};
2061
+ }
2062
+ text-align: center;
2063
+ }
2064
+
2065
+ /* For html labels only */
2066
+ .labelBkg {
2067
+ background-color: ${fade(options.edgeLabelBackground, 0.5)};
2068
+ // background-color:
2069
+ }
2070
+
2071
+ .node .cluster {
2072
+ // fill: ${fade(options.mainBkg, 0.5)};
2073
+ fill: ${fade(options.clusterBkg, 0.5)};
2074
+ stroke: ${fade(options.clusterBorder, 0.2)};
2075
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
2076
+ stroke-width: 1px;
2077
+ }
2078
+
2079
+ .cluster text {
2080
+ fill: ${options.titleColor};
2081
+ }
2082
+
2083
+ .cluster span,p {
2084
+ color: ${options.titleColor};
2085
+ }
2086
+ /* .cluster div {
2087
+ color: ${options.titleColor};
2088
+ } */
2089
+
2090
+ div.mermaidTooltip {
2091
+ position: absolute;
2092
+ text-align: center;
2093
+ max-width: 200px;
2094
+ padding: 2px;
2095
+ font-family: ${options.fontFamily};
2096
+ font-size: 12px;
2097
+ background: ${options.tertiaryColor};
2098
+ border: 1px solid ${options.border2};
2099
+ border-radius: 2px;
2100
+ pointer-events: none;
2101
+ z-index: 100;
2102
+ }
2103
+
2104
+ .flowchartTitleText {
2105
+ text-anchor: middle;
2106
+ font-size: 18px;
2107
+ fill: ${options.textColor};
2108
+ }
2109
+ `, "getStyles");
2110
+ var styles_default = getStyles;
2111
+
2112
+ // src/diagrams/block/blockRenderer.ts
2113
+
2114
+
2115
+ // src/dagre-wrapper/markers.js
2116
+ var insertMarkers = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, markerArray, type, id) => {
2117
+ markerArray.forEach((markerName) => {
2118
+ markers[markerName](elem, type, id);
2119
+ });
2120
+ }, "insertMarkers");
2121
+ var extension = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2122
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.trace("Making markers for ", id);
2123
+ 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");
2124
+ 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");
2125
+ }, "extension");
2126
+ var composition = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2127
+ 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");
2128
+ 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");
2129
+ }, "composition");
2130
+ var aggregation = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2131
+ 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");
2132
+ 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");
2133
+ }, "aggregation");
2134
+ var dependency = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2135
+ 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");
2136
+ 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");
2137
+ }, "dependency");
2138
+ var lollipop = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2139
+ 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);
2140
+ 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);
2141
+ }, "lollipop");
2142
+ var point = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2143
+ 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");
2144
+ 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");
2145
+ }, "point");
2146
+ var circle = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2147
+ 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");
2148
+ 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");
2149
+ }, "circle");
2150
+ var cross = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2151
+ 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");
2152
+ 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");
2153
+ }, "cross");
2154
+ var barb = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, type, id) => {
2155
+ 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");
2156
+ }, "barb");
2157
+ var markers = {
2158
+ extension,
2159
+ composition,
2160
+ aggregation,
2161
+ dependency,
2162
+ lollipop,
2163
+ point,
2164
+ circle,
2165
+ cross,
2166
+ barb
2167
+ };
2168
+ var markers_default = insertMarkers;
2169
+
2170
+ // src/diagrams/block/layout.ts
2171
+ var padding = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)()?.block?.padding ?? 8;
2172
+ function calculateBlockPosition(columns, position) {
2173
+ if (columns === 0 || !Number.isInteger(columns)) {
2174
+ throw new Error("Columns must be an integer !== 0.");
2175
+ }
2176
+ if (position < 0 || !Number.isInteger(position)) {
2177
+ throw new Error("Position must be a non-negative integer." + position);
2178
+ }
2179
+ if (columns < 0) {
2180
+ return { px: position, py: 0 };
2181
+ }
2182
+ if (columns === 1) {
2183
+ return { px: 0, py: position };
2184
+ }
2185
+ const px = position % columns;
2186
+ const py = Math.floor(position / columns);
2187
+ return { px, py };
2188
+ }
2189
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(calculateBlockPosition, "calculateBlockPosition");
2190
+ var getMaxChildSize = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((block) => {
2191
+ let maxWidth = 0;
2192
+ let maxHeight = 0;
2193
+ for (const child of block.children) {
2194
+ const { width, height, x, y } = child.size ?? { width: 0, height: 0, x: 0, y: 0 };
2195
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2196
+ "getMaxChildSize abc95 child:",
2197
+ child.id,
2198
+ "width:",
2199
+ width,
2200
+ "height:",
2201
+ height,
2202
+ "x:",
2203
+ x,
2204
+ "y:",
2205
+ y,
2206
+ child.type
2207
+ );
2208
+ if (child.type === "space") {
2209
+ continue;
2210
+ }
2211
+ if (width > maxWidth) {
2212
+ maxWidth = width / (block.widthInColumns ?? 1);
2213
+ }
2214
+ if (height > maxHeight) {
2215
+ maxHeight = height;
2216
+ }
2217
+ }
2218
+ return { width: maxWidth, height: maxHeight };
2219
+ }, "getMaxChildSize");
2220
+ function setBlockSizes(block, db2, siblingWidth = 0, siblingHeight = 0) {
2221
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2222
+ "setBlockSizes abc95 (start)",
2223
+ block.id,
2224
+ block?.size?.x,
2225
+ "block width =",
2226
+ block?.size,
2227
+ "sieblingWidth",
2228
+ siblingWidth
2229
+ );
2230
+ if (!block?.size?.width) {
2231
+ block.size = {
2232
+ width: siblingWidth,
2233
+ height: siblingHeight,
2234
+ x: 0,
2235
+ y: 0
2236
+ };
2237
+ }
2238
+ let maxWidth = 0;
2239
+ let maxHeight = 0;
2240
+ if (block.children?.length > 0) {
2241
+ for (const child of block.children) {
2242
+ setBlockSizes(child, db2);
2243
+ }
2244
+ const childSize = getMaxChildSize(block);
2245
+ maxWidth = childSize.width;
2246
+ maxHeight = childSize.height;
2247
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("setBlockSizes abc95 maxWidth of", block.id, ":s children is ", maxWidth, maxHeight);
2248
+ for (const child of block.children) {
2249
+ if (child.size) {
2250
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2251
+ `abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}`
2252
+ );
2253
+ child.size.width = maxWidth * (child.widthInColumns ?? 1) + padding * ((child.widthInColumns ?? 1) - 1);
2254
+ child.size.height = maxHeight;
2255
+ child.size.x = 0;
2256
+ child.size.y = 0;
2257
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2258
+ `abc95 updating size of ${block.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}`
2259
+ );
2260
+ }
2261
+ }
2262
+ for (const child of block.children) {
2263
+ setBlockSizes(child, db2, maxWidth, maxHeight);
2264
+ }
2265
+ const columns = block.columns ?? -1;
2266
+ let numItems = 0;
2267
+ for (const child of block.children) {
2268
+ numItems += child.widthInColumns ?? 1;
2269
+ }
2270
+ let xSize = block.children.length;
2271
+ if (columns > 0 && columns < numItems) {
2272
+ xSize = columns;
2273
+ }
2274
+ const ySize = Math.ceil(numItems / xSize);
2275
+ let width = xSize * (maxWidth + padding) + padding;
2276
+ let height = ySize * (maxHeight + padding) + padding;
2277
+ if (width < siblingWidth) {
2278
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2279
+ `Detected to small siebling: abc95 ${block.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width}`
2280
+ );
2281
+ width = siblingWidth;
2282
+ height = siblingHeight;
2283
+ const childWidth = (siblingWidth - xSize * padding - padding) / xSize;
2284
+ const childHeight = (siblingHeight - ySize * padding - padding) / ySize;
2285
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("Size indata abc88", block.id, "childWidth", childWidth, "maxWidth", maxWidth);
2286
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("Size indata abc88", block.id, "childHeight", childHeight, "maxHeight", maxHeight);
2287
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("Size indata abc88 xSize", xSize, "padding", padding);
2288
+ for (const child of block.children) {
2289
+ if (child.size) {
2290
+ child.size.width = childWidth;
2291
+ child.size.height = childHeight;
2292
+ child.size.x = 0;
2293
+ child.size.y = 0;
2294
+ }
2295
+ }
2296
+ }
2297
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2298
+ `abc95 (finale calc) ${block.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block.children.length} width=${Math.max(width, block.size?.width || 0)}`
2299
+ );
2300
+ if (width < (block?.size?.width || 0)) {
2301
+ width = block?.size?.width || 0;
2302
+ const num = columns > 0 ? Math.min(block.children.length, columns) : block.children.length;
2303
+ if (num > 0) {
2304
+ const childWidth = (width - num * padding - padding) / num;
2305
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("abc95 (growing to fit) width", block.id, width, block.size?.width, childWidth);
2306
+ for (const child of block.children) {
2307
+ if (child.size) {
2308
+ child.size.width = childWidth;
2309
+ }
2310
+ }
2311
+ }
2312
+ }
2313
+ block.size = {
2314
+ width,
2315
+ height,
2316
+ x: 0,
2317
+ y: 0
2318
+ };
2319
+ }
2320
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2321
+ "setBlockSizes abc94 (done)",
2322
+ block.id,
2323
+ block?.size?.x,
2324
+ block?.size?.width,
2325
+ block?.size?.y,
2326
+ block?.size?.height
2327
+ );
2328
+ }
2329
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(setBlockSizes, "setBlockSizes");
2330
+ function layoutBlocks(block, db2) {
2331
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2332
+ `abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${block?.size?.x} y: ${block?.size?.y} width: ${block?.size?.width}`
2333
+ );
2334
+ const columns = block.columns ?? -1;
2335
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("layoutBlocks columns abc95", block.id, "=>", columns, block);
2336
+ if (block.children && // find max width of children
2337
+ block.children.length > 0) {
2338
+ const width = block?.children[0]?.size?.width ?? 0;
2339
+ const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
2340
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("widthOfChildren 88", widthOfChildren, "posX");
2341
+ let columnPos = 0;
2342
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("abc91 block?.size?.x", block.id, block?.size?.x);
2343
+ let startingPosX = block?.size?.x ? block?.size?.x + (-block?.size?.width / 2 || 0) : -padding;
2344
+ let rowPos = 0;
2345
+ for (const child of block.children) {
2346
+ const parent = block;
2347
+ if (!child.size) {
2348
+ continue;
2349
+ }
2350
+ const { width: width2, height } = child.size;
2351
+ const { px, py } = calculateBlockPosition(columns, columnPos);
2352
+ if (py != rowPos) {
2353
+ rowPos = py;
2354
+ startingPosX = block?.size?.x ? block?.size?.x + (-block?.size?.width / 2 || 0) : -padding;
2355
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("New row in layout for block", block.id, " and child ", child.id, rowPos);
2356
+ }
2357
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2358
+ `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${parent?.size?.x},${parent?.size?.y}) parent: ${parent.id} width: ${width2}${padding}`
2359
+ );
2360
+ if (parent.size) {
2361
+ const halfWidth = width2 / 2;
2362
+ child.size.x = startingPosX + padding + halfWidth;
2363
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2364
+ `abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width2} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width2 * (child?.widthInColumns ?? 1) / 2}`
2365
+ );
2366
+ startingPosX = child.size.x + halfWidth;
2367
+ child.size.y = parent.size.y - parent.size.height / 2 + py * (height + padding) + height / 2 + padding;
2368
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2369
+ `abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width2 * (child?.widthInColumns ?? 1) / 2}`
2370
+ );
2371
+ }
2372
+ if (child.children) {
2373
+ layoutBlocks(child, db2);
2374
+ }
2375
+ columnPos += child?.widthInColumns ?? 1;
2376
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("abc88 columnsPos", child, columnPos);
2377
+ }
2378
+ }
2379
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2380
+ `layout blocks (<==layoutBlocks) ${block.id} x: ${block?.size?.x} y: ${block?.size?.y} width: ${block?.size?.width}`
2381
+ );
2382
+ }
2383
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(layoutBlocks, "layoutBlocks");
2384
+ function findBounds(block, { minX, minY, maxX, maxY } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
2385
+ if (block.size && block.id !== "root") {
2386
+ const { x, y, width, height } = block.size;
2387
+ if (x - width / 2 < minX) {
2388
+ minX = x - width / 2;
2389
+ }
2390
+ if (y - height / 2 < minY) {
2391
+ minY = y - height / 2;
2392
+ }
2393
+ if (x + width / 2 > maxX) {
2394
+ maxX = x + width / 2;
2395
+ }
2396
+ if (y + height / 2 > maxY) {
2397
+ maxY = y + height / 2;
2398
+ }
2399
+ }
2400
+ if (block.children) {
2401
+ for (const child of block.children) {
2402
+ ({ minX, minY, maxX, maxY } = findBounds(child, { minX, minY, maxX, maxY }));
2403
+ }
2404
+ }
2405
+ return { minX, minY, maxX, maxY };
2406
+ }
2407
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(findBounds, "findBounds");
2408
+ function layout(db2) {
2409
+ const root = db2.getBlock("root");
2410
+ if (!root) {
2411
+ return;
2412
+ }
2413
+ setBlockSizes(root, db2, 0, 0);
2414
+ layoutBlocks(root, db2);
2415
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("getBlocks", JSON.stringify(root, null, 2));
2416
+ const { minX, minY, maxX, maxY } = findBounds(root);
2417
+ const height = maxY - minY;
2418
+ const width = maxX - minX;
2419
+ return { x: minX, y: minY, width, height };
2420
+ }
2421
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(layout, "layout");
2422
+
2423
+ // src/diagrams/block/renderHelpers.ts
2424
+
2425
+
2426
+ // src/dagre-wrapper/createLabel.js
2427
+
2428
+ function applyStyle(dom, styleFn) {
2429
+ if (styleFn) {
2430
+ dom.attr("style", styleFn);
2431
+ }
2432
+ }
2433
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(applyStyle, "applyStyle");
2434
+ function addHtmlLabel(node) {
2435
+ const fo = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
2436
+ const div = fo.append("xhtml:div");
2437
+ const label = node.label;
2438
+ const labelClass = node.isNode ? "nodeLabel" : "edgeLabel";
2439
+ const span = div.append("span");
2440
+ span.html(label);
2441
+ applyStyle(span, node.labelStyle);
2442
+ span.attr("class", labelClass);
2443
+ applyStyle(div, node.labelStyle);
2444
+ div.style("display", "inline-block");
2445
+ div.style("white-space", "nowrap");
2446
+ div.attr("xmlns", "http://www.w3.org/1999/xhtml");
2447
+ return fo.node();
2448
+ }
2449
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(addHtmlLabel, "addHtmlLabel");
2450
+ var createLabel = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((_vertexText, style, isTitle, isNode) => {
2451
+ let vertexText = _vertexText || "";
2452
+ if (typeof vertexText === "object") {
2453
+ vertexText = vertexText[0];
2454
+ }
2455
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
2456
+ vertexText = vertexText.replace(/\\n|\n/g, "<br />");
2457
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("vertexText" + vertexText);
2458
+ const node = {
2459
+ isNode,
2460
+ label: (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .replaceIconSubstring */ .hE)((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .Sm)(vertexText)),
2461
+ labelStyle: style.replace("fill:", "color:")
2462
+ };
2463
+ let vertexNode = addHtmlLabel(node);
2464
+ return vertexNode;
2465
+ } else {
2466
+ const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
2467
+ svgLabel.setAttribute("style", style.replace("color:", "fill:"));
2468
+ let rows = [];
2469
+ if (typeof vertexText === "string") {
2470
+ rows = vertexText.split(/\\n|\n|<br\s*\/?>/gi);
2471
+ } else if (Array.isArray(vertexText)) {
2472
+ rows = vertexText;
2473
+ } else {
2474
+ rows = [];
2475
+ }
2476
+ for (const row of rows) {
2477
+ const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
2478
+ tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
2479
+ tspan.setAttribute("dy", "1em");
2480
+ tspan.setAttribute("x", "0");
2481
+ if (isTitle) {
2482
+ tspan.setAttribute("class", "title-row");
2483
+ } else {
2484
+ tspan.setAttribute("class", "row");
2485
+ }
2486
+ tspan.textContent = row.trim();
2487
+ svgLabel.appendChild(tspan);
2488
+ }
2489
+ return svgLabel;
2490
+ }
2491
+ }, "createLabel");
2492
+ var createLabel_default = createLabel;
2493
+
2494
+ // src/dagre-wrapper/edges.js
2495
+
2496
+
2497
+ // src/dagre-wrapper/edgeMarker.ts
2498
+ var addEdgeMarkers = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((svgPath, edge, url, id, diagramType) => {
2499
+ if (edge.arrowTypeStart) {
2500
+ addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id, diagramType);
2501
+ }
2502
+ if (edge.arrowTypeEnd) {
2503
+ addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id, diagramType);
2504
+ }
2505
+ }, "addEdgeMarkers");
2506
+ var arrowTypesMap = {
2507
+ arrow_cross: "cross",
2508
+ arrow_point: "point",
2509
+ arrow_barb: "barb",
2510
+ arrow_circle: "circle",
2511
+ aggregation: "aggregation",
2512
+ extension: "extension",
2513
+ composition: "composition",
2514
+ dependency: "dependency",
2515
+ lollipop: "lollipop"
2516
+ };
2517
+ var addEdgeMarker = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((svgPath, position, arrowType, url, id, diagramType) => {
2518
+ const endMarkerType = arrowTypesMap[arrowType];
2519
+ if (!endMarkerType) {
2520
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.warn(`Unknown arrow type: ${arrowType}`);
2521
+ return;
2522
+ }
2523
+ const suffix = position === "start" ? "Start" : "End";
2524
+ svgPath.attr(`marker-${position}`, `url(${url}#${id}_${diagramType}-${endMarkerType}${suffix})`);
2525
+ }, "addEdgeMarker");
2526
+
2527
+ // src/dagre-wrapper/edges.js
2528
+ var edgeLabels = {};
2529
+ var terminalLabels = {};
2530
+ var insertEdgeLabel = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((elem, edge) => {
2531
+ const config2 = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)();
2532
+ const useHtmlLabels = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)(config2.flowchart.htmlLabels);
2533
+ const labelElement = edge.labelType === "markdown" ? (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .GZ)(
2534
+ elem,
2535
+ edge.label,
2536
+ {
2537
+ style: edge.labelStyle,
2538
+ useHtmlLabels,
2539
+ addSvgBackground: true
2540
+ },
2541
+ config2
2542
+ ) : createLabel_default(edge.label, edge.labelStyle);
2543
+ const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
2544
+ const label = edgeLabel.insert("g").attr("class", "label");
2545
+ label.node().appendChild(labelElement);
2546
+ let bbox = labelElement.getBBox();
2547
+ if (useHtmlLabels) {
2548
+ const div = labelElement.children[0];
2549
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(labelElement);
2550
+ bbox = div.getBoundingClientRect();
2551
+ dv.attr("width", bbox.width);
2552
+ dv.attr("height", bbox.height);
2553
+ }
2554
+ label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
2555
+ edgeLabels[edge.id] = edgeLabel;
2556
+ edge.width = bbox.width;
2557
+ edge.height = bbox.height;
2558
+ let fo;
2559
+ if (edge.startLabelLeft) {
2560
+ const startLabelElement = createLabel_default(edge.startLabelLeft, edge.labelStyle);
2561
+ const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
2562
+ const inner = startEdgeLabelLeft.insert("g").attr("class", "inner");
2563
+ fo = inner.node().appendChild(startLabelElement);
2564
+ const slBox = startLabelElement.getBBox();
2565
+ inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
2566
+ if (!terminalLabels[edge.id]) {
2567
+ terminalLabels[edge.id] = {};
2568
+ }
2569
+ terminalLabels[edge.id].startLeft = startEdgeLabelLeft;
2570
+ setTerminalWidth(fo, edge.startLabelLeft);
2571
+ }
2572
+ if (edge.startLabelRight) {
2573
+ const startLabelElement = createLabel_default(edge.startLabelRight, edge.labelStyle);
2574
+ const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
2575
+ const inner = startEdgeLabelRight.insert("g").attr("class", "inner");
2576
+ fo = startEdgeLabelRight.node().appendChild(startLabelElement);
2577
+ inner.node().appendChild(startLabelElement);
2578
+ const slBox = startLabelElement.getBBox();
2579
+ inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
2580
+ if (!terminalLabels[edge.id]) {
2581
+ terminalLabels[edge.id] = {};
2582
+ }
2583
+ terminalLabels[edge.id].startRight = startEdgeLabelRight;
2584
+ setTerminalWidth(fo, edge.startLabelRight);
2585
+ }
2586
+ if (edge.endLabelLeft) {
2587
+ const endLabelElement = createLabel_default(edge.endLabelLeft, edge.labelStyle);
2588
+ const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
2589
+ const inner = endEdgeLabelLeft.insert("g").attr("class", "inner");
2590
+ fo = inner.node().appendChild(endLabelElement);
2591
+ const slBox = endLabelElement.getBBox();
2592
+ inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
2593
+ endEdgeLabelLeft.node().appendChild(endLabelElement);
2594
+ if (!terminalLabels[edge.id]) {
2595
+ terminalLabels[edge.id] = {};
2596
+ }
2597
+ terminalLabels[edge.id].endLeft = endEdgeLabelLeft;
2598
+ setTerminalWidth(fo, edge.endLabelLeft);
2599
+ }
2600
+ if (edge.endLabelRight) {
2601
+ const endLabelElement = createLabel_default(edge.endLabelRight, edge.labelStyle);
2602
+ const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
2603
+ const inner = endEdgeLabelRight.insert("g").attr("class", "inner");
2604
+ fo = inner.node().appendChild(endLabelElement);
2605
+ const slBox = endLabelElement.getBBox();
2606
+ inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
2607
+ endEdgeLabelRight.node().appendChild(endLabelElement);
2608
+ if (!terminalLabels[edge.id]) {
2609
+ terminalLabels[edge.id] = {};
2610
+ }
2611
+ terminalLabels[edge.id].endRight = endEdgeLabelRight;
2612
+ setTerminalWidth(fo, edge.endLabelRight);
2613
+ }
2614
+ return labelElement;
2615
+ }, "insertEdgeLabel");
2616
+ function setTerminalWidth(fo, value) {
2617
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels && fo) {
2618
+ fo.style.width = value.length * 9 + "px";
2619
+ fo.style.height = "12px";
2620
+ }
2621
+ }
2622
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(setTerminalWidth, "setTerminalWidth");
2623
+ var positionEdgeLabel = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((edge, paths) => {
2624
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels[edge.id], paths);
2625
+ let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
2626
+ const siteConfig = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)();
2627
+ const { subGraphTitleTotalMargin } = (0,_chunk_K557N5IZ_mjs__WEBPACK_IMPORTED_MODULE_1__/* .getSubGraphTitleMargins */ .O)(siteConfig);
2628
+ if (edge.label) {
2629
+ const el = edgeLabels[edge.id];
2630
+ let x = edge.x;
2631
+ let y = edge.y;
2632
+ if (path) {
2633
+ const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .utils_default */ ._K.calcLabelPosition(path);
2634
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(
2635
+ "Moving label " + edge.label + " from (",
2636
+ x,
2637
+ ",",
2638
+ y,
2639
+ ") to (",
2640
+ pos.x,
2641
+ ",",
2642
+ pos.y,
2643
+ ") abc88"
2644
+ );
2645
+ if (paths.updatedPath) {
2646
+ x = pos.x;
2647
+ y = pos.y;
2648
+ }
2649
+ }
2650
+ el.attr("transform", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);
2651
+ }
2652
+ if (edge.startLabelLeft) {
2653
+ const el = terminalLabels[edge.id].startLeft;
2654
+ let x = edge.x;
2655
+ let y = edge.y;
2656
+ if (path) {
2657
+ const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path);
2658
+ x = pos.x;
2659
+ y = pos.y;
2660
+ }
2661
+ el.attr("transform", `translate(${x}, ${y})`);
2662
+ }
2663
+ if (edge.startLabelRight) {
2664
+ const el = terminalLabels[edge.id].startRight;
2665
+ let x = edge.x;
2666
+ let y = edge.y;
2667
+ if (path) {
2668
+ const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .utils_default */ ._K.calcTerminalLabelPosition(
2669
+ edge.arrowTypeStart ? 10 : 0,
2670
+ "start_right",
2671
+ path
2672
+ );
2673
+ x = pos.x;
2674
+ y = pos.y;
2675
+ }
2676
+ el.attr("transform", `translate(${x}, ${y})`);
2677
+ }
2678
+ if (edge.endLabelLeft) {
2679
+ const el = terminalLabels[edge.id].endLeft;
2680
+ let x = edge.x;
2681
+ let y = edge.y;
2682
+ if (path) {
2683
+ const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path);
2684
+ x = pos.x;
2685
+ y = pos.y;
2686
+ }
2687
+ el.attr("transform", `translate(${x}, ${y})`);
2688
+ }
2689
+ if (edge.endLabelRight) {
2690
+ const el = terminalLabels[edge.id].endRight;
2691
+ let x = edge.x;
2692
+ let y = edge.y;
2693
+ if (path) {
2694
+ const pos = _chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path);
2695
+ x = pos.x;
2696
+ y = pos.y;
2697
+ }
2698
+ el.attr("transform", `translate(${x}, ${y})`);
2699
+ }
2700
+ }, "positionEdgeLabel");
2701
+ var outsideNode = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((node, point2) => {
2702
+ const x = node.x;
2703
+ const y = node.y;
2704
+ const dx = Math.abs(point2.x - x);
2705
+ const dy = Math.abs(point2.y - y);
2706
+ const w = node.width / 2;
2707
+ const h = node.height / 2;
2708
+ if (dx >= w || dy >= h) {
2709
+ return true;
2710
+ }
2711
+ return false;
2712
+ }, "outsideNode");
2713
+ var intersection = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((node, outsidePoint, insidePoint) => {
2714
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(`intersection calc abc89:
2715
+ outsidePoint: ${JSON.stringify(outsidePoint)}
2716
+ insidePoint : ${JSON.stringify(insidePoint)}
2717
+ node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);
2718
+ const x = node.x;
2719
+ const y = node.y;
2720
+ const dx = Math.abs(x - insidePoint.x);
2721
+ const w = node.width / 2;
2722
+ let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;
2723
+ const h = node.height / 2;
2724
+ const Q = Math.abs(outsidePoint.y - insidePoint.y);
2725
+ const R = Math.abs(outsidePoint.x - insidePoint.x);
2726
+ if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
2727
+ let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
2728
+ r = R * q / Q;
2729
+ const res = {
2730
+ x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,
2731
+ y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q
2732
+ };
2733
+ if (r === 0) {
2734
+ res.x = outsidePoint.x;
2735
+ res.y = outsidePoint.y;
2736
+ }
2737
+ if (R === 0) {
2738
+ res.x = outsidePoint.x;
2739
+ }
2740
+ if (Q === 0) {
2741
+ res.y = outsidePoint.y;
2742
+ }
2743
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
2744
+ return res;
2745
+ } else {
2746
+ if (insidePoint.x < outsidePoint.x) {
2747
+ r = outsidePoint.x - w - x;
2748
+ } else {
2749
+ r = x - w - outsidePoint.x;
2750
+ }
2751
+ let q = Q * r / R;
2752
+ let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;
2753
+ let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;
2754
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });
2755
+ if (r === 0) {
2756
+ _x = outsidePoint.x;
2757
+ _y = outsidePoint.y;
2758
+ }
2759
+ if (R === 0) {
2760
+ _x = outsidePoint.x;
2761
+ }
2762
+ if (Q === 0) {
2763
+ _y = outsidePoint.y;
2764
+ }
2765
+ return { x: _x, y: _y };
2766
+ }
2767
+ }, "intersection");
2768
+ var cutPathAtIntersect = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((_points, boundaryNode) => {
2769
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("abc88 cutPathAtIntersect", _points, boundaryNode);
2770
+ let points = [];
2771
+ let lastPointOutside = _points[0];
2772
+ let isInside = false;
2773
+ _points.forEach((point2) => {
2774
+ if (!outsideNode(boundaryNode, point2) && !isInside) {
2775
+ const inter = intersection(boundaryNode, lastPointOutside, point2);
2776
+ let pointPresent = false;
2777
+ points.forEach((p) => {
2778
+ pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;
2779
+ });
2780
+ if (!points.some((e) => e.x === inter.x && e.y === inter.y)) {
2781
+ points.push(inter);
2782
+ }
2783
+ isInside = true;
2784
+ } else {
2785
+ lastPointOutside = point2;
2786
+ if (!isInside) {
2787
+ points.push(point2);
2788
+ }
2789
+ }
2790
+ });
2791
+ return points;
2792
+ }, "cutPathAtIntersect");
2793
+ var insertEdge = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(elem, e, edge, clusterDb, diagramType, graph, id) {
2794
+ let points = edge.points;
2795
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("abc88 InsertEdge: edge=", edge, "e=", e);
2796
+ let pointsHasChanged = false;
2797
+ const tail = graph.node(e.v);
2798
+ var head = graph.node(e.w);
2799
+ if (head?.intersect && tail?.intersect) {
2800
+ points = points.slice(1, edge.points.length - 1);
2801
+ points.unshift(tail.intersect(points[0]));
2802
+ points.push(head.intersect(points[points.length - 1]));
2803
+ }
2804
+ if (edge.toCluster) {
2805
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("to cluster abc88", clusterDb[edge.toCluster]);
2806
+ points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node);
2807
+ pointsHasChanged = true;
2808
+ }
2809
+ if (edge.fromCluster) {
2810
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("from cluster abc88", clusterDb[edge.fromCluster]);
2811
+ points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse();
2812
+ pointsHasChanged = true;
2813
+ }
2814
+ const lineData = points.filter((p) => !Number.isNaN(p.y));
2815
+ let curve = d3__WEBPACK_IMPORTED_MODULE_8__/* .curveBasis */ .qrM;
2816
+ if (edge.curve && (diagramType === "graph" || diagramType === "flowchart")) {
2817
+ curve = edge.curve;
2818
+ }
2819
+ const { x, y } = (0,_chunk_VV3M67IP_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getLineFunctionsWithOffset */ .R)(edge);
2820
+ const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .line */ .n8j)().x(x).y(y).curve(curve);
2821
+ let strokeClasses;
2822
+ switch (edge.thickness) {
2823
+ case "normal":
2824
+ strokeClasses = "edge-thickness-normal";
2825
+ break;
2826
+ case "thick":
2827
+ strokeClasses = "edge-thickness-thick";
2828
+ break;
2829
+ case "invisible":
2830
+ strokeClasses = "edge-thickness-thick";
2831
+ break;
2832
+ default:
2833
+ strokeClasses = "";
2834
+ }
2835
+ switch (edge.pattern) {
2836
+ case "solid":
2837
+ strokeClasses += " edge-pattern-solid";
2838
+ break;
2839
+ case "dotted":
2840
+ strokeClasses += " edge-pattern-dotted";
2841
+ break;
2842
+ case "dashed":
2843
+ strokeClasses += " edge-pattern-dashed";
2844
+ break;
2845
+ }
2846
+ const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style);
2847
+ let url = "";
2848
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.arrowMarkerAbsolute || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().state.arrowMarkerAbsolute) {
2849
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
2850
+ url = url.replace(/\(/g, "\\(");
2851
+ url = url.replace(/\)/g, "\\)");
2852
+ }
2853
+ addEdgeMarkers(svgPath, edge, url, id, diagramType);
2854
+ let paths = {};
2855
+ if (pointsHasChanged) {
2856
+ paths.updatedPath = points;
2857
+ }
2858
+ paths.originalPath = edge.points;
2859
+ return paths;
2860
+ }, "insertEdge");
2861
+
2862
+ // src/dagre-wrapper/nodes.js
2863
+
2864
+
2865
+ // src/dagre-wrapper/blockArrowHelper.ts
2866
+ var expandAndDeduplicateDirections = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((directions) => {
2867
+ const uniqueDirections = /* @__PURE__ */ new Set();
2868
+ for (const direction of directions) {
2869
+ switch (direction) {
2870
+ case "x":
2871
+ uniqueDirections.add("right");
2872
+ uniqueDirections.add("left");
2873
+ break;
2874
+ case "y":
2875
+ uniqueDirections.add("up");
2876
+ uniqueDirections.add("down");
2877
+ break;
2878
+ default:
2879
+ uniqueDirections.add(direction);
2880
+ break;
2881
+ }
2882
+ }
2883
+ return uniqueDirections;
2884
+ }, "expandAndDeduplicateDirections");
2885
+ var getArrowPoints = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((duplicatedDirections, bbox, node) => {
2886
+ const directions = expandAndDeduplicateDirections(duplicatedDirections);
2887
+ const f = 2;
2888
+ const height = bbox.height + 2 * node.padding;
2889
+ const midpoint = height / f;
2890
+ const width = bbox.width + 2 * midpoint + node.padding;
2891
+ const padding2 = node.padding / 2;
2892
+ if (directions.has("right") && directions.has("left") && directions.has("up") && directions.has("down")) {
2893
+ return [
2894
+ // Bottom
2895
+ { x: 0, y: 0 },
2896
+ { x: midpoint, y: 0 },
2897
+ { x: width / 2, y: 2 * padding2 },
2898
+ { x: width - midpoint, y: 0 },
2899
+ { x: width, y: 0 },
2900
+ // Right
2901
+ { x: width, y: -height / 3 },
2902
+ { x: width + 2 * padding2, y: -height / 2 },
2903
+ { x: width, y: -2 * height / 3 },
2904
+ { x: width, y: -height },
2905
+ // Top
2906
+ { x: width - midpoint, y: -height },
2907
+ { x: width / 2, y: -height - 2 * padding2 },
2908
+ { x: midpoint, y: -height },
2909
+ // Left
2910
+ { x: 0, y: -height },
2911
+ { x: 0, y: -2 * height / 3 },
2912
+ { x: -2 * padding2, y: -height / 2 },
2913
+ { x: 0, y: -height / 3 }
2914
+ ];
2915
+ }
2916
+ if (directions.has("right") && directions.has("left") && directions.has("up")) {
2917
+ return [
2918
+ { x: midpoint, y: 0 },
2919
+ { x: width - midpoint, y: 0 },
2920
+ { x: width, y: -height / 2 },
2921
+ { x: width - midpoint, y: -height },
2922
+ { x: midpoint, y: -height },
2923
+ { x: 0, y: -height / 2 }
2924
+ ];
2925
+ }
2926
+ if (directions.has("right") && directions.has("left") && directions.has("down")) {
2927
+ return [
2928
+ { x: 0, y: 0 },
2929
+ { x: midpoint, y: -height },
2930
+ { x: width - midpoint, y: -height },
2931
+ { x: width, y: 0 }
2932
+ ];
2933
+ }
2934
+ if (directions.has("right") && directions.has("up") && directions.has("down")) {
2935
+ return [
2936
+ { x: 0, y: 0 },
2937
+ { x: width, y: -midpoint },
2938
+ { x: width, y: -height + midpoint },
2939
+ { x: 0, y: -height }
2940
+ ];
2941
+ }
2942
+ if (directions.has("left") && directions.has("up") && directions.has("down")) {
2943
+ return [
2944
+ { x: width, y: 0 },
2945
+ { x: 0, y: -midpoint },
2946
+ { x: 0, y: -height + midpoint },
2947
+ { x: width, y: -height }
2948
+ ];
2949
+ }
2950
+ if (directions.has("right") && directions.has("left")) {
2951
+ return [
2952
+ { x: midpoint, y: 0 },
2953
+ { x: midpoint, y: -padding2 },
2954
+ { x: width - midpoint, y: -padding2 },
2955
+ { x: width - midpoint, y: 0 },
2956
+ { x: width, y: -height / 2 },
2957
+ { x: width - midpoint, y: -height },
2958
+ { x: width - midpoint, y: -height + padding2 },
2959
+ { x: midpoint, y: -height + padding2 },
2960
+ { x: midpoint, y: -height },
2961
+ { x: 0, y: -height / 2 }
2962
+ ];
2963
+ }
2964
+ if (directions.has("up") && directions.has("down")) {
2965
+ return [
2966
+ // Bottom center
2967
+ { x: width / 2, y: 0 },
2968
+ // Left pont of bottom arrow
2969
+ { x: 0, y: -padding2 },
2970
+ { x: midpoint, y: -padding2 },
2971
+ // Left top over vertical section
2972
+ { x: midpoint, y: -height + padding2 },
2973
+ { x: 0, y: -height + padding2 },
2974
+ // Top of arrow
2975
+ { x: width / 2, y: -height },
2976
+ { x: width, y: -height + padding2 },
2977
+ // Top of right vertical bar
2978
+ { x: width - midpoint, y: -height + padding2 },
2979
+ { x: width - midpoint, y: -padding2 },
2980
+ { x: width, y: -padding2 }
2981
+ ];
2982
+ }
2983
+ if (directions.has("right") && directions.has("up")) {
2984
+ return [
2985
+ { x: 0, y: 0 },
2986
+ { x: width, y: -midpoint },
2987
+ { x: 0, y: -height }
2988
+ ];
2989
+ }
2990
+ if (directions.has("right") && directions.has("down")) {
2991
+ return [
2992
+ { x: 0, y: 0 },
2993
+ { x: width, y: 0 },
2994
+ { x: 0, y: -height }
2995
+ ];
2996
+ }
2997
+ if (directions.has("left") && directions.has("up")) {
2998
+ return [
2999
+ { x: width, y: 0 },
3000
+ { x: 0, y: -midpoint },
3001
+ { x: width, y: -height }
3002
+ ];
3003
+ }
3004
+ if (directions.has("left") && directions.has("down")) {
3005
+ return [
3006
+ { x: width, y: 0 },
3007
+ { x: 0, y: 0 },
3008
+ { x: width, y: -height }
3009
+ ];
3010
+ }
3011
+ if (directions.has("right")) {
3012
+ return [
3013
+ { x: midpoint, y: -padding2 },
3014
+ { x: midpoint, y: -padding2 },
3015
+ { x: width - midpoint, y: -padding2 },
3016
+ { x: width - midpoint, y: 0 },
3017
+ { x: width, y: -height / 2 },
3018
+ { x: width - midpoint, y: -height },
3019
+ { x: width - midpoint, y: -height + padding2 },
3020
+ // top left corner of arrow
3021
+ { x: midpoint, y: -height + padding2 },
3022
+ { x: midpoint, y: -height + padding2 }
3023
+ ];
3024
+ }
3025
+ if (directions.has("left")) {
3026
+ return [
3027
+ { x: midpoint, y: 0 },
3028
+ { x: midpoint, y: -padding2 },
3029
+ // Two points, the right corners
3030
+ { x: width - midpoint, y: -padding2 },
3031
+ { x: width - midpoint, y: -height + padding2 },
3032
+ { x: midpoint, y: -height + padding2 },
3033
+ { x: midpoint, y: -height },
3034
+ { x: 0, y: -height / 2 }
3035
+ ];
3036
+ }
3037
+ if (directions.has("up")) {
3038
+ return [
3039
+ // Bottom center
3040
+ { x: midpoint, y: -padding2 },
3041
+ // Left top over vertical section
3042
+ { x: midpoint, y: -height + padding2 },
3043
+ { x: 0, y: -height + padding2 },
3044
+ // Top of arrow
3045
+ { x: width / 2, y: -height },
3046
+ { x: width, y: -height + padding2 },
3047
+ // Top of right vertical bar
3048
+ { x: width - midpoint, y: -height + padding2 },
3049
+ { x: width - midpoint, y: -padding2 }
3050
+ ];
3051
+ }
3052
+ if (directions.has("down")) {
3053
+ return [
3054
+ // Bottom center
3055
+ { x: width / 2, y: 0 },
3056
+ // Left pont of bottom arrow
3057
+ { x: 0, y: -padding2 },
3058
+ { x: midpoint, y: -padding2 },
3059
+ // Left top over vertical section
3060
+ { x: midpoint, y: -height + padding2 },
3061
+ { x: width - midpoint, y: -height + padding2 },
3062
+ { x: width - midpoint, y: -padding2 },
3063
+ { x: width, y: -padding2 }
3064
+ ];
3065
+ }
3066
+ return [{ x: 0, y: 0 }];
3067
+ }, "getArrowPoints");
3068
+
3069
+ // src/dagre-wrapper/intersect/intersect-node.js
3070
+ function intersectNode(node, point2) {
3071
+ return node.intersect(point2);
3072
+ }
3073
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(intersectNode, "intersectNode");
3074
+ var intersect_node_default = intersectNode;
3075
+
3076
+ // src/dagre-wrapper/intersect/intersect-ellipse.js
3077
+ function intersectEllipse(node, rx, ry, point2) {
3078
+ var cx = node.x;
3079
+ var cy = node.y;
3080
+ var px = cx - point2.x;
3081
+ var py = cy - point2.y;
3082
+ var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);
3083
+ var dx = Math.abs(rx * ry * px / det);
3084
+ if (point2.x < cx) {
3085
+ dx = -dx;
3086
+ }
3087
+ var dy = Math.abs(rx * ry * py / det);
3088
+ if (point2.y < cy) {
3089
+ dy = -dy;
3090
+ }
3091
+ return { x: cx + dx, y: cy + dy };
3092
+ }
3093
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(intersectEllipse, "intersectEllipse");
3094
+ var intersect_ellipse_default = intersectEllipse;
3095
+
3096
+ // src/dagre-wrapper/intersect/intersect-circle.js
3097
+ function intersectCircle(node, rx, point2) {
3098
+ return intersect_ellipse_default(node, rx, rx, point2);
3099
+ }
3100
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(intersectCircle, "intersectCircle");
3101
+ var intersect_circle_default = intersectCircle;
3102
+
3103
+ // src/dagre-wrapper/intersect/intersect-line.js
3104
+ function intersectLine(p1, p2, q1, q2) {
3105
+ var a1, a2, b1, b2, c1, c2;
3106
+ var r1, r2, r3, r4;
3107
+ var denom, offset, num;
3108
+ var x, y;
3109
+ a1 = p2.y - p1.y;
3110
+ b1 = p1.x - p2.x;
3111
+ c1 = p2.x * p1.y - p1.x * p2.y;
3112
+ r3 = a1 * q1.x + b1 * q1.y + c1;
3113
+ r4 = a1 * q2.x + b1 * q2.y + c1;
3114
+ if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {
3115
+ return;
3116
+ }
3117
+ a2 = q2.y - q1.y;
3118
+ b2 = q1.x - q2.x;
3119
+ c2 = q2.x * q1.y - q1.x * q2.y;
3120
+ r1 = a2 * p1.x + b2 * p1.y + c2;
3121
+ r2 = a2 * p2.x + b2 * p2.y + c2;
3122
+ if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {
3123
+ return;
3124
+ }
3125
+ denom = a1 * b2 - a2 * b1;
3126
+ if (denom === 0) {
3127
+ return;
3128
+ }
3129
+ offset = Math.abs(denom / 2);
3130
+ num = b1 * c2 - b2 * c1;
3131
+ x = num < 0 ? (num - offset) / denom : (num + offset) / denom;
3132
+ num = a2 * c1 - a1 * c2;
3133
+ y = num < 0 ? (num - offset) / denom : (num + offset) / denom;
3134
+ return { x, y };
3135
+ }
3136
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(intersectLine, "intersectLine");
3137
+ function sameSign(r1, r2) {
3138
+ return r1 * r2 > 0;
3139
+ }
3140
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(sameSign, "sameSign");
3141
+ var intersect_line_default = intersectLine;
3142
+
3143
+ // src/dagre-wrapper/intersect/intersect-polygon.js
3144
+ var intersect_polygon_default = intersectPolygon;
3145
+ function intersectPolygon(node, polyPoints, point2) {
3146
+ var x1 = node.x;
3147
+ var y1 = node.y;
3148
+ var intersections = [];
3149
+ var minX = Number.POSITIVE_INFINITY;
3150
+ var minY = Number.POSITIVE_INFINITY;
3151
+ if (typeof polyPoints.forEach === "function") {
3152
+ polyPoints.forEach(function(entry) {
3153
+ minX = Math.min(minX, entry.x);
3154
+ minY = Math.min(minY, entry.y);
3155
+ });
3156
+ } else {
3157
+ minX = Math.min(minX, polyPoints.x);
3158
+ minY = Math.min(minY, polyPoints.y);
3159
+ }
3160
+ var left = x1 - node.width / 2 - minX;
3161
+ var top = y1 - node.height / 2 - minY;
3162
+ for (var i = 0; i < polyPoints.length; i++) {
3163
+ var p1 = polyPoints[i];
3164
+ var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];
3165
+ var intersect = intersect_line_default(
3166
+ node,
3167
+ point2,
3168
+ { x: left + p1.x, y: top + p1.y },
3169
+ { x: left + p2.x, y: top + p2.y }
3170
+ );
3171
+ if (intersect) {
3172
+ intersections.push(intersect);
3173
+ }
3174
+ }
3175
+ if (!intersections.length) {
3176
+ return node;
3177
+ }
3178
+ if (intersections.length > 1) {
3179
+ intersections.sort(function(p, q) {
3180
+ var pdx = p.x - point2.x;
3181
+ var pdy = p.y - point2.y;
3182
+ var distp = Math.sqrt(pdx * pdx + pdy * pdy);
3183
+ var qdx = q.x - point2.x;
3184
+ var qdy = q.y - point2.y;
3185
+ var distq = Math.sqrt(qdx * qdx + qdy * qdy);
3186
+ return distp < distq ? -1 : distp === distq ? 0 : 1;
3187
+ });
3188
+ }
3189
+ return intersections[0];
3190
+ }
3191
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(intersectPolygon, "intersectPolygon");
3192
+
3193
+ // src/dagre-wrapper/intersect/intersect-rect.js
3194
+ var intersectRect = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((node, point2) => {
3195
+ var x = node.x;
3196
+ var y = node.y;
3197
+ var dx = point2.x - x;
3198
+ var dy = point2.y - y;
3199
+ var w = node.width / 2;
3200
+ var h = node.height / 2;
3201
+ var sx, sy;
3202
+ if (Math.abs(dy) * w > Math.abs(dx) * h) {
3203
+ if (dy < 0) {
3204
+ h = -h;
3205
+ }
3206
+ sx = dy === 0 ? 0 : h * dx / dy;
3207
+ sy = h;
3208
+ } else {
3209
+ if (dx < 0) {
3210
+ w = -w;
3211
+ }
3212
+ sx = w;
3213
+ sy = dx === 0 ? 0 : w * dy / dx;
3214
+ }
3215
+ return { x: x + sx, y: y + sy };
3216
+ }, "intersectRect");
3217
+ var intersect_rect_default = intersectRect;
3218
+
3219
+ // src/dagre-wrapper/intersect/index.js
3220
+ var intersect_default = {
3221
+ node: intersect_node_default,
3222
+ circle: intersect_circle_default,
3223
+ ellipse: intersect_ellipse_default,
3224
+ polygon: intersect_polygon_default,
3225
+ rect: intersect_rect_default
3226
+ };
3227
+
3228
+ // src/dagre-wrapper/shapes/util.js
3229
+
3230
+ var labelHelper = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node, _classes, isNode) => {
3231
+ const config2 = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)();
3232
+ let classes2;
3233
+ const useHtmlLabels = node.useHtmlLabels || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)(config2.flowchart.htmlLabels);
3234
+ if (!_classes) {
3235
+ classes2 = "node default";
3236
+ } else {
3237
+ classes2 = _classes;
3238
+ }
3239
+ const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node.domId || node.id);
3240
+ const label = shapeSvg.insert("g").attr("class", "label").attr("style", node.labelStyle);
3241
+ let labelText;
3242
+ if (node.labelText === void 0) {
3243
+ labelText = "";
3244
+ } else {
3245
+ labelText = typeof node.labelText === "string" ? node.labelText : node.labelText[0];
3246
+ }
3247
+ const textNode = label.node();
3248
+ let text;
3249
+ if (node.labelType === "markdown") {
3250
+ text = (0,_chunk_C3MQ5ANM_mjs__WEBPACK_IMPORTED_MODULE_2__/* .createText */ .GZ)(
3251
+ label,
3252
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .sanitizeText */ .jZ)((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .Sm)(labelText), config2),
3253
+ {
3254
+ useHtmlLabels,
3255
+ width: node.width || config2.flowchart.wrappingWidth,
3256
+ classes: "markdown-node-label"
3257
+ },
3258
+ config2
3259
+ );
3260
+ } else {
3261
+ text = textNode.appendChild(
3262
+ createLabel_default((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .sanitizeText */ .jZ)((0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .decodeEntities */ .Sm)(labelText), config2), node.labelStyle, false, isNode)
3263
+ );
3264
+ }
3265
+ let bbox = text.getBBox();
3266
+ const halfPadding = node.padding / 2;
3267
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)(config2.flowchart.htmlLabels)) {
3268
+ const div = text.children[0];
3269
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(text);
3270
+ const images = div.getElementsByTagName("img");
3271
+ if (images) {
3272
+ const noImgText = labelText.replace(/<img[^>]*>/g, "").trim() === "";
3273
+ await Promise.all(
3274
+ [...images].map(
3275
+ (img) => new Promise((res) => {
3276
+ function setupImage() {
3277
+ img.style.display = "flex";
3278
+ img.style.flexDirection = "column";
3279
+ if (noImgText) {
3280
+ const bodyFontSize = config2.fontSize ? config2.fontSize : window.getComputedStyle(document.body).fontSize;
3281
+ const enlargingFactor = 5;
3282
+ const width = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
3283
+ img.style.minWidth = width;
3284
+ img.style.maxWidth = width;
3285
+ } else {
3286
+ img.style.width = "100%";
3287
+ }
3288
+ res(img);
3289
+ }
3290
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(setupImage, "setupImage");
3291
+ setTimeout(() => {
3292
+ if (img.complete) {
3293
+ setupImage();
3294
+ }
3295
+ });
3296
+ img.addEventListener("error", setupImage);
3297
+ img.addEventListener("load", setupImage);
3298
+ })
3299
+ )
3300
+ );
3301
+ }
3302
+ bbox = div.getBoundingClientRect();
3303
+ dv.attr("width", bbox.width);
3304
+ dv.attr("height", bbox.height);
3305
+ }
3306
+ if (useHtmlLabels) {
3307
+ label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
3308
+ } else {
3309
+ label.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
3310
+ }
3311
+ if (node.centerLabel) {
3312
+ label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
3313
+ }
3314
+ label.insert("rect", ":first-child");
3315
+ return { shapeSvg, bbox, halfPadding, label };
3316
+ }, "labelHelper");
3317
+ var updateNodeBounds = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((node, element) => {
3318
+ const bbox = element.node().getBBox();
3319
+ node.width = bbox.width;
3320
+ node.height = bbox.height;
3321
+ }, "updateNodeBounds");
3322
+ function insertPolygonShape(parent, w, h, points) {
3323
+ return parent.insert("polygon", ":first-child").attr(
3324
+ "points",
3325
+ points.map(function(d) {
3326
+ return d.x + "," + d.y;
3327
+ }).join(" ")
3328
+ ).attr("class", "label-container").attr("transform", "translate(" + -w / 2 + "," + h / 2 + ")");
3329
+ }
3330
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(insertPolygonShape, "insertPolygonShape");
3331
+
3332
+ // src/dagre-wrapper/shapes/note.js
3333
+ var note = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3334
+ const useHtmlLabels = node.useHtmlLabels || (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels;
3335
+ if (!useHtmlLabels) {
3336
+ node.centerLabel = true;
3337
+ }
3338
+ const { shapeSvg, bbox, halfPadding } = await labelHelper(
3339
+ parent,
3340
+ node,
3341
+ "node " + node.classes,
3342
+ true
3343
+ );
3344
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("Classes = ", node.classes);
3345
+ const rect2 = shapeSvg.insert("rect", ":first-child");
3346
+ 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);
3347
+ updateNodeBounds(node, rect2);
3348
+ node.intersect = function(point2) {
3349
+ return intersect_default.rect(node, point2);
3350
+ };
3351
+ return shapeSvg;
3352
+ }, "note");
3353
+ var note_default = note;
3354
+
3355
+ // src/dagre-wrapper/nodes.js
3356
+ var formatClass = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((str) => {
3357
+ if (str) {
3358
+ return " " + str;
3359
+ }
3360
+ return "";
3361
+ }, "formatClass");
3362
+ var getClassesFromNode = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((node, otherClasses) => {
3363
+ return `${otherClasses ? otherClasses : "node default"}${formatClass(node.classes)} ${formatClass(
3364
+ node.class
3365
+ )}`;
3366
+ }, "getClassesFromNode");
3367
+ var question = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3368
+ const { shapeSvg, bbox } = await labelHelper(
3369
+ parent,
3370
+ node,
3371
+ getClassesFromNode(node, void 0),
3372
+ true
3373
+ );
3374
+ const w = bbox.width + node.padding;
3375
+ const h = bbox.height + node.padding;
3376
+ const s = w + h;
3377
+ const points = [
3378
+ { x: s / 2, y: 0 },
3379
+ { x: s, y: -s / 2 },
3380
+ { x: s / 2, y: -s },
3381
+ { x: 0, y: -s / 2 }
3382
+ ];
3383
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("Question main (Circle)");
3384
+ const questionElem = insertPolygonShape(shapeSvg, s, s, points);
3385
+ questionElem.attr("style", node.style);
3386
+ updateNodeBounds(node, questionElem);
3387
+ node.intersect = function(point2) {
3388
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.warn("Intersect called");
3389
+ return intersect_default.polygon(node, points, point2);
3390
+ };
3391
+ return shapeSvg;
3392
+ }, "question");
3393
+ var choice = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((parent, node) => {
3394
+ const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
3395
+ const s = 28;
3396
+ const points = [
3397
+ { x: 0, y: s / 2 },
3398
+ { x: s / 2, y: 0 },
3399
+ { x: 0, y: -s / 2 },
3400
+ { x: -s / 2, y: 0 }
3401
+ ];
3402
+ const choice2 = shapeSvg.insert("polygon", ":first-child").attr(
3403
+ "points",
3404
+ points.map(function(d) {
3405
+ return d.x + "," + d.y;
3406
+ }).join(" ")
3407
+ );
3408
+ choice2.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28);
3409
+ node.width = 28;
3410
+ node.height = 28;
3411
+ node.intersect = function(point2) {
3412
+ return intersect_default.circle(node, 14, point2);
3413
+ };
3414
+ return shapeSvg;
3415
+ }, "choice");
3416
+ var hexagon = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3417
+ const { shapeSvg, bbox } = await labelHelper(
3418
+ parent,
3419
+ node,
3420
+ getClassesFromNode(node, void 0),
3421
+ true
3422
+ );
3423
+ const f = 4;
3424
+ const h = bbox.height + node.padding;
3425
+ const m = h / f;
3426
+ const w = bbox.width + 2 * m + node.padding;
3427
+ const points = [
3428
+ { x: m, y: 0 },
3429
+ { x: w - m, y: 0 },
3430
+ { x: w, y: -h / 2 },
3431
+ { x: w - m, y: -h },
3432
+ { x: m, y: -h },
3433
+ { x: 0, y: -h / 2 }
3434
+ ];
3435
+ const hex = insertPolygonShape(shapeSvg, w, h, points);
3436
+ hex.attr("style", node.style);
3437
+ updateNodeBounds(node, hex);
3438
+ node.intersect = function(point2) {
3439
+ return intersect_default.polygon(node, points, point2);
3440
+ };
3441
+ return shapeSvg;
3442
+ }, "hexagon");
3443
+ var block_arrow = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3444
+ const { shapeSvg, bbox } = await labelHelper(parent, node, void 0, true);
3445
+ const f = 2;
3446
+ const h = bbox.height + 2 * node.padding;
3447
+ const m = h / f;
3448
+ const w = bbox.width + 2 * m + node.padding;
3449
+ const points = getArrowPoints(node.directions, bbox, node);
3450
+ const blockArrow = insertPolygonShape(shapeSvg, w, h, points);
3451
+ blockArrow.attr("style", node.style);
3452
+ updateNodeBounds(node, blockArrow);
3453
+ node.intersect = function(point2) {
3454
+ return intersect_default.polygon(node, points, point2);
3455
+ };
3456
+ return shapeSvg;
3457
+ }, "block_arrow");
3458
+ var rect_left_inv_arrow = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3459
+ const { shapeSvg, bbox } = await labelHelper(
3460
+ parent,
3461
+ node,
3462
+ getClassesFromNode(node, void 0),
3463
+ true
3464
+ );
3465
+ const w = bbox.width + node.padding;
3466
+ const h = bbox.height + node.padding;
3467
+ const points = [
3468
+ { x: -h / 2, y: 0 },
3469
+ { x: w, y: 0 },
3470
+ { x: w, y: -h },
3471
+ { x: -h / 2, y: -h },
3472
+ { x: 0, y: -h / 2 }
3473
+ ];
3474
+ const el = insertPolygonShape(shapeSvg, w, h, points);
3475
+ el.attr("style", node.style);
3476
+ node.width = w + h;
3477
+ node.height = h;
3478
+ node.intersect = function(point2) {
3479
+ return intersect_default.polygon(node, points, point2);
3480
+ };
3481
+ return shapeSvg;
3482
+ }, "rect_left_inv_arrow");
3483
+ var lean_right = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3484
+ const { shapeSvg, bbox } = await labelHelper(parent, node, getClassesFromNode(node), true);
3485
+ const w = bbox.width + node.padding;
3486
+ const h = bbox.height + node.padding;
3487
+ const points = [
3488
+ { x: -2 * h / 6, y: 0 },
3489
+ { x: w - h / 6, y: 0 },
3490
+ { x: w + 2 * h / 6, y: -h },
3491
+ { x: h / 6, y: -h }
3492
+ ];
3493
+ const el = insertPolygonShape(shapeSvg, w, h, points);
3494
+ el.attr("style", node.style);
3495
+ updateNodeBounds(node, el);
3496
+ node.intersect = function(point2) {
3497
+ return intersect_default.polygon(node, points, point2);
3498
+ };
3499
+ return shapeSvg;
3500
+ }, "lean_right");
3501
+ var lean_left = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3502
+ const { shapeSvg, bbox } = await labelHelper(
3503
+ parent,
3504
+ node,
3505
+ getClassesFromNode(node, void 0),
3506
+ true
3507
+ );
3508
+ const w = bbox.width + node.padding;
3509
+ const h = bbox.height + node.padding;
3510
+ const points = [
3511
+ { x: 2 * h / 6, y: 0 },
3512
+ { x: w + h / 6, y: 0 },
3513
+ { x: w - 2 * h / 6, y: -h },
3514
+ { x: -h / 6, y: -h }
3515
+ ];
3516
+ const el = insertPolygonShape(shapeSvg, w, h, points);
3517
+ el.attr("style", node.style);
3518
+ updateNodeBounds(node, el);
3519
+ node.intersect = function(point2) {
3520
+ return intersect_default.polygon(node, points, point2);
3521
+ };
3522
+ return shapeSvg;
3523
+ }, "lean_left");
3524
+ var trapezoid = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3525
+ const { shapeSvg, bbox } = await labelHelper(
3526
+ parent,
3527
+ node,
3528
+ getClassesFromNode(node, void 0),
3529
+ true
3530
+ );
3531
+ const w = bbox.width + node.padding;
3532
+ const h = bbox.height + node.padding;
3533
+ const points = [
3534
+ { x: -2 * h / 6, y: 0 },
3535
+ { x: w + 2 * h / 6, y: 0 },
3536
+ { x: w - h / 6, y: -h },
3537
+ { x: h / 6, y: -h }
3538
+ ];
3539
+ const el = insertPolygonShape(shapeSvg, w, h, points);
3540
+ el.attr("style", node.style);
3541
+ updateNodeBounds(node, el);
3542
+ node.intersect = function(point2) {
3543
+ return intersect_default.polygon(node, points, point2);
3544
+ };
3545
+ return shapeSvg;
3546
+ }, "trapezoid");
3547
+ var inv_trapezoid = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3548
+ const { shapeSvg, bbox } = await labelHelper(
3549
+ parent,
3550
+ node,
3551
+ getClassesFromNode(node, void 0),
3552
+ true
3553
+ );
3554
+ const w = bbox.width + node.padding;
3555
+ const h = bbox.height + node.padding;
3556
+ const points = [
3557
+ { x: h / 6, y: 0 },
3558
+ { x: w - h / 6, y: 0 },
3559
+ { x: w + 2 * h / 6, y: -h },
3560
+ { x: -2 * h / 6, y: -h }
3561
+ ];
3562
+ const el = insertPolygonShape(shapeSvg, w, h, points);
3563
+ el.attr("style", node.style);
3564
+ updateNodeBounds(node, el);
3565
+ node.intersect = function(point2) {
3566
+ return intersect_default.polygon(node, points, point2);
3567
+ };
3568
+ return shapeSvg;
3569
+ }, "inv_trapezoid");
3570
+ var rect_right_inv_arrow = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3571
+ const { shapeSvg, bbox } = await labelHelper(
3572
+ parent,
3573
+ node,
3574
+ getClassesFromNode(node, void 0),
3575
+ true
3576
+ );
3577
+ const w = bbox.width + node.padding;
3578
+ const h = bbox.height + node.padding;
3579
+ const points = [
3580
+ { x: 0, y: 0 },
3581
+ { x: w + h / 2, y: 0 },
3582
+ { x: w, y: -h / 2 },
3583
+ { x: w + h / 2, y: -h },
3584
+ { x: 0, y: -h }
3585
+ ];
3586
+ const el = insertPolygonShape(shapeSvg, w, h, points);
3587
+ el.attr("style", node.style);
3588
+ updateNodeBounds(node, el);
3589
+ node.intersect = function(point2) {
3590
+ return intersect_default.polygon(node, points, point2);
3591
+ };
3592
+ return shapeSvg;
3593
+ }, "rect_right_inv_arrow");
3594
+ var cylinder = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3595
+ const { shapeSvg, bbox } = await labelHelper(
3596
+ parent,
3597
+ node,
3598
+ getClassesFromNode(node, void 0),
3599
+ true
3600
+ );
3601
+ const w = bbox.width + node.padding;
3602
+ const rx = w / 2;
3603
+ const ry = rx / (2.5 + w / 50);
3604
+ const h = bbox.height + ry + node.padding;
3605
+ 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;
3606
+ 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) + ")");
3607
+ updateNodeBounds(node, el);
3608
+ node.intersect = function(point2) {
3609
+ const pos = intersect_default.rect(node, point2);
3610
+ const x = pos.x - node.x;
3611
+ 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)) {
3612
+ let y = ry * ry * (1 - x * x / (rx * rx));
3613
+ if (y != 0) {
3614
+ y = Math.sqrt(y);
3615
+ }
3616
+ y = ry - y;
3617
+ if (point2.y - node.y > 0) {
3618
+ y = -y;
3619
+ }
3620
+ pos.y += y;
3621
+ }
3622
+ return pos;
3623
+ };
3624
+ return shapeSvg;
3625
+ }, "cylinder");
3626
+ var rect = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3627
+ const { shapeSvg, bbox, halfPadding } = await labelHelper(
3628
+ parent,
3629
+ node,
3630
+ "node " + node.classes + " " + node.class,
3631
+ true
3632
+ );
3633
+ const rect2 = shapeSvg.insert("rect", ":first-child");
3634
+ const totalWidth = node.positioned ? node.width : bbox.width + node.padding;
3635
+ const totalHeight = node.positioned ? node.height : bbox.height + node.padding;
3636
+ const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
3637
+ const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
3638
+ 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);
3639
+ if (node.props) {
3640
+ const propKeys = new Set(Object.keys(node.props));
3641
+ if (node.props.borders) {
3642
+ applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
3643
+ propKeys.delete("borders");
3644
+ }
3645
+ propKeys.forEach((propKey) => {
3646
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
3647
+ });
3648
+ }
3649
+ updateNodeBounds(node, rect2);
3650
+ node.intersect = function(point2) {
3651
+ return intersect_default.rect(node, point2);
3652
+ };
3653
+ return shapeSvg;
3654
+ }, "rect");
3655
+ var composite = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3656
+ const { shapeSvg, bbox, halfPadding } = await labelHelper(
3657
+ parent,
3658
+ node,
3659
+ "node " + node.classes,
3660
+ true
3661
+ );
3662
+ const rect2 = shapeSvg.insert("rect", ":first-child");
3663
+ const totalWidth = node.positioned ? node.width : bbox.width + node.padding;
3664
+ const totalHeight = node.positioned ? node.height : bbox.height + node.padding;
3665
+ const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
3666
+ const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
3667
+ 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);
3668
+ if (node.props) {
3669
+ const propKeys = new Set(Object.keys(node.props));
3670
+ if (node.props.borders) {
3671
+ applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
3672
+ propKeys.delete("borders");
3673
+ }
3674
+ propKeys.forEach((propKey) => {
3675
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
3676
+ });
3677
+ }
3678
+ updateNodeBounds(node, rect2);
3679
+ node.intersect = function(point2) {
3680
+ return intersect_default.rect(node, point2);
3681
+ };
3682
+ return shapeSvg;
3683
+ }, "composite");
3684
+ var labelRect = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3685
+ const { shapeSvg } = await labelHelper(parent, node, "label", true);
3686
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.trace("Classes = ", node.class);
3687
+ const rect2 = shapeSvg.insert("rect", ":first-child");
3688
+ const totalWidth = 0;
3689
+ const totalHeight = 0;
3690
+ rect2.attr("width", totalWidth).attr("height", totalHeight);
3691
+ shapeSvg.attr("class", "label edgeLabel");
3692
+ if (node.props) {
3693
+ const propKeys = new Set(Object.keys(node.props));
3694
+ if (node.props.borders) {
3695
+ applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
3696
+ propKeys.delete("borders");
3697
+ }
3698
+ propKeys.forEach((propKey) => {
3699
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
3700
+ });
3701
+ }
3702
+ updateNodeBounds(node, rect2);
3703
+ node.intersect = function(point2) {
3704
+ return intersect_default.rect(node, point2);
3705
+ };
3706
+ return shapeSvg;
3707
+ }, "labelRect");
3708
+ function applyNodePropertyBorders(rect2, borders, totalWidth, totalHeight) {
3709
+ const strokeDashArray = [];
3710
+ const addBorder = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((length) => {
3711
+ strokeDashArray.push(length, 0);
3712
+ }, "addBorder");
3713
+ const skipBorder = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((length) => {
3714
+ strokeDashArray.push(0, length);
3715
+ }, "skipBorder");
3716
+ if (borders.includes("t")) {
3717
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("add top border");
3718
+ addBorder(totalWidth);
3719
+ } else {
3720
+ skipBorder(totalWidth);
3721
+ }
3722
+ if (borders.includes("r")) {
3723
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("add right border");
3724
+ addBorder(totalHeight);
3725
+ } else {
3726
+ skipBorder(totalHeight);
3727
+ }
3728
+ if (borders.includes("b")) {
3729
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("add bottom border");
3730
+ addBorder(totalWidth);
3731
+ } else {
3732
+ skipBorder(totalWidth);
3733
+ }
3734
+ if (borders.includes("l")) {
3735
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("add left border");
3736
+ addBorder(totalHeight);
3737
+ } else {
3738
+ skipBorder(totalHeight);
3739
+ }
3740
+ rect2.attr("stroke-dasharray", strokeDashArray.join(" "));
3741
+ }
3742
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(applyNodePropertyBorders, "applyNodePropertyBorders");
3743
+ var rectWithTitle = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((parent, node) => {
3744
+ let classes2;
3745
+ if (!node.classes) {
3746
+ classes2 = "node default";
3747
+ } else {
3748
+ classes2 = "node " + node.classes;
3749
+ }
3750
+ const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node.domId || node.id);
3751
+ const rect2 = shapeSvg.insert("rect", ":first-child");
3752
+ const innerLine = shapeSvg.insert("line");
3753
+ const label = shapeSvg.insert("g").attr("class", "label");
3754
+ const text2 = node.labelText.flat ? node.labelText.flat() : node.labelText;
3755
+ let title = "";
3756
+ if (typeof text2 === "object") {
3757
+ title = text2[0];
3758
+ } else {
3759
+ title = text2;
3760
+ }
3761
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("Label text abc79", title, text2, typeof text2 === "object");
3762
+ const text = label.node().appendChild(createLabel_default(title, node.labelStyle, true, true));
3763
+ let bbox = { width: 0, height: 0 };
3764
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
3765
+ const div = text.children[0];
3766
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(text);
3767
+ bbox = div.getBoundingClientRect();
3768
+ dv.attr("width", bbox.width);
3769
+ dv.attr("height", bbox.height);
3770
+ }
3771
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("Text 2", text2);
3772
+ const textRows = text2.slice(1, text2.length);
3773
+ let titleBox = text.getBBox();
3774
+ const descr = label.node().appendChild(
3775
+ createLabel_default(textRows.join ? textRows.join("<br/>") : textRows, node.labelStyle, true, true)
3776
+ );
3777
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
3778
+ const div = descr.children[0];
3779
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(descr);
3780
+ bbox = div.getBoundingClientRect();
3781
+ dv.attr("width", bbox.width);
3782
+ dv.attr("height", bbox.height);
3783
+ }
3784
+ const halfPadding = node.padding / 2;
3785
+ (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(descr).attr(
3786
+ "transform",
3787
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
3788
+ (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
3789
+ );
3790
+ (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(text).attr(
3791
+ "transform",
3792
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
3793
+ (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
3794
+ );
3795
+ bbox = label.node().getBBox();
3796
+ label.attr(
3797
+ "transform",
3798
+ "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
3799
+ );
3800
+ 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);
3801
+ 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);
3802
+ updateNodeBounds(node, rect2);
3803
+ node.intersect = function(point2) {
3804
+ return intersect_default.rect(node, point2);
3805
+ };
3806
+ return shapeSvg;
3807
+ }, "rectWithTitle");
3808
+ var stadium = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3809
+ const { shapeSvg, bbox } = await labelHelper(
3810
+ parent,
3811
+ node,
3812
+ getClassesFromNode(node, void 0),
3813
+ true
3814
+ );
3815
+ const h = bbox.height + node.padding;
3816
+ const w = bbox.width + h / 4 + node.padding;
3817
+ 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);
3818
+ updateNodeBounds(node, rect2);
3819
+ node.intersect = function(point2) {
3820
+ return intersect_default.rect(node, point2);
3821
+ };
3822
+ return shapeSvg;
3823
+ }, "stadium");
3824
+ var circle2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3825
+ const { shapeSvg, bbox, halfPadding } = await labelHelper(
3826
+ parent,
3827
+ node,
3828
+ getClassesFromNode(node, void 0),
3829
+ true
3830
+ );
3831
+ const circle3 = shapeSvg.insert("circle", ":first-child");
3832
+ 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);
3833
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("Circle main");
3834
+ updateNodeBounds(node, circle3);
3835
+ node.intersect = function(point2) {
3836
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("Circle intersect", node, bbox.width / 2 + halfPadding, point2);
3837
+ return intersect_default.circle(node, bbox.width / 2 + halfPadding, point2);
3838
+ };
3839
+ return shapeSvg;
3840
+ }, "circle");
3841
+ var doublecircle = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3842
+ const { shapeSvg, bbox, halfPadding } = await labelHelper(
3843
+ parent,
3844
+ node,
3845
+ getClassesFromNode(node, void 0),
3846
+ true
3847
+ );
3848
+ const gap = 5;
3849
+ const circleGroup = shapeSvg.insert("g", ":first-child");
3850
+ const outerCircle = circleGroup.insert("circle");
3851
+ const innerCircle = circleGroup.insert("circle");
3852
+ circleGroup.attr("class", node.class);
3853
+ 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);
3854
+ 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);
3855
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("DoubleCircle main");
3856
+ updateNodeBounds(node, outerCircle);
3857
+ node.intersect = function(point2) {
3858
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.info("DoubleCircle intersect", node, bbox.width / 2 + halfPadding + gap, point2);
3859
+ return intersect_default.circle(node, bbox.width / 2 + halfPadding + gap, point2);
3860
+ };
3861
+ return shapeSvg;
3862
+ }, "doublecircle");
3863
+ var subroutine = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (parent, node) => {
3864
+ const { shapeSvg, bbox } = await labelHelper(
3865
+ parent,
3866
+ node,
3867
+ getClassesFromNode(node, void 0),
3868
+ true
3869
+ );
3870
+ const w = bbox.width + node.padding;
3871
+ const h = bbox.height + node.padding;
3872
+ const points = [
3873
+ { x: 0, y: 0 },
3874
+ { x: w, y: 0 },
3875
+ { x: w, y: -h },
3876
+ { x: 0, y: -h },
3877
+ { x: 0, y: 0 },
3878
+ { x: -8, y: 0 },
3879
+ { x: w + 8, y: 0 },
3880
+ { x: w + 8, y: -h },
3881
+ { x: -8, y: -h },
3882
+ { x: -8, y: 0 }
3883
+ ];
3884
+ const el = insertPolygonShape(shapeSvg, w, h, points);
3885
+ el.attr("style", node.style);
3886
+ updateNodeBounds(node, el);
3887
+ node.intersect = function(point2) {
3888
+ return intersect_default.polygon(node, points, point2);
3889
+ };
3890
+ return shapeSvg;
3891
+ }, "subroutine");
3892
+ var start = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((parent, node) => {
3893
+ const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
3894
+ const circle3 = shapeSvg.insert("circle", ":first-child");
3895
+ circle3.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
3896
+ updateNodeBounds(node, circle3);
3897
+ node.intersect = function(point2) {
3898
+ return intersect_default.circle(node, 7, point2);
3899
+ };
3900
+ return shapeSvg;
3901
+ }, "start");
3902
+ var forkJoin = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((parent, node, dir) => {
3903
+ const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
3904
+ let width = 70;
3905
+ let height = 10;
3906
+ if (dir === "LR") {
3907
+ width = 10;
3908
+ height = 70;
3909
+ }
3910
+ 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");
3911
+ updateNodeBounds(node, shape);
3912
+ node.height = node.height + node.padding / 2;
3913
+ node.width = node.width + node.padding / 2;
3914
+ node.intersect = function(point2) {
3915
+ return intersect_default.rect(node, point2);
3916
+ };
3917
+ return shapeSvg;
3918
+ }, "forkJoin");
3919
+ var end = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((parent, node) => {
3920
+ const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
3921
+ const innerCircle = shapeSvg.insert("circle", ":first-child");
3922
+ const circle3 = shapeSvg.insert("circle", ":first-child");
3923
+ circle3.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
3924
+ innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10);
3925
+ updateNodeBounds(node, circle3);
3926
+ node.intersect = function(point2) {
3927
+ return intersect_default.circle(node, 7, point2);
3928
+ };
3929
+ return shapeSvg;
3930
+ }, "end");
3931
+ var class_box = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((parent, node) => {
3932
+ const halfPadding = node.padding / 2;
3933
+ const rowPadding = 4;
3934
+ const lineHeight = 8;
3935
+ let classes2;
3936
+ if (!node.classes) {
3937
+ classes2 = "node default";
3938
+ } else {
3939
+ classes2 = "node " + node.classes;
3940
+ }
3941
+ const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node.domId || node.id);
3942
+ const rect2 = shapeSvg.insert("rect", ":first-child");
3943
+ const topLine = shapeSvg.insert("line");
3944
+ const bottomLine = shapeSvg.insert("line");
3945
+ let maxWidth = 0;
3946
+ let maxHeight = rowPadding;
3947
+ const labelContainer = shapeSvg.insert("g").attr("class", "label");
3948
+ let verticalPos = 0;
3949
+ const hasInterface = node.classData.annotations?.[0];
3950
+ const interfaceLabelText = node.classData.annotations[0] ? "\xAB" + node.classData.annotations[0] + "\xBB" : "";
3951
+ const interfaceLabel = labelContainer.node().appendChild(createLabel_default(interfaceLabelText, node.labelStyle, true, true));
3952
+ let interfaceBBox = interfaceLabel.getBBox();
3953
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
3954
+ const div = interfaceLabel.children[0];
3955
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(interfaceLabel);
3956
+ interfaceBBox = div.getBoundingClientRect();
3957
+ dv.attr("width", interfaceBBox.width);
3958
+ dv.attr("height", interfaceBBox.height);
3959
+ }
3960
+ if (node.classData.annotations[0]) {
3961
+ maxHeight += interfaceBBox.height + rowPadding;
3962
+ maxWidth += interfaceBBox.width;
3963
+ }
3964
+ let classTitleString = node.classData.label;
3965
+ if (node.classData.type !== void 0 && node.classData.type !== "") {
3966
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
3967
+ classTitleString += "&lt;" + node.classData.type + "&gt;";
3968
+ } else {
3969
+ classTitleString += "<" + node.classData.type + ">";
3970
+ }
3971
+ }
3972
+ const classTitleLabel = labelContainer.node().appendChild(createLabel_default(classTitleString, node.labelStyle, true, true));
3973
+ (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(classTitleLabel).attr("class", "classTitle");
3974
+ let classTitleBBox = classTitleLabel.getBBox();
3975
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
3976
+ const div = classTitleLabel.children[0];
3977
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(classTitleLabel);
3978
+ classTitleBBox = div.getBoundingClientRect();
3979
+ dv.attr("width", classTitleBBox.width);
3980
+ dv.attr("height", classTitleBBox.height);
3981
+ }
3982
+ maxHeight += classTitleBBox.height + rowPadding;
3983
+ if (classTitleBBox.width > maxWidth) {
3984
+ maxWidth = classTitleBBox.width;
3985
+ }
3986
+ const classAttributes = [];
3987
+ node.classData.members.forEach((member) => {
3988
+ const parsedInfo = member.getDisplayDetails();
3989
+ let parsedText = parsedInfo.displayText;
3990
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
3991
+ parsedText = parsedText.replace(/</g, "&lt;").replace(/>/g, "&gt;");
3992
+ }
3993
+ const lbl = labelContainer.node().appendChild(
3994
+ createLabel_default(
3995
+ parsedText,
3996
+ parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,
3997
+ true,
3998
+ true
3999
+ )
4000
+ );
4001
+ let bbox = lbl.getBBox();
4002
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
4003
+ const div = lbl.children[0];
4004
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(lbl);
4005
+ bbox = div.getBoundingClientRect();
4006
+ dv.attr("width", bbox.width);
4007
+ dv.attr("height", bbox.height);
4008
+ }
4009
+ if (bbox.width > maxWidth) {
4010
+ maxWidth = bbox.width;
4011
+ }
4012
+ maxHeight += bbox.height + rowPadding;
4013
+ classAttributes.push(lbl);
4014
+ });
4015
+ maxHeight += lineHeight;
4016
+ const classMethods = [];
4017
+ node.classData.methods.forEach((member) => {
4018
+ const parsedInfo = member.getDisplayDetails();
4019
+ let displayText = parsedInfo.displayText;
4020
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
4021
+ displayText = displayText.replace(/</g, "&lt;").replace(/>/g, "&gt;");
4022
+ }
4023
+ const lbl = labelContainer.node().appendChild(
4024
+ createLabel_default(
4025
+ displayText,
4026
+ parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,
4027
+ true,
4028
+ true
4029
+ )
4030
+ );
4031
+ let bbox = lbl.getBBox();
4032
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .evaluate */ ._3)((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
4033
+ const div = lbl.children[0];
4034
+ const dv = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(lbl);
4035
+ bbox = div.getBoundingClientRect();
4036
+ dv.attr("width", bbox.width);
4037
+ dv.attr("height", bbox.height);
4038
+ }
4039
+ if (bbox.width > maxWidth) {
4040
+ maxWidth = bbox.width;
4041
+ }
4042
+ maxHeight += bbox.height + rowPadding;
4043
+ classMethods.push(lbl);
4044
+ });
4045
+ maxHeight += lineHeight;
4046
+ if (hasInterface) {
4047
+ let diffX2 = (maxWidth - interfaceBBox.width) / 2;
4048
+ (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(interfaceLabel).attr(
4049
+ "transform",
4050
+ "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")"
4051
+ );
4052
+ verticalPos = interfaceBBox.height + rowPadding;
4053
+ }
4054
+ let diffX = (maxWidth - classTitleBBox.width) / 2;
4055
+ (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(classTitleLabel).attr(
4056
+ "transform",
4057
+ "translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
4058
+ );
4059
+ verticalPos += classTitleBBox.height + rowPadding;
4060
+ 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);
4061
+ verticalPos += lineHeight;
4062
+ classAttributes.forEach((lbl) => {
4063
+ (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(lbl).attr(
4064
+ "transform",
4065
+ "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")"
4066
+ );
4067
+ const memberBBox = lbl?.getBBox();
4068
+ verticalPos += (memberBBox?.height ?? 0) + rowPadding;
4069
+ });
4070
+ verticalPos += lineHeight;
4071
+ 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);
4072
+ verticalPos += lineHeight;
4073
+ classMethods.forEach((lbl) => {
4074
+ (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(lbl).attr(
4075
+ "transform",
4076
+ "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
4077
+ );
4078
+ const memberBBox = lbl?.getBBox();
4079
+ verticalPos += (memberBBox?.height ?? 0) + rowPadding;
4080
+ });
4081
+ 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);
4082
+ updateNodeBounds(node, rect2);
4083
+ node.intersect = function(point2) {
4084
+ return intersect_default.rect(node, point2);
4085
+ };
4086
+ return shapeSvg;
4087
+ }, "class_box");
4088
+ var shapes = {
4089
+ rhombus: question,
4090
+ composite,
4091
+ question,
4092
+ rect,
4093
+ labelRect,
4094
+ rectWithTitle,
4095
+ choice,
4096
+ circle: circle2,
4097
+ doublecircle,
4098
+ stadium,
4099
+ hexagon,
4100
+ block_arrow,
4101
+ rect_left_inv_arrow,
4102
+ lean_right,
4103
+ lean_left,
4104
+ trapezoid,
4105
+ inv_trapezoid,
4106
+ rect_right_inv_arrow,
4107
+ cylinder,
4108
+ start,
4109
+ end,
4110
+ note: note_default,
4111
+ subroutine,
4112
+ fork: forkJoin,
4113
+ join: forkJoin,
4114
+ class_box
4115
+ };
4116
+ var nodeElems = {};
4117
+ var insertNode = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async (elem, node, renderOptions) => {
4118
+ let newEl;
4119
+ let el;
4120
+ if (node.link) {
4121
+ let target;
4122
+ if ((0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig2 */ .D7)().securityLevel === "sandbox") {
4123
+ target = "_top";
4124
+ } else if (node.linkTarget) {
4125
+ target = node.linkTarget || "_blank";
4126
+ }
4127
+ newEl = elem.insert("svg:a").attr("xlink:href", node.link).attr("target", target);
4128
+ el = await shapes[node.shape](newEl, node, renderOptions);
4129
+ } else {
4130
+ el = await shapes[node.shape](elem, node, renderOptions);
4131
+ newEl = el;
4132
+ }
4133
+ if (node.tooltip) {
4134
+ el.attr("title", node.tooltip);
4135
+ }
4136
+ if (node.class) {
4137
+ el.attr("class", "node default " + node.class);
4138
+ }
4139
+ nodeElems[node.id] = newEl;
4140
+ if (node.haveCallback) {
4141
+ nodeElems[node.id].attr("class", nodeElems[node.id].attr("class") + " clickable");
4142
+ }
4143
+ return newEl;
4144
+ }, "insertNode");
4145
+ var positionNode = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)((node) => {
4146
+ const el = nodeElems[node.id];
4147
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.trace(
4148
+ "Transforming node",
4149
+ node.diff,
4150
+ node,
4151
+ "translate(" + (node.x - node.width / 2 - 5) + ", " + node.width / 2 + ")"
4152
+ );
4153
+ const padding2 = 8;
4154
+ const diff = node.diff || 0;
4155
+ if (node.clusterNode) {
4156
+ el.attr(
4157
+ "transform",
4158
+ "translate(" + (node.x + diff - node.width / 2) + ", " + (node.y - node.height / 2 - padding2) + ")"
4159
+ );
4160
+ } else {
4161
+ el.attr("transform", "translate(" + node.x + ", " + node.y + ")");
4162
+ }
4163
+ return diff;
4164
+ }, "positionNode");
4165
+
4166
+ // src/diagrams/block/renderHelpers.ts
4167
+ function getNodeFromBlock(block, db2, positioned = false) {
4168
+ const vertex = block;
4169
+ let classStr = "default";
4170
+ if ((vertex?.classes?.length || 0) > 0) {
4171
+ classStr = (vertex?.classes ?? []).join(" ");
4172
+ }
4173
+ classStr = classStr + " flowchart-label";
4174
+ let radius = 0;
4175
+ let shape = "";
4176
+ let padding2;
4177
+ switch (vertex.type) {
4178
+ case "round":
4179
+ radius = 5;
4180
+ shape = "rect";
4181
+ break;
4182
+ case "composite":
4183
+ radius = 0;
4184
+ shape = "composite";
4185
+ padding2 = 0;
4186
+ break;
4187
+ case "square":
4188
+ shape = "rect";
4189
+ break;
4190
+ case "diamond":
4191
+ shape = "question";
4192
+ break;
4193
+ case "hexagon":
4194
+ shape = "hexagon";
4195
+ break;
4196
+ case "block_arrow":
4197
+ shape = "block_arrow";
4198
+ break;
4199
+ case "odd":
4200
+ shape = "rect_left_inv_arrow";
4201
+ break;
4202
+ case "lean_right":
4203
+ shape = "lean_right";
4204
+ break;
4205
+ case "lean_left":
4206
+ shape = "lean_left";
4207
+ break;
4208
+ case "trapezoid":
4209
+ shape = "trapezoid";
4210
+ break;
4211
+ case "inv_trapezoid":
4212
+ shape = "inv_trapezoid";
4213
+ break;
4214
+ case "rect_left_inv_arrow":
4215
+ shape = "rect_left_inv_arrow";
4216
+ break;
4217
+ case "circle":
4218
+ shape = "circle";
4219
+ break;
4220
+ case "ellipse":
4221
+ shape = "ellipse";
4222
+ break;
4223
+ case "stadium":
4224
+ shape = "stadium";
4225
+ break;
4226
+ case "subroutine":
4227
+ shape = "subroutine";
4228
+ break;
4229
+ case "cylinder":
4230
+ shape = "cylinder";
4231
+ break;
4232
+ case "group":
4233
+ shape = "rect";
4234
+ break;
4235
+ case "doublecircle":
4236
+ shape = "doublecircle";
4237
+ break;
4238
+ default:
4239
+ shape = "rect";
4240
+ }
4241
+ const styles = (0,_chunk_O4NI6UNU_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getStylesFromArray */ .sM)(vertex?.styles ?? []);
4242
+ const vertexText = vertex.label;
4243
+ const bounds = vertex.size ?? { width: 0, height: 0, x: 0, y: 0 };
4244
+ const node = {
4245
+ labelStyle: styles.labelStyle,
4246
+ shape,
4247
+ labelText: vertexText,
4248
+ rx: radius,
4249
+ ry: radius,
4250
+ class: classStr,
4251
+ style: styles.style,
4252
+ id: vertex.id,
4253
+ directions: vertex.directions,
4254
+ width: bounds.width,
4255
+ height: bounds.height,
4256
+ x: bounds.x,
4257
+ y: bounds.y,
4258
+ positioned,
4259
+ intersect: void 0,
4260
+ type: vertex.type,
4261
+ padding: padding2 ?? (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .zj)()?.block?.padding ?? 0
4262
+ };
4263
+ return node;
4264
+ }
4265
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(getNodeFromBlock, "getNodeFromBlock");
4266
+ async function calculateBlockSize(elem, block, db2) {
4267
+ const node = getNodeFromBlock(block, db2, false);
4268
+ if (node.type === "group") {
4269
+ return;
4270
+ }
4271
+ const config2 = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .zj)();
4272
+ const nodeEl = await insertNode(elem, node, { config: config2 });
4273
+ const boundingBox = nodeEl.node().getBBox();
4274
+ const obj = db2.getBlock(node.id);
4275
+ obj.size = { width: boundingBox.width, height: boundingBox.height, x: 0, y: 0, node: nodeEl };
4276
+ db2.setBlock(obj);
4277
+ nodeEl.remove();
4278
+ }
4279
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(calculateBlockSize, "calculateBlockSize");
4280
+ async function insertBlockPositioned(elem, block, db2) {
4281
+ const node = getNodeFromBlock(block, db2, true);
4282
+ const obj = db2.getBlock(node.id);
4283
+ if (obj.type !== "space") {
4284
+ const config2 = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .zj)();
4285
+ await insertNode(elem, node, { config: config2 });
4286
+ block.intersect = node?.intersect;
4287
+ positionNode(node);
4288
+ }
4289
+ }
4290
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(insertBlockPositioned, "insertBlockPositioned");
4291
+ async function performOperations(elem, blocks2, db2, operation) {
4292
+ for (const block of blocks2) {
4293
+ await operation(elem, block, db2);
4294
+ if (block.children) {
4295
+ await performOperations(elem, block.children, db2, operation);
4296
+ }
4297
+ }
4298
+ }
4299
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(performOperations, "performOperations");
4300
+ async function calculateBlockSizes(elem, blocks2, db2) {
4301
+ await performOperations(elem, blocks2, db2, calculateBlockSize);
4302
+ }
4303
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(calculateBlockSizes, "calculateBlockSizes");
4304
+ async function insertBlocks(elem, blocks2, db2) {
4305
+ await performOperations(elem, blocks2, db2, insertBlockPositioned);
4306
+ }
4307
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(insertBlocks, "insertBlocks");
4308
+ async function insertEdges(elem, edges, blocks2, db2, id) {
4309
+ const g = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_9__/* .Graph */ .T({
4310
+ multigraph: true,
4311
+ compound: true
4312
+ });
4313
+ g.setGraph({
4314
+ rankdir: "TB",
4315
+ nodesep: 10,
4316
+ ranksep: 10,
4317
+ marginx: 8,
4318
+ marginy: 8
4319
+ });
4320
+ for (const block of blocks2) {
4321
+ if (block.size) {
4322
+ g.setNode(block.id, {
4323
+ width: block.size.width,
4324
+ height: block.size.height,
4325
+ intersect: block.intersect
4326
+ });
4327
+ }
4328
+ }
4329
+ for (const edge of edges) {
4330
+ if (edge.start && edge.end) {
4331
+ const startBlock = db2.getBlock(edge.start);
4332
+ const endBlock = db2.getBlock(edge.end);
4333
+ if (startBlock?.size && endBlock?.size) {
4334
+ const start2 = startBlock.size;
4335
+ const end2 = endBlock.size;
4336
+ const points = [
4337
+ { x: start2.x, y: start2.y },
4338
+ { x: start2.x + (end2.x - start2.x) / 2, y: start2.y + (end2.y - start2.y) / 2 },
4339
+ { x: end2.x, y: end2.y }
4340
+ ];
4341
+ insertEdge(
4342
+ elem,
4343
+ { v: edge.start, w: edge.end, name: edge.id },
4344
+ {
4345
+ ...edge,
4346
+ arrowTypeEnd: edge.arrowTypeEnd,
4347
+ arrowTypeStart: edge.arrowTypeStart,
4348
+ points,
4349
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
4350
+ },
4351
+ void 0,
4352
+ "block",
4353
+ g,
4354
+ id
4355
+ );
4356
+ if (edge.label) {
4357
+ await insertEdgeLabel(elem, {
4358
+ ...edge,
4359
+ label: edge.label,
4360
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
4361
+ arrowTypeEnd: edge.arrowTypeEnd,
4362
+ arrowTypeStart: edge.arrowTypeStart,
4363
+ points,
4364
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
4365
+ });
4366
+ positionEdgeLabel(
4367
+ { ...edge, x: points[1].x, y: points[1].y },
4368
+ {
4369
+ originalPath: points
4370
+ }
4371
+ );
4372
+ }
4373
+ }
4374
+ }
4375
+ }
4376
+ }
4377
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(insertEdges, "insertEdges");
4378
+
4379
+ // src/diagrams/block/blockRenderer.ts
4380
+ var getClasses2 = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(function(text, diagObj) {
4381
+ return diagObj.db.getClasses();
4382
+ }, "getClasses");
4383
+ var draw = /* @__PURE__ */ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .__name */ .K2)(async function(text, id, _version, diagObj) {
4384
+ const { securityLevel, block: conf } = (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .zj)();
4385
+ const db2 = diagObj.db;
4386
+ let sandboxElement;
4387
+ if (securityLevel === "sandbox") {
4388
+ sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)("#i" + id);
4389
+ }
4390
+ const root = securityLevel === "sandbox" ? (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)("body");
4391
+ const svg = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : (0,d3__WEBPACK_IMPORTED_MODULE_8__/* .select */ .Ltv)(`[id="${id}"]`);
4392
+ const markers2 = ["point", "circle", "cross"];
4393
+ markers_default(svg, markers2, diagObj.type, id);
4394
+ const bl = db2.getBlocks();
4395
+ const blArr = db2.getBlocksFlat();
4396
+ const edges = db2.getEdges();
4397
+ const nodes = svg.insert("g").attr("class", "block");
4398
+ await calculateBlockSizes(nodes, bl, db2);
4399
+ const bounds = layout(db2);
4400
+ await insertBlocks(nodes, bl, db2);
4401
+ await insertEdges(nodes, edges, blArr, db2, id);
4402
+ if (bounds) {
4403
+ const bounds2 = bounds;
4404
+ const magicFactor = Math.max(1, Math.round(0.125 * (bounds2.width / bounds2.height)));
4405
+ const height = bounds2.height + magicFactor + 10;
4406
+ const width = bounds2.width + 10;
4407
+ const { useMaxWidth } = conf;
4408
+ (0,_chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .configureSvgSize */ .a$)(svg, height, width, !!useMaxWidth);
4409
+ _chunk_YTJNT7DU_mjs__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm.debug("Here Bounds", bounds, bounds2);
4410
+ svg.attr(
4411
+ "viewBox",
4412
+ `${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`
4413
+ );
4414
+ }
4415
+ }, "draw");
4416
+ var blockRenderer_default = {
4417
+ draw,
4418
+ getClasses: getClasses2
4419
+ };
4420
+
4421
+ // src/diagrams/block/blockDiagram.ts
4422
+ var diagram = {
4423
+ parser: block_default,
4424
+ db: blockDB_default,
4425
+ renderer: blockRenderer_default,
4426
+ styles: styles_default
4427
+ };
4428
+
4429
+
4430
+
4431
+ /***/ })
4432
+
4433
+ };
4434
+ ;
4435
+ //# sourceMappingURL=364.node.js.map