@zombie-mermaid/svg-renderer 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DEFAULTS as e, buildStyleBlock as t, checkGraphSize as n, checkLimit as r, detectDiagramType as i, dropInvalidColors as a, escapeAttr as o, escapeXml as s, extractAccessibility as c, f as l, formatCssColor as u, getReadableTextColor as d, isMonospaceFont as f, measureMultilineText as p, measureTextWidth as m, mixSrgb as h, niceTickValues as g, niceTickValues as _, parseCssColor as v, renderMultilineText as y, renderMultilineTextWithBackground as b, resolveNodeStyle as x, safeHref as S, sanitizeClassName as C, setMonospaceMetrics as w, splitStatements as T, styleOpenTag as E, subgraphDirectionIsHonored as D, svgOpenTag as O, themeStyleDeclarations as k, withDirectionOverride as A, withoutOwnClusterEdges as ee } from "@zombie-mermaid/core";
2
- import { CHART_ACCENT_FALLBACK as j, architectureToGraph as M, c4BoundaryTypeLine as N, c4RelLabelLines as P, c4TypeLine as te, formatClassMember as F, getSeriesColor as ne, parseArchitecture as re, parseC4Diagram as ie, parseClassDiagram as ae, parseErDiagram as oe, parseMermaid as se, parsePieChart as ce, parseSequenceDiagram as le, parseXYChart as ue } from "@zombie-mermaid/mermaid-parser";
2
+ import { CHART_ACCENT_FALLBACK as j, architectureToGraph as M, c4BoundaryTypeLine as N, c4RelLabelLines as P, c4TypeLine as te, formatClassMember as ne, getSeriesColor as F, parseArchitecture as re, parseC4Diagram as ie, parseClassDiagram as ae, parseErDiagram as oe, parseMermaid as se, parsePieChart as ce, parseSequenceDiagram as le, parseXYChart as ue } from "@zombie-mermaid/mermaid-parser";
3
3
  import { decodeXML as de } from "entities";
4
4
  //#region packages/svg-renderer/src/edge-curves.ts
5
5
  function fe(e) {
@@ -198,11 +198,11 @@ var L = {
198
198
  outerBox: 1,
199
199
  innerBox: .75,
200
200
  connector: 1
201
- }, z = "0.35em", Be = {
201
+ }, z = "0.35em", B = {
202
202
  width: 8,
203
203
  height: 5
204
204
  };
205
- function Ve(e, n, r) {
205
+ function Be(e, n, r) {
206
206
  return t(e, n ? {
207
207
  family: je,
208
208
  faceCss: Me
@@ -210,7 +210,7 @@ function Ve(e, n, r) {
210
210
  }
211
211
  //#endregion
212
212
  //#region packages/svg-renderer/src/layout-engine/constants.ts
213
- var B = {
213
+ var V = {
214
214
  font: "Inter",
215
215
  padding: 40,
216
216
  nodeSpacing: 28,
@@ -221,8 +221,69 @@ var B = {
221
221
  };
222
222
  //#endregion
223
223
  //#region packages/svg-renderer/src/layout-engine/back-edges.ts
224
- function He(e, t) {
225
- return Ue(e.edges, t ?? e.nodes.keys());
224
+ function Ve(e, t, n = /* @__PURE__ */ new Set()) {
225
+ let r = e.edges.map((e, t) => n.has(t) ? {
226
+ source: e.target,
227
+ target: e.source
228
+ } : e), i = new Set(n);
229
+ for (let n of Ue(r, t ?? e.nodes.keys())) i.delete(n) || i.add(n);
230
+ return i;
231
+ }
232
+ function He(e) {
233
+ let t = /* @__PURE__ */ new Map(), n = (e, r) => {
234
+ for (let i of e) {
235
+ t.set(i.id, r);
236
+ for (let e of i.nodeIds) t.set(e, i.id);
237
+ n(i.children, i.id);
238
+ }
239
+ };
240
+ n(e.subgraphs, "");
241
+ let r = (e) => {
242
+ let n = [e];
243
+ for (let r = t.get(e); r; r = t.get(r)) n.push(r);
244
+ return n;
245
+ }, i = /* @__PURE__ */ new Map();
246
+ e.edges.forEach((e, t) => {
247
+ let n = r(e.source), a = r(e.target);
248
+ if (n.includes(e.target) || a.includes(e.source)) return;
249
+ let o = n.find((e) => a.includes(e)) ?? "", s = (e) => o === "" ? e[e.length - 1] : e[e.indexOf(o) - 1], c = s(n), l = s(a), u = i.get(o) ?? [];
250
+ u.push({
251
+ index: t,
252
+ from: c,
253
+ to: l,
254
+ lifted: c !== e.source || l !== e.target
255
+ }), i.set(o, u);
256
+ });
257
+ let a = /* @__PURE__ */ new Set();
258
+ for (let e of i.values()) {
259
+ let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
260
+ for (let r of e) {
261
+ for (let e of [r.from, r.to]) t.has(e) || (t.set(e, []), n.set(e, 0));
262
+ t.get(r.from).push(r), n.set(r.to, n.get(r.to) + 1);
263
+ }
264
+ let r = [...t.keys()], i = /* @__PURE__ */ new Map();
265
+ for (let e of [...r.filter((e) => n.get(e) === 0), ...r]) {
266
+ if (i.has(e)) continue;
267
+ i.set(e, "open");
268
+ let n = [{
269
+ id: e,
270
+ next: 0
271
+ }];
272
+ for (; n.length > 0;) {
273
+ let e = n[n.length - 1], r = t.get(e.id);
274
+ if (e.next >= r.length) {
275
+ i.set(e.id, "done"), n.pop();
276
+ continue;
277
+ }
278
+ let o = r[e.next++], s = i.get(o.to);
279
+ s === "open" ? o.lifted && a.add(o.index) : s === void 0 && (i.set(o.to, "open"), n.push({
280
+ id: o.to,
281
+ next: 0
282
+ }));
283
+ }
284
+ }
285
+ }
286
+ return a;
226
287
  }
227
288
  function Ue(e, t) {
228
289
  let n = /* @__PURE__ */ new Map();
@@ -329,7 +390,7 @@ function et(e) {
329
390
  for (let t of e.nodes.values()) if (t.shape === "state-start" || t.shape === "state-end") return !0;
330
391
  return !1;
331
392
  }
332
- var V = {
393
+ var H = {
333
394
  top: 44,
334
395
  left: 16,
335
396
  bottom: 16,
@@ -339,22 +400,33 @@ var V = {
339
400
  left: 16,
340
401
  bottom: 16,
341
402
  right: 16
342
- }, nt = /* @__PURE__ */ new WeakMap();
343
- function rt(e, t) {
344
- let n = nt.get(e);
345
- return n || (n = et(e) || ut(e.subgraphs) ? /* @__PURE__ */ new Set() : He(e, t?.walkOrder), nt.set(e, n)), n;
403
+ };
404
+ function nt(e) {
405
+ let t = /* @__PURE__ */ new Map();
406
+ for (let n of e.edges) {
407
+ if (!n.label) continue;
408
+ let e = `${n.source}\0${n.target}`, r = (t.get(e) ?? 0) + 1;
409
+ if (r >= 3) return !0;
410
+ t.set(e, r);
411
+ }
412
+ return !1;
346
413
  }
414
+ var rt = /* @__PURE__ */ new WeakMap();
347
415
  function it(e, t) {
416
+ let n = rt.get(e);
417
+ return n || (n = et(e) || dt(e.subgraphs) ? /* @__PURE__ */ new Set() : Ve(e, t?.walkOrder, t?.feedbackEdges ?? He(e)), rt.set(e, n)), n;
418
+ }
419
+ function at(e, t) {
348
420
  for (let n = 0; n < e.edges.length; n++) {
349
421
  let r = e.edges[n];
350
422
  if (t.has(r.source) || t.has(r.target)) return n;
351
423
  }
352
424
  return Infinity;
353
425
  }
354
- function at(e) {
426
+ function ot(e) {
355
427
  return Ge(e, We.flowchart);
356
428
  }
357
- function ot(e) {
429
+ function st(e) {
358
430
  return {
359
431
  ...qe(e),
360
432
  "elk.spacing.edgeEdge": "12",
@@ -364,13 +436,13 @@ function ot(e) {
364
436
  "elk.contentAlignment": "H_CENTER V_CENTER"
365
437
  };
366
438
  }
367
- function st(e) {
439
+ function ct(e) {
368
440
  return {
369
441
  fontSize: e.fontSizes.edgeLabel,
370
442
  layoutOptions: Ye
371
443
  };
372
444
  }
373
- function ct(e, t, n, r) {
445
+ function lt(e, t, n, r) {
374
446
  let i = p(t, r, L.nodeLabel), a = i.width + ze.horizontal * 2, o = i.height + ze.vertical * 2;
375
447
  if (n === "diamond") {
376
448
  let e = Math.max(a, o) + ze.diamondExtra;
@@ -391,16 +463,16 @@ function ct(e, t, n, r) {
391
463
  height: o
392
464
  });
393
465
  }
394
- var lt = " root";
395
- function ut(e) {
396
- for (let t of e) if (t.direction !== void 0 || ut(t.children)) return !0;
466
+ var ut = " root";
467
+ function dt(e) {
468
+ for (let t of e) if (t.direction !== void 0 || dt(t.children)) return !0;
397
469
  return !1;
398
470
  }
399
- function dt(e, t) {
471
+ function ft(e, t) {
400
472
  for (let n of e.nodeIds) t.add(n);
401
- for (let n of e.children) dt(n, t);
473
+ for (let n of e.children) ft(n, t);
402
474
  }
403
- function ft(e) {
475
+ function pt(e) {
404
476
  let t = /* @__PURE__ */ new Map();
405
477
  function n(e, r) {
406
478
  let i = [...r, e.id];
@@ -410,15 +482,15 @@ function ft(e) {
410
482
  for (let t of e) n(t, []);
411
483
  return t;
412
484
  }
413
- function pt(e, t) {
485
+ function mt(e, t) {
414
486
  let n = 0;
415
487
  for (; n < e.length && n < t.length && e[n] === t[n];) n++;
416
488
  return n;
417
489
  }
418
- function mt(e, t, n) {
490
+ function ht(e, t, n) {
419
491
  let r = t, i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
420
- for (let t of e.subgraphs) a.add(t.id), gt(t, i, a);
421
- let o = _t(e.subgraphs), s = ft(e.subgraphs), c = (e) => e ? s.get(e) ?? [] : [], l = /* @__PURE__ */ new Map();
492
+ for (let t of e.subgraphs) a.add(t.id), _t(t, i, a);
493
+ let o = vt(e.subgraphs), s = pt(e.subgraphs), c = (e) => e ? s.get(e) ?? [] : [], l = /* @__PURE__ */ new Map();
422
494
  l.set(null, []);
423
495
  let u = [];
424
496
  for (let t = 0; t < e.edges.length; t++) {
@@ -439,18 +511,19 @@ function mt(e, t, n) {
439
511
  tgtChain: c(i)
440
512
  });
441
513
  }
442
- let d = ut(e.subgraphs), f = [], p = [], m = {
443
- ...ot({
444
- direction: at(e.direction),
514
+ let d = dt(e.subgraphs), f = [], p = [], m = {
515
+ ...st({
516
+ direction: ot(e.direction),
445
517
  nodeSpacing: r.nodeSpacing,
446
518
  layerSpacing: r.layerSpacing,
447
519
  padding: r.padding
448
520
  }),
449
- "elk.layered.thoroughness": String(B.thoroughness),
521
+ "elk.layered.thoroughness": String(V.thoroughness),
450
522
  "elk.layered.highDegreeNodes.treatment": "true",
451
523
  "elk.layered.highDegreeNodes.threshold": "8",
452
- "elk.layered.compaction.postCompaction.strategy": e.subgraphs.length === 0 && !n ? "NONE" : "LEFT_RIGHT_CONSTRAINT_LOCKING",
524
+ "elk.layered.compaction.postCompaction.strategy": e.subgraphs.length === 0 && !n?.forceNodeOrder ? "NONE" : "LEFT_RIGHT_CONSTRAINT_LOCKING",
453
525
  "elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
526
+ ...nt(e) ? { "elk.spacing.edgeEdge": "40" } : {},
454
527
  ...n?.forceNodeOrder ? { "elk.layered.crossingMinimization.forceNodeModelOrder": "true" } : {},
455
528
  ...et(e) ? $e : {},
456
529
  "elk.layered.wrapping.strategy": "OFF",
@@ -465,7 +538,7 @@ function mt(e, t, n) {
465
538
  g.set(e, n), n.push(t);
466
539
  }
467
540
  if (d) for (let { index: e, edge: t, srcChain: n, tgtChain: i } of u) {
468
- let a = pt(n, i), o = t.source;
541
+ let a = mt(n, i), o = t.source;
469
542
  if (n.length > a) {
470
543
  for (let r = n.length - 1; r >= a; r--) {
471
544
  let i = n[r], a = `${i}_out_${e}`;
@@ -493,33 +566,33 @@ function mt(e, t, n) {
493
566
  }
494
567
  s = `${i[a]}_in_${e}`;
495
568
  }
496
- v(a > 0 ? n[a - 1] : lt, Ze({
569
+ v(a > 0 ? n[a - 1] : ut, Ze({
497
570
  id: `e${e}`,
498
571
  source: o,
499
572
  target: s,
500
573
  label: t.label,
501
- labelStyle: st(r)
574
+ labelStyle: ct(r)
502
575
  }));
503
576
  }
504
577
  for (let [t, o] of e.nodes) if (!i.has(t) && !a.has(t)) {
505
- let i = ct(t, o.label, o.shape, r.fontSizes.nodeLabel), a = n?.fixedWidths?.get(t);
578
+ let i = lt(t, o.label, o.shape, r.fontSizes.nodeLabel), a = n?.fixedWidths?.get(t);
506
579
  a !== void 0 && (i.width = a);
507
580
  let s = Je(t, i, o.label), c = et(e) ? Qe[o.shape] : void 0;
508
581
  c !== void 0 && (s.layoutOptions = { "elk.layered.layering.layerConstraint": c }), f.push(s);
509
582
  }
510
583
  let y = et(e), b = f.length, x = y ? e.subgraphs : [...e.subgraphs].reverse();
511
- for (let t of x) f.push(ht(t, e, r, l, h, g, e.direction));
584
+ for (let t of x) f.push(gt(t, e, r, l, h, g, e.direction));
512
585
  if (y && e.subgraphs.length > 0) {
513
586
  let t = f.map((t, n) => {
514
- if (n < b) return it(e, /* @__PURE__ */ new Set([t.id]));
515
- let r = e.subgraphs[n - b], i = it(e, /* @__PURE__ */ new Set([r.id]));
587
+ if (n < b) return at(e, /* @__PURE__ */ new Set([t.id]));
588
+ let r = e.subgraphs[n - b], i = at(e, /* @__PURE__ */ new Set([r.id]));
516
589
  if (i !== Infinity) return i;
517
590
  let a = /* @__PURE__ */ new Set();
518
- return dt(r, a), it(e, a);
591
+ return ft(r, a), at(e, a);
519
592
  }), n = f.map((e, t) => t).sort((e, n) => t[e] - t[n] || e - n).map((e) => f[e]);
520
593
  f.splice(0, f.length, ...n);
521
594
  }
522
- let S = rt(e, n);
595
+ let S = it(e, n);
523
596
  for (let { index: e, edge: t } of l.get(null)) {
524
597
  if (t.source === t.target || n?.detachedEdges?.has(e)) continue;
525
598
  let i = Ze({
@@ -527,20 +600,20 @@ function mt(e, t, n) {
527
600
  source: S.has(e) ? t.target : t.source,
528
601
  target: S.has(e) ? t.source : t.target,
529
602
  label: t.label,
530
- labelStyle: st(r)
603
+ labelStyle: ct(r)
531
604
  });
532
605
  n?.looseEdges?.has(e) && (i.layoutOptions = {
533
606
  ...i.layoutOptions,
534
607
  "elk.layered.priority.straightness": "0"
535
608
  }), p.push(i);
536
609
  }
537
- if (d) for (let e of g.get(lt) ?? []) p.push(e);
610
+ if (d) for (let e of g.get(ut) ?? []) p.push(e);
538
611
  else for (let { index: e, edge: t } of u) p.push(Ze({
539
612
  id: `e${e}`,
540
613
  source: S.has(e) ? t.target : t.source,
541
614
  target: S.has(e) ? t.source : t.target,
542
615
  label: t.label,
543
- labelStyle: st(r)
616
+ labelStyle: ct(r)
544
617
  }));
545
618
  return {
546
619
  id: "root",
@@ -549,31 +622,31 @@ function mt(e, t, n) {
549
622
  edges: p
550
623
  };
551
624
  }
552
- function ht(e, t, n, r, i, a, o) {
553
- let s = e.direction !== void 0 && D(e, t) ? e.direction : o, c = ot({
554
- direction: at(s),
625
+ function gt(e, t, n, r, i, a, o) {
626
+ let s = e.direction !== void 0 && D(e, t) ? e.direction : o, c = st({
627
+ direction: ot(s),
555
628
  nodeSpacing: n.nodeSpacing,
556
629
  layerSpacing: n.layerSpacing,
557
- padding: e.region ? tt : V
630
+ padding: e.region ? tt : H
558
631
  }), l, u = i.get(e.id);
559
632
  u && u.size > 0 && (l = [...u].map((e) => ({ id: e })));
560
633
  let d = [];
561
634
  for (let r of e.nodeIds) {
562
635
  let e = t.nodes.get(r);
563
636
  if (e) {
564
- let t = ct(r, e.label, e.shape, n.fontSizes.nodeLabel);
637
+ let t = lt(r, e.label, e.shape, n.fontSizes.nodeLabel);
565
638
  d.push(Je(r, t, e.label));
566
639
  }
567
640
  }
568
641
  let f = e.children.some((e) => e.region) ? e.children : [...e.children].reverse();
569
- for (let e of f) d.push(ht(e, t, n, r, i, a, s));
570
- let p = [], m = r.get(e.id) ?? [], h = rt(t);
642
+ for (let e of f) d.push(gt(e, t, n, r, i, a, s));
643
+ let p = [], m = r.get(e.id) ?? [], h = it(t);
571
644
  for (let { index: e, edge: t } of m) t.source !== t.target && p.push(Ze({
572
645
  id: `e${e}`,
573
646
  source: h.has(e) ? t.target : t.source,
574
647
  target: h.has(e) ? t.source : t.target,
575
648
  label: t.label,
576
- labelStyle: st(n)
649
+ labelStyle: ct(n)
577
650
  }));
578
651
  for (let t of a.get(e.id) ?? []) p.push(t);
579
652
  return {
@@ -585,11 +658,11 @@ function ht(e, t, n, r, i, a, o) {
585
658
  edges: p
586
659
  };
587
660
  }
588
- function gt(e, t, n) {
661
+ function _t(e, t, n) {
589
662
  for (let n of e.nodeIds) t.add(n);
590
- for (let r of e.children) n.add(r.id), gt(r, t, n);
663
+ for (let r of e.children) n.add(r.id), _t(r, t, n);
591
664
  }
592
- function _t(e) {
665
+ function vt(e) {
593
666
  let t = /* @__PURE__ */ new Map();
594
667
  function n(e) {
595
668
  for (let n of e.nodeIds) t.set(n, e.id);
@@ -600,19 +673,19 @@ function _t(e) {
600
673
  }
601
674
  //#endregion
602
675
  //#region packages/svg-renderer/src/shape-clipping.ts
603
- function vt(e, t, n) {
676
+ function yt(e, t, n) {
604
677
  if (e.length < 2 || t.shape === "rectangle" || t.shape === "rounded" || t.shape === "stadium") return e;
605
678
  let r = [...e];
606
679
  if (t.shape === "diamond") {
607
- if (n) r[0] = yt(e[0], e[1], t);
680
+ if (n) r[0] = bt(e[0], e[1], t);
608
681
  else {
609
682
  let n = e.length - 1;
610
- r[n] = yt(e[n], e[n - 1], t);
683
+ r[n] = bt(e[n], e[n - 1], t);
611
684
  }
612
685
  }
613
686
  return r;
614
687
  }
615
- function yt(e, t, n) {
688
+ function bt(e, t, n) {
616
689
  let r = n.x + n.width / 2, i = n.y + n.height / 2, a = {
617
690
  x: r,
618
691
  y: n.y
@@ -628,14 +701,14 @@ function yt(e, t, n) {
628
701
  }, l = e.x - t.x, u = e.y - t.y;
629
702
  if (Math.abs(l) < Math.abs(u)) {
630
703
  let t = e.x;
631
- return u > 0 ? t <= r ? xt(t, c, a) ?? a : xt(t, a, o) ?? a : t <= r ? xt(t, s, c) ?? s : xt(t, o, s) ?? s;
704
+ return u > 0 ? t <= r ? St(t, c, a) ?? a : St(t, a, o) ?? a : t <= r ? St(t, s, c) ?? s : St(t, o, s) ?? s;
632
705
  }
633
706
  {
634
707
  let t = e.y;
635
- return l > 0 ? t <= i ? bt(t, a, c) ?? c : bt(t, c, s) ?? c : t <= i ? bt(t, a, o) ?? o : bt(t, o, s) ?? o;
708
+ return l > 0 ? t <= i ? xt(t, a, c) ?? c : xt(t, c, s) ?? c : t <= i ? xt(t, a, o) ?? o : xt(t, o, s) ?? o;
636
709
  }
637
710
  }
638
- function bt(e, t, n) {
711
+ function xt(e, t, n) {
639
712
  let r = n.y - t.y;
640
713
  if (Math.abs(r) < .001) return null;
641
714
  let i = (e - t.y) / r;
@@ -644,7 +717,7 @@ function bt(e, t, n) {
644
717
  y: e
645
718
  };
646
719
  }
647
- function xt(e, t, n) {
720
+ function St(e, t, n) {
648
721
  let r = n.x - t.x;
649
722
  if (Math.abs(r) < .001) return null;
650
723
  let i = (e - t.x) / r;
@@ -655,11 +728,11 @@ function xt(e, t, n) {
655
728
  }
656
729
  //#endregion
657
730
  //#region packages/svg-renderer/src/layout-engine/layer-alignment.ts
658
- function St(e, t, n) {
731
+ function Ct(e, t, n) {
659
732
  if (e.length === 0) return;
660
733
  let r = n === "LR" || n === "RL", i = /* @__PURE__ */ new Set();
661
734
  for (let e of t) i.add(`${e.source}:${e.target}`), i.add(`${e.target}:${e.source}`);
662
- let a = B.layerSpacing * .6, o = [...e].sort((e, t) => r ? e.x - t.x : e.y - t.y), s = [], c = [o[0]];
735
+ let a = V.layerSpacing * .6, o = [...e].sort((e, t) => r ? e.x - t.x : e.y - t.y), s = [], c = [o[0]];
663
736
  for (let e = 1; e < o.length; e++) {
664
737
  let t = (r ? o[e].x : o[e].y) - (r ? o[e - 1].x : o[e - 1].y), n = c.some((t) => i.has(`${t.id}:${o[e].id}`));
665
738
  t <= a && !n ? c.push(o[e]) : (s.push(c), c = [o[e]]);
@@ -699,37 +772,37 @@ function St(e, t, n) {
699
772
  }
700
773
  //#endregion
701
774
  //#region packages/svg-renderer/src/layout-engine/edge-bundling.ts
702
- var Ct = .5;
703
- function wt(e, t, n) {
775
+ var wt = .5;
776
+ function Tt(e, t, n) {
704
777
  for (let r = 0; r < e.length - 1; r++) {
705
778
  let i = e[r], a = e[r + 1], o = Math.min(i.x, a.x), s = Math.max(i.x, a.x), c = Math.min(i.y, a.y), l = Math.max(i.y, a.y);
706
779
  for (let e of t) {
707
780
  if (n.has(e.id)) continue;
708
- let t = e.x + Ct, r = e.x + e.width - Ct, i = e.y + Ct, a = e.y + e.height - Ct;
781
+ let t = e.x + wt, r = e.x + e.width - wt, i = e.y + wt, a = e.y + e.height - wt;
709
782
  if (!(t >= r || i >= a) && o < r && s > t && c < a && l > i) return !1;
710
783
  }
711
784
  }
712
785
  return !0;
713
786
  }
714
- function Tt(e, t, n) {
787
+ function Et(e, t, n) {
715
788
  let r = [];
716
- for (let i of n) e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height && (r.push(i), r.push(...Tt(e, t, i.children)));
789
+ for (let i of n) e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height && (r.push(i), r.push(...Et(e, t, i.children)));
717
790
  return r;
718
791
  }
719
- function Et(e, t, n, r, i) {
720
- let a = i === "LR", o = i === "RL", s = i === "BT", c = a || o, l = new Set(Tt(t, n, r).map((e) => e.id)), u = Tt(c ? e : t, c ? n : e, r).find((e) => !l.has(e.id));
792
+ function Dt(e, t, n, r, i) {
793
+ let a = i === "LR", o = i === "RL", s = i === "BT", c = a || o, l = new Set(Et(t, n, r).map((e) => e.id)), u = Et(c ? e : t, c ? n : e, r).find((e) => !l.has(e.id));
721
794
  return u ? a ? u.x - 12 : o ? u.x + u.width + 12 : s ? u.y + u.height + 12 : u.y - 12 : e;
722
795
  }
723
- var Dt = 2;
724
- function Ot(e, t, n, r, i) {
796
+ var Ot = 2;
797
+ function kt(e, t, n, r, i) {
725
798
  for (let a of e) {
726
799
  if (t.has(a) || a.source === a.target) continue;
727
800
  let e = a.source === n ? a.points[0] : a.target === n ? a.points[a.points.length - 1] : void 0;
728
- if (e && Math.abs((i ? e.x : e.y) - r) <= Dt) return !0;
801
+ if (e && Math.abs((i ? e.x : e.y) - r) <= Ot) return !0;
729
802
  }
730
803
  return !1;
731
804
  }
732
- function kt(e, t, n, r) {
805
+ function At(e, t, n, r) {
733
806
  let i = new Map(t.map((e) => [e.id, e])), a = /* @__PURE__ */ new Set(), o = r === "LR", s = r === "RL", c = r === "BT", l = o || s, u = /* @__PURE__ */ new Map();
734
807
  for (let t of e) {
735
808
  if (t.source === t.target) continue;
@@ -754,9 +827,9 @@ function kt(e, t, n, r) {
754
827
  let h = p.x + p.width / 2, g = p.y + p.height / 2;
755
828
  if (l) {
756
829
  let i = o ? p.x + p.width : p.x, s = g;
757
- if (Ot(e, new Set(m.map((e) => e.edge)), d, i, !0)) continue;
830
+ if (kt(e, new Set(m.map((e) => e.edge)), d, i, !0)) continue;
758
831
  let c = i + ((o ? Math.min(...m.map((e) => e.node.x)) : Math.max(...m.map((e) => e.node.x + e.node.width))) - i) / 2;
759
- c = Et(c, h, g, n, r);
832
+ c = Dt(c, h, g, n, r);
760
833
  let l = [];
761
834
  for (let { edge: e, node: n } of m) {
762
835
  let r = o ? n.x : n.x + n.width, a = n.y + n.height / 2, u = [
@@ -777,7 +850,7 @@ function kt(e, t, n, r) {
777
850
  y: a
778
851
  }
779
852
  ];
780
- wt(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
853
+ Tt(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
781
854
  edge: e,
782
855
  points: u
783
856
  });
@@ -786,9 +859,9 @@ function kt(e, t, n, r) {
786
859
  for (let { edge: e, points: t } of l) e.points = t, a.add(e);
787
860
  } else {
788
861
  let i = h, o = c ? p.y : p.y + p.height;
789
- if (Ot(e, new Set(m.map((e) => e.edge)), d, o, !1)) continue;
862
+ if (kt(e, new Set(m.map((e) => e.edge)), d, o, !1)) continue;
790
863
  let s = o + ((c ? Math.max(...m.map((e) => e.node.y + e.node.height)) : Math.min(...m.map((e) => e.node.y))) - o) / 2;
791
- s = Et(s, h, g, n, r);
864
+ s = Dt(s, h, g, n, r);
792
865
  let l = [];
793
866
  for (let { edge: e, node: n } of m) {
794
867
  let r = n.x + n.width / 2, a = c ? n.y + n.height : n.y, u = [
@@ -809,7 +882,7 @@ function kt(e, t, n, r) {
809
882
  y: a
810
883
  }
811
884
  ];
812
- wt(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
885
+ Tt(u, t, /* @__PURE__ */ new Set([d, n.id])) && l.push({
813
886
  edge: e,
814
887
  points: u
815
888
  });
@@ -842,9 +915,9 @@ function kt(e, t, n, r) {
842
915
  let m = f.x + f.width / 2, h = f.y + f.height / 2;
843
916
  if (l) {
844
917
  let i = o ? f.x : f.x + f.width, s = h;
845
- if (Ot(e, new Set(p.map((e) => e.edge)), a, i, !0)) continue;
918
+ if (kt(e, new Set(p.map((e) => e.edge)), a, i, !0)) continue;
846
919
  let c = o ? Math.max(...p.map((e) => e.node.x + e.node.width)) : Math.min(...p.map((e) => e.node.x)), l = c + (i - c) / 2;
847
- l = Et(l, m, h, n, r);
920
+ l = Dt(l, m, h, n, r);
848
921
  let u = [];
849
922
  for (let { edge: e, node: n } of p) {
850
923
  let r = o ? n.x + n.width : n.x, c = n.y + n.height / 2, d = [
@@ -865,7 +938,7 @@ function kt(e, t, n, r) {
865
938
  y: s
866
939
  }
867
940
  ];
868
- wt(d, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
941
+ Tt(d, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
869
942
  edge: e,
870
943
  points: d
871
944
  });
@@ -874,9 +947,9 @@ function kt(e, t, n, r) {
874
947
  for (let { edge: e, points: t } of u) e.points = t;
875
948
  } else {
876
949
  let i = m, o = c ? f.y + f.height : f.y;
877
- if (Ot(e, new Set(p.map((e) => e.edge)), a, o, !1)) continue;
950
+ if (kt(e, new Set(p.map((e) => e.edge)), a, o, !1)) continue;
878
951
  let s = c ? Math.min(...p.map((e) => e.node.y)) : Math.max(...p.map((e) => e.node.y + e.node.height)), l = s + (o - s) / 2;
879
- l = Et(l, m, h, n, r);
952
+ l = Dt(l, m, h, n, r);
880
953
  let u = [];
881
954
  for (let { edge: e, node: n } of p) {
882
955
  let r = n.x + n.width / 2, s = [
@@ -897,7 +970,7 @@ function kt(e, t, n, r) {
897
970
  y: o
898
971
  }
899
972
  ];
900
- wt(s, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
973
+ Tt(s, t, /* @__PURE__ */ new Set([n.id, a])) && u.push({
901
974
  edge: e,
902
975
  points: s
903
976
  });
@@ -909,8 +982,8 @@ function kt(e, t, n, r) {
909
982
  }
910
983
  //#endregion
911
984
  //#region packages/svg-renderer/src/layout-engine/jog-straightening.ts
912
- var At = 1.5, jt = .01;
913
- function Mt(e) {
985
+ var jt = 1.5, Mt = .01;
986
+ function Nt(e) {
914
987
  let t = e.map((e) => ({ ...e })), n = 0;
915
988
  for (; n + 3 < t.length;) {
916
989
  let [e, r, i, a] = [
@@ -918,7 +991,7 @@ function Mt(e) {
918
991
  t[n + 1],
919
992
  t[n + 2],
920
993
  t[n + 3]
921
- ], o = Math.abs(e.x - r.x) < jt && Math.abs(i.x - a.x) < jt && Math.abs(r.y - i.y) < jt && Math.abs(r.x - i.x) <= At && Math.abs(r.x - i.x) >= jt, s = Math.abs(e.y - r.y) < jt && Math.abs(i.y - a.y) < jt && Math.abs(r.x - i.x) < jt && Math.abs(r.y - i.y) <= At && Math.abs(r.y - i.y) >= jt;
994
+ ], o = Math.abs(e.x - r.x) < Mt && Math.abs(i.x - a.x) < Mt && Math.abs(r.y - i.y) < Mt && Math.abs(r.x - i.x) <= jt && Math.abs(r.x - i.x) >= Mt, s = Math.abs(e.y - r.y) < Mt && Math.abs(i.y - a.y) < Mt && Math.abs(r.x - i.x) < Mt && Math.abs(r.y - i.y) <= jt && Math.abs(r.y - i.y) >= Mt;
922
995
  if (o) {
923
996
  let r = (e.x + a.x) / 2;
924
997
  t.splice(n, 4, {
@@ -943,7 +1016,7 @@ function Mt(e) {
943
1016
  }
944
1017
  //#endregion
945
1018
  //#region packages/svg-renderer/src/layout-engine/elk-adapter-utils.ts
946
- function Nt(e, t = 0, n = 0) {
1019
+ function Pt(e, t = 0, n = 0) {
947
1020
  let r = [];
948
1021
  if (!e.sections || e.sections.length === 0) return r;
949
1022
  let i = e.sections[0];
@@ -959,7 +1032,7 @@ function Nt(e, t = 0, n = 0) {
959
1032
  y: i.endPoint.y + n
960
1033
  }), r;
961
1034
  }
962
- function Pt(e, t = 0, n = 0) {
1035
+ function Ft(e, t = 0, n = 0) {
963
1036
  if (!e.labels || e.labels.length === 0) return;
964
1037
  let r = e.labels[0];
965
1038
  if (r.x != null && r.y != null) return {
@@ -969,11 +1042,11 @@ function Pt(e, t = 0, n = 0) {
969
1042
  }
970
1043
  //#endregion
971
1044
  //#region packages/svg-renderer/src/layout-engine/from-elk.ts
972
- var Ft = 16, It = 28, Lt = 18, Rt = 28, zt = 10;
973
- function Bt(e, t) {
974
- let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(Rt, e.height * .6) / 2, a = It + t * Lt, o = [];
975
- for (let e = 0; e <= Ft; e++) {
976
- let t = Math.PI * e / Ft;
1045
+ var It = 16, Lt = 28, Rt = 18, zt = 28, Bt = 10;
1046
+ function Vt(e, t) {
1047
+ let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(zt, e.height * .6) / 2, a = Lt + t * Rt, o = [];
1048
+ for (let e = 0; e <= It; e++) {
1049
+ let t = Math.PI * e / It;
977
1050
  o.push({
978
1051
  x: n + a * Math.sin(t),
979
1052
  y: r - i * Math.cos(t)
@@ -982,12 +1055,12 @@ function Bt(e, t) {
982
1055
  return {
983
1056
  points: o,
984
1057
  labelPosition: {
985
- x: n + a + zt,
1058
+ x: n + a + Bt,
986
1059
  y: r
987
1060
  }
988
1061
  };
989
1062
  }
990
- function Vt(e, t, n) {
1063
+ function Ht(e, t, n) {
991
1064
  let r = /* @__PURE__ */ new Map();
992
1065
  for (let i = 0; i < e.edges.length; i++) {
993
1066
  let a = e.edges[i];
@@ -996,7 +1069,7 @@ function Vt(e, t, n) {
996
1069
  if (!o) continue;
997
1070
  let s = r.get(o.id) ?? 0;
998
1071
  r.set(o.id, s + 1);
999
- let { points: c, labelPosition: l } = Bt(o, s);
1072
+ let { points: c, labelPosition: l } = Vt(o, s);
1000
1073
  n.push({
1001
1074
  source: a.source,
1002
1075
  target: a.target,
@@ -1006,39 +1079,39 @@ function Vt(e, t, n) {
1006
1079
  hasArrowEnd: a.hasArrowEnd,
1007
1080
  points: c,
1008
1081
  labelPosition: a.label ? l : void 0,
1009
- inlineStyle: $t(i, e),
1082
+ inlineStyle: en(i, e),
1010
1083
  id: a.id,
1011
1084
  animate: a.animate
1012
1085
  });
1013
1086
  }
1014
1087
  }
1015
- function Ht(e) {
1088
+ function Ut(e) {
1016
1089
  let t = [];
1017
1090
  for (let n of e) t.push({
1018
1091
  x: n.x,
1019
1092
  y: n.y,
1020
1093
  right: n.x + n.width,
1021
1094
  bottom: n.y + n.height
1022
- }), t.push(...Ht(n.children));
1095
+ }), t.push(...Ut(n.children));
1023
1096
  return t;
1024
1097
  }
1025
- function Ut(e, t, n = !1) {
1098
+ function Wt(e, t, n = !1) {
1026
1099
  let r = [], i = [], a = [], o = /* @__PURE__ */ new Set();
1027
- for (let e of t.subgraphs) Qt(e, o);
1028
- Wt(e, t, o, r, a, 0, 0);
1029
- let s = Ht(a);
1030
- qt(e, t, i, 0, 0, s.length > 0 ? {
1100
+ for (let e of t.subgraphs) $t(e, o);
1101
+ Gt(e, t, o, r, a, 0, 0);
1102
+ let s = Ut(a);
1103
+ Jt(e, t, i, 0, 0, s.length > 0 ? {
1031
1104
  leftX: Math.min(...s.map((e) => e.x)) - 20,
1032
1105
  rightX: Math.max(...s.map((e) => e.right)) + 20
1033
- } : void 0), St(r, i, t.direction);
1106
+ } : void 0), Ct(r, i, t.direction);
1034
1107
  let c = new Map(r.map((e) => [e.id, e]));
1035
- Vt(t, c, i), n && kt(i, r, a, t.direction);
1108
+ Ht(t, c, i), n && At(i, r, a, t.direction);
1036
1109
  for (let e of i) {
1037
- e.points = Mt(e.points);
1110
+ e.points = Nt(e.points);
1038
1111
  let t = c.get(e.source), n = c.get(e.target);
1039
- t && (e.points = vt(e.points, t, !0)), n && (e.points = vt(e.points, n, !1));
1112
+ t && (e.points = yt(e.points, t, !0)), n && (e.points = yt(e.points, n, !1));
1040
1113
  }
1041
- let l = e.width ?? 800, u = e.height ?? 600, d = Be.width, f = B.padding;
1114
+ let l = e.width ?? 800, u = e.height ?? 600, d = B.width, f = V.padding;
1042
1115
  for (let e of i) {
1043
1116
  for (let t of e.points) l = Math.max(l, t.x + d + f), u = Math.max(u, t.y + d + f);
1044
1117
  e.labelPosition && (l = Math.max(l, e.labelPosition.x + 60 + f), u = Math.max(u, e.labelPosition.y + 20 + f));
@@ -1051,13 +1124,13 @@ function Ut(e, t, n = !1) {
1051
1124
  groups: a
1052
1125
  };
1053
1126
  }
1054
- function Wt(e, t, n, r, i, a, o) {
1127
+ function Gt(e, t, n, r, i, a, o) {
1055
1128
  if (e.children) for (let s of e.children) {
1056
1129
  let e = (s.x ?? 0) + a, c = (s.y ?? 0) + o, l = s.width ?? 0, u = s.height ?? 0;
1057
1130
  if (n.has(s.id)) {
1058
1131
  let a = [];
1059
- Wt(s, t, n, r, a, e, c);
1060
- let o = Zt(t.subgraphs, s.id);
1132
+ Gt(s, t, n, r, a, e, c);
1133
+ let o = Qt(t.subgraphs, s.id);
1061
1134
  i.push({
1062
1135
  id: s.id,
1063
1136
  label: o?.label ?? "",
@@ -1085,11 +1158,11 @@ function Wt(e, t, n, r, i, a, o) {
1085
1158
  interaction: t.interactions.get(s.id)
1086
1159
  });
1087
1160
  }
1088
- s.children && s.children.length > 0 && Wt(s, t, n, r, i, e, c);
1161
+ s.children && s.children.length > 0 && Gt(s, t, n, r, i, e, c);
1089
1162
  }
1090
1163
  }
1091
1164
  }
1092
- function Gt(e) {
1165
+ function Kt(e) {
1093
1166
  let t = /^e(\d+)$/.exec(e);
1094
1167
  if (t) return {
1095
1168
  edgeIndex: parseInt(t[1], 10),
@@ -1102,7 +1175,7 @@ function Gt(e) {
1102
1175
  level: parseInt(n[3], 10)
1103
1176
  };
1104
1177
  }
1105
- function Kt(e) {
1178
+ function qt(e) {
1106
1179
  if (e.length === 0) return {
1107
1180
  x: 0,
1108
1181
  y: 0
@@ -1127,11 +1200,11 @@ function Kt(e) {
1127
1200
  }
1128
1201
  return e[e.length - 1];
1129
1202
  }
1130
- function qt(e, t, n, r, i, a) {
1203
+ function Jt(e, t, n, r, i, a) {
1131
1204
  let o = /* @__PURE__ */ new Map();
1132
- Jt(e, o, 0, 0);
1205
+ Yt(e, o, 0, 0);
1133
1206
  let s = /* @__PURE__ */ new Map();
1134
- Xt(e, s, 0, 0, o);
1207
+ Zt(e, s, 0, 0, o);
1135
1208
  let c = 0;
1136
1209
  for (let [e, r] of s) {
1137
1210
  let i = t.edges[e];
@@ -1144,24 +1217,24 @@ function qt(e, t, n, r, i, a) {
1144
1217
  let u = [...r.targetHops.keys()].sort((e, t) => e - t);
1145
1218
  for (let e of u) s(r.targetHops.get(e));
1146
1219
  let d;
1147
- i.label && o.length >= 2 && (d = r.bridge?.labelPosition ?? Kt(o));
1148
- let f = Yt(o, a, c);
1149
- f !== o && c++, i.label && f !== o && f.length >= 2 && (d = Kt(f)), n.push({
1220
+ i.label && o.length >= 2 && (d = r.bridge?.labelPosition ?? qt(o));
1221
+ let f = Xt(o, a, c);
1222
+ f !== o && c++, i.label && f !== o && f.length >= 2 && (d = qt(f)), n.push({
1150
1223
  source: i.source,
1151
1224
  target: i.target,
1152
1225
  label: i.label,
1153
1226
  style: i.style,
1154
1227
  hasArrowStart: i.hasArrowStart,
1155
1228
  hasArrowEnd: i.hasArrowEnd,
1156
- points: rt(t).has(e) ? [...f].reverse() : f,
1229
+ points: it(t).has(e) ? [...f].reverse() : f,
1157
1230
  labelPosition: d,
1158
- inlineStyle: $t(e, t),
1231
+ inlineStyle: en(e, t),
1159
1232
  id: i.id,
1160
1233
  animate: i.animate
1161
1234
  });
1162
1235
  }
1163
1236
  }
1164
- function Jt(e, t, n, r) {
1237
+ function Yt(e, t, n, r) {
1165
1238
  t.set(e.id, {
1166
1239
  x: n,
1167
1240
  y: r
@@ -1169,10 +1242,10 @@ function Jt(e, t, n, r) {
1169
1242
  for (let i of e.children ?? []) {
1170
1243
  /* v8 ignore next */
1171
1244
  let e = i.x ?? 0, a = i.y ?? 0;
1172
- Jt(i, t, n + e, r + a);
1245
+ Yt(i, t, n + e, r + a);
1173
1246
  }
1174
1247
  }
1175
- function Yt(e, t, n = 0) {
1248
+ function Xt(e, t, n = 0) {
1176
1249
  if (e.length < 2) return e;
1177
1250
  let r = !1;
1178
1251
  for (let t = 1; t < e.length; t++) {
@@ -1211,11 +1284,11 @@ function Yt(e, t, n = 0) {
1211
1284
  }
1212
1285
  return i;
1213
1286
  }
1214
- function Xt(e, t, n, r, i) {
1287
+ function Zt(e, t, n, r, i) {
1215
1288
  if (e.edges) for (let a of e.edges) {
1216
- let e = Gt(a.id);
1289
+ let e = Kt(a.id);
1217
1290
  if (!e) continue;
1218
- let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d = Nt(a, l, u), f = Pt(a, l, u), p = t.get(o) ?? {
1291
+ let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d = Pt(a, l, u), f = Ft(a, l, u), p = t.get(o) ?? {
1219
1292
  sourceHops: /* @__PURE__ */ new Map(),
1220
1293
  targetHops: /* @__PURE__ */ new Map()
1221
1294
  };
@@ -1227,20 +1300,20 @@ function Xt(e, t, n, r, i) {
1227
1300
  };
1228
1301
  e.role === "bridge" ? p.bridge = m : e.role === "source" ? p.sourceHops.set(e.level, m) : p.targetHops.set(e.level, m);
1229
1302
  }
1230
- if (e.children) for (let a of e.children) Xt(a, t, n + (a.x ?? 0), r + (a.y ?? 0), i);
1303
+ if (e.children) for (let a of e.children) Zt(a, t, n + (a.x ?? 0), r + (a.y ?? 0), i);
1231
1304
  }
1232
- function Zt(e, t) {
1305
+ function Qt(e, t) {
1233
1306
  for (let n of e) {
1234
1307
  if (n.id === t) return n;
1235
- let e = Zt(n.children, t);
1308
+ let e = Qt(n.children, t);
1236
1309
  if (e) return e;
1237
1310
  }
1238
1311
  }
1239
- function Qt(e, t) {
1312
+ function $t(e, t) {
1240
1313
  t.add(e.id);
1241
- for (let n of e.children) Qt(n, t);
1314
+ for (let n of e.children) $t(n, t);
1242
1315
  }
1243
- function $t(e, t) {
1316
+ function en(e, t) {
1244
1317
  let n, r = t.linkStyles.get("default");
1245
1318
  r && (n = { ...r });
1246
1319
  let i = t.linkStyles.get(e);
@@ -1251,12 +1324,12 @@ function $t(e, t) {
1251
1324
  }
1252
1325
  //#endregion
1253
1326
  //#region packages/svg-renderer/src/layout-engine/inner-edges.ts
1254
- var en = 10, tn = 14, nn = 14, rn = 10, an = 24, on = 400, sn = /* @__PURE__ */ new Set([
1327
+ var tn = 10, nn = 14, rn = 14, an = 10, on = 24, sn = 400, cn = /* @__PURE__ */ new Set([
1255
1328
  "rectangle",
1256
1329
  "rounded",
1257
1330
  "subroutine"
1258
1331
  ]);
1259
- function cn(e) {
1332
+ function ln(e) {
1260
1333
  let t = e === "TD" || e === "TB" || e === "BT", n = e === "BT" || e === "RL" ? -1 : 1;
1261
1334
  return {
1262
1335
  span: (e) => {
@@ -1277,17 +1350,17 @@ function cn(e) {
1277
1350
  }
1278
1351
  };
1279
1352
  }
1280
- function ln(e, t, n) {
1353
+ function un(e, t, n) {
1281
1354
  let r = Math.min(e.a, t.a), i = Math.max(e.a, t.a), a = Math.min(e.c, t.c), o = Math.max(e.c, t.c);
1282
1355
  return i > n.a0 && r < n.a1 && o > n.c0 && a < n.c1;
1283
1356
  }
1284
- var un = (e, t) => ({
1357
+ var dn = (e, t) => ({
1285
1358
  a0: e.a0 - t,
1286
1359
  a1: e.a1 + t,
1287
1360
  c0: e.c0 - t,
1288
1361
  c1: e.c1 + t
1289
1362
  });
1290
- function dn(e, t) {
1363
+ function fn(e, t) {
1291
1364
  let n = e.span({
1292
1365
  x: t.x,
1293
1366
  y: t.y,
@@ -1299,23 +1372,23 @@ function dn(e, t) {
1299
1372
  c: n.c0
1300
1373
  };
1301
1374
  }
1302
- function fn(e, t, n) {
1375
+ function pn(e, t, n) {
1303
1376
  let r = e.c === t.c;
1304
1377
  for (let i = 1; i < n.length; i++) {
1305
1378
  let a = n[i - 1], o = n[i];
1306
1379
  if (a.c === o.c === r) {
1307
1380
  if (r) {
1308
1381
  let n = Math.abs(e.c - a.c), r = Math.min(Math.max(e.a, t.a), Math.max(a.a, o.a)) - Math.max(Math.min(e.a, t.a), Math.min(a.a, o.a));
1309
- if (n < tn && r > 0) return !0;
1382
+ if (n < nn && r > 0) return !0;
1310
1383
  } else {
1311
1384
  let n = Math.abs(e.a - a.a), r = Math.min(Math.max(e.c, t.c), Math.max(a.c, o.c)) - Math.max(Math.min(e.c, t.c), Math.min(a.c, o.c));
1312
- if (n < tn && r > 0) return !0;
1385
+ if (n < nn && r > 0) return !0;
1313
1386
  }
1314
1387
  }
1315
1388
  }
1316
1389
  return !1;
1317
1390
  }
1318
- function pn(e) {
1391
+ function mn(e) {
1319
1392
  let t = [];
1320
1393
  for (let n of e) {
1321
1394
  let e = t[t.length - 1];
@@ -1327,24 +1400,24 @@ function pn(e) {
1327
1400
  }
1328
1401
  return t;
1329
1402
  }
1330
- var mn = (e) => {
1403
+ var hn = (e) => {
1331
1404
  let t = 0;
1332
1405
  for (let n = 1; n < e.length; n++) t += Math.abs(e[n].a - e[n - 1].a) + Math.abs(e[n].c - e[n - 1].c);
1333
1406
  return t;
1334
1407
  };
1335
- function hn(e, t, n, r, i, a = []) {
1336
- let o = cn(i), s = o.span(e), c = o.span(t), l = s.a1 <= c.a0, u = c.a1 <= s.a0;
1408
+ function gn(e, t, n, r, i, a = []) {
1409
+ let o = ln(i), s = o.span(e), c = o.span(t), l = s.a1 <= c.a0, u = c.a1 <= s.a0;
1337
1410
  if (!l && !u) return;
1338
1411
  let d = o.span(r), f = {
1339
- a0: d.a0 + rn,
1340
- a1: d.a1 - rn,
1341
- c0: d.c0 + rn,
1342
- c1: d.c1 - rn
1343
- }, p = a.map((e) => e.map((e) => dn(o, e))), m = n.map((e) => un(o.span(e), en)), h = (e) => (e.c0 + e.c1) / 2, g = (e) => (e.a0 + e.a1) / 2, _ = (e) => sn.has(e.shape), v = (e) => {
1412
+ a0: d.a0 + an,
1413
+ a1: d.a1 - an,
1414
+ c0: d.c0 + an,
1415
+ c1: d.c1 - an
1416
+ }, p = a.map((e) => e.map((e) => fn(o, e))), m = n.map((e) => dn(o.span(e), tn)), h = (e) => (e.c0 + e.c1) / 2, g = (e) => (e.a0 + e.a1) / 2, _ = (e) => cn.has(e.shape), v = (e) => {
1344
1417
  for (let t of e) if (t.a < f.a0 || t.a > f.a1 || t.c < f.c0 || t.c > f.c1) return !1;
1345
1418
  for (let t = 1; t < e.length; t++) {
1346
1419
  let n = e[t - 1], r = e[t];
1347
- if (n.a !== r.a && n.c !== r.c || m.some((e) => ln(n, r, e)) || ln(n, r, s) || ln(n, r, c) || p.some((e) => fn(n, r, e))) return !1;
1420
+ if (n.a !== r.a && n.c !== r.c || m.some((e) => un(n, r, e)) || un(n, r, s) || un(n, r, c) || p.some((e) => pn(n, r, e))) return !1;
1348
1421
  }
1349
1422
  return !0;
1350
1423
  }, y = /* @__PURE__ */ new Set([
@@ -1354,10 +1427,10 @@ function hn(e, t, n, r, i, a = []) {
1354
1427
  f.c1
1355
1428
  ]);
1356
1429
  for (let e of m) y.add(e.c0 - 1), y.add(e.c1 + 1);
1357
- for (let e of [s, c]) y.add(e.c0 - en), y.add(e.c1 + en);
1430
+ for (let e of [s, c]) y.add(e.c0 - tn), y.add(e.c1 + tn);
1358
1431
  let b = (e, t, n) => _(e) ? n >= t.c0 + 4 && n <= t.c1 - 4 : Math.abs(n - h(t)) < .5, x = [];
1359
1432
  if (l) {
1360
- let n = (c.a0 - s.a1) / 2, r = s.a1 + Math.min(nn, n), i = c.a0 - Math.min(nn, n);
1433
+ let n = (c.a0 - s.a1) / 2, r = s.a1 + Math.min(rn, n), i = c.a0 - Math.min(rn, n);
1361
1434
  for (let n of y) {
1362
1435
  b(e, s, n) && b(t, c, n) && x.push([{
1363
1436
  a: s.a1,
@@ -1496,14 +1569,14 @@ function hn(e, t, n, r, i, a = []) {
1496
1569
  }
1497
1570
  let S, C = Infinity;
1498
1571
  for (let t of x) {
1499
- let n = pn(t);
1572
+ let n = mn(t);
1500
1573
  if (n.length < 2 || !v(n)) continue;
1501
- let r = e.shape === "diamond" && n[0].a === s.a1 ? on : 0, i = mn(n) + an * (n.length - 2) + r;
1574
+ let r = e.shape === "diamond" && n[0].a === s.a1 ? sn : 0, i = hn(n) + on * (n.length - 2) + r;
1502
1575
  i < C && (S = n, C = i);
1503
1576
  }
1504
1577
  return S?.map(o.toPoint);
1505
1578
  }
1506
- function gn(e) {
1579
+ function _n(e) {
1507
1580
  let t = {
1508
1581
  x: e[0].x,
1509
1582
  y: e[0].y
@@ -1519,24 +1592,24 @@ function gn(e) {
1519
1592
  }
1520
1593
  //#endregion
1521
1594
  //#region packages/svg-renderer/src/layout-engine/compound-flat.ts
1522
- var _n = "__zm_spine__", vn = 8, yn = 6, bn = 12, xn = 4, Sn = 4, Cn = .25, wn = .02, Tn = 40, En = (e) => e === "TD" || e === "TB" || e === "BT", Dn = (e) => e.startsWith(_n);
1523
- function On(e) {
1524
- return e.flatMap((e) => [e, ...On(e.children)]);
1595
+ var vn = "__zm_spine__", yn = 8, bn = 6, xn = 12, Sn = 4, Cn = 4, wn = .25, Tn = .02, En = 40, Dn = (e) => e === "TD" || e === "TB" || e === "BT", On = (e) => e.startsWith(vn);
1596
+ function kn(e) {
1597
+ return e.flatMap((e) => [e, ...kn(e.children)]);
1525
1598
  }
1526
- function H(e) {
1599
+ function U(e) {
1527
1600
  let t = new Set(e.nodeIds);
1528
- for (let n of e.children) for (let e of H(n)) t.add(e);
1601
+ for (let n of e.children) for (let e of U(n)) t.add(e);
1529
1602
  return t;
1530
1603
  }
1531
- function kn(e) {
1532
- if (e.subgraphs.length === 0 || et(e) || ut(e.subgraphs)) return !1;
1533
- for (let t of e.nodes.keys()) if (Dn(t)) return !1;
1604
+ function An(e) {
1605
+ if (e.subgraphs.length === 0 || et(e) || dt(e.subgraphs)) return !1;
1606
+ for (let t of e.nodes.keys()) if (On(t)) return !1;
1534
1607
  for (let t of e.edges) if (!e.nodes.has(t.source) || !e.nodes.has(t.target)) return !1;
1535
- let t = On(e.subgraphs);
1536
- return !t.some((t) => e.nodes.has(t.id)) && t.every((t) => [...H(t)].some((t) => e.nodes.has(t)));
1608
+ let t = kn(e.subgraphs);
1609
+ return !t.some((t) => e.nodes.has(t.id)) && t.every((t) => [...U(t)].some((t) => e.nodes.has(t)));
1537
1610
  }
1538
- function An(e, t) {
1539
- let n = En(t), r = (e) => n ? [e.y, e.y + e.height] : [e.x, e.x + e.width], i = [...e].sort((e, t) => {
1611
+ function jn(e, t) {
1612
+ let n = Dn(t), r = (e) => n ? [e.y, e.y + e.height] : [e.x, e.x + e.width], i = [...e].sort((e, t) => {
1540
1613
  let [n, i] = r(e), [a, o] = r(t);
1541
1614
  return (n + i) / 2 - (a + o) / 2;
1542
1615
  }), a = [];
@@ -1551,20 +1624,20 @@ function An(e, t) {
1551
1624
  let o = /* @__PURE__ */ new Map();
1552
1625
  return a.forEach((e, t) => e.ids.forEach((e) => o.set(e, t))), o;
1553
1626
  }
1554
- function jn(e, t, n) {
1627
+ function Mn(e, t, n) {
1555
1628
  let r = {
1556
1629
  ghosts: [],
1557
1630
  edges: []
1558
1631
  };
1559
1632
  for (let i of e) {
1560
- let e = [...H(i)].filter((e) => t.has(e));
1633
+ let e = [...U(i)].filter((e) => t.has(e));
1561
1634
  if (e.length === 0) continue;
1562
1635
  let a = e.map((e) => t.get(e)), o = Math.min(...a), s = Math.max(...a), c = /* @__PURE__ */ new Map();
1563
1636
  for (let a = o; a <= s; a++) {
1564
1637
  let o = e.filter((e) => t.get(e) === a).sort((e, t) => n(e) - n(t));
1565
1638
  if (o.length > 0) c.set(a, o[0]);
1566
1639
  else {
1567
- let e = `${_n}${i.id}__${a}`;
1640
+ let e = `${vn}${i.id}__${a}`;
1568
1641
  r.ghosts.push({
1569
1642
  id: e,
1570
1643
  subgraph: i.id
@@ -1573,7 +1646,7 @@ function jn(e, t, n) {
1573
1646
  }
1574
1647
  for (let e = o; e < s; e++) {
1575
1648
  let t = c.get(e), n = c.get(e + 1);
1576
- !Dn(t) && !Dn(n) || r.edges.push({
1649
+ !On(t) && !On(n) || r.edges.push({
1577
1650
  source: t,
1578
1651
  target: n,
1579
1652
  style: "invisible",
@@ -1584,12 +1657,12 @@ function jn(e, t, n) {
1584
1657
  }
1585
1658
  return r;
1586
1659
  }
1587
- function Mn(e, t, n, r = () => !1, i = () => !1) {
1660
+ function Nn(e, t, n, r = () => !1, i = () => !1) {
1588
1661
  let a = (e) => {
1589
- let n = [...H(e)].filter((e) => t.has(e)).map((e) => t.get(e));
1662
+ let n = [...U(e)].filter((e) => t.has(e)).map((e) => t.get(e));
1590
1663
  return n.length > 0 ? [Math.min(...n), Math.max(...n)] : void 0;
1591
1664
  }, o = (e) => {
1592
- let t = [...H(e)].filter((e) => n.has(e)).map((e) => n.get(e));
1665
+ let t = [...U(e)].filter((e) => n.has(e)).map((e) => n.get(e));
1593
1666
  return t.reduce((e, t) => e + t, 0) / t.length;
1594
1667
  }, s = e.map((e) => ({
1595
1668
  sg: e,
@@ -1603,21 +1676,21 @@ function Mn(e, t, n, r = () => !1, i = () => !1) {
1603
1676
  if (t.length < 2 || t.some((e, n) => t.slice(n + 1).some((t) => r(e, t)))) continue;
1604
1677
  let a = t.some((e) => e.region) || t.some((e, n) => t.slice(n + 1).some((t) => i(e, t))) ? -1 : 1, s = [...t].sort((t, n) => a * (e.indexOf(n) - e.indexOf(t))), c = t.map(o).sort((e, t) => e - t), l = s.map((e, t) => c[t] - o(e));
1605
1678
  s.forEach((e, t) => {
1606
- for (let r of H(e)) n.has(r) && n.set(r, n.get(r) + l[t]);
1679
+ for (let r of U(e)) n.has(r) && n.set(r, n.get(r) + l[t]);
1607
1680
  });
1608
1681
  }
1609
- for (let a of e) Mn(a.children, t, n, r, i);
1682
+ for (let a of e) Nn(a.children, t, n, r, i);
1610
1683
  }
1611
- function Nn(e, t, n, r, i) {
1684
+ function Pn(e, t, n, r, i) {
1612
1685
  let a = new Map(t);
1613
1686
  for (let t of r) {
1614
- let r = H(t);
1687
+ let r = U(t);
1615
1688
  for (let e of i.get(t.id) ?? []) r.add(e);
1616
1689
  let o = [...r].filter((e) => a.has(e)), s = o.filter((e) => n.has(e));
1617
1690
  if (s.length === 0) continue;
1618
1691
  let c = Math.min(...s.map((e) => n.get(e))), l = Math.max(...s.map((e) => n.get(e))), u = o.map((e) => a.get(e)), d = Math.min(...u), f = Math.max(...u), p = (d + f) / 2, m = 0;
1619
1692
  for (let t of e) {
1620
- if (r.has(t) || Dn(t)) continue;
1693
+ if (r.has(t) || On(t)) continue;
1621
1694
  let e = n.get(t);
1622
1695
  if (e === void 0 || e < c || e > l) continue;
1623
1696
  m++;
@@ -1628,13 +1701,13 @@ function Nn(e, t, n, r, i) {
1628
1701
  let o = new Map(e.map((e, t) => [e, t]));
1629
1702
  return [...e].sort((e, t) => a.get(e) - a.get(t) || o.get(e) - o.get(t));
1630
1703
  }
1631
- var Pn = (e, t) => t >= Math.min(...e) && t <= Math.max(...e);
1632
- function Fn(e, t, n) {
1704
+ var Fn = (e, t) => t >= Math.min(...e) && t <= Math.max(...e);
1705
+ function In(e, t, n) {
1633
1706
  let r = (e) => {
1634
- let i = e.children.map(r), a = [...[...H(e)].flatMap((e) => {
1707
+ let i = e.children.map(r), a = [...[...U(e)].flatMap((e) => {
1635
1708
  let n = t.get(e);
1636
1709
  return n ? [n] : [];
1637
- }), ...i], o = e.region ? tt : V, s = Math.min(...a.map((e) => e.x)) - o.left, c = Math.min(...a.map((e) => e.y)) - o.top, l = Math.max(...a.map((e) => e.x + e.width)) + o.right, u = Math.max(...a.map((e) => e.y + e.height)) + o.bottom, d = e.region ? 0 : p(e.label, n.groupHeader, L.groupHeader).width + 24;
1710
+ }), ...i], o = e.region ? tt : H, s = Math.min(...a.map((e) => e.x)) - o.left, c = Math.min(...a.map((e) => e.y)) - o.top, l = Math.max(...a.map((e) => e.x + e.width)) + o.right, u = Math.max(...a.map((e) => e.y + e.height)) + o.bottom, d = e.region ? 0 : p(e.label, n.groupHeader, L.groupHeader).width + 24;
1638
1711
  return {
1639
1712
  id: e.id,
1640
1713
  label: e.label,
@@ -1648,14 +1721,14 @@ function Fn(e, t, n) {
1648
1721
  };
1649
1722
  return e.map(r);
1650
1723
  }
1651
- var In = (e) => e.flatMap((e) => [e, ...In(e.children)]);
1652
- function Ln(e, t, n, r, i, a) {
1653
- let o = En(r), s = new Map(On(t).map((e) => [e.id, H(e)])), c = /* @__PURE__ */ new Map(), l = !1, u = [], d = (e) => o ? [e.x, e.x + e.width] : [e.y, e.y + e.height], f = (e) => o ? [e.y, e.y + e.height] : [e.x, e.x + e.width], p = ([e, t], [n, r]) => Math.max(0, Math.min(t, r) - Math.max(e, n)), m = (e) => ({
1654
- x: e.x - Tn,
1655
- y: e.y - Tn,
1724
+ var Ln = (e) => e.flatMap((e) => [e, ...Ln(e.children)]);
1725
+ function Rn(e, t, n, r, i, a) {
1726
+ let o = Dn(r), s = new Map(kn(t).map((e) => [e.id, U(e)])), c = /* @__PURE__ */ new Map(), l = !1, u = [], d = (e) => o ? [e.x, e.x + e.width] : [e.y, e.y + e.height], f = (e) => o ? [e.y, e.y + e.height] : [e.x, e.x + e.width], p = ([e, t], [n, r]) => Math.max(0, Math.min(t, r) - Math.max(e, n)), m = (e) => ({
1727
+ x: e.x - En,
1728
+ y: e.y - En,
1656
1729
  width: e.width + 80,
1657
1730
  height: e.height + 80
1658
- }), h = (e, t) => p(f(e), f(t)) > 0 ? p(d(e), d(t)) : 0, g = In(e), _ = new Map(g.map((e) => [e, m(e)])), v = (e, t, n, r) => {
1731
+ }), h = (e, t) => p(f(e), f(t)) > 0 ? p(d(e), d(t)) : 0, g = Ln(e), _ = new Map(g.map((e) => [e, m(e)])), v = (e, t, n, r) => {
1659
1732
  let i = p(d(e), d(t)), a = p(f(e), f(t));
1660
1733
  if (i <= 0 || a <= 0) return;
1661
1734
  let s = i <= a, c = s === o, l = (e) => c ? e.x : e.y, m = (e) => c ? e.x + e.width : e.y + e.height, h = (e) => (l(e) + m(e)) / 2, g = h(n) <= h(r) ? n : r;
@@ -1669,7 +1742,7 @@ function Ln(e, t, n, r, i, a) {
1669
1742
  let t = s.get(e.id), r = [...t].filter((e) => a.has(e)).map((e) => a.get(e)), o = new Set(r);
1670
1743
  for (let [s, u] of n) {
1671
1744
  if (t.has(s)) continue;
1672
- if (o.has(a.get(s)) || !Pn(r, a.get(s))) {
1745
+ if (o.has(a.get(s)) || !Fn(r, a.get(s))) {
1673
1746
  v(_.get(e), u, e, u);
1674
1747
  continue;
1675
1748
  }
@@ -1677,7 +1750,7 @@ function Ln(e, t, n, r, i, a) {
1677
1750
  n <= 0 || (i.has(e.id) ? c.set(e.id, Math.max(c.get(e.id) ?? 0, n)) : l = !0);
1678
1751
  }
1679
1752
  }
1680
- let y = (e, t) => In(e.children).includes(t);
1753
+ let y = (e, t) => Ln(e.children).includes(t);
1681
1754
  for (let e = 0; e < g.length; e++) for (let t = e + 1; t < g.length; t++) {
1682
1755
  let n = g[e], r = g[t];
1683
1756
  y(n, r) || y(r, n) || v(_.get(n), r, n, r);
@@ -1688,71 +1761,72 @@ function Ln(e, t, n, r, i, a) {
1688
1761
  requests: u
1689
1762
  };
1690
1763
  }
1691
- function Rn(e, t, n) {
1764
+ function zn(e, t, n) {
1692
1765
  let r = [...e.nodes.keys()], i = {
1693
1766
  ...e,
1694
1767
  subgraphs: []
1695
- }, a = t(i), o = An(a.nodes, e.direction), s = En(e.direction), c = new Map(a.nodes.map((e) => [e.id, e])), l = (e) => {
1696
- let t = c.get(e);
1697
- return s ? t.x : t.y;
1698
- }, u = On(e.subgraphs), d = jn(u, o, l), f = /* @__PURE__ */ new Map();
1699
- for (let e of d.ghosts) f.set(e.subgraph, [...f.get(e.subgraph) ?? [], e.id]);
1700
- let p = new Map(a.nodes.map((e) => [e.id, l(e.id)]));
1701
- Mn(e.subgraphs, o, p, (t, n) => {
1702
- let r = H(t), i = H(n), a = (t, n) => e.edges.some((e) => t.has(e.source) && n.has(e.target));
1768
+ }, a = He(e), o = t(i, { feedbackEdges: a }), s = jn(o.nodes, e.direction), c = Dn(e.direction), l = new Map(o.nodes.map((e) => [e.id, e])), u = (e) => {
1769
+ let t = l.get(e);
1770
+ return c ? t.x : t.y;
1771
+ }, d = kn(e.subgraphs), f = Mn(d, s, u), p = /* @__PURE__ */ new Map();
1772
+ for (let e of f.ghosts) p.set(e.subgraph, [...p.get(e.subgraph) ?? [], e.id]);
1773
+ let m = new Map(o.nodes.map((e) => [e.id, u(e.id)]));
1774
+ Nn(e.subgraphs, s, m, (t, n) => {
1775
+ let r = U(t), i = U(n), a = (t, n) => e.edges.some((e) => t.has(e.source) && n.has(e.target));
1703
1776
  return a(r, i) && a(i, r);
1704
1777
  }, (t, n) => {
1705
- let r = H(t), i = H(n), a = (t, n) => e.edges.some((e) => e.source === t && n.has(e.target) || e.target === t && n.has(e.source));
1778
+ let r = U(t), i = U(n), a = (t, n) => e.edges.some((e) => e.source === t && n.has(e.target) || e.target === t && n.has(e.source));
1706
1779
  return [...e.nodes.keys()].some((e) => r.has(e) || i.has(e) ? r.has(e) && a(e, i) || i.has(e) && a(e, r) : a(e, r) && a(e, i));
1707
1780
  });
1708
- for (let e of d.ghosts) {
1709
- let t = [...H(u.find((t) => t.id === e.subgraph))].filter((e) => p.has(e)).map((e) => p.get(e));
1710
- p.set(e.id, t.reduce((e, t) => e + t, 0) / t.length);
1781
+ for (let e of f.ghosts) {
1782
+ let t = [...U(d.find((t) => t.id === e.subgraph))].filter((e) => m.has(e)).map((e) => m.get(e));
1783
+ m.set(e.id, t.reduce((e, t) => e + t, 0) / t.length);
1711
1784
  }
1712
- let m = new Map(e.nodes);
1713
- for (let e of d.ghosts) m.set(e.id, {
1785
+ let h = new Map(e.nodes);
1786
+ for (let e of f.ghosts) h.set(e.id, {
1714
1787
  id: e.id,
1715
1788
  label: " ",
1716
1789
  shape: "rectangle"
1717
1790
  });
1718
- let h = Nn([...m.keys()], p, o, u, f), g = {
1791
+ let g = Pn([...h.keys()], m, s, d, p), _ = {
1719
1792
  ...i,
1720
- nodes: new Map(h.map((e) => [e, m.get(e)])),
1721
- edges: [...e.edges, ...d.edges]
1722
- }, _ = new Set(d.edges.map((t, n) => e.edges.length + n)), v = (i) => {
1723
- let a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1724
- for (let c = 0;; c++) {
1725
- let l = new Map(d.ghosts.map((e) => [e.id, vn + (a.get(e.subgraph) ?? 0)])), p = t(g, {
1726
- fixedWidths: l,
1727
- looseEdges: _,
1793
+ nodes: new Map(g.map((e) => [e, h.get(e)])),
1794
+ edges: [...e.edges, ...f.edges]
1795
+ }, v = new Set(f.edges.map((t, n) => e.edges.length + n)), y = (i) => {
1796
+ let o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
1797
+ for (let l = 0;; l++) {
1798
+ let u = new Map(f.ghosts.map((e) => [e.id, yn + (o.get(e.subgraph) ?? 0)])), m = t(_, {
1799
+ fixedWidths: u,
1800
+ looseEdges: v,
1728
1801
  detachedEdges: i,
1729
1802
  walkOrder: r,
1803
+ feedbackEdges: a,
1730
1804
  forceNodeOrder: !0
1731
- }), m = new Map(p.nodes.filter((e) => !Dn(e.id)).map((e) => [e.id, e])), h = Fn(e.subgraphs, m, n), v = Ln(h, e.subgraphs, m, e.direction, new Set(f.keys()), o), { penetration: y, stuck: b } = v;
1732
- if (b) return;
1733
- if (y.size === 0) {
1734
- for (let t = 0; v.requests.length > 0; t++) {
1735
- if (t === bn) return;
1736
- Vn(v.requests.reduce((e, t) => t.amount > e.amount ? t : e), [...m.values()], p.edges), h = Fn(e.subgraphs, m, n), v = Ln(h, e.subgraphs, m, e.direction, new Set(f.keys()), o);
1805
+ }), h = new Map(m.nodes.filter((e) => !On(e.id)).map((e) => [e.id, e])), g = In(e.subgraphs, h, n), y = Rn(g, e.subgraphs, h, e.direction, new Set(p.keys()), s), { penetration: b, stuck: x } = y;
1806
+ if (x) return;
1807
+ if (b.size === 0) {
1808
+ for (let t = 0; y.requests.length > 0; t++) {
1809
+ if (t === xn) return;
1810
+ Hn(y.requests.reduce((e, t) => t.amount > e.amount ? t : e), [...h.values()], m.edges), g = In(e.subgraphs, h, n), y = Rn(g, e.subgraphs, h, e.direction, new Set(p.keys()), s);
1737
1811
  }
1738
- let t = Bn(e, i, m, h, u);
1739
- return t && Wn(p, [...m.values()], h, t, e.direction);
1812
+ let t = Vn(e, i, h, g, d);
1813
+ return t && Gn(m, [...h.values()], g, t, e.direction);
1740
1814
  }
1741
- if (c === yn) return;
1742
- for (let [e, t] of y) {
1743
- let n = a.get(e) ?? 0, r = s.get(e), i = r ? (r.overlap - t) / (n - r.width) : 0, o = i > wn ? i : Cn;
1744
- s.set(e, {
1815
+ if (l === bn) return;
1816
+ for (let [e, t] of b) {
1817
+ let n = o.get(e) ?? 0, r = c.get(e), i = r ? (r.overlap - t) / (n - r.width) : 0, a = i > Tn ? i : wn;
1818
+ c.set(e, {
1745
1819
  width: n,
1746
1820
  overlap: t
1747
- }), a.set(e, n + t / o + Sn);
1821
+ }), o.set(e, n + t / a + Cn);
1748
1822
  }
1749
1823
  }
1750
- }, y = zn(e, d, o, u);
1751
- return (y.size > 0 ? v(y) : void 0) ?? v(/* @__PURE__ */ new Set());
1824
+ }, b = Bn(e, f, s, d);
1825
+ return (b.size > 0 ? y(b) : void 0) ?? y(/* @__PURE__ */ new Set());
1752
1826
  }
1753
- function zn(e, t, n, r) {
1827
+ function Bn(e, t, n, r) {
1754
1828
  let i = r.map((e) => {
1755
- let t = H(e);
1829
+ let t = U(e);
1756
1830
  return {
1757
1831
  inside: t,
1758
1832
  layers: new Set([...t].filter((e) => n.has(e)).map((e) => n.get(e)))
@@ -1776,15 +1850,15 @@ function zn(e, t, n, r) {
1776
1850
  }
1777
1851
  return o;
1778
1852
  }
1779
- function Bn(e, t, n, r, i) {
1780
- let a = new Map(In(r).map((e) => [e.id, e])), o = [];
1853
+ function Vn(e, t, n, r, i) {
1854
+ let a = new Map(Ln(r).map((e) => [e.id, e])), o = [];
1781
1855
  for (let r of t) {
1782
1856
  let t = e.edges[r], s = n.get(t.source), c = n.get(t.target), l = i.filter((e) => {
1783
- let n = H(e);
1857
+ let n = U(e);
1784
1858
  return n.has(t.source) && n.has(t.target);
1785
- }).sort((e, t) => H(e).size - H(t).size)[0], u = l && a.get(l.id);
1859
+ }).sort((e, t) => U(e).size - U(t).size)[0], u = l && a.get(l.id);
1786
1860
  if (!s || !c || !u) return;
1787
- let d = hn(s, c, [...n.values()].filter((e) => e !== s && e !== c), u, e.direction, o.map((e) => e.points));
1861
+ let d = gn(s, c, [...n.values()].filter((e) => e !== s && e !== c), u, e.direction, o.map((e) => e.points));
1788
1862
  if (!d) return;
1789
1863
  o.push({
1790
1864
  source: t.source,
@@ -1794,42 +1868,42 @@ function Bn(e, t, n, r, i) {
1794
1868
  hasArrowStart: t.hasArrowStart,
1795
1869
  hasArrowEnd: t.hasArrowEnd,
1796
1870
  points: d,
1797
- labelPosition: t.label ? gn(d) : void 0,
1798
- inlineStyle: $t(r, e),
1871
+ labelPosition: t.label ? _n(d) : void 0,
1872
+ inlineStyle: en(r, e),
1799
1873
  id: t.id,
1800
1874
  animate: t.animate
1801
1875
  });
1802
1876
  }
1803
1877
  return o;
1804
1878
  }
1805
- function Vn(e, t, n) {
1806
- let { axis: r, amount: i, after: a } = e, o = i + xn, s = t.filter((e) => e[r] >= a), c = Math.min(...s.map((e) => e[r]));
1879
+ function Hn(e, t, n) {
1880
+ let { axis: r, amount: i, after: a } = e, o = i + Sn, s = t.filter((e) => e[r] >= a), c = Math.min(...s.map((e) => e[r]));
1807
1881
  for (let e of s) e[r] += o;
1808
1882
  let l = (e) => {
1809
1883
  e[r] >= c && (e[r] += o);
1810
1884
  };
1811
1885
  for (let e of n) e.points.forEach(l), e.labelPosition && l(e.labelPosition);
1812
1886
  }
1813
- var Hn = 8;
1814
- function Un(e, t, n, r) {
1815
- let i = En(r) ? "y" : "x", a = i === "x" ? "y" : "x", o = i === "x" ? "width" : "height", s = i === "x" ? "height" : "width";
1887
+ var Un = 8;
1888
+ function Wn(e, t, n, r) {
1889
+ let i = Dn(r) ? "y" : "x", a = i === "x" ? "y" : "x", o = i === "x" ? "width" : "height", s = i === "x" ? "height" : "width";
1816
1890
  for (let { points: r } of e) for (let e = 1; e < r.length - 1;) {
1817
1891
  let c = e;
1818
1892
  for (; c + 1 < r.length - 1 && r[c + 1][i] === r[e][i];) c++;
1819
1893
  let l = r.slice(e, c + 1), u = l[0], d = Math.min(...l.map((e) => e[a])), f = Math.max(...l.map((e) => e[a])), p = r[e - 1][i], m = r[c + 1][i], h = n.flatMap((e) => [e[i], e[i] + e[o]].map((t) => ({
1820
1894
  g: e,
1821
1895
  s: t
1822
- }))).find(({ g: e, s: t }) => Math.abs(u[i] - t) < Hn && f > e[a] && d < e[a] + e[s]);
1896
+ }))).find(({ g: e, s: t }) => Math.abs(u[i] - t) < Un && f > e[a] && d < e[a] + e[s]);
1823
1897
  if (h) {
1824
- let e = h.s + (u[i] >= h.s ? Hn : -8), n = (e - p) * (m - e) > 0, r = t.every((t) => t[i] + t[o] <= e || t[i] >= e || t[a] + t[s] <= d || t[a] >= f);
1898
+ let e = h.s + (u[i] >= h.s ? Un : -8), n = (e - p) * (m - e) > 0, r = t.every((t) => t[i] + t[o] <= e || t[i] >= e || t[a] + t[s] <= d || t[a] >= f);
1825
1899
  if (n && r) for (let t of l) t[i] = e;
1826
1900
  }
1827
1901
  e = c + 1;
1828
1902
  }
1829
1903
  }
1830
- function Wn(e, t, n, r, i) {
1831
- let a = [...e.edges.filter((e) => !Dn(e.source) && !Dn(e.target)), ...r], o = In(n);
1832
- Un(a, t, o, i);
1904
+ function Gn(e, t, n, r, i) {
1905
+ let a = [...e.edges.filter((e) => !On(e.source) && !On(e.target)), ...r], o = Ln(n);
1906
+ Wn(a, t, o, i);
1833
1907
  let s = [
1834
1908
  ...t.map((e) => e.x),
1835
1909
  ...o.map((e) => e.x),
@@ -1838,7 +1912,7 @@ function Wn(e, t, n, r, i) {
1838
1912
  ...t.map((e) => e.y),
1839
1913
  ...o.map((e) => e.y),
1840
1914
  ...a.flatMap((e) => e.points.map((e) => e.y))
1841
- ], l = B.padding - Math.min(...s), u = B.padding - Math.min(...c);
1915
+ ], l = V.padding - Math.min(...s), u = V.padding - Math.min(...c);
1842
1916
  for (let e of t) e.x += l, e.y += u;
1843
1917
  for (let e of o) e.x += l, e.y += u;
1844
1918
  for (let e of a) {
@@ -1846,11 +1920,11 @@ function Wn(e, t, n, r, i) {
1846
1920
  e.labelPosition && (e.labelPosition.x += l, e.labelPosition.y += u);
1847
1921
  }
1848
1922
  let d = 0, f = 0;
1849
- for (let e of t) d = Math.max(d, e.x + e.width + B.padding), f = Math.max(f, e.y + e.height + B.padding);
1850
- for (let e of o) d = Math.max(d, e.x + e.width + B.padding), f = Math.max(f, e.y + e.height + B.padding);
1923
+ for (let e of t) d = Math.max(d, e.x + e.width + V.padding), f = Math.max(f, e.y + e.height + V.padding);
1924
+ for (let e of o) d = Math.max(d, e.x + e.width + V.padding), f = Math.max(f, e.y + e.height + V.padding);
1851
1925
  for (let e of a) {
1852
- for (let t of e.points) d = Math.max(d, t.x + Be.width + B.padding), f = Math.max(f, t.y + Be.width + B.padding);
1853
- e.labelPosition && (d = Math.max(d, e.labelPosition.x + 60 + B.padding), f = Math.max(f, e.labelPosition.y + 20 + B.padding));
1926
+ for (let t of e.points) d = Math.max(d, t.x + B.width + V.padding), f = Math.max(f, t.y + B.width + V.padding);
1927
+ e.labelPosition && (d = Math.max(d, e.labelPosition.x + 60 + V.padding), f = Math.max(f, e.labelPosition.y + 20 + V.padding));
1854
1928
  }
1855
1929
  return {
1856
1930
  ...e,
@@ -1863,8 +1937,8 @@ function Wn(e, t, n, r, i) {
1863
1937
  }
1864
1938
  //#endregion
1865
1939
  //#region packages/svg-renderer/src/layout-engine/layered.ts
1866
- var Gn = 12, Kn = 8, qn = 4;
1867
- function Jn(e, t, n) {
1940
+ var Kn = 12, qn = 8, Jn = 4;
1941
+ function Yn(e, t, n) {
1868
1942
  let r = e.map((e) => ({
1869
1943
  axis: e.axis,
1870
1944
  cross: e.cross,
@@ -1925,7 +1999,7 @@ function Jn(e, t, n) {
1925
1999
  });
1926
2000
  let g = r.map(() => 0), _ = [], v = [];
1927
2001
  for (let e of h.values()) {
1928
- let t = Yn(e, r, i, a, n), o = Infinity, s = -Infinity;
2002
+ let t = Xn(e, r, i, a, n), o = Infinity, s = -Infinity;
1929
2003
  for (let n of e) g[n] = t.get(n), o = Math.min(o, g[n] - r[n].cross / 2), s = Math.max(s, g[n] + r[n].cross / 2 + r[n].after);
1930
2004
  _.push({
1931
2005
  min: o,
@@ -1966,7 +2040,7 @@ function Jn(e, t, n) {
1966
2040
  crossSize: b
1967
2041
  };
1968
2042
  }
1969
- function Yn(e, t, n, r, i) {
2043
+ function Xn(e, t, n, r, i) {
1970
2044
  let a = [], o = /* @__PURE__ */ new Set(), s = [...e].sort((e, n) => t[e].rank - t[n].rank || e - n);
1971
2045
  for (let e of s) {
1972
2046
  if (o.has(e)) continue;
@@ -1995,7 +2069,7 @@ function Yn(e, t, n, r, i) {
1995
2069
  };
1996
2070
  u();
1997
2071
  let f = c.map((e) => [...e]), p = d();
1998
- for (let e = 0; e < Kn && p > 0; e++) {
2072
+ for (let e = 0; e < qn && p > 0; e++) {
1999
2073
  let t = e % 2 == 0, i = c.map((e, t) => t);
2000
2074
  t || i.reverse();
2001
2075
  for (let e of i) {
@@ -2009,21 +2083,21 @@ function Yn(e, t, n, r, i) {
2009
2083
  a < p && (p = a, f = c.map((e) => [...e]));
2010
2084
  }
2011
2085
  f.forEach((e, t) => c[t] = e);
2012
- let m = /* @__PURE__ */ new Map(), h = (e, n) => (t[e].cross + t[n].cross) / 2 + t[e].after + (t[e].real && t[n].real ? i.nodeSep : Math.min(i.nodeSep, Gn)), g = (e, t) => {
2086
+ let m = /* @__PURE__ */ new Map(), h = (e, n) => (t[e].cross + t[n].cross) / 2 + t[e].after + (t[e].real && t[n].real ? i.nodeSep : Math.min(i.nodeSep, Kn)), g = (e, t) => {
2013
2087
  let n = e.slice(1).map((t, n) => h(e[n], t)), r = [0];
2014
- n.forEach((e, t) => r.push(r[t] + e)), Xn(e.map((e, n) => {
2088
+ n.forEach((e, t) => r.push(r[t] + e)), Zn(e.map((e, n) => {
2015
2089
  let i = (t[e] ?? []).filter((e) => m.has(e));
2016
2090
  return (i.length === 0 ? m.get(e) ?? 0 : i.reduce((e, t) => e + m.get(t), 0) / i.length) - r[n];
2017
2091
  })).forEach((t, n) => m.set(e[n], t + r[n]));
2018
2092
  };
2019
2093
  for (let e of c) g(e, []);
2020
- for (let e = 0; e < qn; e++) {
2094
+ for (let e = 0; e < Jn; e++) {
2021
2095
  for (let e = 1; e < c.length; e++) g(c[e], n);
2022
2096
  for (let e = c.length - 2; e >= 0; e--) g(c[e], r);
2023
2097
  }
2024
2098
  return m;
2025
2099
  }
2026
- function Xn(e) {
2100
+ function Zn(e) {
2027
2101
  let t = [];
2028
2102
  for (let n of e) for (t.push({
2029
2103
  sum: n,
@@ -2040,10 +2114,10 @@ function Xn(e) {
2040
2114
  }
2041
2115
  //#endregion
2042
2116
  //#region packages/svg-renderer/src/layout-engine/simple-layout.ts
2043
- var Zn = 28, Qn = 18, $n = 10, er = 32;
2044
- function tr(e, t = {}) {
2117
+ var Qn = 28, $n = 18, er = 10, tr = 32;
2118
+ function nr(e, t = {}) {
2045
2119
  let n = {
2046
- ...B,
2120
+ ...V,
2047
2121
  ...t,
2048
2122
  fontSizes: Le(t.fontSizes)
2049
2123
  }, r = e.direction === "TB" || e.direction === "TD" || e.direction === "BT", i = e.direction === "BT" || e.direction === "RL", a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = (e, t) => {
@@ -2090,20 +2164,20 @@ function tr(e, t = {}) {
2090
2164
  }]);
2091
2165
  });
2092
2166
  let v = r ? i ? {
2093
- axisStart: V.bottom,
2094
- axisEnd: V.top,
2095
- crossStart: V.left,
2096
- crossEnd: V.right
2167
+ axisStart: H.bottom,
2168
+ axisEnd: H.top,
2169
+ crossStart: H.left,
2170
+ crossEnd: H.right
2097
2171
  } : {
2098
- axisStart: V.top,
2099
- axisEnd: V.bottom,
2100
- crossStart: V.left,
2101
- crossEnd: V.right
2172
+ axisStart: H.top,
2173
+ axisEnd: H.bottom,
2174
+ crossStart: H.left,
2175
+ crossEnd: H.right
2102
2176
  } : {
2103
- axisStart: i ? V.right : V.left,
2104
- axisEnd: i ? V.left : V.right,
2105
- crossStart: V.top,
2106
- crossEnd: V.bottom
2177
+ axisStart: i ? H.right : H.left,
2178
+ axisEnd: i ? H.left : H.right,
2179
+ crossStart: H.top,
2180
+ crossEnd: H.bottom
2107
2181
  }, y = (e, t) => r ? {
2108
2182
  aSize: t,
2109
2183
  cSize: e
@@ -2112,14 +2186,14 @@ function tr(e, t = {}) {
2112
2186
  cSize: t
2113
2187
  }, b = /* @__PURE__ */ new Map();
2114
2188
  for (let t of c) {
2115
- let r = e.nodes.get(t), i = ct(t, r.label, r.shape, n.fontSizes.nodeLabel);
2189
+ let r = e.nodes.get(t), i = lt(t, r.label, r.shape, n.fontSizes.nodeLabel);
2116
2190
  b.set(t, y(i.width, i.height));
2117
2191
  }
2118
2192
  let S = (e) => {
2119
2193
  let t = _.get(e);
2120
2194
  if (!r || !t) return 0;
2121
- let n = Math.max(0, ...t.map((e) => (h(e)?.cross ?? -10) + $n));
2122
- return Zn + (t.length - 1) * Qn + n;
2195
+ let n = Math.max(0, ...t.map((e) => (h(e)?.cross ?? -10) + er));
2196
+ return Qn + (t.length - 1) * $n + n;
2123
2197
  }, C = (e) => {
2124
2198
  let t = f(e), i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
2125
2199
  for (let e of t) {
@@ -2130,7 +2204,7 @@ function tr(e, t = {}) {
2130
2204
  }
2131
2205
  let c = C(e);
2132
2206
  i.set(e, c);
2133
- let l = p(t.label, n.fontSizes.groupHeader, L.groupHeader).width, u = c.axisSize + v.axisStart + v.axisEnd, d = c.crossSize + v.crossStart + v.crossEnd, f = r ? 0 : l + er, m = r ? l + er : 0, h = Math.max(0, f - u), g = Math.max(0, m - d);
2207
+ let l = p(t.label, n.fontSizes.groupHeader, L.groupHeader).width, u = c.axisSize + v.axisStart + v.axisEnd, d = c.crossSize + v.crossStart + v.crossEnd, f = r ? 0 : l + tr, m = r ? l + tr : 0, h = Math.max(0, f - u), g = Math.max(0, m - d);
2134
2208
  u += h, d += g, o.set(e, {
2135
2209
  aSize: u,
2136
2210
  cSize: d
@@ -2139,7 +2213,7 @@ function tr(e, t = {}) {
2139
2213
  cross: v.crossStart + g / 2
2140
2214
  });
2141
2215
  }
2142
- let c = new Map(t.map((e, t) => [e, t])), l = g.get(e ?? "") ?? [], u = Jn(t.map((e) => ({
2216
+ let c = new Map(t.map((e, t) => [e, t])), l = g.get(e ?? "") ?? [], u = Yn(t.map((e) => ({
2143
2217
  axis: o.get(e).aSize,
2144
2218
  cross: o.get(e).cSize,
2145
2219
  after: S(e)
@@ -2271,10 +2345,10 @@ function tr(e, t = {}) {
2271
2345
  }
2272
2346
  u.push(e);
2273
2347
  }
2274
- let d = Mt(nr(u.map(ee)));
2348
+ let d = Nt(rr(u.map(ee)));
2275
2349
  o && d.reverse();
2276
2350
  let f = P.get(t.source), p = P.get(t.target);
2277
- f && (d = vt(d, f, !0)), p && (d = vt(d, p, !1)), te.push({
2351
+ f && (d = yt(d, f, !0)), p && (d = yt(d, p, !1)), te.push({
2278
2352
  source: t.source,
2279
2353
  target: t.target,
2280
2354
  label: t.label,
@@ -2283,25 +2357,25 @@ function tr(e, t = {}) {
2283
2357
  hasArrowEnd: t.hasArrowEnd,
2284
2358
  points: d,
2285
2359
  labelPosition: r.label && ee(r.label),
2286
- inlineStyle: $t(n, e),
2360
+ inlineStyle: en(n, e),
2287
2361
  id: t.id,
2288
2362
  animate: t.animate
2289
2363
  });
2290
- }), Vt(e, P, te);
2291
- let F = (r ? w.crossSize : w.axisSize) + k * 2, ne = (r ? w.axisSize : w.crossSize) + k * 2;
2364
+ }), Ht(e, P, te);
2365
+ let ne = (r ? w.crossSize : w.axisSize) + k * 2, F = (r ? w.axisSize : w.crossSize) + k * 2;
2292
2366
  for (let e of te) {
2293
- for (let t of e.points) F = Math.max(F, t.x + Be.width + k), ne = Math.max(ne, t.y + Be.width + k);
2294
- e.labelPosition && (F = Math.max(F, e.labelPosition.x + 60 + k), ne = Math.max(ne, e.labelPosition.y + 20 + k));
2367
+ for (let t of e.points) ne = Math.max(ne, t.x + B.width + k), F = Math.max(F, t.y + B.width + k);
2368
+ e.labelPosition && (ne = Math.max(ne, e.labelPosition.x + 60 + k), F = Math.max(F, e.labelPosition.y + 20 + k));
2295
2369
  }
2296
2370
  return {
2297
- width: F,
2298
- height: ne,
2371
+ width: ne,
2372
+ height: F,
2299
2373
  nodes: N,
2300
2374
  edges: te,
2301
2375
  groups: O
2302
2376
  };
2303
2377
  }
2304
- function nr(e) {
2378
+ function rr(e) {
2305
2379
  return e.filter((t, n) => {
2306
2380
  let r = e[n - 1], i = e[n + 1];
2307
2381
  return !r || !i || !(r.x === t.x && t.x === i.x || r.y === t.y && t.y === i.y);
@@ -2309,53 +2383,53 @@ function nr(e) {
2309
2383
  }
2310
2384
  //#endregion
2311
2385
  //#region packages/svg-renderer/src/layout-engine.ts
2312
- function rr(e, t = {}) {
2313
- return ir(e, t);
2386
+ function ir(e, t = {}) {
2387
+ return ar(e, t);
2314
2388
  }
2315
- function ir(e, t, n) {
2389
+ function ar(e, t, n) {
2316
2390
  let r = {
2317
- ...B,
2391
+ ...V,
2318
2392
  ...t,
2319
2393
  fontSizes: Le(t.fontSizes)
2320
2394
  };
2321
- return Ut(Ae(mt(e, r, n), t.layoutCache), e, r.mergeEdges);
2395
+ return Wt(Ae(ht(e, r, n), t.layoutCache), e, r.mergeEdges);
2322
2396
  }
2323
- function ar(e, t = {}) {
2397
+ function or(e, t = {}) {
2324
2398
  let n = ee(e);
2325
- if (t.layout === "simple" && !et(n)) return tr(n, t);
2399
+ if (t.layout === "simple" && !et(n)) return nr(n, t);
2326
2400
  if (t.layout !== void 0 && t.layout !== "elk" && t.layout !== "simple") throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(t.layout)}; use 'elk' or 'simple'.`);
2327
- if (kn(n)) {
2328
- let e = Rn(n, (e, n) => ir(e, t, n), Le(t.fontSizes));
2401
+ if (An(n)) {
2402
+ let e = zn(n, (e, n) => ar(e, t, n), Le(t.fontSizes));
2329
2403
  if (e) return e;
2330
2404
  }
2331
- return rr(n, t);
2405
+ return ir(n, t);
2332
2406
  }
2333
- function or(e, t = {}) {
2334
- return mt(e, {
2335
- ...B,
2407
+ function sr(e, t = {}) {
2408
+ return ht(e, {
2409
+ ...V,
2336
2410
  ...t,
2337
2411
  fontSizes: Le(t.fontSizes)
2338
2412
  });
2339
2413
  }
2340
2414
  //#endregion
2341
2415
  //#region packages/svg-renderer/src/title-gaps.ts
2342
- var sr = 12, cr = 2;
2343
- function lr(e) {
2344
- return e.flatMap((e) => [e, ...lr(e.children)]);
2416
+ var cr = 12, lr = 2;
2417
+ function ur(e) {
2418
+ return e.flatMap((e) => [e, ...ur(e.children)]);
2345
2419
  }
2346
- function ur(e, t) {
2420
+ function dr(e, t) {
2347
2421
  let n = t.groupHeader + 16;
2348
- return lr(e).filter((e) => e.label !== "").map((e) => {
2422
+ return ur(e).filter((e) => e.label !== "").map((e) => {
2349
2423
  let r = p(e.label, t.groupHeader, L.groupHeader);
2350
2424
  return {
2351
- x: e.x + sr - cr,
2352
- y: e.y + n / 2 - r.height / 2 - cr,
2425
+ x: e.x + cr - lr,
2426
+ y: e.y + n / 2 - r.height / 2 - lr,
2353
2427
  width: r.width + 4,
2354
2428
  height: r.height + 4
2355
2429
  };
2356
2430
  });
2357
2431
  }
2358
- function dr(e, t, n) {
2432
+ function fr(e, t, n) {
2359
2433
  let r = t.x - e.x, i = t.y - e.y, a = [
2360
2434
  -r,
2361
2435
  r,
@@ -2378,26 +2452,26 @@ function dr(e, t, n) {
2378
2452
  }
2379
2453
  return !0;
2380
2454
  }
2381
- function fr(e) {
2455
+ function pr(e) {
2382
2456
  return {
2383
- x: e.x + cr,
2384
- y: e.y + cr,
2457
+ x: e.x + lr,
2458
+ y: e.y + lr,
2385
2459
  width: e.width - 4,
2386
2460
  height: e.height - 4
2387
2461
  };
2388
2462
  }
2389
- function pr(e, t) {
2390
- let n = e.points, r = t.map(fr);
2391
- for (let e = 0; e + 1 < n.length; e++) if (r.some((t) => dr(n[e], n[e + 1], t))) return !0;
2463
+ function mr(e, t) {
2464
+ let n = e.points, r = t.map(pr);
2465
+ for (let e = 0; e + 1 < n.length; e++) if (r.some((t) => fr(n[e], n[e + 1], t))) return !0;
2392
2466
  return !1;
2393
2467
  }
2394
- function mr(e) {
2468
+ function hr(e) {
2395
2469
  let t = 2166136261;
2396
2470
  for (let n of e.map((e) => `${e.x},${e.y},${e.width},${e.height}`).join(";")) t = Math.imul(t ^ n.charCodeAt(0), 16777619);
2397
2471
  return (t >>> 0).toString(36);
2398
2472
  }
2399
- function hr(e, t, n) {
2400
- let r = `zm-title-gap-${mr(e)}`;
2473
+ function gr(e, t, n) {
2474
+ let r = `zm-title-gap-${hr(e)}`;
2401
2475
  return {
2402
2476
  id: r,
2403
2477
  markup: ` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map((e) => ` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join("\n")}\n </mask>`
@@ -2405,25 +2479,25 @@ function hr(e, t, n) {
2405
2479
  }
2406
2480
  //#endregion
2407
2481
  //#region packages/svg-renderer/src/renderer.ts
2408
- function gr(e, n, r = "Inter", i = !1, a = Ie, o = "linear", s, c = !0, l = !0, u, d, f = {}) {
2482
+ function _r(e, n, r = "Inter", i = !1, a = Ie, o = "linear", s, c = !0, l = !0, u, d, f = {}) {
2409
2483
  let p = [], m = l && e.nodes.some((e) => !!S(e.interaction?.href));
2410
- p.push(pi(O(e.width, e.height, n, i, u, d, m, f.styleAttribute, f.description), s)), p.push(t(r, !1, f.nonce)), c && e.edges.some((e) => e.animate) && p.push(_r(f.nonce)), p.push("<defs>"), p.push(vr());
2484
+ p.push(mi(O(e.width, e.height, n, i, u, d, m, f.styleAttribute, f.description), s)), p.push(t(r, !1, f.nonce)), c && e.edges.some((e) => e.animate) && p.push(vr(f.nonce)), p.push("<defs>"), p.push(yr());
2411
2485
  let h = /* @__PURE__ */ new Set();
2412
2486
  for (let t of e.edges) t.inlineStyle?.stroke && h.add(t.inlineStyle.stroke);
2413
- for (let e of h) p.push(yr(e));
2414
- let g = ur(e.groups, a), _ = new Set(e.edges.filter((e) => pr(e, g))), v;
2487
+ for (let e of h) p.push(br(e));
2488
+ let g = dr(e.groups, a), _ = new Set(e.edges.filter((e) => mr(e, g))), v;
2415
2489
  if (_.size > 0) {
2416
- let t = hr(g, e.width, e.height);
2490
+ let t = gr(g, e.width, e.height);
2417
2491
  v = t.id, p.push(t.markup);
2418
2492
  }
2419
2493
  p.push("</defs>");
2420
- for (let t of e.groups) p.push(Sr(t, r, a));
2421
- for (let t of e.edges) p.push(Cr(t, o, c, _.has(t) ? v : void 0));
2422
- for (let t of e.edges) t.label && p.push(Tr(t, r, a));
2423
- for (let t of e.nodes) p.push(kr(t, r, a, l));
2494
+ for (let t of e.groups) p.push(Cr(t, r, a));
2495
+ for (let t of e.edges) p.push(wr(t, o, c, _.has(t) ? v : void 0));
2496
+ for (let t of e.edges) t.label && p.push(Er(t, r, a));
2497
+ for (let t of e.nodes) p.push(Ar(t, r, a, l));
2424
2498
  return p.push("</svg>"), p.join("\n");
2425
2499
  }
2426
- function _r(e) {
2500
+ function vr(e) {
2427
2501
  return [
2428
2502
  E(e),
2429
2503
  " @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }",
@@ -2434,33 +2508,33 @@ function _r(e) {
2434
2508
  "</style>"
2435
2509
  ].join("\n");
2436
2510
  }
2437
- function vr() {
2438
- return br("var(--_arrow)", "");
2511
+ function yr() {
2512
+ return xr("var(--_arrow)", "");
2439
2513
  }
2440
- function yr(e) {
2441
- return br(o(e), l`-${xr(e)}`);
2514
+ function br(e) {
2515
+ return xr(o(e), l`-${Sr(e)}`);
2442
2516
  }
2443
- function br(e, t) {
2444
- let n = Be.width, r = Be.height, i = n - 1, a = l`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`, o = l`<polygon points="0 0, ${n} ${r / 2}, 0 ${r}" ${a} />`, s = (e, t) => l` <marker id="${e}" markerWidth="${n}" markerHeight="${r}" refX="${i}" refY="${r / 2}" orient="${t}">` + l`\n ${o}` + "\n </marker>";
2517
+ function xr(e, t) {
2518
+ let n = B.width, r = B.height, i = n - 1, a = l`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`, o = l`<polygon points="0 0, ${n} ${r / 2}, 0 ${r}" ${a} />`, s = (e, t) => l` <marker id="${e}" markerWidth="${n}" markerHeight="${r}" refX="${i}" refY="${r / 2}" orient="${t}">` + l`\n ${o}` + "\n </marker>";
2445
2519
  return s(l`arrowhead${t}`, "auto") + "\n" + s(l`arrowhead-start${t}`, "auto-start-reverse");
2446
2520
  }
2447
- function xr(e) {
2521
+ function Sr(e) {
2448
2522
  return e.replace(/[^a-zA-Z0-9]/g, (e) => e.charCodeAt(0).toString(16));
2449
2523
  }
2450
- function Sr(e, t, n) {
2524
+ function Cr(e, t, n) {
2451
2525
  let r = n.groupHeader + 16, i = [];
2452
2526
  if (e.region) {
2453
2527
  i.push(l`<g class="subgraph subgraph-region" data-id="${o(e.id)}">`, l` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + l`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" stroke-dasharray="6 4" />`);
2454
- for (let r of e.children) i.push(Sr(r, t, n));
2528
+ for (let r of e.children) i.push(Cr(r, t, n));
2455
2529
  return i.push("</g>"), i.join("\n");
2456
2530
  }
2457
2531
  i.push(l`<g class="subgraph" data-id="${o(e.id)}" data-label="${o(e.label)}">`), i.push(l` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + l`rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), i.push(l` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${r}" ` + l`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), i.push(" " + y(e.label, e.x + 12, e.y + r / 2, n.groupHeader, l`font-size="${n.groupHeader}" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`));
2458
- for (let r of e.children) i.push(Sr(r, t, n));
2532
+ for (let r of e.children) i.push(Cr(r, t, n));
2459
2533
  return i.push("</g>"), i.join("\n");
2460
2534
  }
2461
- function Cr(e, t, n = !0, r) {
2535
+ function wr(e, t, n = !0, r) {
2462
2536
  if (e.points.length < 2) return "";
2463
- let i = n && (e.animate ?? !1), a = t !== "linear", s = e.style === "invisible", c = e.style === "dotted" ? " stroke-dasharray=\"4 4\"" : "", u = e.style === "thick" ? R.connector * 2 : R.connector, d = s ? "none" : o(e.inlineStyle?.stroke ?? "var(--_line)"), f = o(e.inlineStyle?.["stroke-width"] ?? String(u)), p = e.inlineStyle?.stroke ? l`-${xr(e.inlineStyle.stroke)}` : "", m = "";
2537
+ let i = n && (e.animate ?? !1), a = t !== "linear", s = e.style === "invisible", c = e.style === "dotted" ? " stroke-dasharray=\"4 4\"" : "", u = e.style === "thick" ? R.connector * 2 : R.connector, d = s ? "none" : o(e.inlineStyle?.stroke ?? "var(--_line)"), f = o(e.inlineStyle?.["stroke-width"] ?? String(u)), p = e.inlineStyle?.stroke ? l`-${Sr(e.inlineStyle.stroke)}` : "", m = "";
2464
2538
  s || (e.hasArrowEnd && (m += l` marker-end="url(#arrowhead${p})"`), e.hasArrowStart && (m += l` marker-start="url(#arrowhead-start${p})"`));
2465
2539
  let h = [
2466
2540
  l`class="edge${i ? " edge-animated" : ""}"`,
@@ -2471,35 +2545,35 @@ function Cr(e, t, n = !0, r) {
2471
2545
  l`data-arrow-end="${e.hasArrowEnd}"`
2472
2546
  ];
2473
2547
  e.label && h.push(l`data-label="${o(e.label)}"`), e.id && h.push(l`data-id="${o(e.id)}"`);
2474
- let g = i && !c ? " stroke-dasharray=\"8 6\"" : "", _ = a ? l`d="${_e(e.points, t)}"` : l`points="${wr(e.points)}"`;
2548
+ let g = i && !c ? " stroke-dasharray=\"8 6\"" : "", _ = a ? l`d="${_e(e.points, t)}"` : l`points="${Tr(e.points)}"`;
2475
2549
  return l`<${a ? "path" : "polyline"} ${h.join(" ")} ${_} ` + l`fill="none" stroke="${d}" ` + l`stroke-width="${f}"${c}${g}${m}` + (r ? l` mask="url(#${r})"` : "") + " />";
2476
2550
  }
2477
- function wr(e) {
2551
+ function Tr(e) {
2478
2552
  return e.map((e) => l`${e.x},${e.y}`).join(" ");
2479
2553
  }
2480
- function Tr(e, t, n) {
2554
+ function Er(e, t, n) {
2481
2555
  if (!e.label) return "";
2482
- let r = e.label, i = e.labelPosition ?? Dr(e.points), a = p(r, n.edgeLabel, L.edgeLabel), s = b(r, i.x, i.y, a.width, a.height, n.edgeLabel, 8, l`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`, "rx=\"2\" ry=\"2\" fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"1\"");
2556
+ let r = e.label, i = e.labelPosition ?? Or(e.points), a = p(r, n.edgeLabel, L.edgeLabel), s = b(r, i.x, i.y, a.width, a.height, n.edgeLabel, 8, l`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${L.edgeLabel}" fill="var(--_text-sec)"`, "rx=\"2\" ry=\"2\" fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"1\"");
2483
2557
  return l`<g class="edge-label" data-from="${o(e.source)}" data-to="${o(e.target)}" data-label="${o(r)}">\n` + l` ${s.replace(/\n/g, "\n ")}\n` + "</g>";
2484
2558
  }
2485
- function Er(e, t) {
2559
+ function Dr(e, t) {
2486
2560
  let n = e[t];
2487
2561
  if (!n)
2488
2562
  /* v8 ignore next */
2489
2563
  throw Error(l`edgeMidpoint: missing point at index ${t}`);
2490
2564
  return n;
2491
2565
  }
2492
- function Dr(e) {
2566
+ function Or(e) {
2493
2567
  if (e.length === 0) return {
2494
2568
  x: 0,
2495
2569
  y: 0
2496
2570
  };
2497
2571
  if (e.length === 1) return e[0];
2498
2572
  let t = 0;
2499
- for (let n = 1; n < e.length; n++) t += Or(Er(e, n - 1), Er(e, n));
2573
+ for (let n = 1; n < e.length; n++) t += kr(Dr(e, n - 1), Dr(e, n));
2500
2574
  let n = t / 2;
2501
2575
  for (let t = 1; t < e.length; t++) {
2502
- let r = Er(e, t - 1), i = Er(e, t), a = Or(r, i);
2576
+ let r = Dr(e, t - 1), i = Dr(e, t), a = kr(r, i);
2503
2577
  if (n <= a) {
2504
2578
  let e = n / a;
2505
2579
  return {
@@ -2511,11 +2585,11 @@ function Dr(e) {
2511
2585
  }
2512
2586
  return e[e.length - 1];
2513
2587
  }
2514
- function Or(e, t) {
2588
+ function kr(e, t) {
2515
2589
  return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2);
2516
2590
  }
2517
- function kr(e, t, n, r = !0) {
2518
- let i = Ar(e), a = di(e, t, n), c = [], u = C(e.className), d = u ? l`node ${u}` : "node", f = e.interaction, p = [
2591
+ function Ar(e, t, n, r = !0) {
2592
+ let i = jr(e), a = fi(e, t, n), c = [], u = C(e.className), d = u ? l`node ${u}` : "node", f = e.interaction, p = [
2519
2593
  l`class="${d}"`,
2520
2594
  l`data-id="${o(e.id)}"`,
2521
2595
  l`data-label="${o(e.label)}"`,
@@ -2529,66 +2603,66 @@ function kr(e, t, n, r = !0) {
2529
2603
  }
2530
2604
  return r && f?.tooltip && c.push(l`${h}<title>${s(f.tooltip)}</title>`), c.push(l`${h}${i.replace(/\n/g, l`\n${h}`)}`), a && c.push(l`${h}${a.replace(/\n/g, l`\n${h}`)}`), m && c.push(" </a>"), c.push("</g>"), c.join("\n");
2531
2605
  }
2532
- function Ar(e) {
2606
+ function jr(e) {
2533
2607
  let { x: t, y: n, width: r, height: i, shape: a, inlineStyle: s } = e, c = o(s?.fill ?? "var(--_node-fill)"), l = o(s?.stroke ?? "var(--_node-stroke)"), u = o(s?.["stroke-width"] ?? String(R.innerBox));
2534
2608
  switch (a) {
2535
- case "diamond": return Fr(t, n, r, i, c, l, u);
2536
- case "rounded": return Mr(t, n, r, i, c, l, u);
2537
- case "stadium": return Nr(t, n, r, i, c, l, u);
2538
- case "circle": return Pr(t, n, r, i, c, l, u);
2539
- case "subroutine": return Ir(t, n, r, i, c, l, u);
2540
- case "doublecircle": return Lr(t, n, r, i, c, l, u);
2541
- case "hexagon": return Rr(t, n, r, i, c, l, u);
2542
- case "cylinder": return zr(t, n, r, i, c, l, u);
2543
- case "asymmetric": return Br(t, n, r, i, c, l, u);
2544
- case "trapezoid": return Vr(t, n, r, i, c, l, u);
2545
- case "trapezoid-alt": return Hr(t, n, r, i, c, l, u);
2546
- case "parallelogram": return Ur(t, n, r, i, c, l, u);
2547
- case "parallelogram-alt": return Wr(t, n, r, i, c, l, u);
2548
- case "state-start": return li(t, n, r, i);
2549
- case "state-end": return ui(t, n, r, i);
2550
- case "document": return Gr(t, n, r, i, c, l, u);
2551
- case "stacked-document": return Kr(t, n, r, i, c, l, u, !0);
2552
- case "stacked-process": return Kr(t, n, r, i, c, l, u, !1);
2553
- case "card": return qr(t, n, r, i, c, l, u);
2554
- case "lined-process": return Jr(t, n, r, i, c, l, u);
2555
- case "divided-process": return Yr(t, n, r, i, c, l, u);
2556
- case "window-pane": return Xr(t, n, r, i, c, l, u);
2557
- case "triangle": return Zr(t, n, r, i, c, l, u, !1);
2558
- case "flipped-triangle": return Zr(t, n, r, i, c, l, u, !0);
2559
- case "filled-circle": return Qr(t, n, r, i, l);
2560
- case "crossed-circle": return $r(t, n, r, i, c, l, u);
2561
- case "fork-join": return ei(t, n, r, i, l);
2562
- case "note": return ti(t, n, r, i, o(s?.fill ?? "var(--bg)"), l, u);
2563
- case "notched-pentagon": return ni(t, n, r, i, c, l, u);
2564
- case "sloped-rectangle": return ri(t, n, r, i, c, l, u);
2565
- case "flag": return ii(t, n, r, i, c, l, u);
2566
- case "bow-tie-rectangle": return ai(t, n, r, i, c, l, u);
2567
- case "half-rounded-rectangle": return oi(t, n, r, i, c, l, u);
2568
- case "brace": return si(t, n, r, i, c, l, u, "left");
2569
- case "brace-right": return si(t, n, r, i, c, l, u, "right");
2570
- case "braces": return si(t, n, r, i, c, l, u, "both");
2571
- case "bolt": return ci(t, n, r, i, c, l, u);
2609
+ case "diamond": return Ir(t, n, r, i, c, l, u);
2610
+ case "rounded": return Nr(t, n, r, i, c, l, u);
2611
+ case "stadium": return Pr(t, n, r, i, c, l, u);
2612
+ case "circle": return Fr(t, n, r, i, c, l, u);
2613
+ case "subroutine": return Lr(t, n, r, i, c, l, u);
2614
+ case "doublecircle": return Rr(t, n, r, i, c, l, u);
2615
+ case "hexagon": return zr(t, n, r, i, c, l, u);
2616
+ case "cylinder": return Br(t, n, r, i, c, l, u);
2617
+ case "asymmetric": return Vr(t, n, r, i, c, l, u);
2618
+ case "trapezoid": return Hr(t, n, r, i, c, l, u);
2619
+ case "trapezoid-alt": return Ur(t, n, r, i, c, l, u);
2620
+ case "parallelogram": return Wr(t, n, r, i, c, l, u);
2621
+ case "parallelogram-alt": return Gr(t, n, r, i, c, l, u);
2622
+ case "state-start": return ui(t, n, r, i);
2623
+ case "state-end": return di(t, n, r, i);
2624
+ case "document": return Kr(t, n, r, i, c, l, u);
2625
+ case "stacked-document": return qr(t, n, r, i, c, l, u, !0);
2626
+ case "stacked-process": return qr(t, n, r, i, c, l, u, !1);
2627
+ case "card": return Jr(t, n, r, i, c, l, u);
2628
+ case "lined-process": return Yr(t, n, r, i, c, l, u);
2629
+ case "divided-process": return Xr(t, n, r, i, c, l, u);
2630
+ case "window-pane": return Zr(t, n, r, i, c, l, u);
2631
+ case "triangle": return Qr(t, n, r, i, c, l, u, !1);
2632
+ case "flipped-triangle": return Qr(t, n, r, i, c, l, u, !0);
2633
+ case "filled-circle": return $r(t, n, r, i, l);
2634
+ case "crossed-circle": return ei(t, n, r, i, c, l, u);
2635
+ case "fork-join": return ti(t, n, r, i, l);
2636
+ case "note": return ni(t, n, r, i, o(s?.fill ?? "var(--bg)"), l, u);
2637
+ case "notched-pentagon": return ri(t, n, r, i, c, l, u);
2638
+ case "sloped-rectangle": return ii(t, n, r, i, c, l, u);
2639
+ case "flag": return ai(t, n, r, i, c, l, u);
2640
+ case "bow-tie-rectangle": return oi(t, n, r, i, c, l, u);
2641
+ case "half-rounded-rectangle": return si(t, n, r, i, c, l, u);
2642
+ case "brace": return ci(t, n, r, i, c, l, u, "left");
2643
+ case "brace-right": return ci(t, n, r, i, c, l, u, "right");
2644
+ case "braces": return ci(t, n, r, i, c, l, u, "both");
2645
+ case "bolt": return li(t, n, r, i, c, l, u);
2572
2646
  case "text":
2573
2647
  case "anchor": return "";
2574
- default: return jr(t, n, r, i, c, l, u);
2648
+ default: return Mr(t, n, r, i, c, l, u);
2575
2649
  }
2576
2650
  }
2577
- function jr(e, t, n, r, i, a, o) {
2651
+ function Mr(e, t, n, r, i, a, o) {
2578
2652
  return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + l`rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2579
2653
  }
2580
- function Mr(e, t, n, r, i, a, o) {
2654
+ function Nr(e, t, n, r, i, a, o) {
2581
2655
  return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + l`rx="6" ry="6" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2582
2656
  }
2583
- function Nr(e, t, n, r, i, a, o) {
2657
+ function Pr(e, t, n, r, i, a, o) {
2584
2658
  let s = r / 2;
2585
2659
  return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + l`rx="${s}" ry="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2586
2660
  }
2587
- function Pr(e, t, n, r, i, a, o) {
2661
+ function Fr(e, t, n, r, i, a, o) {
2588
2662
  let s = e + n / 2, c = t + r / 2, u = Math.min(n, r) / 2;
2589
2663
  return l`<circle cx="${s}" cy="${c}" r="${u}" ` + l`fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2590
2664
  }
2591
- function Fr(e, t, n, r, i, a, o) {
2665
+ function Ir(e, t, n, r, i, a, o) {
2592
2666
  let s = e + n / 2, c = t + r / 2, u = n / 2, d = r / 2, f = [
2593
2667
  l`${s},${c - d}`,
2594
2668
  l`${s + u},${c}`,
@@ -2597,14 +2671,14 @@ function Fr(e, t, n, r, i, a, o) {
2597
2671
  ].join(" ");
2598
2672
  return l`<polygon points="${f}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2599
2673
  }
2600
- function Ir(e, t, n, r, i, a, o) {
2674
+ function Lr(e, t, n, r, i, a, o) {
2601
2675
  return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + l`rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />` + l`\n<line x1="${e + 8}" y1="${t}" x2="${e + 8}" y2="${t + r}" ` + l`stroke="${a}" stroke-width="${o}" />` + l`\n<line x1="${e + n - 8}" y1="${t}" x2="${e + n - 8}" y2="${t + r}" ` + l`stroke="${a}" stroke-width="${o}" />`;
2602
2676
  }
2603
- function Lr(e, t, n, r, i, a, o) {
2677
+ function Rr(e, t, n, r, i, a, o) {
2604
2678
  let s = e + n / 2, c = t + r / 2, u = Math.min(n, r) / 2, d = u - 5;
2605
2679
  return l`<circle cx="${s}" cy="${c}" r="${u}" ` + l`fill="${i}" stroke="${a}" stroke-width="${o}" />` + l`\n<circle cx="${s}" cy="${c}" r="${d}" ` + l`fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2606
2680
  }
2607
- function Rr(e, t, n, r, i, a, o) {
2681
+ function zr(e, t, n, r, i, a, o) {
2608
2682
  let s = r / 4, c = [
2609
2683
  l`${e + s},${t}`,
2610
2684
  l`${e + n - s},${t}`,
@@ -2615,11 +2689,11 @@ function Rr(e, t, n, r, i, a, o) {
2615
2689
  ].join(" ");
2616
2690
  return l`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2617
2691
  }
2618
- function zr(e, t, n, r, i, a, o) {
2692
+ function Br(e, t, n, r, i, a, o) {
2619
2693
  let s = e + n / 2, c = t + 7, u = r - 14;
2620
2694
  return l`<rect x="${e}" y="${c}" width="${n}" height="${u}" ` + l`fill="${i}" stroke="none" />` + l`\n<line x1="${e}" y1="${c}" x2="${e}" y2="${c + u}" stroke="${a}" stroke-width="${o}" />` + l`\n<line x1="${e + n}" y1="${c}" x2="${e + n}" y2="${c + u}" stroke="${a}" stroke-width="${o}" />` + l`\n<ellipse cx="${s}" cy="${t + r - 7}" rx="${n / 2}" ry="${7}" ` + l`fill="${i}" stroke="${a}" stroke-width="${o}" />` + l`\n<ellipse cx="${s}" cy="${c}" rx="${n / 2}" ry="${7}" ` + l`fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2621
2695
  }
2622
- function Br(e, t, n, r, i, a, o) {
2696
+ function Vr(e, t, n, r, i, a, o) {
2623
2697
  let s = [
2624
2698
  l`${e + 12},${t}`,
2625
2699
  l`${e + n},${t}`,
@@ -2629,7 +2703,7 @@ function Br(e, t, n, r, i, a, o) {
2629
2703
  ].join(" ");
2630
2704
  return l`<polygon points="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2631
2705
  }
2632
- function Vr(e, t, n, r, i, a, o) {
2706
+ function Hr(e, t, n, r, i, a, o) {
2633
2707
  let s = n * .15, c = [
2634
2708
  l`${e + s},${t}`,
2635
2709
  l`${e + n - s},${t}`,
@@ -2638,7 +2712,7 @@ function Vr(e, t, n, r, i, a, o) {
2638
2712
  ].join(" ");
2639
2713
  return l`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2640
2714
  }
2641
- function Hr(e, t, n, r, i, a, o) {
2715
+ function Ur(e, t, n, r, i, a, o) {
2642
2716
  let s = n * .15, c = [
2643
2717
  l`${e},${t}`,
2644
2718
  l`${e + n},${t}`,
@@ -2647,7 +2721,7 @@ function Hr(e, t, n, r, i, a, o) {
2647
2721
  ].join(" ");
2648
2722
  return l`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2649
2723
  }
2650
- function Ur(e, t, n, r, i, a, o) {
2724
+ function Wr(e, t, n, r, i, a, o) {
2651
2725
  let s = n * .15, c = [
2652
2726
  l`${e + s},${t}`,
2653
2727
  l`${e + n},${t}`,
@@ -2656,7 +2730,7 @@ function Ur(e, t, n, r, i, a, o) {
2656
2730
  ].join(" ");
2657
2731
  return l`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2658
2732
  }
2659
- function Wr(e, t, n, r, i, a, o) {
2733
+ function Gr(e, t, n, r, i, a, o) {
2660
2734
  let s = n * .15, c = [
2661
2735
  l`${e},${t}`,
2662
2736
  l`${e + n - s},${t}`,
@@ -2665,19 +2739,19 @@ function Wr(e, t, n, r, i, a, o) {
2665
2739
  ].join(" ");
2666
2740
  return l`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
2667
2741
  }
2668
- function U(e, t, n) {
2742
+ function W(e, t, n) {
2669
2743
  return l`fill="${e}" stroke="${t}" stroke-width="${n}"`;
2670
2744
  }
2671
- function Gr(e, t, n, r, i, a, o) {
2745
+ function Kr(e, t, n, r, i, a, o) {
2672
2746
  let s = Math.min(10, r * .16), c = t + r - s, u = l`M ${e} ${t} L ${e + n} ${t} L ${e + n} ${c} ` + l`C ${e + n * .75} ${c + s * 1.8} ${e + n * .25} ${c - s * .8} ${e} ${c} Z`;
2673
- return l`<path d="${u}" ${U(i, a, o)} />`;
2747
+ return l`<path d="${u}" ${W(i, a, o)} />`;
2674
2748
  }
2675
- function Kr(e, t, n, r, i, a, o, s) {
2749
+ function qr(e, t, n, r, i, a, o, s) {
2676
2750
  let c = n - 10, u = r - 10, d = [];
2677
- for (let n = 2; n >= 1; n--) d.push(l`<rect x="${e + 5 * n}" y="${t + 5 * (2 - n)}" width="${c}" height="${u}" ` + l`${U(i, a, o)} />`);
2678
- return d.push(s ? Gr(e, t + 10, c, u, i, a, o) : l`<rect x="${e}" y="${t + 10}" width="${c}" height="${u}" ${U(i, a, o)} />`), d.join("\n");
2751
+ for (let n = 2; n >= 1; n--) d.push(l`<rect x="${e + 5 * n}" y="${t + 5 * (2 - n)}" width="${c}" height="${u}" ` + l`${W(i, a, o)} />`);
2752
+ return d.push(s ? Kr(e, t + 10, c, u, i, a, o) : l`<rect x="${e}" y="${t + 10}" width="${c}" height="${u}" ${W(i, a, o)} />`), d.join("\n");
2679
2753
  }
2680
- function qr(e, t, n, r, i, a, o) {
2754
+ function Jr(e, t, n, r, i, a, o) {
2681
2755
  let s = Math.min(14, n * .12, r * .3), c = [
2682
2756
  l`${e + s},${t}`,
2683
2757
  l`${e + n},${t}`,
@@ -2685,21 +2759,21 @@ function qr(e, t, n, r, i, a, o) {
2685
2759
  l`${e},${t + r}`,
2686
2760
  l`${e},${t + s}`
2687
2761
  ].join(" ");
2688
- return l`<polygon points="${c}" ${U(i, a, o)} />`;
2762
+ return l`<polygon points="${c}" ${W(i, a, o)} />`;
2689
2763
  }
2690
- function Jr(e, t, n, r, i, a, o) {
2764
+ function Yr(e, t, n, r, i, a, o) {
2691
2765
  let s = Math.min(12, n * .12);
2692
- return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${U(i, a, o)} />\n` + l`<line x1="${e + s}" y1="${t}" x2="${e + s}" y2="${t + r}" stroke="${a}" stroke-width="${o}" />`;
2766
+ return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${W(i, a, o)} />\n` + l`<line x1="${e + s}" y1="${t}" x2="${e + s}" y2="${t + r}" stroke="${a}" stroke-width="${o}" />`;
2693
2767
  }
2694
- function Yr(e, t, n, r, i, a, o) {
2768
+ function Xr(e, t, n, r, i, a, o) {
2695
2769
  let s = t + Math.min(16, r * .3);
2696
- return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${U(i, a, o)} />\n` + l`<line x1="${e}" y1="${s}" x2="${e + n}" y2="${s}" stroke="${a}" stroke-width="${o}" />`;
2770
+ return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${W(i, a, o)} />\n` + l`<line x1="${e}" y1="${s}" x2="${e + n}" y2="${s}" stroke="${a}" stroke-width="${o}" />`;
2697
2771
  }
2698
- function Xr(e, t, n, r, i, a, o) {
2772
+ function Zr(e, t, n, r, i, a, o) {
2699
2773
  let s = e + Math.min(16, n * .16), c = t + Math.min(14, r * .28);
2700
- return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${U(i, a, o)} />\n` + l`<line x1="${s}" y1="${t}" x2="${s}" y2="${t + r}" stroke="${a}" stroke-width="${o}" />\n` + l`<line x1="${e}" y1="${c}" x2="${e + n}" y2="${c}" stroke="${a}" stroke-width="${o}" />`;
2774
+ return l`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${W(i, a, o)} />\n` + l`<line x1="${s}" y1="${t}" x2="${s}" y2="${t + r}" stroke="${a}" stroke-width="${o}" />\n` + l`<line x1="${e}" y1="${c}" x2="${e + n}" y2="${c}" stroke="${a}" stroke-width="${o}" />`;
2701
2775
  }
2702
- function Zr(e, t, n, r, i, a, o, s) {
2776
+ function Qr(e, t, n, r, i, a, o, s) {
2703
2777
  let c = s ? [
2704
2778
  l`${e},${t}`,
2705
2779
  l`${e + n},${t}`,
@@ -2709,21 +2783,21 @@ function Zr(e, t, n, r, i, a, o, s) {
2709
2783
  l`${e + n},${t + r}`,
2710
2784
  l`${e},${t + r}`
2711
2785
  ];
2712
- return l`<polygon points="${c.join(" ")}" ${U(i, a, o)} />`;
2786
+ return l`<polygon points="${c.join(" ")}" ${W(i, a, o)} />`;
2713
2787
  }
2714
- function Qr(e, t, n, r, i) {
2788
+ function $r(e, t, n, r, i) {
2715
2789
  let a = Math.min(n, r) / 2 - 2;
2716
2790
  return l`<circle cx="${e + n / 2}" cy="${t + r / 2}" r="${a}" fill="${i}" stroke="${i}" />`;
2717
2791
  }
2718
- function $r(e, t, n, r, i, a, o) {
2792
+ function ei(e, t, n, r, i, a, o) {
2719
2793
  let s = e + n / 2, c = t + r / 2, u = Math.min(n, r) / 2 - 2, d = u / Math.SQRT2;
2720
- return l`<circle cx="${s}" cy="${c}" r="${u}" ${U(i, a, o)} />\n` + l`<line x1="${s - d}" y1="${c - d}" x2="${s + d}" y2="${c + d}" stroke="${a}" stroke-width="${o}" />\n` + l`<line x1="${s + d}" y1="${c - d}" x2="${s - d}" y2="${c + d}" stroke="${a}" stroke-width="${o}" />`;
2794
+ return l`<circle cx="${s}" cy="${c}" r="${u}" ${W(i, a, o)} />\n` + l`<line x1="${s - d}" y1="${c - d}" x2="${s + d}" y2="${c + d}" stroke="${a}" stroke-width="${o}" />\n` + l`<line x1="${s + d}" y1="${c - d}" x2="${s - d}" y2="${c + d}" stroke="${a}" stroke-width="${o}" />`;
2721
2795
  }
2722
- function ei(e, t, n, r, i) {
2796
+ function ti(e, t, n, r, i) {
2723
2797
  let a = Math.min(8, r);
2724
2798
  return l`<rect x="${e}" y="${t + (r - a) / 2}" width="${n}" height="${a}" fill="${i}" stroke="${i}" />`;
2725
2799
  }
2726
- function ti(e, t, n, r, i, a, o) {
2800
+ function ni(e, t, n, r, i, a, o) {
2727
2801
  let s = [
2728
2802
  l`${e},${t}`,
2729
2803
  l`${e + n - 6},${t}`,
@@ -2733,7 +2807,7 @@ function ti(e, t, n, r, i, a, o) {
2733
2807
  ].join(" ");
2734
2808
  return l`<polygon points="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />\n` + l`<polygon points="${e + n - 6},${t} ${e + n},${t + 6} ${e + n - 6},${t + 6}" fill="var(--_inner-stroke)" stroke="${a}" stroke-width="${o}" />`;
2735
2809
  }
2736
- function ni(e, t, n, r, i, a, o) {
2810
+ function ri(e, t, n, r, i, a, o) {
2737
2811
  let s = Math.min(14, n * .12, r * .3), c = [
2738
2812
  l`${e + s},${t}`,
2739
2813
  l`${e + n - s},${t}`,
@@ -2742,34 +2816,34 @@ function ni(e, t, n, r, i, a, o) {
2742
2816
  l`${e},${t + r}`,
2743
2817
  l`${e},${t + s}`
2744
2818
  ].join(" ");
2745
- return l`<polygon points="${c}" ${U(i, a, o)} />`;
2819
+ return l`<polygon points="${c}" ${W(i, a, o)} />`;
2746
2820
  }
2747
- function ri(e, t, n, r, i, a, o) {
2821
+ function ii(e, t, n, r, i, a, o) {
2748
2822
  let s = Math.min(12, r * .3), c = [
2749
2823
  l`${e},${t + s}`,
2750
2824
  l`${e + n},${t}`,
2751
2825
  l`${e + n},${t + r}`,
2752
2826
  l`${e},${t + r}`
2753
2827
  ].join(" ");
2754
- return l`<polygon points="${c}" ${U(i, a, o)} />`;
2828
+ return l`<polygon points="${c}" ${W(i, a, o)} />`;
2755
2829
  }
2756
- function ii(e, t, n, r, i, a, o) {
2830
+ function ai(e, t, n, r, i, a, o) {
2757
2831
  let s = Math.min(8, r * .14), c = l`M ${e} ${t + s} ` + l`C ${e + n * .25} ${t - s} ${e + n * .75} ${t + s * 2} ${e + n} ${t + s} ` + l`L ${e + n} ${t + r - s} ` + l`C ${e + n * .75} ${t + r + s} ${e + n * .25} ${t + r - s * 2} ${e} ${t + r - s} Z`;
2758
- return l`<path d="${c}" ${U(i, a, o)} />`;
2832
+ return l`<path d="${c}" ${W(i, a, o)} />`;
2759
2833
  }
2760
- function ai(e, t, n, r, i, a, o) {
2834
+ function oi(e, t, n, r, i, a, o) {
2761
2835
  let s = Math.min(14, n * .12), c = l`M ${e + s} ${t} L ${e + n} ${t} ` + l`Q ${e + n - s * 1.4} ${t + r / 2} ${e + n} ${t + r} ` + l`L ${e + s} ${t + r} ` + l`Q ${e + s * 1.4} ${t + r / 2} ${e + s} ${t} Z`;
2762
- return l`<path d="${c}" ${U(i, a, o)} />`;
2836
+ return l`<path d="${c}" ${W(i, a, o)} />`;
2763
2837
  }
2764
- function oi(e, t, n, r, i, a, o) {
2838
+ function si(e, t, n, r, i, a, o) {
2765
2839
  let s = r / 2, c = Math.max(0, n - s), u = l`M ${e} ${t} L ${e + c} ${t} ` + l`A ${s} ${s} 0 0 1 ${e + c} ${t + r} ` + l`L ${e} ${t + r} Z`;
2766
- return l`<path d="${u}" ${U(i, a, o)} />`;
2840
+ return l`<path d="${u}" ${W(i, a, o)} />`;
2767
2841
  }
2768
- function si(e, t, n, r, i, a, o, s) {
2842
+ function ci(e, t, n, r, i, a, o, s) {
2769
2843
  let c = Math.min(10, n * .12), u = [l`<rect x="${e}" y="${t}" width="${n}" height="${r}" fill="none" stroke="none" />`], d = l`M ${e + c} ${t} Q ${e} ${t} ${e} ${t + r * .25} ` + l`Q ${e} ${t + r / 2} ${e - c * .4} ${t + r / 2} ` + l`Q ${e} ${t + r / 2} ${e} ${t + r * .75} ` + l`Q ${e} ${t + r} ${e + c} ${t + r}`, f = l`M ${e + n - c} ${t} Q ${e + n} ${t} ${e + n} ${t + r * .25} ` + l`Q ${e + n} ${t + r / 2} ${e + n + c * .4} ${t + r / 2} ` + l`Q ${e + n} ${t + r / 2} ${e + n} ${t + r * .75} ` + l`Q ${e + n} ${t + r} ${e + n - c} ${t + r}`;
2770
2844
  return (s === "left" || s === "both") && u.push(l`<path d="${d}" fill="none" stroke="${a}" stroke-width="${o}" />`), (s === "right" || s === "both") && u.push(l`<path d="${f}" fill="none" stroke="${a}" stroke-width="${o}" />`), u.join("\n");
2771
2845
  }
2772
- function ci(e, t, n, r, i, a, o) {
2846
+ function li(e, t, n, r, i, a, o) {
2773
2847
  let s = [
2774
2848
  l`${e + n * .42},${t}`,
2775
2849
  l`${e + n},${t}`,
@@ -2779,30 +2853,30 @@ function ci(e, t, n, r, i, a, o) {
2779
2853
  l`${e + n * .5},${t + r * .55}`,
2780
2854
  l`${e},${t + r * .55}`
2781
2855
  ].join(" ");
2782
- return l`<polygon points="${s}" ${U(i, a, o)} />`;
2856
+ return l`<polygon points="${s}" ${W(i, a, o)} />`;
2783
2857
  }
2784
- function li(e, t, n, r) {
2858
+ function ui(e, t, n, r) {
2785
2859
  let i = e + n / 2, a = t + r / 2, o = Math.min(n, r) / 2 - 2;
2786
2860
  return l`<circle cx="${i}" cy="${a}" r="${o}" fill="var(--_text)" stroke="none" />`;
2787
2861
  }
2788
- function ui(e, t, n, r) {
2862
+ function di(e, t, n, r) {
2789
2863
  let i = e + n / 2, a = t + r / 2, o = Math.min(n, r) / 2 - 2, s = o - 4;
2790
2864
  return l`<circle cx="${i}" cy="${a}" r="${o}" ` + l`fill="none" stroke="var(--_text)" stroke-width="${R.innerBox * 2}" />` + l`\n<circle cx="${i}" cy="${a}" r="${s}" fill="var(--_text)" stroke="none" />`;
2791
2865
  }
2792
- function di(e, t, n) {
2866
+ function fi(e, t, n) {
2793
2867
  if ((e.shape === "state-start" || e.shape === "state-end") && !e.label) return "";
2794
2868
  let r = e.x + e.width / 2, i = e.y + e.height / 2, a = o(e.inlineStyle?.color ?? d(e.inlineStyle?.fill, "var(--_text)")), s = l`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${L.nodeLabel}" fill="${a}"`, c = e.inlineStyle?.["font-family"];
2795
2869
  return c && (s += l` style="font-family: ${o(c)};"`), y(e.label, r, i, n.nodeLabel, s);
2796
2870
  }
2797
- function fi(e) {
2871
+ function pi(e) {
2798
2872
  return o(e).replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
2799
2873
  }
2800
- function pi(e, t) {
2801
- return t === void 0 ? e : e.replace("<svg ", l`<svg data-src="${fi(t)}" `);
2874
+ function mi(e, t) {
2875
+ return t === void 0 ? e : e.replace("<svg ", l`<svg data-src="${pi(t)}" `);
2802
2876
  }
2803
2877
  //#endregion
2804
2878
  //#region packages/svg-renderer/src/resolve-colors.ts
2805
- var mi = class {
2879
+ var hi = class {
2806
2880
  raw = /* @__PURE__ */ new Map();
2807
2881
  resolved = /* @__PURE__ */ new Map();
2808
2882
  inProgress = /* @__PURE__ */ new Set();
@@ -2814,13 +2888,13 @@ var mi = class {
2814
2888
  let t = this.raw.get(e);
2815
2889
  if (t === void 0 || this.inProgress.has(e)) return;
2816
2890
  this.inProgress.add(e);
2817
- let n = xi(t, this).trim();
2891
+ let n = Si(t, this).trim();
2818
2892
  this.inProgress.delete(e);
2819
2893
  let r = !/\bvar\(|\bcolor-mix\(/.test(n);
2820
2894
  return this.resolved.set(e, r ? n : void 0), r ? n : void 0;
2821
2895
  }
2822
2896
  };
2823
- function hi(e, t) {
2897
+ function gi(e, t) {
2824
2898
  let n = 0;
2825
2899
  for (let r = t; r < e.length; r++) {
2826
2900
  let t = e[r];
@@ -2829,7 +2903,7 @@ function hi(e, t) {
2829
2903
  }
2830
2904
  return -1;
2831
2905
  }
2832
- function gi(e) {
2906
+ function _i(e) {
2833
2907
  let t = [], n = 0, r = 0;
2834
2908
  for (let i = 0; i < e.length; i++) {
2835
2909
  let a = e[i];
@@ -2837,12 +2911,12 @@ function gi(e) {
2837
2911
  }
2838
2912
  return t.push(e.slice(r)), t;
2839
2913
  }
2840
- var _i = "(?<![\\w-])(var|color-mix)\\(";
2841
- function vi(e, t) {
2842
- let [n, ...r] = gi(e), i = (n ?? "").trim(), a = t.lookup(i);
2914
+ var vi = "(?<![\\w-])(var|color-mix)\\(";
2915
+ function yi(e, t) {
2916
+ let [n, ...r] = _i(e), i = (n ?? "").trim(), a = t.lookup(i);
2843
2917
  return a === void 0 ? r.length > 0 ? r.join(",").trim() : null : a;
2844
2918
  }
2845
- function yi(e) {
2919
+ function bi(e) {
2846
2920
  let t = e.trim().split(/\s+/), n, r;
2847
2921
  for (let e of t) if (/^[\d.]+%$/.test(e)) {
2848
2922
  if (r !== void 0) return null;
@@ -2856,61 +2930,61 @@ function yi(e) {
2856
2930
  pct: r
2857
2931
  };
2858
2932
  }
2859
- function bi(e) {
2860
- let t = gi(e);
2933
+ function xi(e) {
2934
+ let t = _i(e);
2861
2935
  if (t.length !== 3) return null;
2862
2936
  let [n, r, i] = t;
2863
2937
  if (n === void 0 || r === void 0 || i === void 0 || !/^\s*in\s+srgb\s*$/i.test(n)) return null;
2864
- let a = yi(r), o = yi(i);
2938
+ let a = bi(r), o = bi(i);
2865
2939
  if (!a || !o) return null;
2866
2940
  let s = v(a.color), c = v(o.color);
2867
2941
  if (!s || !c) return null;
2868
2942
  let l = h(s, c, a.pct, o.pct);
2869
2943
  return l ? u(l) : null;
2870
2944
  }
2871
- function xi(e, t) {
2872
- let n = "", r = 0, i = new RegExp(_i, "g"), a;
2945
+ function Si(e, t) {
2946
+ let n = "", r = 0, i = new RegExp(vi, "g"), a;
2873
2947
  for (; (a = i.exec(e)) !== null;) {
2874
2948
  let o = a[1];
2875
2949
  if (o === void 0) continue;
2876
- let s = a.index, c = s + o.length, l = hi(e, c);
2950
+ let s = a.index, c = s + o.length, l = gi(e, c);
2877
2951
  if (l === -1) break;
2878
- let u = xi(e.slice(c + 1, l), t), d = o === "var" ? vi(u, t) : bi(u);
2952
+ let u = Si(e.slice(c + 1, l), t), d = o === "var" ? yi(u, t) : xi(u);
2879
2953
  n += e.slice(r, s), n += d ?? `${o}(${u})`, r = l + 1, i.lastIndex = r;
2880
2954
  }
2881
2955
  return n + e.slice(r);
2882
2956
  }
2883
- function Si(e, t) {
2884
- let n = new mi();
2957
+ function Ci(e, t) {
2958
+ let n = new hi();
2885
2959
  for (let [e, r] of Object.entries(t)) n.declare(e, r);
2886
- return xi(e, n);
2960
+ return Si(e, n);
2887
2961
  }
2888
- var Ci = /(--[\w-]+)\s*:\s*([^;{}]+)/g, wi = /(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g, Ti = /* @__PURE__ */ new Set(["data-src"]);
2889
- function Ei(e, t) {
2890
- Ci.lastIndex = 0;
2962
+ var wi = /(--[\w-]+)\s*:\s*([^;{}]+)/g, Ti = /(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g, Ei = /* @__PURE__ */ new Set(["data-src"]);
2963
+ function Di(e, t) {
2964
+ wi.lastIndex = 0;
2891
2965
  let n;
2892
- for (; (n = Ci.exec(e)) !== null;) {
2966
+ for (; (n = wi.exec(e)) !== null;) {
2893
2967
  let [, e, r] = n;
2894
2968
  e !== void 0 && r !== void 0 && t.declare(e, r.trim());
2895
2969
  }
2896
2970
  }
2897
- function Di(e, t) {
2898
- return e.replace(wi, (e, n, r, i, a) => {
2899
- if (Ti.has(r)) return e;
2971
+ function Oi(e, t) {
2972
+ return e.replace(Ti, (e, n, r, i, a) => {
2973
+ if (Ei.has(r)) return e;
2900
2974
  let o = a[0] ?? "\"";
2901
- return `${n}${r}${i}${o}${xi(a.slice(1, -1), t)}${o}`;
2975
+ return `${n}${r}${i}${o}${Si(a.slice(1, -1), t)}${o}`;
2902
2976
  });
2903
2977
  }
2904
- function Oi(e, t) {
2905
- let n = new mi();
2978
+ function ki(e, t) {
2979
+ let n = new hi();
2906
2980
  n.declare("--bg", t.bg), n.declare("--fg", t.fg), t.line && n.declare("--line", t.line), t.accent && n.declare("--accent", t.accent), t.muted && n.declare("--muted", t.muted), t.surface && n.declare("--surface", t.surface), t.border && n.declare("--border", t.border);
2907
2981
  for (let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)) {
2908
2982
  let e = t[1];
2909
- e !== void 0 && Ei(e, n);
2983
+ e !== void 0 && Di(e, n);
2910
2984
  }
2911
2985
  for (let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)) {
2912
2986
  let e = t[1];
2913
- e !== void 0 && Ei(e.slice(1, -1), n);
2987
+ e !== void 0 && Di(e.slice(1, -1), n);
2914
2988
  }
2915
2989
  let r = "", i = 0;
2916
2990
  for (; i < e.length;) {
@@ -2919,7 +2993,7 @@ function Oi(e, t) {
2919
2993
  if (r += e.slice(i, t), e.startsWith("<style", t)) {
2920
2994
  let a = e.indexOf(">", t), o = e.indexOf("</style>", t);
2921
2995
  if (a === -1 || o === -1) break;
2922
- r += e.slice(t, a + 1), r += xi(e.slice(a + 1, o), n), r += "</style>", i = o + 8;
2996
+ r += e.slice(t, a + 1), r += Si(e.slice(a + 1, o), n), r += "</style>", i = o + 8;
2923
2997
  continue;
2924
2998
  }
2925
2999
  let a = -1, o = null;
@@ -2934,13 +3008,13 @@ function Oi(e, t) {
2934
3008
  }
2935
3009
  if (a === -1) break;
2936
3010
  let s = e.slice(t, a + 1);
2937
- r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s : Di(s, n), i = a + 1;
3011
+ r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s : Oi(s, n), i = a + 1;
2938
3012
  }
2939
3013
  return r + e.slice(i);
2940
3014
  }
2941
3015
  //#endregion
2942
3016
  //#region packages/svg-renderer/src/class/layout.ts
2943
- var W = {
3017
+ var G = {
2944
3018
  padding: 40,
2945
3019
  boxPadX: 8,
2946
3020
  headerBaseHeight: 32,
@@ -2959,38 +3033,38 @@ var W = {
2959
3033
  namespacePad: 16,
2960
3034
  namespaceTitleFontSize: 12
2961
3035
  };
2962
- function ki(e) {
3036
+ function Ai(e) {
2963
3037
  return `note ${e}`;
2964
3038
  }
2965
- function Ai(e) {
3039
+ function ji(e) {
2966
3040
  return `${e} link`;
2967
3041
  }
2968
- function ji(e) {
3042
+ function Mi(e) {
2969
3043
  return `namespace ${e}`;
2970
3044
  }
2971
- function Mi(e) {
3045
+ function Ni(e) {
2972
3046
  let t = new Set(e.classes.map((e) => e.id)), n = /* @__PURE__ */ new Set(), r = [];
2973
3047
  for (let [i, a] of e.namespaces.entries()) {
2974
3048
  let e = [];
2975
3049
  for (let r of a.classIds) !t.has(r) || n.has(r) || (n.add(r), e.push(r));
2976
3050
  e.length > 0 && r.push({
2977
- id: ji(i),
3051
+ id: Mi(i),
2978
3052
  name: a.name,
2979
3053
  classIds: e
2980
3054
  });
2981
3055
  }
2982
3056
  return r;
2983
3057
  }
2984
- function Ni(e) {
3058
+ function Pi(e) {
2985
3059
  return Ue(e.relationships.map((e) => ({
2986
3060
  source: e.from,
2987
3061
  target: e.to
2988
3062
  })), e.classes.map((e) => e.id));
2989
3063
  }
2990
- function Pi(e, t) {
3064
+ function Fi(e, t) {
2991
3065
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = Le(t.fontSizes);
2992
3066
  for (let t of e.classes) {
2993
- let e = t.annotation ? W.headerBaseHeight + W.annotationHeight : W.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * W.memberRowHeight + W.sectionPadY : W.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * W.memberRowHeight + W.sectionPadY : W.emptySectionHeight, o = I(t.label, i.nodeLabel, L.nodeLabel), s = Ri(t.attributes), c = Ri(t.methods), l = Math.max(W.minWidth, o + W.boxPadX * 2, s + W.boxPadX * 2, c + W.boxPadX * 2), u = e + r + a;
3067
+ let e = t.annotation ? G.headerBaseHeight + G.annotationHeight : G.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * G.memberRowHeight + G.sectionPadY : G.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * G.memberRowHeight + G.sectionPadY : G.emptySectionHeight, o = I(t.label, i.nodeLabel, L.nodeLabel), s = zi(t.attributes), c = zi(t.methods), l = Math.max(G.minWidth, o + G.boxPadX * 2, s + G.boxPadX * 2, c + G.boxPadX * 2), u = e + r + a;
2994
3068
  n.set(t.id, {
2995
3069
  width: l,
2996
3070
  height: u,
@@ -2999,19 +3073,19 @@ function Pi(e, t) {
2999
3073
  methodHeight: a
3000
3074
  });
3001
3075
  }
3002
- let a = Mi(e), o = /* @__PURE__ */ new Map();
3076
+ let a = Ni(e), o = /* @__PURE__ */ new Map();
3003
3077
  for (let e of a) for (let t of e.classIds) o.set(t, e.id);
3004
3078
  let s = /* @__PURE__ */ new Map(), c = [];
3005
3079
  for (let e of a) {
3006
- let t = I(e.name, W.namespaceTitleFontSize, L.groupHeader) + W.namespacePad * 2, n = {
3080
+ let t = I(e.name, G.namespaceTitleFontSize, L.groupHeader) + G.namespacePad * 2, n = {
3007
3081
  id: e.id,
3008
3082
  children: [],
3009
3083
  layoutOptions: {
3010
3084
  "elk.padding": Ke({
3011
- top: W.namespaceTitleHeight + W.namespacePad / 2,
3012
- left: W.namespacePad,
3013
- bottom: W.namespacePad,
3014
- right: W.namespacePad
3085
+ top: G.namespaceTitleHeight + G.namespacePad / 2,
3086
+ left: G.namespacePad,
3087
+ bottom: G.namespacePad,
3088
+ right: G.namespacePad
3015
3089
  }),
3016
3090
  "elk.nodeSize.constraints": "MINIMUM_SIZE",
3017
3091
  "elk.nodeSize.minimum": `(${Math.ceil(t)}, 0)`
@@ -3023,7 +3097,7 @@ function Pi(e, t) {
3023
3097
  let n = Je(e, t), r = s.get(o.get(e) ?? "");
3024
3098
  r?.children ? r.children.push(n) : c.push(n);
3025
3099
  }
3026
- let l = { fontSize: i.edgeLabel }, u = Ni(e), d = [];
3100
+ let l = { fontSize: i.edgeLabel }, u = Pi(e), d = [];
3027
3101
  for (let [t, n] of e.relationships.entries()) {
3028
3102
  let e = u.has(t);
3029
3103
  d.push(Ze({
@@ -3036,12 +3110,12 @@ function Pi(e, t) {
3036
3110
  }
3037
3111
  let f = new Set(n.keys());
3038
3112
  for (let [t, n] of e.notes.entries()) {
3039
- let e = ki(t), a = p(n.text, i.edgeLabel, L.edgeLabel), o = {
3040
- width: a.width + W.notePadX * 2,
3041
- height: a.height + W.notePadY * 2
3113
+ let e = Ai(t), a = p(n.text, i.edgeLabel, L.edgeLabel), o = {
3114
+ width: a.width + G.notePadX * 2,
3115
+ height: a.height + G.notePadY * 2
3042
3116
  };
3043
3117
  r.set(e, o), c.push(Je(e, o)), n.forClass !== void 0 && f.has(n.forClass) && d.push(Ze({
3044
- id: Ai(e),
3118
+ id: ji(e),
3045
3119
  source: e,
3046
3120
  target: n.forClass,
3047
3121
  labelStyle: l
@@ -3053,9 +3127,9 @@ function Pi(e, t) {
3053
3127
  layoutOptions: {
3054
3128
  ...qe({
3055
3129
  direction: Ge(void 0, We.class),
3056
- nodeSpacing: W.nodeSpacing,
3057
- layerSpacing: W.layerSpacing,
3058
- padding: W.padding
3130
+ nodeSpacing: G.nodeSpacing,
3131
+ layerSpacing: G.layerSpacing,
3132
+ padding: G.padding
3059
3133
  }),
3060
3134
  "elk.edgeLabels.placement": "CENTER",
3061
3135
  "elk.hierarchyHandling": "INCLUDE_CHILDREN",
@@ -3071,7 +3145,7 @@ function Pi(e, t) {
3071
3145
  namespaces: a
3072
3146
  };
3073
3147
  }
3074
- function Fi(e, t, n, r, i) {
3148
+ function Ii(e, t, n, r, i) {
3075
3149
  let a = /* @__PURE__ */ new Map();
3076
3150
  for (let e of t.classes) a.set(e.id, e);
3077
3151
  let o = new Set(i.map((e) => e.id)), s = /* @__PURE__ */ new Map(), c = [];
@@ -3132,13 +3206,13 @@ function Fi(e, t, n, r, i) {
3132
3206
  });
3133
3207
  }
3134
3208
  }
3135
- let f = [], p = Ni(t), m = e.edges ?? [];
3209
+ let f = [], p = Pi(t), m = e.edges ?? [];
3136
3210
  for (let [e, n] of t.relationships.entries()) {
3137
3211
  let t = m[e];
3138
3212
  if (!t)
3139
3213
  /* v8 ignore next */
3140
3214
  throw Error(`Missing ELK edge for relationship ${e}`);
3141
- let r = l(t), i = Nt(t, r.x, r.y), a = p.has(e) ? i.reverse() : i, o = Pt(t, r.x, r.y);
3215
+ let r = l(t), i = Pt(t, r.x, r.y), a = p.has(e) ? i.reverse() : i, o = Ft(t, r.x, r.y);
3142
3216
  f.push({
3143
3217
  from: n.from,
3144
3218
  to: n.to,
@@ -3157,11 +3231,11 @@ function Fi(e, t, n, r, i) {
3157
3231
  for (let e of c) g.set(e.id, e);
3158
3232
  let _ = [];
3159
3233
  for (let [e, n] of t.notes.entries()) {
3160
- let t = ki(e), i = g.get(t), a = r.get(t);
3234
+ let t = Ai(e), i = g.get(t), a = r.get(t);
3161
3235
  if (!i || !a)
3162
3236
  /* v8 ignore next */
3163
3237
  throw Error(`Missing layout for note ${e}`);
3164
- let o = h.get(Ai(t));
3238
+ let o = h.get(ji(t));
3165
3239
  _.push({
3166
3240
  id: t,
3167
3241
  text: n.text,
@@ -3170,7 +3244,7 @@ function Fi(e, t, n, r, i) {
3170
3244
  y: i.y ?? 0,
3171
3245
  width: i.width ?? a.width,
3172
3246
  height: i.height ?? a.height,
3173
- ...o ? { linkPoints: Nt(o, l(o).x, l(o).y) } : {}
3247
+ ...o ? { linkPoints: Pt(o, l(o).x, l(o).y) } : {}
3174
3248
  });
3175
3249
  }
3176
3250
  return {
@@ -3182,7 +3256,7 @@ function Fi(e, t, n, r, i) {
3182
3256
  namespaces: u
3183
3257
  };
3184
3258
  }
3185
- function Ii(e, t = {}) {
3259
+ function Li(e, t = {}) {
3186
3260
  if (e.classes.length === 0 && e.notes.length === 0) return {
3187
3261
  width: 0,
3188
3262
  height: 0,
@@ -3191,54 +3265,54 @@ function Ii(e, t = {}) {
3191
3265
  notes: [],
3192
3266
  namespaces: []
3193
3267
  };
3194
- let { elkGraph: n, classSizes: r, noteSizes: i, namespaces: a } = Pi(e, t);
3195
- return Fi(Ae(n, t.layoutCache), e, r, i, a);
3196
- }
3197
- function Li(e) {
3198
- return e.length * Math.ceil(Ne("M", W.memberFontSize));
3268
+ let { elkGraph: n, classSizes: r, noteSizes: i, namespaces: a } = Fi(e, t);
3269
+ return Ii(Ae(n, t.layoutCache), e, r, i, a);
3199
3270
  }
3200
3271
  function Ri(e) {
3272
+ return e.length * Math.ceil(Ne("M", G.memberFontSize));
3273
+ }
3274
+ function zi(e) {
3201
3275
  if (e.length === 0) return 0;
3202
3276
  let t = 0;
3203
3277
  for (let n of e) {
3204
- let e = Li(F(n));
3278
+ let e = Ri(ne(n));
3205
3279
  e > t && (t = e);
3206
3280
  }
3207
3281
  return t;
3208
3282
  }
3209
3283
  //#endregion
3210
3284
  //#region packages/svg-renderer/src/class/renderer.ts
3211
- var zi = {
3285
+ var Bi = {
3212
3286
  memberSize: 11,
3213
3287
  memberWeight: 400,
3214
3288
  annotationSize: 10,
3215
3289
  annotationWeight: 500
3216
3290
  };
3217
- function Bi(e, t, n = "Inter", r = !1, i = Ie, a, o, s, c = !0, l = {}) {
3291
+ function Vi(e, t, n = "Inter", r = !1, i = Ie, a, o, s, c = !0, l = {}) {
3218
3292
  let u = [], d = c && e.classes.some((e) => !!S(e.interaction?.href));
3219
- u.push(pi(O(e.width, e.height, t, r, o, s, d, l.styleAttribute, l.description), a)), u.push(Ve(n, !0, l.nonce)), u.push("<defs>"), u.push(Hi()), u.push("</defs>");
3220
- for (let t of e.namespaces) u.push(Vi(t));
3221
- for (let t of e.relationships) u.push(Yi(t));
3222
- for (let t of e.notes) u.push(Ji(t));
3223
- for (let t of e.classes) u.push(Ui(t, i, c));
3224
- for (let t of e.notes) u.push(qi(t, i));
3225
- for (let t of e.relationships) u.push(Qi(t, i));
3293
+ u.push(mi(O(e.width, e.height, t, r, o, s, d, l.styleAttribute, l.description), a)), u.push(Be(n, !0, l.nonce)), u.push("<defs>"), u.push(Ui()), u.push("</defs>");
3294
+ for (let t of e.namespaces) u.push(Hi(t));
3295
+ for (let t of e.relationships) u.push(Xi(t));
3296
+ for (let t of e.notes) u.push(Yi(t));
3297
+ for (let t of e.classes) u.push(Wi(t, i, c));
3298
+ for (let t of e.notes) u.push(Ji(t, i));
3299
+ for (let t of e.relationships) u.push($i(t, i));
3226
3300
  return u.push("</svg>"), u.join("\n");
3227
3301
  }
3228
- function Vi(e) {
3229
- let { x: t, y: n, width: r, height: i } = e, a = W.namespaceTitleHeight, s = R.outerBox;
3302
+ function Hi(e) {
3303
+ let { x: t, y: n, width: r, height: i } = e, a = G.namespaceTitleHeight, s = R.outerBox;
3230
3304
  return [
3231
3305
  l`<g class="class-namespace" data-id="${o(e.name)}" data-label="${o(e.name)}">`,
3232
3306
  l` <rect x="${t}" y="${n}" width="${r}" height="${i}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,
3233
3307
  l` <rect x="${t}" y="${n}" width="${r}" height="${a}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,
3234
- l` <text x="${t + W.namespacePad}" y="${n + a / 2}" dy="${z}" font-size="${W.namespaceTitleFontSize}" font-weight="${L.groupHeader}" fill="var(--_text-sec)">${ta(e.name)}</text>`,
3308
+ l` <text x="${t + G.namespacePad}" y="${n + a / 2}" dy="${z}" font-size="${G.namespaceTitleFontSize}" font-weight="${L.groupHeader}" fill="var(--_text-sec)">${na(e.name)}</text>`,
3235
3309
  "</g>"
3236
3310
  ].join("\n");
3237
3311
  }
3238
- function Hi() {
3312
+ function Ui() {
3239
3313
  return " <marker id=\"cls-inherit\" markerWidth=\"12\" markerHeight=\"10\" refX=\"12\" refY=\"5\" orient=\"auto-start-reverse\">\n <polygon points=\"0 0, 12 5, 0 10\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-composition\" markerWidth=\"18\" markerHeight=\"14\" refX=\"16.5\" refY=\"7\" orient=\"auto-start-reverse\">\n <polygon points=\"9 1.5, 16.5 7, 9 12.5, 1.5 7\" fill=\"var(--_arrow)\" stroke=\"var(--_arrow)\" stroke-width=\"1\" />\n </marker>\n <marker id=\"cls-aggregation\" markerWidth=\"18\" markerHeight=\"14\" refX=\"16.5\" refY=\"7\" orient=\"auto-start-reverse\">\n <polygon points=\"9 1.5, 16.5 7, 9 12.5, 1.5 7\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-arrow\" markerWidth=\"8\" markerHeight=\"6\" refX=\"8\" refY=\"3\" orient=\"auto-start-reverse\">\n <polyline points=\"0 0, 8 3, 0 6\" fill=\"none\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>";
3240
3314
  }
3241
- function Ui(e, t, n = !0) {
3315
+ function Wi(e, t, n = !0) {
3242
3316
  let { x: r, y: i, width: a, height: s, headerHeight: c, attrHeight: u, inlineStyle: f } = e, p = [], m = e.interaction, h = o(f?.fill ?? "var(--_node-fill)"), g = o(f?.stroke ?? "var(--_node-stroke)"), _ = o(f?.["stroke-width"] ?? String(R.outerBox)), v = f?.fill ? h : "var(--_group-hdr)", b = f?.color ? o(f.color) : f?.fill ? o(d(f.fill, "var(--_text)")) : void 0, x = e.annotation ? l` data-annotation="${o(e.annotation)}"` : "", w = C(e.className), T = [
3243
3317
  l`class="${w ? l`class-node ${w}` : "class-node"}"`,
3244
3318
  l`data-id="${o(e.id)}"`,
@@ -3250,53 +3324,53 @@ function Ui(e, t, n = !0) {
3250
3324
  let e = m?.target ? l` target="${o(m.target)}"` : "";
3251
3325
  p.push(l` <a href="${o(E)}"${e}>`);
3252
3326
  }
3253
- n && m?.tooltip && p.push(l` <title>${ta(m.tooltip)}</title>`), p.push(l` <rect x="${r}" y="${i}" width="${a}" height="${s}" ` + l`rx="0" ry="0" fill="${h}" stroke="${g}" stroke-width="${_}" />`), p.push(l` <rect x="${r}" y="${i}" width="${a}" height="${c}" ` + l`rx="0" ry="0" fill="${v}" stroke="${g}" stroke-width="${_}" />`);
3327
+ n && m?.tooltip && p.push(l` <title>${na(m.tooltip)}</title>`), p.push(l` <rect x="${r}" y="${i}" width="${a}" height="${s}" ` + l`rx="0" ry="0" fill="${h}" stroke="${g}" stroke-width="${_}" />`), p.push(l` <rect x="${r}" y="${i}" width="${a}" height="${c}" ` + l`rx="0" ry="0" fill="${v}" stroke="${g}" stroke-width="${_}" />`);
3254
3328
  let D = i + c / 2;
3255
3329
  if (e.annotation) {
3256
3330
  let t = i + 12;
3257
- p.push(l` <text x="${r + a / 2}" y="${t}" text-anchor="middle" dy="${z}" ` + l`font-size="${zi.annotationSize}" font-weight="${zi.annotationWeight}" ` + l`font-style="italic" fill="${b ?? "var(--_text-muted)"}">&lt;&lt;${ta(e.annotation)}&gt;&gt;</text>`), D = i + c / 2 + 6;
3331
+ p.push(l` <text x="${r + a / 2}" y="${t}" text-anchor="middle" dy="${z}" ` + l`font-size="${Bi.annotationSize}" font-weight="${Bi.annotationWeight}" ` + l`font-style="italic" fill="${b ?? "var(--_text-muted)"}">&lt;&lt;${na(e.annotation)}&gt;&gt;</text>`), D = i + c / 2 + 6;
3258
3332
  }
3259
3333
  p.push(" " + y(e.label, r + a / 2, D, t.nodeLabel, l`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="${b ?? "var(--_text)"}"`));
3260
3334
  let O = i + c;
3261
3335
  p.push(l` <line x1="${r}" y1="${O}" x2="${r + a}" y2="${O}" ` + l`stroke="${g}" stroke-width="${R.innerBox}" />`);
3262
3336
  for (let t = 0; t < e.attributes.length; t++) {
3263
3337
  let n = e.attributes[t], i = O + 4 + t * 20 + 10;
3264
- p.push(" " + Gi(n, r + W.boxPadX, i, b));
3338
+ p.push(" " + Ki(n, r + G.boxPadX, i, b));
3265
3339
  }
3266
3340
  let k = O + u;
3267
3341
  p.push(l` <line x1="${r}" y1="${k}" x2="${r + a}" y2="${k}" ` + l`stroke="${g}" stroke-width="${R.innerBox}" />`);
3268
3342
  for (let t = 0; t < e.methods.length; t++) {
3269
3343
  let n = e.methods[t], i = k + 4 + t * 20 + 10;
3270
- p.push(" " + Gi(n, r + W.boxPadX, i, b));
3344
+ p.push(" " + Ki(n, r + G.boxPadX, i, b));
3271
3345
  }
3272
3346
  return E && p.push(" </a>"), p.push("</g>"), p.join("\n");
3273
3347
  }
3274
- var Wi = 700;
3275
- function Gi(e, t, n, r) {
3348
+ var Gi = 700;
3349
+ function Ki(e, t, n, r) {
3276
3350
  let i = e.isAbstract ? " font-style=\"italic\"" : "", a = e.isStatic ? " text-decoration=\"underline\"" : "", o = r ?? "var(--_text-faint)", s = r ?? "var(--_text-sec)", c = r ?? "var(--_text-muted)", u = [];
3277
- e.visibility && u.push(l`<tspan fill="${s}" font-weight="${Wi}">${ta(e.visibility)}</tspan><tspan fill="${o}"> </tspan>`);
3351
+ e.visibility && u.push(l`<tspan fill="${s}" font-weight="${Gi}">${na(e.visibility)}</tspan><tspan fill="${o}"> </tspan>`);
3278
3352
  let d = e.isMethod ? l`${e.name}(${e.params || ""})` : e.name;
3279
- return u.push(l`<tspan fill="${s}">${ta(d)}</tspan>`), e.type && (u.push(l`<tspan fill="${o}">: </tspan>`), u.push(l`<tspan fill="${c}">${ta(e.type)}</tspan>`)), l`<text x="${t}" y="${n}" class="mono" dy="${z}" ` + l`font-size="${zi.memberSize}" font-weight="${zi.memberWeight}"${i}${a}>` + l`${u.join("")}</text>`;
3353
+ return u.push(l`<tspan fill="${s}">${na(d)}</tspan>`), e.type && (u.push(l`<tspan fill="${o}">: </tspan>`), u.push(l`<tspan fill="${c}">${na(e.type)}</tspan>`)), l`<text x="${t}" y="${n}" class="mono" dy="${z}" ` + l`font-size="${Bi.memberSize}" font-weight="${Bi.memberWeight}"${i}${a}>` + l`${u.join("")}</text>`;
3280
3354
  }
3281
- var Ki = 6;
3282
- function qi(e, t) {
3355
+ var qi = 6;
3356
+ function Ji(e, t) {
3283
3357
  let { x: n, y: r, width: i, height: a } = e, s = e.forClass === void 0 ? "" : l` data-for="${o(e.forClass)}"`, c = [
3284
3358
  l`${n},${r}`,
3285
- l`${n + i - Ki},${r}`,
3286
- l`${n + i},${r + Ki}`,
3359
+ l`${n + i - qi},${r}`,
3360
+ l`${n + i},${r + qi}`,
3287
3361
  l`${n + i},${r + a}`,
3288
3362
  l`${n},${r + a}`
3289
- ].join(" "), u = l`${n + i - Ki},${r} ${n + i},${r + Ki} ` + l`${n + i - Ki},${r + Ki}`;
3363
+ ].join(" "), u = l`${n + i - qi},${r} ${n + i},${r + qi} ` + l`${n + i - qi},${r + qi}`;
3290
3364
  return l`<g class="class-note"${s}>` + l`\n <polygon points="${c}" ` + l`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />` + l`\n <polygon points="${u}" ` + l`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />` + l`\n ${y(e.text, n + i / 2, r + a / 2, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`)}` + "\n</g>";
3291
3365
  }
3292
- function Ji(e) {
3366
+ function Yi(e) {
3293
3367
  if (!e.linkPoints || e.linkPoints.length < 2) return "";
3294
3368
  let t = e.linkPoints.map((e) => l`${e.x},${e.y}`).join(" "), n = e.forClass === void 0 ? "" : l` data-for="${o(e.forClass)}"`;
3295
3369
  return l`<polyline class="class-note-link"${n} points="${t}" ` + l`fill="none" stroke="var(--_line)" stroke-width="${R.connector}" stroke-dasharray="2 3" />`;
3296
3370
  }
3297
- function Yi(e) {
3371
+ function Xi(e) {
3298
3372
  if (e.points.length < 2) return "";
3299
- let t = e.points.map((e) => l`${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", r = Xi(e.type, e.markerAt), i = [
3373
+ let t = e.points.map((e) => l`${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", r = Zi(e.type, e.markerAt), i = [
3300
3374
  "class=\"class-relationship\"",
3301
3375
  l`data-from="${o(e.from)}"`,
3302
3376
  l`data-to="${o(e.to)}"`,
@@ -3305,11 +3379,11 @@ function Yi(e) {
3305
3379
  ];
3306
3380
  return e.label && i.push(l`data-label="${o(e.label)}"`), e.fromCardinality && i.push(l`data-from-cardinality="${o(e.fromCardinality)}"`), e.toCardinality && i.push(l`data-to-cardinality="${o(e.toCardinality)}"`), l`<polyline ${i.join(" ")} points="${t}" fill="none" stroke="var(--_line)" ` + l`stroke-width="${R.connector}"${n}${r} />`;
3307
3381
  }
3308
- function Xi(e, t) {
3309
- let n = Zi(e);
3382
+ function Zi(e, t) {
3383
+ let n = Qi(e);
3310
3384
  return n ? t === "from" ? l` marker-start="url(#${n})"` : l` marker-end="url(#${n})"` : "";
3311
3385
  }
3312
- function Zi(e) {
3386
+ function Qi(e) {
3313
3387
  switch (e) {
3314
3388
  case "inheritance":
3315
3389
  case "realization": return "cls-inherit";
@@ -3320,30 +3394,30 @@ function Zi(e) {
3320
3394
  default: return null;
3321
3395
  }
3322
3396
  }
3323
- function Qi(e, t) {
3397
+ function $i(e, t) {
3324
3398
  if (!e.label && !e.fromCardinality && !e.toCardinality || e.points.length < 2) return "";
3325
3399
  let n = [];
3326
3400
  if (e.label) {
3327
- let r = e.labelPosition ?? $i(e.points);
3401
+ let r = e.labelPosition ?? ea(e.points);
3328
3402
  n.push(y(e.label, r.x, r.y - 8, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3329
3403
  }
3330
3404
  if (e.fromCardinality && e.points.length >= 2) {
3331
- let r = e.points[0], i = e.points[1], a = ea(r, i);
3405
+ let r = e.points[0], i = e.points[1], a = ta(r, i);
3332
3406
  n.push(y(e.fromCardinality, r.x + a.x, r.y + a.y, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3333
3407
  }
3334
3408
  if (e.toCardinality && e.points.length >= 2) {
3335
- let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], a = ea(r, i);
3409
+ let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], a = ta(r, i);
3336
3410
  n.push(y(e.toCardinality, r.x + a.x, r.y + a.y, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3337
3411
  }
3338
3412
  return n.join("\n");
3339
3413
  }
3340
- function $i(e) {
3414
+ function ea(e) {
3341
3415
  return e.length === 0 ? {
3342
3416
  x: 0,
3343
3417
  y: 0
3344
3418
  } : e[Math.floor(e.length / 2)];
3345
3419
  }
3346
- function ea(e, t) {
3420
+ function ta(e, t) {
3347
3421
  let n = t.x - e.x, r = t.y - e.y;
3348
3422
  return Math.abs(n) > Math.abs(r) ? {
3349
3423
  x: n > 0 ? 14 : -14,
@@ -3353,7 +3427,7 @@ function ea(e, t) {
3353
3427
  y: r > 0 ? 14 : -14
3354
3428
  };
3355
3429
  }
3356
- var ta = s, G = {
3430
+ var na = s, ra = {
3357
3431
  padding: 40,
3358
3432
  boxPadX: 14,
3359
3433
  headerHeight: 34,
@@ -3364,18 +3438,18 @@ var ta = s, G = {
3364
3438
  nodeSpacing: 70,
3365
3439
  layerSpacing: 90
3366
3440
  };
3367
- function na(e) {
3368
- return e.length * Math.ceil(Ne("M", G.attrFontSize));
3441
+ function ia(e) {
3442
+ return e.length * Math.ceil(Ne("M", ra.attrFontSize));
3369
3443
  }
3370
- function ra(e, t) {
3444
+ function aa(e, t) {
3371
3445
  let n = /* @__PURE__ */ new Map(), r = Le(t.fontSizes);
3372
3446
  for (let t of e.entities) {
3373
3447
  let e = I(t.label, r.nodeLabel, L.nodeLabel), i = 0;
3374
3448
  for (let e of t.attributes) {
3375
- let t = na(`${e.type} ${e.name}${e.keys.length > 0 ? " " + e.keys.join(",") : ""}`);
3449
+ let t = ia(`${e.type} ${e.name}${e.keys.length > 0 ? " " + e.keys.join(",") : ""}`);
3376
3450
  t > i && (i = t);
3377
3451
  }
3378
- let a = Math.max(G.minWidth, e + G.boxPadX * 2, i + G.boxPadX * 2), o = G.headerHeight + Math.max(t.attributes.length, 1) * G.rowHeight;
3452
+ let a = Math.max(ra.minWidth, e + ra.boxPadX * 2, i + ra.boxPadX * 2), o = ra.headerHeight + Math.max(t.attributes.length, 1) * ra.rowHeight;
3379
3453
  n.set(t.id, {
3380
3454
  width: a,
3381
3455
  height: o
@@ -3397,9 +3471,9 @@ function ra(e, t) {
3397
3471
  layoutOptions: {
3398
3472
  ...qe({
3399
3473
  direction: Ge(e.direction, We.er),
3400
- nodeSpacing: G.nodeSpacing,
3401
- layerSpacing: G.layerSpacing,
3402
- padding: G.padding
3474
+ nodeSpacing: ra.nodeSpacing,
3475
+ layerSpacing: ra.layerSpacing,
3476
+ padding: ra.padding
3403
3477
  }),
3404
3478
  "elk.edgeLabels.placement": "CENTER",
3405
3479
  "elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
@@ -3412,7 +3486,7 @@ function ra(e, t) {
3412
3486
  entitySizes: n
3413
3487
  };
3414
3488
  }
3415
- function ia(e, t, n) {
3489
+ function oa(e, t, n) {
3416
3490
  let r = /* @__PURE__ */ new Map();
3417
3491
  for (let e of t.entities) r.set(e.id, e);
3418
3492
  let i = [];
@@ -3431,14 +3505,14 @@ function ia(e, t, n) {
3431
3505
  y: t.y ?? 0,
3432
3506
  width: t.width ?? r.width,
3433
3507
  height: t.height ?? r.height,
3434
- headerHeight: G.headerHeight,
3435
- rowHeight: G.rowHeight
3508
+ headerHeight: ra.headerHeight,
3509
+ rowHeight: ra.rowHeight
3436
3510
  });
3437
3511
  }
3438
3512
  }
3439
3513
  let a = [];
3440
3514
  for (let [n, r] of (e.edges ?? []).entries()) {
3441
- let e = t.relationships[n], i = Nt(r);
3515
+ let e = t.relationships[n], i = Pt(r);
3442
3516
  a.push({
3443
3517
  entity1: e.entity1,
3444
3518
  entity2: e.entity2,
@@ -3456,58 +3530,58 @@ function ia(e, t, n) {
3456
3530
  relationships: a
3457
3531
  };
3458
3532
  }
3459
- function aa(e, t = {}) {
3533
+ function sa(e, t = {}) {
3460
3534
  if (e.entities.length === 0) return {
3461
3535
  width: 0,
3462
3536
  height: 0,
3463
3537
  entities: [],
3464
3538
  relationships: []
3465
3539
  };
3466
- let { elkGraph: n, entitySizes: r } = ra(e, t);
3467
- return ia(Ae(n, t.layoutCache), e, r);
3540
+ let { elkGraph: n, entitySizes: r } = aa(e, t);
3541
+ return oa(Ae(n, t.layoutCache), e, r);
3468
3542
  }
3469
3543
  //#endregion
3470
3544
  //#region packages/svg-renderer/src/er/renderer.ts
3471
- var oa = 70, sa = {
3545
+ var ca = 70, la = {
3472
3546
  attrSize: 11,
3473
3547
  attrWeight: 400,
3474
3548
  keySize: 9,
3475
3549
  keyWeight: 600
3476
3550
  };
3477
- function ca(e, t, n = "Inter", r = !1, i = Ie, a, o, s, c = {}) {
3551
+ function ua(e, t, n = "Inter", r = !1, i = Ie, a, o, s, c = {}) {
3478
3552
  let l = [];
3479
- l.push(pi(O(e.width, e.height, t, r, o, s, void 0, c.styleAttribute, c.description), a)), l.push(Ve(n, !0, c.nonce)), l.push("<defs>"), l.push("</defs>");
3480
- for (let t of e.relationships) l.push(da(t));
3481
- for (let t of e.entities) l.push(la(t, i));
3553
+ l.push(mi(O(e.width, e.height, t, r, o, s, void 0, c.styleAttribute, c.description), a)), l.push(Be(n, !0, c.nonce)), l.push("<defs>"), l.push("</defs>");
3482
3554
  for (let t of e.relationships) l.push(pa(t));
3483
- for (let t of e.relationships) l.push(fa(t, i));
3555
+ for (let t of e.entities) l.push(da(t, i));
3556
+ for (let t of e.relationships) l.push(ha(t));
3557
+ for (let t of e.relationships) l.push(ma(t, i));
3484
3558
  return l.push("</svg>"), l.join("\n");
3485
3559
  }
3486
- function la(e, t) {
3560
+ function da(e, t) {
3487
3561
  let { id: n, x: r, y: i, width: a, height: s, headerHeight: c, rowHeight: u, label: d, attributes: f } = e, p = [];
3488
3562
  p.push(l`<g class="entity" data-id="${o(n)}" data-label="${o(d)}">`), p.push(l` <rect x="${r}" y="${i}" width="${a}" height="${s}" ` + l`rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), p.push(l` <rect x="${r}" y="${i}" width="${a}" height="${c}" ` + l`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), p.push(" " + y(d, r + a / 2, i + c / 2, t.nodeLabel, l`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="var(--_text)"`));
3489
3563
  let m = i + c;
3490
3564
  p.push(l` <line x1="${r}" y1="${m}" x2="${r + a}" y2="${m}" ` + l`stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`);
3491
3565
  for (let e = 0; e < f.length; e++) {
3492
3566
  let t = f[e], n = m + e * u + u / 2;
3493
- p.push(" " + ua(t, r, n, a).replace(/\n/g, "\n "));
3567
+ p.push(" " + fa(t, r, n, a).replace(/\n/g, "\n "));
3494
3568
  }
3495
- return f.length === 0 && p.push(l` <text x="${r + a / 2}" y="${m + u / 2}" text-anchor="middle" dy="${z}" ` + l`font-size="${sa.attrSize}" fill="var(--_text-muted)" font-style="italic">(no attributes)</text>`), p.push("</g>"), p.join("\n");
3569
+ return f.length === 0 && p.push(l` <text x="${r + a / 2}" y="${m + u / 2}" text-anchor="middle" dy="${z}" ` + l`font-size="${la.attrSize}" fill="var(--_text-muted)" font-style="italic">(no attributes)</text>`), p.push("</g>"), p.join("\n");
3496
3570
  }
3497
- function ua(e, t, n, r) {
3571
+ function fa(e, t, n, r) {
3498
3572
  let i = [], a = e.comment && e.comment.length > 0;
3499
3573
  if (e.comment && e.comment.length > 0) {
3500
3574
  let t = e.comment.replace(/<br\s*\/?>/gi, "\n");
3501
- i.push(l`<g><title>${ga(t)}</title>`);
3575
+ i.push(l`<g><title>${va(t)}</title>`);
3502
3576
  }
3503
3577
  let o = 0;
3504
- e.keys.length > 0 && (o = I(e.keys.join(","), sa.keySize, sa.keyWeight) + 8, i.push(l`<rect x="${t + 6}" y="${n - 7}" width="${o}" height="14" rx="2" ry="2" ` + "fill=\"var(--_key-badge)\" />"), i.push(l`<text x="${t + 6 + o / 2}" y="${n}" text-anchor="middle" dy="${z}" ` + l`font-size="${sa.keySize}" font-weight="${sa.keyWeight}" fill="var(--_text-sec)">${e.keys.join(",")}</text>`));
3578
+ e.keys.length > 0 && (o = I(e.keys.join(","), la.keySize, la.keyWeight) + 8, i.push(l`<rect x="${t + 6}" y="${n - 7}" width="${o}" height="14" rx="2" ry="2" ` + "fill=\"var(--_key-badge)\" />"), i.push(l`<text x="${t + 6 + o / 2}" y="${n}" text-anchor="middle" dy="${z}" ` + l`font-size="${la.keySize}" font-weight="${la.keyWeight}" fill="var(--_text-sec)">${e.keys.join(",")}</text>`));
3505
3579
  let s = t + 8 + (o > 0 ? o + 6 : 0);
3506
- i.push(l`<text x="${s}" y="${n}" class="mono" dy="${z}" ` + l`font-size="${sa.attrSize}" font-weight="${sa.attrWeight}">` + l`<tspan fill="var(--_text-muted)">${ga(e.type)}</tspan></text>`);
3580
+ i.push(l`<text x="${s}" y="${n}" class="mono" dy="${z}" ` + l`font-size="${la.attrSize}" font-weight="${la.attrWeight}">` + l`<tspan fill="var(--_text-muted)">${va(e.type)}</tspan></text>`);
3507
3581
  let c = t + r - 8;
3508
- return i.push(l`<text x="${c}" y="${n}" class="mono" text-anchor="end" dy="${z}" ` + l`font-size="${sa.attrSize}" font-weight="${sa.attrWeight}">` + l`<tspan fill="var(--_text-sec)">${ga(e.name)}</tspan></text>`), a && i.push("</g>"), i.join("\n");
3582
+ return i.push(l`<text x="${c}" y="${n}" class="mono" text-anchor="end" dy="${z}" ` + l`font-size="${la.attrSize}" font-weight="${la.attrWeight}">` + l`<tspan fill="var(--_text-sec)">${va(e.name)}</tspan></text>`), a && i.push("</g>"), i.join("\n");
3509
3583
  }
3510
- function da(e) {
3584
+ function pa(e) {
3511
3585
  if (e.points.length < 2) return "";
3512
3586
  let t = e.points.map((e) => l`${e.x},${e.y}`).join(" "), n = e.identifying ? "" : " stroke-dasharray=\"6 4\"", r = e.label ? l` data-label="${o(e.label)}"` : "", i = [
3513
3587
  "class=\"er-relationship\"",
@@ -3519,19 +3593,19 @@ function da(e) {
3519
3593
  ];
3520
3594
  return l`<polyline ${i.join(" ")}${r} points="${t}" fill="none" stroke="var(--_line)" ` + l`stroke-width="${R.connector}"${n} />`;
3521
3595
  }
3522
- function fa(e, t) {
3596
+ function ma(e, t) {
3523
3597
  if (!e.label || e.points.length < 2) return "";
3524
- let n = ha(e.points), r = p(e.label, t.edgeLabel, L.edgeLabel), i = r.width + 8, a = r.height + 6;
3525
- return l`<rect x="${n.x - i / 2}" y="${n.y - a / 2}" width="${i}" height="${a}" rx="2" ry="2" ` + "fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"0.5\" />" + l`\n${y(e.label, n.x, n.y, t.edgeLabel, l`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${oa}%, var(--bg))"`)}`;
3598
+ let n = _a(e.points), r = p(e.label, t.edgeLabel, L.edgeLabel), i = r.width + 8, a = r.height + 6;
3599
+ return l`<rect x="${n.x - i / 2}" y="${n.y - a / 2}" width="${i}" height="${a}" rx="2" ry="2" ` + "fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"0.5\" />" + l`\n${y(e.label, n.x, n.y, t.edgeLabel, l`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${L.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${ca}%, var(--bg))"`)}`;
3526
3600
  }
3527
- function pa(e) {
3601
+ function ha(e) {
3528
3602
  if (e.points.length < 2) return "";
3529
3603
  let t = [], n = e.points[0], r = e.points[1];
3530
- t.push(ma(n, r, e.cardinality1));
3604
+ t.push(ga(n, r, e.cardinality1));
3531
3605
  let i = e.points[e.points.length - 1], a = e.points[e.points.length - 2];
3532
- return t.push(ma(i, a, e.cardinality2)), t.join("\n");
3606
+ return t.push(ga(i, a, e.cardinality2)), t.join("\n");
3533
3607
  }
3534
- function ma(e, t, n) {
3608
+ function ga(e, t, n) {
3535
3609
  let r = [], i = R.connector + .25, a = e.x - t.x, o = e.y - t.y, s = Math.sqrt(a * a + o * o);
3536
3610
  if (s === 0) return "";
3537
3611
  let c = a / s, u = o / s, d = -u, f = c, p = e.x - c * 4, m = e.y - u * 4, h = e.x - c * 16, g = e.y - u * 16, _ = n === "one" || n === "zero-one", v = n === "many" || n === "zero-many", y = n === "zero-one" || n === "zero-many";
@@ -3554,7 +3628,7 @@ function ma(e, t, n) {
3554
3628
  }
3555
3629
  return r.join("\n");
3556
3630
  }
3557
- function ha(e) {
3631
+ function _a(e) {
3558
3632
  if (e.length === 0) return {
3559
3633
  x: 0,
3560
3634
  y: 0
@@ -3580,7 +3654,7 @@ function ha(e) {
3580
3654
  }
3581
3655
  return e[e.length - 1];
3582
3656
  }
3583
- var ga = s, _a = {
3657
+ var va = s, ya = {
3584
3658
  padding: 30,
3585
3659
  actorGap: 140,
3586
3660
  actorHeight: 40,
@@ -3602,24 +3676,33 @@ var ga = s, _a = {
3602
3676
  noteStackGap: 4,
3603
3677
  boxPad: 10
3604
3678
  };
3605
- function va(e) {
3679
+ function ba(e) {
3606
3680
  return e + 8;
3607
3681
  }
3608
- var ya = 14, ba = 4;
3609
- function xa(e, t, n) {
3682
+ var xa = 14, Sa = /* @__PURE__ */ new Set([
3683
+ "boundary",
3684
+ "control",
3685
+ "entity",
3686
+ "database"
3687
+ ]);
3688
+ function Ca(e) {
3689
+ return e.type === "actor" || Sa.has(e.participantType);
3690
+ }
3691
+ var wa = 4;
3692
+ function Ta(e, t, n) {
3610
3693
  return 14 + p(e, t, n).height / 2;
3611
3694
  }
3612
- function Sa(e) {
3695
+ function Ea(e) {
3613
3696
  return {
3614
- ..._a,
3615
- actorHeight: e?.actorHeight ?? _a.actorHeight,
3616
- headerGap: e?.headerGap ?? _a.headerGap,
3617
- messageRowHeight: e?.messageRowHeight ?? _a.messageRowHeight,
3618
- noteOffsetAfterMessage: e?.noteOffsetAfterMessage ?? _a.noteOffsetAfterMessage,
3619
- noteStackGap: e?.noteStackGap ?? _a.noteStackGap
3697
+ ...ya,
3698
+ actorHeight: e?.actorHeight ?? ya.actorHeight,
3699
+ headerGap: e?.headerGap ?? ya.headerGap,
3700
+ messageRowHeight: e?.messageRowHeight ?? ya.messageRowHeight,
3701
+ noteOffsetAfterMessage: e?.noteOffsetAfterMessage ?? ya.noteOffsetAfterMessage,
3702
+ noteStackGap: e?.noteStackGap ?? ya.noteStackGap
3620
3703
  };
3621
3704
  }
3622
- function Ca(e, t = {}) {
3705
+ function Da(e, t = {}) {
3623
3706
  if (e.actors.length === 0) return {
3624
3707
  width: 0,
3625
3708
  height: 0,
@@ -3631,7 +3714,7 @@ function Ca(e, t = {}) {
3631
3714
  notes: [],
3632
3715
  boxes: []
3633
3716
  };
3634
- let n = Sa(t.sequence), r = Le(t.fontSizes), i = e.actors.map((e) => {
3717
+ let n = Ea(t.sequence), r = Le(t.fontSizes), i = e.actors.map((e) => {
3635
3718
  let t = I(e.label, r.nodeLabel, L.nodeLabel);
3636
3719
  return Math.max(t + n.actorPadX * 2, 80);
3637
3720
  }), a = [], o = n.padding + i[0] / 2;
@@ -3644,10 +3727,11 @@ function Ca(e, t = {}) {
3644
3727
  }
3645
3728
  let s = /* @__PURE__ */ new Map();
3646
3729
  for (let t = 0; t < e.actors.length; t++) s.set(e.actors[t].id, t);
3647
- let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ? va(r.edgeLabel) : 0), d = n.padding + u, f = e.actors.map((e, t) => ({
3730
+ let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ? ba(r.edgeLabel) : 0), d = n.padding + u, f = e.actors.map((e, t) => ({
3648
3731
  id: e.id,
3649
3732
  label: e.label,
3650
3733
  type: e.type,
3734
+ ...e.participantType !== void 0 && { participantType: e.participantType },
3651
3735
  x: a[t],
3652
3736
  y: d,
3653
3737
  width: i[t],
@@ -3661,7 +3745,7 @@ function Ca(e, t = {}) {
3661
3745
  height: 0
3662
3746
  };
3663
3747
  return e.color !== void 0 && (u.color = e.color), u;
3664
- }), m = e.actors.map((e) => e.type === "actor" ? xa(e.label, r.nodeLabel, L.nodeLabel) : 0), h = Math.max(0, ...e.actors.map((e, t) => e.createdAt === void 0 ? m[t] : 0)), g = r.edgeLabel + 12, _ = d + n.actorHeight + Math.max(n.headerGap, h > 0 ? h + ba + g : 0), v = [], y = /* @__PURE__ */ new Map();
3748
+ }), m = e.actors.map((e) => Ca(e) ? Ta(e.label, r.nodeLabel, L.nodeLabel) : 0), h = Math.max(0, ...e.actors.map((e, t) => e.createdAt === void 0 ? m[t] : 0)), g = r.edgeLabel + 12, _ = d + n.actorHeight + Math.max(n.headerGap, h > 0 ? h + wa + g : 0), v = [], y = /* @__PURE__ */ new Map();
3665
3749
  for (let t of e.blocks) {
3666
3750
  let e = y.get(t.startIndex) ?? 0;
3667
3751
  y.set(t.startIndex, Math.max(e, n.blockHeaderExtra));
@@ -3841,15 +3925,15 @@ function Ca(e, t = {}) {
3841
3925
  let r = e.destroyedAt, i = {
3842
3926
  actorId: e.id,
3843
3927
  x: a[t],
3844
- topY: f[t].y + n.actorHeight + (m[t] > 0 ? m[t] + ba : 0),
3928
+ topY: f[t].y + n.actorHeight + (m[t] > 0 ? m[t] + wa : 0),
3845
3929
  bottomY: r === void 0 ? j - n.padding : v[r]?.y ?? _
3846
3930
  };
3847
3931
  return r !== void 0 && (i.destroyed = !0), i;
3848
3932
  });
3849
3933
  for (let e of p) e.height = j - n.padding + n.boxPad - e.y;
3850
- let F = N + P + n.padding;
3934
+ let ne = N + P + n.padding;
3851
3935
  return {
3852
- width: Math.max(F, 200),
3936
+ width: Math.max(ne, 200),
3853
3937
  height: Math.max(j, 100),
3854
3938
  actors: f,
3855
3939
  lifelines: te,
@@ -3862,36 +3946,49 @@ function Ca(e, t = {}) {
3862
3946
  }
3863
3947
  //#endregion
3864
3948
  //#region packages/svg-renderer/src/sequence/renderer.ts
3865
- function wa(e, n, r = "Inter", i = !1, a = Ie, o, s, c, l = {}) {
3949
+ function Oa(e, n, r = "Inter", i = !1, a = Ie, o, s, c, l = {}) {
3866
3950
  let u = [];
3867
- u.push(pi(O(e.width, e.height, n, i, s, c, void 0, l.styleAttribute, l.description), o)), u.push(t(r, !1, l.nonce)), u.push("<defs>"), u.push(Ta()), u.push("</defs>");
3868
- for (let t of e.boxes) u.push(Ua(t, a));
3869
- for (let t of e.blocks) u.push(Wa(t, a));
3870
- let d = Fa(e, a);
3871
- for (let t of e.lifelines) u.push(La(t, d));
3872
- for (let t of e.activations) u.push(za(t));
3873
- for (let t of e.messages) u.push(Ba(t, a));
3874
- for (let t of e.notes) u.push(Ga(t, a));
3875
- for (let t of e.actors) u.push(Ea(t, a));
3951
+ u.push(mi(O(e.width, e.height, n, i, s, c, void 0, l.styleAttribute, l.description), o)), u.push(t(r, !1, l.nonce)), u.push("<defs>"), u.push(ka()), u.push("</defs>");
3952
+ for (let t of e.boxes) u.push(Ja(t, a));
3953
+ for (let t of e.blocks) u.push(Ya(t, a));
3954
+ let d = Ba(e, a);
3955
+ for (let t of e.lifelines) u.push(Ha(t, d));
3956
+ for (let t of e.activations) u.push(Wa(t));
3957
+ for (let t of e.messages) u.push(Ga(t, a));
3958
+ for (let t of e.notes) u.push(Xa(t, a));
3959
+ for (let t of e.actors) u.push(ja(t, a));
3876
3960
  return u.push("</svg>"), u.join("\n");
3877
3961
  }
3878
- function Ta() {
3879
- let e = Be.width, t = Be.height;
3962
+ function ka() {
3963
+ let e = B.width, t = B.height;
3880
3964
  return l` <marker id="seq-arrow" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + l`\n <polygon points="0 0, ${e} ${t / 2}, 0 ${t}" fill="var(--_arrow)" />` + "\n </marker>" + l`\n <marker id="seq-arrow-open" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + l`\n <polyline points="0 0, ${e} ${t / 2}, 0 ${t}" fill="none" stroke="var(--_arrow)" stroke-width="1" />` + "\n </marker>";
3881
3965
  }
3882
- function Ea(e, t) {
3883
- let { id: n, x: r, y: i, width: a, height: s, label: c, type: u } = e, d = [];
3884
- if (d.push(l`<g class="actor" data-id="${o(n)}" data-label="${o(c)}" data-type="${u}">`), u === "actor") {
3966
+ var Aa = {
3967
+ boundary: (e, t) => `\n <circle cx="15" cy="12" r="8" ${e} />\n <path d="M1 6V18M1 12H7" ${t} />`,
3968
+ control: (e, t) => `\n <circle cx="12" cy="13" r="9" ${e} />\n <path d="M13 1L10 4L13 7" ${t} />`,
3969
+ entity: (e, t) => `\n <circle cx="12" cy="11" r="9" ${e} />\n <path d="M3 22H21" ${t} />`,
3970
+ database: (e, t) => `\n <path d="M2 5A10 3.5 0 0 1 22 5V19A10 3.5 0 0 1 2 19Z" ${e} />\n <path d="M2 5A10 3.5 0 0 0 22 5" ${t} />`
3971
+ };
3972
+ function ja(e, t) {
3973
+ let { id: n, x: r, y: i, width: a, height: s, label: c, type: u, participantType: d } = e, f = [], p = l`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${L.nodeLabel}" fill="var(--_text)"`;
3974
+ if (f.push(l`<g class="actor" data-id="${o(n)}" data-label="${o(c)}" data-type="${u}">`), u === "actor") {
3885
3975
  let e = s / 24 * .9, n = r - 12 * e, a = i + (s - 24 * e) / 2, o = R.outerBox / e, u = "var(--_line)";
3886
- d.push(l` <g transform="translate(${n},${a}) scale(${e})">` + l`\n <path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" fill="none" stroke="${u}" stroke-width="${o}" />` + l`\n <path d="M15 10C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10C9 8.34315 10.3431 7 12 7C13.6569 7 15 8.34315 15 10Z" fill="none" stroke="${u}" stroke-width="${o}" />` + l`\n <path d="M5.62842 18.3563C7.08963 17.0398 9.39997 16 12 16C14.6 16 16.9104 17.0398 18.3716 18.3563" fill="none" stroke="${u}" stroke-width="${o}" />` + "\n </g>"), d.push(" " + y(c, r, i + s + 14, t.nodeLabel, l`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${L.nodeLabel}" fill="var(--_text)"`));
3976
+ f.push(l` <g transform="translate(${n},${a}) scale(${e})">` + l`\n <path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" fill="none" stroke="${u}" stroke-width="${o}" />` + l`\n <path d="M15 10C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10C9 8.34315 10.3431 7 12 7C13.6569 7 15 8.34315 15 10Z" fill="none" stroke="${u}" stroke-width="${o}" />` + l`\n <path d="M5.62842 18.3563C7.08963 17.0398 9.39997 16 12 16C14.6 16 16.9104 17.0398 18.3716 18.3563" fill="none" stroke="${u}" stroke-width="${o}" />` + "\n </g>"), f.push(" " + y(c, r, i + s + 14, t.nodeLabel, p));
3977
+ } else if (Ca(e)) {
3978
+ let e = s / 24 * .9, n = R.outerBox / e, a = l`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${n}"`, o = l`fill="none" stroke="var(--_node-stroke)" stroke-width="${n}"`, u = Aa[d](a, o);
3979
+ f.push(l` <g transform="translate(${r - 12 * e},${i + (s - 24 * e) / 2}) scale(${e})">${u}\n </g>`), f.push(" " + y(c, r, i + s + 14, t.nodeLabel, p));
3887
3980
  } else {
3888
- let e = r - a / 2;
3889
- d.push(l` <rect x="${e}" y="${i}" width="${a}" height="${s}" rx="4" ry="4" ` + l`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), d.push(" " + y(c, r, i + s / 2, t.nodeLabel, l`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${L.nodeLabel}" fill="var(--_text)"`));
3981
+ let e = r - a / 2, n = l`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}"`, o = r, u = i + s / 2;
3982
+ if (d === "queue") {
3983
+ let t = s / 2, r = e + 8, o = e + a - 8;
3984
+ f.push(l` <path d="M${r},${i}H${o}A${8},${t} 0 0 1 ${o},${i + s}H${r}A${8},${t} 0 0 1 ${r},${i}Z" ${n} />`, l` <path d="M${o},${i}A${8},${t} 0 0 0 ${o},${i + s}" fill="none" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`);
3985
+ } else d === "collections" ? (f.push(l` <rect x="${e + 4}" y="${i}" width="${a - 4}" height="${s - 4}" rx="4" ry="4" ${n} />`, l` <rect x="${e}" y="${i + 4}" width="${a - 4}" height="${s - 4}" rx="4" ry="4" ${n} />`), o = r - 2, u = i + 2 + (s - 4) / 2) : f.push(l` <rect x="${e}" y="${i}" width="${a}" height="${s}" rx="4" ry="4" ${n} />`);
3986
+ f.push(" " + y(c, o, u, t.nodeLabel, p));
3890
3987
  }
3891
- return d.push("</g>"), d.join("\n");
3988
+ return f.push("</g>"), f.join("\n");
3892
3989
  }
3893
- var Da = 30, Oa = 20, ka = 8, Aa = 10, ja = 18, Ma = 3, Na = 2, Pa = 3;
3894
- function Fa(e, t) {
3990
+ var Ma = 30, Na = 20, Pa = 8, Fa = 10, Ia = 18, La = 3, Ra = 2, za = 3;
3991
+ function Ba(e, t) {
3895
3992
  let n = [], r = (e) => p(e, t.edgeLabel, L.edgeLabel), i = (e, t, i) => {
3896
3993
  let a = r(e);
3897
3994
  n.push({
@@ -3909,64 +4006,64 @@ function Fa(e, t) {
3909
4006
  y1: i + a.height / 2
3910
4007
  });
3911
4008
  };
3912
- for (let t of e.messages) t.label && (t.isSelf ? a(t.label, t.x1 + Da + ka, t.y + Oa / 2) : i(t.label, (t.x1 + t.x2) / 2, t.y - Aa));
4009
+ for (let t of e.messages) t.label && (t.isSelf ? a(t.label, t.x1 + Ma + Pa, t.y + Na / 2) : i(t.label, (t.x1 + t.x2) / 2, t.y - Fa));
3913
4010
  for (let r of e.blocks) {
3914
4011
  let e = I(`${r.type}${r.label ? ` [${r.label}]` : ""}`.split("\n")[0] ?? "", t.edgeLabel, L.groupHeader) + 16;
3915
4012
  n.push({
3916
4013
  x0: r.x,
3917
4014
  x1: r.x + e,
3918
4015
  y0: r.y,
3919
- y1: r.y + ja
4016
+ y1: r.y + Ia
3920
4017
  });
3921
4018
  for (let e of r.dividers) e.label && a(`[${e.label}]`, r.x + 8, e.y + 14);
3922
4019
  }
3923
4020
  return n;
3924
4021
  }
3925
- function Ia(e, t) {
3926
- let n = t.filter((t) => e.x > t.x0 - Ma && e.x < t.x1 + Ma && t.y1 + Na > e.topY && t.y0 - Na < e.bottomY).map((e) => [e.y0 - Na, e.y1 + Na]).sort((e, t) => e[0] - t[0]), r = [], i = e.topY;
3927
- for (let [e, t] of n) e - i >= Pa && r.push([i, e]), i = Math.max(i, t);
3928
- return e.bottomY - i >= Pa && r.push([i, e.bottomY]), r.length > 0 ? r : [[e.topY, e.bottomY]];
4022
+ function Va(e, t) {
4023
+ let n = t.filter((t) => e.x > t.x0 - La && e.x < t.x1 + La && t.y1 + Ra > e.topY && t.y0 - Ra < e.bottomY).map((e) => [e.y0 - Ra, e.y1 + Ra]).sort((e, t) => e[0] - t[0]), r = [], i = e.topY;
4024
+ for (let [e, t] of n) e - i >= za && r.push([i, e]), i = Math.max(i, t);
4025
+ return e.bottomY - i >= za && r.push([i, e.bottomY]), r.length > 0 ? r : [[e.topY, e.bottomY]];
3929
4026
  }
3930
- function La(e, t) {
3931
- let n = Ia(e, t).map(([t, n]) => l`<line class="lifeline" data-actor="${o(e.actorId)}" ` + l`x1="${e.x}" y1="${t}" x2="${e.x}" y2="${n}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />").join("\n");
4027
+ function Ha(e, t) {
4028
+ let n = Va(e, t).map(([t, n]) => l`<line class="lifeline" data-actor="${o(e.actorId)}" ` + l`x1="${e.x}" y1="${t}" x2="${e.x}" y2="${n}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />").join("\n");
3932
4029
  if (!e.destroyed) return n;
3933
- let { x: r, bottomY: i } = e, a = Ra;
4030
+ let { x: r, bottomY: i } = e, a = Ua;
3934
4031
  return n + l`\n<path class="destroy" data-actor="${o(e.actorId)}" ` + l`d="M${r - a} ${i - a} L${r + a} ${i + a} M${r + a} ${i - a} L${r - a} ${i + a}" ` + l`fill="none" stroke="var(--_line)" stroke-width="${R.outerBox}" stroke-linecap="round" />`;
3935
4032
  }
3936
- var Ra = 8;
3937
- function za(e) {
4033
+ var Ua = 8;
4034
+ function Wa(e) {
3938
4035
  return l`<rect class="activation" data-actor="${o(e.actorId)}" ` + l`x="${e.x}" y="${e.topY}" width="${e.width}" height="${e.bottomY - e.topY}" ` + l`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`;
3939
4036
  }
3940
- function Ba(e, t) {
4037
+ function Ga(e, t) {
3941
4038
  let n = [], r = e.lineStyle === "dashed" ? " stroke-dasharray=\"6 4\"" : "", i = e.arrowHead === "filled" ? "seq-arrow" : "seq-arrow-open", a = e.bidirectional ? l` marker-start="url(#${i})"` : "";
3942
4039
  if (n.push(l`<g class="message" data-from="${o(e.from)}" data-to="${o(e.to)}" ` + l`data-label="${o(e.label)}" data-line-style="${e.lineStyle}" ` + l`data-arrow-head="${e.arrowHead}" data-self="${e.isSelf}" data-bidirectional="${e.bidirectional}">`), e.isSelf) {
3943
- let o = Da, s = Oa, c = ka;
4040
+ let o = Ma, s = Na, c = Pa;
3944
4041
  n.push(l` <polyline points="${e.x1},${e.y} ${e.x1 + o},${e.y} ${e.x1 + o},${e.y + s} ${e.x2},${e.y + s}" ` + l`fill="none" stroke="var(--_line)" stroke-width="${R.connector}"${r} marker-end="url(#${i})"${a} />`), n.push(" " + y(e.label, e.x1 + o + c, e.y + s / 2, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3945
4042
  } else {
3946
4043
  n.push(l` <line x1="${e.x1}" y1="${e.y}" x2="${e.x2}" y2="${e.y}" ` + l`stroke="var(--_line)" stroke-width="${R.connector}"${r} marker-end="url(#${i})"${a} />`);
3947
4044
  let o = (e.x1 + e.x2) / 2;
3948
- n.push(" " + y(e.label, o, e.y - Aa, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
4045
+ n.push(" " + y(e.label, o, e.y - Fa, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3949
4046
  }
3950
- return e.seqNumber !== void 0 && n.push(" " + Va(e, t)), n.push("</g>"), n.join("\n");
4047
+ return e.seqNumber !== void 0 && n.push(" " + Ka(e, t)), n.push("</g>"), n.join("\n");
3951
4048
  }
3952
- function Va(e, t) {
3953
- let n = Math.max(t.edgeLabel - 2, 8), r = e.bidirectional ? e.x1 + Math.sign(e.x2 - e.x1) * (8 + Be.width) : e.x1;
4049
+ function Ka(e, t) {
4050
+ let n = Math.max(t.edgeLabel - 2, 8), r = e.bidirectional ? e.x1 + Math.sign(e.x2 - e.x1) * (8 + B.width) : e.x1;
3954
4051
  return "<g class=\"seq-number\">" + l`<circle cx="${r}" cy="${e.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${R.innerBox}" />` + y(String(e.seqNumber), r, e.y, n, l`font-size="${n}" text-anchor="middle" font-weight="${L.edgeLabel}" fill="var(--_arrow)"`) + "</g>";
3955
4052
  }
3956
- var Ha = 35;
3957
- function Ua(e, t) {
3958
- let n = e.label ? l` data-label="${o(e.label)}"` : "", r = e.color === void 0 ? "" : l` data-color="${o(e.color)}"`, i = e.color === void 0 ? "none" : l`color-mix(in srgb, ${o(e.color)} ${Ha}%, var(--bg))`, a = [l`<g class="participant-box"${n}${r}>`, l` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" ` + l`fill="${i}" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`];
3959
- return e.label && a.push(" " + y(e.label, e.x + e.width / 2, e.y + va(t.edgeLabel) / 2, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)), a.push("</g>"), a.join("\n");
4053
+ var qa = 35;
4054
+ function Ja(e, t) {
4055
+ let n = e.label ? l` data-label="${o(e.label)}"` : "", r = e.color === void 0 ? "" : l` data-color="${o(e.color)}"`, i = e.color === void 0 ? "none" : l`color-mix(in srgb, ${o(e.color)} ${qa}%, var(--bg))`, a = [l`<g class="participant-box"${n}${r}>`, l` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" ` + l`fill="${i}" stroke="var(--_node-stroke)" stroke-width="${R.innerBox}" />`];
4056
+ return e.label && a.push(" " + y(e.label, e.x + e.width / 2, e.y + ba(t.edgeLabel) / 2, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`)), a.push("</g>"), a.join("\n");
3960
4057
  }
3961
- function Wa(e, t) {
4058
+ function Ya(e, t) {
3962
4059
  let n = [], r = e.label ? l` data-label="${o(e.label)}"` : "";
3963
4060
  n.push(l`<g class="block" data-type="${o(e.type)}"${r}>`), n.push(l` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + l`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`);
3964
- let i = l`${e.type}${e.label ? l` [${e.label}]` : ""}`, a = i.split("\n")[0], s = I(a, t.edgeLabel, L.groupHeader) + 16, c = ja;
4061
+ let i = l`${e.type}${e.label ? l` [${e.label}]` : ""}`, a = i.split("\n")[0], s = I(a, t.edgeLabel, L.groupHeader) + 16, c = Ia;
3965
4062
  n.push(l` <rect x="${e.x}" y="${e.y}" width="${s}" height="${c}" ` + l`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${R.outerBox}" />`), n.push(" " + y(i, e.x + 6, e.y + c / 2, t.edgeLabel, l`font-size="${t.edgeLabel}" font-weight="${L.groupHeader}" fill="var(--_text-sec)"`));
3966
4063
  for (let r of e.dividers) n.push(l` <line x1="${e.x}" y1="${r.y}" x2="${e.x + e.width}" y2="${r.y}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />"), r.label && n.push(" " + y(l`[${r.label}]`, e.x + 8, r.y + 14, t.edgeLabel, l`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${L.edgeLabel}" fill="var(--_text-muted)"`));
3967
4064
  return n.push("</g>"), n.join("\n");
3968
4065
  }
3969
- function Ga(e, t) {
4066
+ function Xa(e, t) {
3970
4067
  let { x: n, y: r, width: i, height: a } = e, s = e.actors && e.actors.length > 0 ? l` data-actors="${e.actors.map(o).join(",")}"` : "", c = e.position ? l` data-position="${o(e.position)}"` : "", u = [
3971
4068
  l`${n},${r}`,
3972
4069
  l`${n + i - 6},${r}`,
@@ -4005,23 +4102,23 @@ var K = {
4005
4102
  legendGap: 6,
4006
4103
  legendItemGap: 16
4007
4104
  };
4008
- function Ka(e, t = {}) {
4009
- return e.horizontal ? Ja(e) : qa(e);
4105
+ function Za(e, t = {}) {
4106
+ return e.horizontal ? $a(e) : Qa(e);
4010
4107
  }
4011
- function qa(e) {
4108
+ function Qa(e) {
4012
4109
  let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
4013
4110
  if (!a)
4014
4111
  /* v8 ignore next */
4015
4112
  throw Error("XY chart: y-axis range was not set by the parser");
4016
- let o = _(a.min, a.max), s = no(o), c = Math.max(...s.map((e) => I(e, K.axisLabelFontSize, K.axisLabelFontWeight)), K.yLabelWidth), l = K.padding + (t ? K.titleHeight : 0) + (i ? K.legendHeight : 0), u = K.padding + K.xLabelHeight + (n ? K.axisTitlePad : 0), d = K.padding + c + K.yLabelGap + (r ? K.axisTitlePad : 0), f = K.padding, p = K.plotWidth, m = K.plotHeight, h = d + p + f, g = l + m + u, v = {
4113
+ let o = _(a.min, a.max), s = so(o), c = Math.max(...s.map((e) => I(e, K.axisLabelFontSize, K.axisLabelFontWeight)), K.yLabelWidth), l = K.padding + (t ? K.titleHeight : 0) + (i ? K.legendHeight : 0), u = K.padding + K.xLabelHeight + (n ? K.axisTitlePad : 0), d = K.padding + c + K.yLabelGap + (r ? K.axisTitlePad : 0), f = K.padding, p = K.plotWidth, m = K.plotHeight, h = d + p + f, g = l + m + u, v = {
4017
4114
  x: d,
4018
4115
  y: l,
4019
4116
  width: p,
4020
4117
  height: m
4021
- }, y = Ya(e), b = (e) => d + (e + .5) * (p / y), x = p / y, S = (e) => {
4118
+ }, y = eo(e), b = (e) => d + (e + .5) * (p / y), x = p / y, S = (e) => {
4022
4119
  let t = (e - a.min) / (a.max - a.min || 1);
4023
4120
  return l + m - t * m;
4024
- }, C = $a(e, b, l + m, x), w = o.map((e, t) => ({
4121
+ }, C = io(e, b, l + m, x), w = o.map((e, t) => ({
4025
4122
  label: s[t],
4026
4123
  x: d,
4027
4124
  y: S(e),
@@ -4035,7 +4132,7 @@ function qa(e) {
4035
4132
  y1: S(e),
4036
4133
  x2: d + p,
4037
4134
  y2: S(e)
4038
- })), E = Xa(e, y), D = e.series.map((e, t) => t), O = eo(e, b, S, x, a.min, E, D), k = to(e, b, S, E, D), A = K.padding + (t ? K.titleHeight : 0) + K.legendHeight / 2, ee = i ? io(e, h / 2, A, D) : [], j = {
4135
+ })), E = to(e, y), D = e.series.map((e, t) => t), O = ao(e, b, S, x, a.min, E, D), k = oo(e, b, S, E, D), A = K.padding + (t ? K.titleHeight : 0) + K.legendHeight / 2, ee = i ? lo(e, h / 2, A, D) : [], j = {
4039
4136
  x1: d,
4040
4137
  y1: l + m,
4041
4138
  x2: d + p,
@@ -4080,12 +4177,12 @@ function qa(e) {
4080
4177
  legend: ee
4081
4178
  };
4082
4179
  }
4083
- function Ja(e) {
4180
+ function $a(e) {
4084
4181
  let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
4085
4182
  if (!a)
4086
4183
  /* v8 ignore next */
4087
4184
  throw Error("XY chart: y-axis range was not set by the parser");
4088
- let o = _(a.min, a.max), s = no(o), c = Ya(e), l = Xa(e, c), u = Math.max(...l.map((e) => I(e, K.axisLabelFontSize, K.axisLabelFontWeight)), 40), d = K.padding + (t ? K.titleHeight : 0) + (i ? K.legendHeight : 0), f = K.padding + K.xLabelHeight + (r ? K.axisTitlePad : 0), p = K.padding + u + K.yLabelGap + (n ? K.axisTitlePad : 0), m = K.padding, h = K.plotWidth, g = K.plotHeight, v = p + h + m, y = d + g + f, b = {
4185
+ let o = _(a.min, a.max), s = so(o), c = eo(e), l = to(e, c), u = Math.max(...l.map((e) => I(e, K.axisLabelFontSize, K.axisLabelFontWeight)), 40), d = K.padding + (t ? K.titleHeight : 0) + (i ? K.legendHeight : 0), f = K.padding + K.xLabelHeight + (r ? K.axisTitlePad : 0), p = K.padding + u + K.yLabelGap + (n ? K.axisTitlePad : 0), m = K.padding, h = K.plotWidth, g = K.plotHeight, v = p + h + m, y = d + g + f, b = {
4089
4186
  x: p,
4090
4187
  y: d,
4091
4188
  width: h,
@@ -4185,44 +4282,44 @@ function Ja(e) {
4185
4282
  y: d + g / 2,
4186
4283
  rotate: -90
4187
4284
  } } : {}
4188
- }, F = e.title ? {
4285
+ }, ne = e.title ? {
4189
4286
  text: e.title,
4190
4287
  x: v / 2,
4191
4288
  y: K.padding + K.titleFontSize
4192
- } : void 0, ne = K.padding + (t ? K.titleHeight : 0) + K.legendHeight / 2;
4289
+ } : void 0, F = K.padding + (t ? K.titleHeight : 0) + K.legendHeight / 2;
4193
4290
  return {
4194
4291
  width: v,
4195
4292
  height: y,
4196
4293
  horizontal: !0,
4197
- title: F,
4294
+ title: ne,
4198
4295
  xAxis: P,
4199
4296
  yAxis: te,
4200
4297
  plotArea: b,
4201
4298
  bars: k,
4202
4299
  lines: A,
4203
4300
  gridLines: E,
4204
- legend: i ? io(e, v / 2, ne, D) : []
4301
+ legend: i ? lo(e, v / 2, F, D) : []
4205
4302
  };
4206
4303
  }
4207
- function Ya(e) {
4304
+ function eo(e) {
4208
4305
  if (e.xAxis.categories) return e.xAxis.categories.length;
4209
4306
  for (let t of e.series) if (t.data.length > 0) return t.data.length;
4210
4307
  return 1;
4211
4308
  }
4212
- function Xa(e, t) {
4309
+ function to(e, t) {
4213
4310
  if (e.xAxis.categories) return e.xAxis.categories;
4214
4311
  if (e.xAxis.range) {
4215
4312
  let { min: n, max: r } = e.xAxis.range, i = t > 1 ? (r - n) / (t - 1) : 0;
4216
- return Array.from({ length: t }, (e, t) => ro(n + i * t));
4313
+ return Array.from({ length: t }, (e, t) => co(n + i * t));
4217
4314
  }
4218
4315
  return Array.from({ length: t }, (e, t) => String(t + 1));
4219
4316
  }
4220
- var Za = 8;
4221
- function Qa(e, t) {
4317
+ var no = 8;
4318
+ function ro(e, t) {
4222
4319
  let n = e.map((e) => I(e, K.axisLabelFontSize, K.axisLabelFontWeight));
4223
4320
  for (let r = 1; r < e.length; r++) {
4224
4321
  let i = !0;
4225
- for (let a = 0; a + r < e.length; a += r) if (r * t - (n[a] + n[a + r]) / 2 < Za) {
4322
+ for (let a = 0; a + r < e.length; a += r) if (r * t - (n[a] + n[a + r]) / 2 < no) {
4226
4323
  i = !1;
4227
4324
  break;
4228
4325
  }
@@ -4230,8 +4327,8 @@ function Qa(e, t) {
4230
4327
  }
4231
4328
  return Math.max(1, e.length);
4232
4329
  }
4233
- function $a(e, t, n, r) {
4234
- let i = Xa(e, Ya(e)), a = Qa(i, r);
4330
+ function io(e, t, n, r) {
4331
+ let i = to(e, eo(e)), a = ro(i, r);
4235
4332
  return i.map((e, r) => ({
4236
4333
  label: r % a === 0 ? e : "",
4237
4334
  x: t(r),
@@ -4243,7 +4340,7 @@ function $a(e, t, n, r) {
4243
4340
  textAnchor: "middle"
4244
4341
  }));
4245
4342
  }
4246
- function eo(e, t, n, r, i, a, o) {
4343
+ function ao(e, t, n, r, i, a, o) {
4247
4344
  let s = e.series.filter((e) => e.type === "bar").length;
4248
4345
  if (s === 0) return [];
4249
4346
  let c = r * (1 - K.barPadRatio), l = s > 1 ? (c - (s - 1) * K.barGroupGap) / s : c, u = Math.min(l, K.maxBarWidth), d = s > 1 ? u * s + K.barGroupGap * (s - 1) : u, f = [], p = 0, m = 0;
@@ -4269,7 +4366,7 @@ function eo(e, t, n, r, i, a, o) {
4269
4366
  }
4270
4367
  return f;
4271
4368
  }
4272
- function to(e, t, n, r, i) {
4369
+ function oo(e, t, n, r, i) {
4273
4370
  let a = [], o = 0, s = 0;
4274
4371
  for (let c of e.series) {
4275
4372
  if (c.type !== "line") {
@@ -4290,14 +4387,14 @@ function to(e, t, n, r, i) {
4290
4387
  }
4291
4388
  return a;
4292
4389
  }
4293
- function no(e) {
4390
+ function so(e) {
4294
4391
  let t = e.length > 1 ? Math.abs(e[1] - e[0]) : 0, n = t > 0 && t < 1 ? Math.ceil(-Math.log10(t) - 1e-9) : 0;
4295
4392
  return e.map((e) => String(Number.isInteger(e) && n === 0 ? e : Number(e.toFixed(n))));
4296
4393
  }
4297
- function ro(e) {
4394
+ function co(e) {
4298
4395
  return Number.isInteger(e) ? String(e) : e.toFixed(+(Math.abs(e) < 10));
4299
4396
  }
4300
- function io(e, t, n, r) {
4397
+ function lo(e, t, n, r) {
4301
4398
  let i = [], a = 0, o = 0;
4302
4399
  for (let t = 0; t < e.series.length; t++) {
4303
4400
  let s = e.series[t], c = s.type === "bar" ? `Bar ${a + 1}` : `Line ${o + 1}`;
@@ -4341,24 +4438,24 @@ var q = {
4341
4438
  minY: 4,
4342
4439
  pointerSize: 6
4343
4440
  };
4344
- function ao(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
4345
- let u = [], d = Math.max(0, ...e.bars.map((e) => e.colorIndex), ...e.lines.map((e) => e.colorIndex)), f = pi(O(e.width, e.height, n, i, s, c, void 0, l.styleAttribute, l.description).replace("<svg ", `<svg data-xychart-colors="${d}" `), o);
4441
+ function uo(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
4442
+ let u = [], d = Math.max(0, ...e.bars.map((e) => e.colorIndex), ...e.lines.map((e) => e.colorIndex)), f = mi(O(e.width, e.height, n, i, s, c, void 0, l.styleAttribute, l.description).replace("<svg ", `<svg data-xychart-colors="${d}" `), o);
4346
4443
  u.push(f), u.push(t(r, !1, l.nonce));
4347
- let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } = oo(e, a, m, n.accent, n.bg, l.nonce);
4444
+ let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } = fo(e, a, m, n.accent, n.bg, l.nonce);
4348
4445
  u.push(h), g && u.push(g);
4349
4446
  let { plotArea: _ } = e, v = e.xAxis.ticks.map((e) => e.x), y = e.horizontal ? e.yAxis.ticks.map((e) => e.y) : e.gridLines.map((e) => e.y1), b = v.length > 1 ? Math.abs(v[1] - v[0]) : _.width / 6, x = y.length > 1 ? Math.abs(y[1] - y[0]) : _.height / 6, S = b / Math.max(1, Math.round(b / 20)), C = x / Math.max(1, Math.round(x / 20)), w = v[0] ?? _.x, T = y[0] ?? _.y, E = w - Math.ceil((w - _.x) / S) * S, D = T - Math.ceil((T - _.y) / C) * C;
4350
4447
  for (let e = D; e <= _.y + _.height + .5; e += C) for (let t = E; t <= _.x + _.width + .5; t += S) u.push(`<circle cx="${Y(t)}" cy="${Y(e)}" r="1.5" class="xychart-grid"/>`);
4351
4448
  let k = [];
4352
4449
  for (let t of e.bars) {
4353
- let n = ` data-value="${t.value}"${t.label ? ` data-label="${X(t.label)}"` : ""}`, r = e.horizontal ? co(t.x, t.y, t.width, t.height, q.barRadius) : so(t.x, t.y, t.width, t.height, q.barRadius);
4450
+ let n = ` data-value="${t.value}"${t.label ? ` data-label="${X(t.label)}"` : ""}`, r = e.horizontal ? mo(t.x, t.y, t.width, t.height, q.barRadius) : po(t.x, t.y, t.width, t.height, q.barRadius);
4354
4451
  if (u.push(`<path d="${r}" class="xychart-bar xychart-color-${t.colorIndex}"${n}/>`), a) {
4355
- let e = po(t.value), n = t.label ? `${t.label}: ${e}` : e, r = fo(t.x + t.width / 2, t.y, e);
4452
+ let e = vo(t.value), n = t.label ? `${t.label}: ${e}` : e, r = _o(t.x + t.width / 2, t.y, e);
4356
4453
  k.push(`<g class="xychart-bar-group"><rect x="${Y(t.x)}" y="${Y(t.y)}" width="${Y(t.width)}" height="${Y(t.height)}" fill="transparent"/><title>${X(n)}</title>` + r + "</g>");
4357
4454
  }
4358
4455
  }
4359
4456
  for (let t of e.lines) {
4360
4457
  if (t.points.length === 0) continue;
4361
- let e = lo(t.points);
4458
+ let e = ho(t.points);
4362
4459
  u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`), u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`);
4363
4460
  }
4364
4461
  let A = [];
@@ -4381,16 +4478,16 @@ function ao(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
4381
4478
  let n = e[0].x, r = e[0].label || "";
4382
4479
  if (a && e.length > 1) {
4383
4480
  let i = Math.min(...e.map((e) => e.y)), a = Math.max(...e.map((e) => e.y)), o = q.dotRadius * 3, s = `<rect x="${Y(n - o)}" y="${Y(i - o)}" width="${Y(o * 2)}" height="${Y(a - i + o * 2)}" fill="transparent" class="xychart-hit"/>`, c = e.map((e) => ({
4384
- text: po(e.value),
4481
+ text: vo(e.value),
4385
4482
  legendLabel: t.get(e.seriesIndex) || `Line ${e.seriesIndex + 1}`
4386
- })), l = uo(n, i - q.dotRadius, r, c), u = c.map((e) => e.text), d = r ? `${r}: ${u.join(" · ")}` : u.join(" · "), f = `<g class="xychart-dot-group">${s}`;
4483
+ })), l = go(n, i - q.dotRadius, r, c), u = c.map((e) => e.text), d = r ? `${r}: ${u.join(" · ")}` : u.join(" · "), f = `<g class="xychart-dot-group">${s}`;
4387
4484
  for (let t of e) {
4388
4485
  let e = ` data-value="${t.value}"${t.label ? ` data-label="${X(t.label)}"` : ""}`;
4389
4486
  f += `<circle cx="${Y(t.x)}" cy="${Y(t.y)}" r="${q.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`;
4390
4487
  }
4391
4488
  f += `<title>${X(d)}</title>${l}</g>`, A.push(f);
4392
4489
  } else if (a) {
4393
- let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${X(t.label)}"` : ""}`, i = po(t.value), a = t.label ? `${t.label}: ${i}` : i, o = fo(n, t.y - q.dotRadius, i), s = m ? `<circle cx="${Y(n)}" cy="${Y(t.y)}" r="${q.dotRadius * 3}" fill="transparent" class="xychart-hit"/>` : "";
4490
+ let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${X(t.label)}"` : ""}`, i = vo(t.value), a = t.label ? `${t.label}: ${i}` : i, o = _o(n, t.y - q.dotRadius, i), s = m ? `<circle cx="${Y(n)}" cy="${Y(t.y)}" r="${q.dotRadius * 3}" fill="transparent" class="xychart-hit"/>` : "";
4394
4491
  A.push(`<g class="xychart-dot-group">${s}<circle cx="${Y(t.x)}" cy="${Y(t.y)}" r="${q.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${X(a)}</title>${o}</g>`);
4395
4492
  } else for (let t of e) {
4396
4493
  let e = ` data-value="${t.value}"${t.label ? ` data-label="${X(t.label)}"` : ""}`;
@@ -4421,13 +4518,13 @@ function ao(e, n, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
4421
4518
  for (let e of A) u.push(e);
4422
4519
  return u.push("</svg>"), u.join("\n");
4423
4520
  }
4424
- function oo(e, t, n, r, i, a) {
4521
+ function fo(e, t, n, r, i, a) {
4425
4522
  let o = r ?? j, s = /* @__PURE__ */ new Set();
4426
4523
  for (let t of e.bars) s.add(t.colorIndex);
4427
4524
  for (let t of e.lines) s.add(t.colorIndex);
4428
4525
  let c = [];
4429
4526
  for (let e of [...s].sort((e, t) => e - t)) {
4430
- let t = e === 0 ? `var(--accent, ${j})` : ne(e, o, i);
4527
+ let t = e === 0 ? `var(--accent, ${j})` : F(e, o, i);
4431
4528
  c.push(` --xychart-color-${e}: ${t};`), c.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`);
4432
4529
  }
4433
4530
  let l = [];
@@ -4457,7 +4554,7 @@ ${l.join("\n")}${u}
4457
4554
  defs: ""
4458
4555
  };
4459
4556
  }
4460
- function so(e, t, n, r, i) {
4557
+ function po(e, t, n, r, i) {
4461
4558
  let a = Math.min(i, n / 2, r / 2);
4462
4559
  return a <= 0 ? `M${Y(e)},${Y(t)} h${Y(n)} v${Y(r)} h${Y(-n)} Z` : [
4463
4560
  `M${Y(e)},${Y(t + a)}`,
@@ -4471,7 +4568,7 @@ function so(e, t, n, r, i) {
4471
4568
  "Z"
4472
4569
  ].join(" ");
4473
4570
  }
4474
- function co(e, t, n, r, i) {
4571
+ function mo(e, t, n, r, i) {
4475
4572
  let a = Math.min(i, n / 2, r / 2);
4476
4573
  return a <= 0 ? `M${Y(e)},${Y(t)} h${Y(n)} v${Y(r)} h${Y(-n)} Z` : [
4477
4574
  `M${Y(e + a)},${Y(t)}`,
@@ -4486,7 +4583,7 @@ function co(e, t, n, r, i) {
4486
4583
  "Z"
4487
4584
  ].join(" ");
4488
4585
  }
4489
- function lo(e) {
4586
+ function ho(e) {
4490
4587
  if (e.length === 0) return "";
4491
4588
  if (e.length === 1) return `M${Y(e[0].x)},${Y(e[0].y)}`;
4492
4589
  if (e.length === 2) return `M${Y(e[0].x)},${Y(e[0].y)} L${Y(e[1].x)},${Y(e[1].y)}`;
@@ -4511,7 +4608,7 @@ function lo(e) {
4511
4608
  }
4512
4609
  return o;
4513
4610
  }
4514
- function uo(e, t, n, r) {
4611
+ function go(e, t, n, r) {
4515
4612
  let i = I(n, J.fontSize, 600), a = Math.max(...r.map((e) => {
4516
4613
  let t = I(e.legendLabel, J.fontSize, J.fontWeight), n = I(e.text, J.fontSize, J.fontWeight);
4517
4614
  return t + 10 + n;
@@ -4523,11 +4620,11 @@ function uo(e, t, n, r) {
4523
4620
  for (let e of r) h += 20, m += `<text x="${Y(g)}" y="${Y(h)}" text-anchor="start" font-size="${J.fontSize}" font-weight="${J.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${X(e.legendLabel)}</text>`, m += `<text x="${Y(_)}" y="${Y(h)}" text-anchor="end" font-size="${J.fontSize}" font-weight="${J.fontWeight}" dy="${z}" class="xychart-tip xychart-tip-text">${X(e.text)}</text>`;
4524
4621
  return m;
4525
4622
  }
4526
- function fo(e, t, n) {
4623
+ function _o(e, t, n) {
4527
4624
  let r = I(n, J.fontSize, J.fontWeight) + J.padX * 2, i = J.height, a = Math.max(J.minY, t - J.offsetY - i - J.pointerSize), o = e - r / 2, s = e, c = a + i / 2, l = e, u = a + i, d = J.pointerSize, f = `<polygon points="${Y(l - d)},${Y(u)} ${Y(l + d)},${Y(u)} ${Y(l)},${Y(u + d)}" class="xychart-tip xychart-tip-ptr"/>`;
4528
4625
  return `<rect x="${Y(o)}" y="${Y(a)}" width="${Y(r)}" height="${i}" rx="${J.rx}" class="xychart-tip xychart-tip-bg"/>` + f + `<text x="${Y(s)}" y="${Y(c)}" text-anchor="middle" dy="${z}" class="xychart-tip xychart-tip-text">${X(n)}</text>`;
4529
4626
  }
4530
- function po(e) {
4627
+ function vo(e) {
4531
4628
  return Number.isInteger(e) ? e.toLocaleString("en-US") : e.toFixed(+(Math.abs(e) < 10));
4532
4629
  }
4533
4630
  function Y(e) {
@@ -4552,34 +4649,34 @@ var Z = {
4552
4649
  paletteSize: 12,
4553
4650
  highlightScale: 1.05,
4554
4651
  minPercent: 1
4555
- }, mo = Math.PI * 2;
4652
+ }, yo = Math.PI * 2;
4556
4653
  function Q(e) {
4557
4654
  return String(Math.round(e * 100) / 100);
4558
4655
  }
4559
- function ho(e, t, n, r) {
4656
+ function bo(e, t, n, r) {
4560
4657
  return {
4561
4658
  x: e + n * Math.sin(r),
4562
4659
  y: t - n * Math.cos(r)
4563
4660
  };
4564
4661
  }
4565
- function go(e, t, n, r, i, a = 0) {
4566
- if (i - r >= mo - 1e-9) {
4662
+ function xo(e, t, n, r, i, a = 0) {
4663
+ if (i - r >= yo - 1e-9) {
4567
4664
  let r = (n, r) => `M${Q(e)},${Q(t - n)}A${Q(n)},${Q(n)},0,1,${r},${Q(e)},${Q(t + n)}A${Q(n)},${Q(n)},0,1,${r},${Q(e)},${Q(t - n)}`;
4568
4665
  return r(n, 1) + (a > 0 ? r(a, 0) : "") + "Z";
4569
4666
  }
4570
- let o = ho(e, t, n, r), s = ho(e, t, n, i), c = +(i - r > Math.PI), l = `M${Q(o.x)},${Q(o.y)}A${Q(n)},${Q(n)},0,${c},1,${Q(s.x)},${Q(s.y)}`;
4667
+ let o = bo(e, t, n, r), s = bo(e, t, n, i), c = +(i - r > Math.PI), l = `M${Q(o.x)},${Q(o.y)}A${Q(n)},${Q(n)},0,${c},1,${Q(s.x)},${Q(s.y)}`;
4571
4668
  if (a <= 0) return `${l}L${Q(e)},${Q(t)}Z`;
4572
- let u = ho(e, t, a, i), d = ho(e, t, a, r);
4669
+ let u = bo(e, t, a, i), d = bo(e, t, a, r);
4573
4670
  return `${l}L${Q(u.x)},${Q(u.y)}A${Q(a)},${Q(a)},0,${c},0,${Q(d.x)},${Q(d.y)}Z`;
4574
4671
  }
4575
- function _o(e, t, n) {
4672
+ function So(e, t, n) {
4576
4673
  return n ? `${e} [${String(t)}]` : e;
4577
4674
  }
4578
- function vo(e, t = {}) {
4675
+ function Co(e, t = {}) {
4579
4676
  let n = Z.height, r = n, i = Math.min(r, n) / 2 - Z.margin, a = r / 2, o = n / 2, s = e.slices.reduce((e, t) => e + t.value, 0), c = e.slices.map((e, t) => ({
4580
4677
  slice: e,
4581
4678
  colorIndex: t % Z.paletteSize
4582
- })).filter(({ slice: e }) => e.value / s * 100 >= Z.minPercent), l = c.reduce((e, t) => e + t.slice.value, 0), u = Z.legendRectSize + Z.legendSpacing, d = e.slices.length, f = d > 0 ? e.legendPosition ?? "right" : "right", p = e.slices.map((t) => _o(t.label, t.value, e.showData)), m = Math.max(0, ...p.map((e) => I(e, Z.legendFontSize, Z.fontWeight))), h = Z.legendRectSize + Z.legendSpacing, g = u * d, _ = f === "left" ? m + h : 0, v = f === "top" ? g + u : 0, y = a - m / 2 - h, b = o - g / 2, x = {
4679
+ })).filter(({ slice: e }) => e.value / s * 100 >= Z.minPercent), l = c.reduce((e, t) => e + t.slice.value, 0), u = Z.legendRectSize + Z.legendSpacing, d = e.slices.length, f = d > 0 ? e.legendPosition ?? "right" : "right", p = e.slices.map((t) => So(t.label, t.value, e.showData)), m = Math.max(0, ...p.map((e) => I(e, Z.legendFontSize, Z.fontWeight))), h = Z.legendRectSize + Z.legendSpacing, g = u * d, _ = f === "left" ? m + h : 0, v = f === "top" ? g + u : 0, y = a - m / 2 - h, b = o - g / 2, x = {
4583
4680
  right: {
4584
4681
  x: a + 12 * Z.legendRectSize,
4585
4682
  y: b
@@ -4600,18 +4697,18 @@ function vo(e, t = {}) {
4600
4697
  x: y,
4601
4698
  y: o + i + u
4602
4699
  }
4603
- }[f], S = h + m, C = d > 0 && (f === "left" || f === "right") ? r + Z.margin + S : r + Z.margin, w = f === "top" || f === "bottom" ? n + g : n, T = e.title ?? "", E = T.length > 0 ? I(T, Z.titleFontSize, Z.fontWeight) : 0, D = a - E / 2, O = a + E / 2, k = x.x, A = x.x + S, ee = x.y, j = x.y + g - u + Z.legendRectSize, M = Math.min(0, D, d > 0 ? k : 0), N = Math.max(C, O, d > 0 ? A : 0), P = d > 0 ? Math.min(0, ee) : 0, te = d > 0 ? Math.max(w, j) : n, F = -M, ne = -P, re = a + _ + F, ie = o + v + ne, ae = [], oe = 0, se = e.donutHole ?? 0, ce = se > 0 && se <= .9 ? se * i : 0, le = i * (e.textPosition ?? Z.textPosition);
4700
+ }[f], S = h + m, C = d > 0 && (f === "left" || f === "right") ? r + Z.margin + S : r + Z.margin, w = f === "top" || f === "bottom" ? n + g : n, T = e.title ?? "", E = T.length > 0 ? I(T, Z.titleFontSize, Z.fontWeight) : 0, D = a - E / 2, O = a + E / 2, k = x.x, A = x.x + S, ee = x.y, j = x.y + g - u + Z.legendRectSize, M = Math.min(0, D, d > 0 ? k : 0), N = Math.max(C, O, d > 0 ? A : 0), P = d > 0 ? Math.min(0, ee) : 0, te = d > 0 ? Math.max(w, j) : n, ne = -M, F = -P, re = a + _ + ne, ie = o + v + F, ae = [], oe = 0, se = e.donutHole ?? 0, ce = se > 0 && se <= .9 ? se * i : 0, le = i * (e.textPosition ?? Z.textPosition);
4604
4701
  for (let { slice: t, colorIndex: n } of c) {
4605
- let r = oe, a = oe + t.value / l * mo;
4702
+ let r = oe, a = oe + t.value / l * yo;
4606
4703
  oe = a;
4607
- let o = ho(re, ie, le, (r + a) / 2), c = e.highlightSlice !== void 0 && e.highlightSlice !== "hover" && e.highlightSlice !== "" && e.highlightSlice === t.label, u = c ? Z.highlightScale : 1;
4704
+ let o = bo(re, ie, le, (r + a) / 2), c = e.highlightSlice !== void 0 && e.highlightSlice !== "hover" && e.highlightSlice !== "" && e.highlightSlice === t.label, u = c ? Z.highlightScale : 1;
4608
4705
  ae.push({
4609
4706
  label: t.label,
4610
4707
  value: t.value,
4611
4708
  colorIndex: n,
4612
4709
  startAngle: r,
4613
4710
  endAngle: a,
4614
- path: go(re, ie, i * u, r, a, ce * u),
4711
+ path: xo(re, ie, i * u, r, a, ce * u),
4615
4712
  percentText: `${(t.value / s * 100).toFixed(0)}%`,
4616
4713
  labelX: o.x,
4617
4714
  labelY: o.y,
@@ -4619,7 +4716,7 @@ function vo(e, t = {}) {
4619
4716
  });
4620
4717
  }
4621
4718
  let ue = p.map((e, t) => {
4622
- let n = x.x + F, r = x.y + t * u + ne;
4719
+ let n = x.x + ne, r = x.y + t * u + F;
4623
4720
  return {
4624
4721
  text: e,
4625
4722
  colorIndex: t % Z.paletteSize,
@@ -4639,8 +4736,8 @@ function vo(e, t = {}) {
4639
4736
  outerRadius: i + Z.outerStrokeWidth / 2,
4640
4737
  title: T.length > 0 ? {
4641
4738
  text: T,
4642
- x: a + F,
4643
- y: o + ne - (n - 50) / 2
4739
+ x: a + ne,
4740
+ y: o + F - (n - 50) / 2
4644
4741
  } : void 0,
4645
4742
  slices: ae,
4646
4743
  legend: ue,
@@ -4650,17 +4747,17 @@ function vo(e, t = {}) {
4650
4747
  }
4651
4748
  //#endregion
4652
4749
  //#region packages/svg-renderer/src/pie/renderer.ts
4653
- function yo(e) {
4750
+ function wo(e) {
4654
4751
  return String(Math.round(e * 100) / 100);
4655
4752
  }
4656
- function bo(e, t, n) {
4657
- return e === 0 ? `var(--accent, ${j})` : ne(e, t ?? j, n);
4753
+ function To(e, t, n) {
4754
+ return e === 0 ? `var(--accent, ${j})` : F(e, t ?? j, n);
4658
4755
  }
4659
- function xo(e, t, n) {
4756
+ function Eo(e, t, n) {
4660
4757
  let r = /* @__PURE__ */ new Set();
4661
4758
  for (let t of e.slices) r.add(t.colorIndex);
4662
4759
  for (let t of e.legend) r.add(t.colorIndex);
4663
- let i = [...r].sort((e, t) => e - t), a = i.map((e) => ` --pie-color-${e}: ${bo(e, t.accent, t.bg)};`), o = i.map((e) => ` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`), s = e.slices.some((e) => e.highlighted) ? "\n .pie-slice.pie-highlight { opacity: 1; }" : "", c = a.length > 0 ? `\n svg {\n${a.join("\n")}\n }` : "";
4760
+ let i = [...r].sort((e, t) => e - t), a = i.map((e) => ` --pie-color-${e}: ${To(e, t.accent, t.bg)};`), o = i.map((e) => ` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`), s = e.slices.some((e) => e.highlighted) ? "\n .pie-slice.pie-highlight { opacity: 1; }" : "", c = a.length > 0 ? `\n svg {\n${a.join("\n")}\n }` : "";
4664
4761
  return `${E(n)}
4665
4762
  .pie-outer { fill: none; stroke: var(--fg); stroke-width: ${Z.outerStrokeWidth}px; }
4666
4763
  .pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }${s}
@@ -4670,18 +4767,18 @@ function xo(e, t, n) {
4670
4767
  ${o.join("\n")}
4671
4768
  </style>`;
4672
4769
  }
4673
- function So(e, n, r = "Inter", i = !1, a, c, l, u = {}) {
4770
+ function Do(e, n, r = "Inter", i = !1, a, c, l, u = {}) {
4674
4771
  let d = [];
4675
- d.push(pi(O(e.width, e.height, n, i, c ?? e.accTitle, l, void 0, u.styleAttribute, e.accDescr), a)), d.push(t(r, !1, u.nonce)), d.push(xo(e, n, u.nonce)), d.push(`<circle cx="${yo(e.cx)}" cy="${yo(e.cy)}" r="${yo(e.outerRadius)}" class="pie-outer"/>`);
4772
+ d.push(mi(O(e.width, e.height, n, i, c ?? e.accTitle, l, void 0, u.styleAttribute, e.accDescr), a)), d.push(t(r, !1, u.nonce)), d.push(Eo(e, n, u.nonce)), d.push(`<circle cx="${wo(e.cx)}" cy="${wo(e.cy)}" r="${wo(e.outerRadius)}" class="pie-outer"/>`);
4676
4773
  for (let t of e.slices) d.push(`<path d="${t.path}" class="pie-slice${t.highlighted ? " pie-highlight" : ""} pie-color-${t.colorIndex}" data-label="${o(t.label)}" data-value="${t.value}"/>`);
4677
- for (let t of e.slices) d.push(`<text x="${yo(t.labelX)}" y="${yo(t.labelY)}" text-anchor="middle" class="pie-slice-label">${s(t.percentText)}</text>`);
4678
- e.title && d.push(`<text x="${yo(e.title.x)}" y="${yo(e.title.y)}" text-anchor="middle" class="pie-title">${s(e.title.text)}</text>`);
4679
- for (let t of e.legend) d.push(`<g class="pie-legend"><rect x="${yo(t.x)}" y="${yo(t.y)}" width="${t.size}" height="${t.size}" class="pie-legend-swatch pie-color-${t.colorIndex}"/><text x="${yo(t.textX)}" y="${yo(t.textY)}" class="pie-legend-text">${s(t.text)}</text></g>`);
4774
+ for (let t of e.slices) d.push(`<text x="${wo(t.labelX)}" y="${wo(t.labelY)}" text-anchor="middle" class="pie-slice-label">${s(t.percentText)}</text>`);
4775
+ e.title && d.push(`<text x="${wo(e.title.x)}" y="${wo(e.title.y)}" text-anchor="middle" class="pie-title">${s(e.title.text)}</text>`);
4776
+ for (let t of e.legend) d.push(`<g class="pie-legend"><rect x="${wo(t.x)}" y="${wo(t.y)}" width="${t.size}" height="${t.size}" class="pie-legend-swatch pie-color-${t.colorIndex}"/><text x="${wo(t.textX)}" y="${wo(t.textY)}" class="pie-legend-text">${s(t.text)}</text></g>`);
4680
4777
  return d.push("</svg>"), d.join("\n");
4681
4778
  }
4682
4779
  //#endregion
4683
4780
  //#region packages/svg-renderer/src/c4/arial-widths.ts
4684
- var Co = 2048, wo = [
4781
+ var Oo = 2048, ko = [
4685
4782
  569,
4686
4783
  569,
4687
4784
  727,
@@ -4777,7 +4874,7 @@ var Co = 2048, wo = [
4777
4874
  532,
4778
4875
  684,
4779
4876
  1196
4780
- ], To = [
4877
+ ], Ao = [
4781
4878
  569,
4782
4879
  682,
4783
4880
  971,
@@ -4874,9 +4971,9 @@ var Co = 2048, wo = [
4874
4971
  801,
4875
4972
  1196
4876
4973
  ];
4877
- function Eo(e, t) {
4974
+ function jo(e, t) {
4878
4975
  let n = e.codePointAt(0);
4879
- if (!(n < 32 || n > 126)) return (t ? To : wo)[n - 32] / Co;
4976
+ if (!(n < 32 || n > 126)) return (t ? Ao : ko)[n - 32] / Oo;
4880
4977
  }
4881
4978
  //#endregion
4882
4979
  //#region packages/svg-renderer/src/c4/metrics.ts
@@ -4915,20 +5012,20 @@ var $ = {
4915
5012
  personHeadOverlap: .27,
4916
5013
  dbTrim: 3.91,
4917
5014
  queueExtra: 10
4918
- }, Do = $.width - 2 * $.shapePadding;
4919
- function Oo(e, t, n) {
5015
+ }, Mo = $.width - 2 * $.shapePadding;
5016
+ function No(e, t, n) {
4920
5017
  let r = [];
4921
5018
  for (let i of e.split("\n")) {
4922
5019
  let e = "";
4923
5020
  for (let a of i.split(/\s+/).filter(Boolean)) {
4924
5021
  let i = e ? `${e} ${a}` : a;
4925
- e && Po(i, n, 400) > t ? (r.push(e), e = a) : e = i;
5022
+ e && zo(i, n, 400) > t ? (r.push(e), e = a) : e = i;
4926
5023
  }
4927
5024
  r.push(e);
4928
5025
  }
4929
5026
  return r;
4930
5027
  }
4931
- function ko(e, t) {
5028
+ function Po(e, t) {
4932
5029
  let n = Math.min(Math.max(e * $.personHeadRatio, $.personHeadMin), $.personHeadMax), r = n * (2 - $.personHeadOverlap), i = t === void 0 ? Infinity : t - r;
4933
5030
  return {
4934
5031
  rx: Math.min(e * $.personRx, i * $.personRxMaxOfHeight),
@@ -4936,43 +5033,43 @@ function ko(e, t) {
4936
5033
  pillTop: r
4937
5034
  };
4938
5035
  }
4939
- function Ao(e, t) {
4940
- return e * $.nameLine + $.typeLine + jo(t);
5036
+ function Fo(e, t) {
5037
+ return e * $.nameLine + $.typeLine + Io(t);
4941
5038
  }
4942
- function jo(e) {
5039
+ function Io(e) {
4943
5040
  return e === 0 ? 0 : $.descrLine + (e - 1) * $.descrExtraLine;
4944
5041
  }
4945
- function Mo(e) {
5042
+ function Lo(e) {
4946
5043
  let t = e / 2;
4947
5044
  return {
4948
5045
  rx: t,
4949
5046
  ry: t / (2.5 + e / 50)
4950
5047
  };
4951
5048
  }
4952
- function No(e) {
5049
+ function Ro(e) {
4953
5050
  let t = e / 2;
4954
5051
  return {
4955
5052
  rx: t / (2.5 + e / 50),
4956
5053
  ry: t
4957
5054
  };
4958
5055
  }
4959
- function Po(e, t, n) {
5056
+ function zo(e, t, n) {
4960
5057
  let r = 0;
4961
5058
  for (let i of e) {
4962
- let e = Eo(i, n >= 600);
5059
+ let e = jo(i, n >= 600);
4963
5060
  r += e === void 0 ? I(i, t, n) * $.textScale : e * t;
4964
5061
  }
4965
5062
  return r;
4966
5063
  }
4967
- function Fo(e, t, n, r) {
4968
- let i = Ao(t, n), a = i + 2 * $.shapePadding, o = Math.max($.width, r + 2 * $.shapePadding);
5064
+ function Bo(e, t, n, r) {
5065
+ let i = Fo(t, n), a = i + 2 * $.shapePadding, o = Math.max($.width, r + 2 * $.shapePadding);
4969
5066
  if (e.kind === "person") return {
4970
5067
  width: o,
4971
- height: ko(o).pillTop + a,
5068
+ height: Po(o).pillTop + a,
4972
5069
  textHeight: i
4973
5070
  };
4974
5071
  if (e.shape === "db") {
4975
- let { ry: e } = Mo(o);
5072
+ let { ry: e } = Lo(o);
4976
5073
  return {
4977
5074
  width: o,
4978
5075
  height: a + 2 * e - $.dbTrim,
@@ -4980,7 +5077,7 @@ function Fo(e, t, n, r) {
4980
5077
  };
4981
5078
  }
4982
5079
  if (e.shape === "queue") {
4983
- let e = i + $.queueExtra, { rx: t } = No(e);
5080
+ let e = i + $.queueExtra, { rx: t } = Ro(e);
4984
5081
  return {
4985
5082
  width: o + 3 * t,
4986
5083
  height: e,
@@ -4993,7 +5090,7 @@ function Fo(e, t, n, r) {
4993
5090
  textHeight: i
4994
5091
  };
4995
5092
  }
4996
- function Io(e) {
5093
+ function Vo(e) {
4997
5094
  let t = "#ffffff";
4998
5095
  if (e.external) switch (e.kind) {
4999
5096
  case "person": return {
@@ -5040,48 +5137,48 @@ function Io(e) {
5040
5137
  };
5041
5138
  }
5042
5139
  }
5043
- var Lo = $.messageSize + 5;
5044
- function Ro(e) {
5140
+ var Ho = $.messageSize + 5;
5141
+ function Uo(e) {
5045
5142
  return e.labelLines ?? P(e);
5046
5143
  }
5047
- function zo(e) {
5144
+ function Wo(e) {
5048
5145
  let t = e.labelPosition;
5049
- return t ? Ro(e).map((n, r, i) => ({
5146
+ return t ? Uo(e).map((n, r, i) => ({
5050
5147
  cx: e.technology !== void 0 && r === i.length - 1 && e.technologyX !== void 0 ? e.technologyX : t.x,
5051
- cy: t.y + r * Lo,
5052
- w: Po(n, $.messageSize, 400),
5148
+ cy: t.y + r * Ho,
5149
+ w: zo(n, $.messageSize, 400),
5053
5150
  h: $.messageSize
5054
5151
  })) : [];
5055
5152
  }
5056
5153
  //#endregion
5057
5154
  //#region packages/svg-renderer/src/c4/layout.ts
5058
- function Bo() {
5155
+ function Go() {
5059
5156
  return { next: { cnt: 0 } };
5060
5157
  }
5061
- function Vo(e, t, n, r, i) {
5158
+ function Ko(e, t, n, r, i) {
5062
5159
  e.next.startx = e.startx = t, e.next.stopx = e.stopx = n, e.next.starty = e.starty = r, e.next.stopy = e.stopy = i;
5063
5160
  }
5064
- function Ho(e, t, n, r) {
5161
+ function qo(e, t, n, r) {
5065
5162
  let i = e[t];
5066
5163
  e[t] = i === void 0 ? n : r(n, i);
5067
5164
  }
5068
- function Uo(e, t) {
5165
+ function Jo(e, t) {
5069
5166
  e.next.cnt += 1;
5070
5167
  let n = $.shapeMargin, r = e.next.startx === e.next.stopx ? e.next.stopx + n : e.next.stopx + n * 2, i = r + t.width, a = e.next.starty + n * 2, o = a + t.height;
5071
- (r >= e.widthLimit || i >= e.widthLimit || e.next.cnt > $.shapeInRow) && (r = e.next.startx + n + $.nextLinePaddingX, a = e.next.stopy + n * 2, e.next.stopx = i = r + t.width, e.next.starty = e.next.stopy, e.next.stopy = o = a + t.height, e.next.cnt = 1), t.x = r, t.y = a, Ho(e, "startx", r, Math.min), Ho(e, "starty", a, Math.min), Ho(e, "stopx", i, Math.max), Ho(e, "stopy", o, Math.max), Ho(e.next, "startx", r, Math.min), Ho(e.next, "starty", a, Math.min), Ho(e.next, "stopx", i, Math.max), Ho(e.next, "stopy", o, Math.max);
5168
+ (r >= e.widthLimit || i >= e.widthLimit || e.next.cnt > $.shapeInRow) && (r = e.next.startx + n + $.nextLinePaddingX, a = e.next.stopy + n * 2, e.next.stopx = i = r + t.width, e.next.starty = e.next.stopy, e.next.stopy = o = a + t.height, e.next.cnt = 1), t.x = r, t.y = a, qo(e, "startx", r, Math.min), qo(e, "starty", a, Math.min), qo(e, "stopx", i, Math.max), qo(e, "stopy", o, Math.max), qo(e.next, "startx", r, Math.min), qo(e.next, "starty", a, Math.min), qo(e.next, "stopx", i, Math.max), qo(e.next, "stopy", o, Math.max);
5072
5169
  }
5073
- function Wo(e) {
5074
- let t = Oo(e.label, Do, $.nameSize), n = e.description ? Oo(e.description, Do, $.descrSize) : [], r = Math.max(...t.map((e) => Po(e, $.nameSize, 700)), Po(te(e), $.typeSize, 400), ...n.map((e) => Po(e, $.descrSize, 400)));
5170
+ function Yo(e) {
5171
+ let t = No(e.label, Mo, $.nameSize), n = e.description ? No(e.description, Mo, $.descrSize) : [], r = Math.max(...t.map((e) => zo(e, $.nameSize, 700)), zo(te(e), $.typeSize, 400), ...n.map((e) => zo(e, $.descrSize, 400)));
5075
5172
  return {
5076
5173
  el: e,
5077
5174
  nameLines: t,
5078
5175
  descriptionLines: n,
5079
5176
  x: 0,
5080
5177
  y: 0,
5081
- ...Fo(e, t.length, n.length, r)
5178
+ ...Bo(e, t.length, n.length, r)
5082
5179
  };
5083
5180
  }
5084
- function Go(e) {
5181
+ function Xo(e) {
5085
5182
  let t = /* @__PURE__ */ new Set(), n = new Map(e.elements.map((e) => [e.alias, e])), r = (e) => {
5086
5183
  let i = e.elementAliases.flatMap((e) => {
5087
5184
  t.add(e);
@@ -5101,15 +5198,15 @@ function Go(e) {
5101
5198
  children: i
5102
5199
  };
5103
5200
  }
5104
- function Ko(e) {
5201
+ function Zo(e) {
5105
5202
  let t = /* @__PURE__ */ new Map(), n = [], r = $.diagramMarginX, i = $.diagramMarginY, a = (e, n) => {
5106
5203
  for (let r of n) {
5107
- let n = Wo(r);
5108
- t.set(r.alias, n), Uo(e, n);
5204
+ let n = Yo(r);
5205
+ t.set(r.alias, n), Jo(e, n);
5109
5206
  }
5110
5207
  e.stopx += $.shapeMargin, e.stopy += $.shapeMargin;
5111
5208
  }, o = (e, t, s) => {
5112
- let c = Bo();
5209
+ let c = Go();
5113
5210
  c.widthLimit = e.widthLimit / Math.min($.boundaryInRow, t.length);
5114
5211
  for (let [l, u] of t.entries()) {
5115
5212
  let t = u.boundary, d = 0, f = d + 8;
@@ -5119,10 +5216,10 @@ function Ko(e) {
5119
5216
  let m;
5120
5217
  if (t?.description && (m = d + 20, d = m + $.boundaryDescrHeight), t || (d = $.rootHeadingHeight), l === 0 || l % $.boundaryInRow === 0) {
5121
5218
  let t = e.startx + $.diagramMarginX, n = e.stopy + $.diagramMarginY + d;
5122
- Vo(c, t, t, n, n);
5219
+ Ko(c, t, t, n, n);
5123
5220
  } else {
5124
5221
  let e = c.stopx === c.startx ? c.startx : c.stopx + $.diagramMarginX;
5125
- Vo(c, e, e, c.starty, c.starty);
5222
+ Ko(c, e, e, c.starty, c.starty);
5126
5223
  }
5127
5224
  if (u.elements.length > 0 && a(c, u.elements), u.children.length > 0 && o(c, u.children, s + 1), t) {
5128
5225
  let e = c.stopx - c.startx, r = c.stopy - c.starty;
@@ -5143,15 +5240,15 @@ function Ko(e) {
5143
5240
  }
5144
5241
  e.stopy = Math.max(c.stopy + $.shapeMargin, e.stopy), e.stopx = Math.max(c.stopx + $.shapeMargin, e.stopx), r = Math.max(r, e.stopx), i = Math.max(i, e.stopy);
5145
5242
  }
5146
- }, s = Bo();
5147
- return Vo(s, $.diagramMarginX, $.diagramMarginX, $.diagramMarginY, $.diagramMarginY), s.widthLimit = $.screenWidth, o(s, [e], -1), {
5243
+ }, s = Go();
5244
+ return Ko(s, $.diagramMarginX, $.diagramMarginX, $.diagramMarginY, $.diagramMarginY), s.widthLimit = $.screenWidth, o(s, [e], -1), {
5148
5245
  elements: t,
5149
5246
  boundaries: n,
5150
5247
  maxX: r,
5151
5248
  maxY: i
5152
5249
  };
5153
5250
  }
5154
- function qo(e, t) {
5251
+ function Qo(e, t) {
5155
5252
  let n = e.x + e.width / 2, r = e.y + e.height / 2, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2;
5156
5253
  if (i === 0 && a === 0) return {
5157
5254
  x: n,
@@ -5170,8 +5267,8 @@ function qo(e, t) {
5170
5267
  y: r + l
5171
5268
  };
5172
5269
  }
5173
- function Jo(e, t) {
5174
- let n = ko(e.width, e.height), r = e.x + e.width / 2, i = e.y + e.height / 2, a = e.width, o = e.height, s = -o / 2 + n.headRadius, c = -o / 2 + n.pillTop, l = n.rx, u = (e, t, n, r, i, a) => Array.from({ length: r }, (o, s) => {
5270
+ function $o(e, t) {
5271
+ let n = Po(e.width, e.height), r = e.x + e.width / 2, i = e.y + e.height / 2, a = e.width, o = e.height, s = -o / 2 + n.headRadius, c = -o / 2 + n.pillTop, l = n.rx, u = (e, t, n, r, i, a) => Array.from({ length: r }, (o, s) => {
5175
5272
  let c = (i + s * (a - i) / (r - 1)) * Math.PI / 180;
5176
5273
  return {
5177
5274
  x: e - n * Math.cos(c),
@@ -5184,7 +5281,7 @@ function Jo(e, t) {
5184
5281
  ...u(a / 2 - l, o / 2 - l, l, 12, 270, 180),
5185
5282
  ...u(a / 2 - l, c + l, l, 12, 180, 90)
5186
5283
  ];
5187
- return Xo({
5284
+ return ts({
5188
5285
  x: r,
5189
5286
  y: i
5190
5287
  }, t, f.map((e) => ({
@@ -5192,7 +5289,7 @@ function Jo(e, t) {
5192
5289
  y: i + e.y
5193
5290
  })));
5194
5291
  }
5195
- function Yo(e, t, n, r) {
5292
+ function es(e, t, n, r) {
5196
5293
  let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o;
5197
5294
  if (s !== 0 && c !== 0 && s * c > 0) return;
5198
5295
  let l = r.y - n.y, u = n.x - r.x, d = r.x * n.y - n.x * r.y, f = l * e.x + u * e.y + d, p = l * t.x + u * t.y + d;
@@ -5205,18 +5302,18 @@ function Yo(e, t, n, r) {
5205
5302
  y: g < 0 ? (g - h) / m : (g + h) / m
5206
5303
  };
5207
5304
  }
5208
- function Xo(e, t, n) {
5305
+ function ts(e, t, n) {
5209
5306
  let r, i = Infinity;
5210
5307
  return n.forEach((a, o) => {
5211
- let s = Yo(e, t, a, n[(o + 1) % n.length]);
5308
+ let s = es(e, t, a, n[(o + 1) % n.length]);
5212
5309
  if (!s) return;
5213
5310
  let c = Math.hypot(s.x - t.x, s.y - t.y);
5214
5311
  c < i && (r = s, i = c);
5215
5312
  }), r ?? e;
5216
5313
  }
5217
- var Zo = 1e-6;
5218
- function Qo(e, t) {
5219
- let n = qo(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = Mo(e.width), s = n.x - r, c = Math.abs(s) < e.width / 2 - Zo || Math.abs(Math.abs(s) - e.width / 2) <= Zo && Math.abs(n.y - i) > e.height / 2 - o;
5314
+ var ns = 1e-6;
5315
+ function rs(e, t) {
5316
+ let n = Qo(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = Lo(e.width), s = n.x - r, c = Math.abs(s) < e.width / 2 - ns || Math.abs(Math.abs(s) - e.width / 2) <= ns && Math.abs(n.y - i) > e.height / 2 - o;
5220
5317
  if (a === 0 || !c) return n;
5221
5318
  let l = o * o * (1 - s * s / (a * a)), u = o - (l > 0 ? Math.sqrt(l) : l);
5222
5319
  return t.y - i > 0 && (u = -u), {
@@ -5224,8 +5321,8 @@ function Qo(e, t) {
5224
5321
  y: n.y + u
5225
5322
  };
5226
5323
  }
5227
- function $o(e, t) {
5228
- let n = qo(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = No(e.height), s = n.y - i, c = Math.abs(s) < e.height / 2 - Zo || Math.abs(Math.abs(s) - e.height / 2) <= Zo && Math.abs(n.x - r) > e.width / 2 - a;
5324
+ function is(e, t) {
5325
+ let n = Qo(e, t), r = e.x + e.width / 2, i = e.y + e.height / 2, { rx: a, ry: o } = Ro(e.height), s = n.y - i, c = Math.abs(s) < e.height / 2 - ns || Math.abs(Math.abs(s) - e.height / 2) <= ns && Math.abs(n.x - r) > e.width / 2 - a;
5229
5326
  if (o === 0 || !c) return n;
5230
5327
  let l = a * a * (1 - s * s / (o * o)), u = a - Math.sqrt(Math.abs(l));
5231
5328
  return t.x - r > 0 && (u = -u), {
@@ -5233,16 +5330,16 @@ function $o(e, t) {
5233
5330
  y: n.y
5234
5331
  };
5235
5332
  }
5236
- function es(e, t) {
5333
+ function as(e, t) {
5237
5334
  let n = e.el;
5238
- return n?.kind === "person" ? Jo(e, t) : n?.shape === "db" ? Qo(e, t) : n?.shape === "queue" ? $o(e, t) : qo(e, t);
5335
+ return n?.kind === "person" ? $o(e, t) : n?.shape === "db" ? rs(e, t) : n?.shape === "queue" ? is(e, t) : Qo(e, t);
5239
5336
  }
5240
- var ts = (e) => ({
5337
+ var os = (e) => ({
5241
5338
  x: e.x + e.width / 2,
5242
5339
  y: e.y + e.height / 2
5243
5340
  });
5244
- function ns(e, t, n, r) {
5245
- let i = n.get(e.from), a = n.get(e.to), o = es(i, ts(a)), s = es(a, ts(i)), c = s.x - o.x, l = s.y - o.y, u = (e) => ({
5341
+ function ss(e, t, n, r) {
5342
+ let i = n.get(e.from), a = n.get(e.to), o = as(i, os(a)), s = as(a, os(i)), c = s.x - o.x, l = s.y - o.y, u = (e) => ({
5246
5343
  x: e.x,
5247
5344
  y: e.y + r
5248
5345
  }), d = {
@@ -5256,35 +5353,35 @@ function ns(e, t, n, r) {
5256
5353
  let t = {
5257
5354
  x: Math.min(o.x, s.x) + Math.abs(c) / 2,
5258
5355
  y: Math.min(o.y, s.y) + Math.abs(l) / 2
5259
- }, n = P(e)[0], r = e.label !== "" || e.index !== void 0 ? Po(n ?? "", $.messageSize, 400) : 0;
5356
+ }, n = P(e)[0], r = e.label !== "" || e.index !== void 0 ? zo(n ?? "", $.messageSize, 400) : 0;
5260
5357
  if (d.labelPosition = u({
5261
5358
  x: t.x + r / 2,
5262
5359
  y: t.y
5263
5360
  }), e.technology) {
5264
- let n = Po(`[${e.technology}]`, $.messageSize, 400);
5361
+ let n = zo(`[${e.technology}]`, $.messageSize, 400);
5265
5362
  d.technologyX = t.x + Math.max(r, n) / 2;
5266
5363
  }
5267
5364
  }
5268
5365
  return d;
5269
5366
  }
5270
- var rs = 2, is = 6, as = 2, os = [
5367
+ var cs = 2, ls = 6, us = 2, ds = [
5271
5368
  0,
5272
5369
  14,
5273
5370
  -14,
5274
5371
  28,
5275
5372
  -28
5276
- ], ss = [
5373
+ ], fs = [
5277
5374
  .75,
5278
5375
  .55,
5279
5376
  .4
5280
- ], cs = 1e3, ls = 100, us = 10, ds = 2, fs = 5, ps = 4, ms = (e) => ({
5377
+ ], ps = 1e3, ms = 100, hs = 10, gs = 2, _s = 5, vs = 4, ys = (e) => ({
5281
5378
  x0: e.cx - e.w / 2,
5282
5379
  x1: e.cx + e.w / 2,
5283
5380
  y0: e.cy - e.h / 2,
5284
5381
  y1: e.cy + e.h / 2
5285
- }), hs = (e, t) => e.x0 < t.x1 + rs && e.x1 > t.x0 - rs && e.y0 < t.y1 + rs && e.y1 > t.y0 - rs;
5286
- function gs(e) {
5287
- let t = e.points[0], n = e.points[e.points.length - 1], r = e.curve, i = Math.hypot(n.x - t.x, n.y - t.y), a = Math.max(1, Math.ceil(i / ps));
5382
+ }), bs = (e, t) => e.x0 < t.x1 + cs && e.x1 > t.x0 - cs && e.y0 < t.y1 + cs && e.y1 > t.y0 - cs;
5383
+ function xs(e) {
5384
+ let t = e.points[0], n = e.points[e.points.length - 1], r = e.curve, i = Math.hypot(n.x - t.x, n.y - t.y), a = Math.max(1, Math.ceil(i / vs));
5288
5385
  return Array.from({ length: a + 1 }, (e, i) => {
5289
5386
  let o = i / a;
5290
5387
  if (!r) return {
@@ -5298,45 +5395,45 @@ function gs(e) {
5298
5395
  };
5299
5396
  });
5300
5397
  }
5301
- function _s(e) {
5398
+ function Ss(e) {
5302
5399
  return e.flatMap((e) => {
5303
5400
  let t = (e, t, n, r, i) => ({
5304
5401
  x0: e - i,
5305
5402
  x1: t + i,
5306
5403
  y0: n - i,
5307
5404
  y1: r + i,
5308
- weight: ls
5405
+ weight: ms
5309
5406
  }), n = (n, r, i, a) => {
5310
- let o = Po(n, i, a), s = e.x + e.width / 2;
5311
- return t(s - o / 2, s + o / 2, e.y + r - i / 2, e.y + r + i / 2, fs);
5407
+ let o = zo(n, i, a), s = e.x + e.width / 2;
5408
+ return t(s - o / 2, s + o / 2, e.y + r - i / 2, e.y + r + i / 2, _s);
5312
5409
  }, r = N({
5313
5410
  ...e,
5314
5411
  elementAliases: [],
5315
5412
  children: []
5316
5413
  });
5317
5414
  return [
5318
- t(e.x, e.x + e.width, e.y, e.y, ds),
5319
- t(e.x, e.x + e.width, e.y + e.height, e.y + e.height, ds),
5320
- t(e.x, e.x, e.y, e.y + e.height, ds),
5321
- t(e.x + e.width, e.x + e.width, e.y, e.y + e.height, ds),
5415
+ t(e.x, e.x + e.width, e.y, e.y, gs),
5416
+ t(e.x, e.x + e.width, e.y + e.height, e.y + e.height, gs),
5417
+ t(e.x, e.x, e.y, e.y + e.height, gs),
5418
+ t(e.x + e.width, e.x + e.width, e.y, e.y + e.height, gs),
5322
5419
  n(e.label, e.labelY, $.boundarySize + 2, 700),
5323
5420
  ...r ? [n(r, e.typeY, $.boundarySize, 400)] : [],
5324
5421
  ...e.description ? [n(e.description, e.descrY, $.boundarySize - 2, 400)] : []
5325
5422
  ];
5326
5423
  });
5327
5424
  }
5328
- function vs(e, t) {
5329
- return zo({
5425
+ function Cs(e, t) {
5426
+ return Wo({
5330
5427
  ...e,
5331
5428
  labelLines: t.lines,
5332
5429
  labelPosition: t.position,
5333
5430
  ...t.technologyX === void 0 ? {} : { technologyX: t.technologyX }
5334
- }).map(ms);
5431
+ }).map(ys);
5335
5432
  }
5336
- function ys(e, t, n, r) {
5433
+ function ws(e, t, n, r) {
5337
5434
  let i = e.points[0], a = e.points[e.points.length - 1], o = e.labelPosition;
5338
5435
  if (!o || !i || !a) return;
5339
- let s = a.x - i.x, c = a.y - i.y, l = Math.hypot(s, c), u = P(e), d = e.label !== "" || e.index !== void 0, f = d ? Po(u[0], $.messageSize, 400) : 0, p = o.x - f / 2, m = [{
5436
+ let s = a.x - i.x, c = a.y - i.y, l = Math.hypot(s, c), u = P(e), d = e.label !== "" || e.index !== void 0, f = d ? zo(u[0], $.messageSize, 400) : 0, p = o.x - f / 2, m = [{
5340
5437
  variant: {
5341
5438
  lines: u,
5342
5439
  position: o,
@@ -5346,11 +5443,11 @@ function ys(e, t, n, r) {
5346
5443
  }];
5347
5444
  if (d) {
5348
5445
  let t = e.technology ? [`[${e.technology}]`] : [], n = /* @__PURE__ */ new Set([u.join("\n")]);
5349
- ss.forEach((e, r) => {
5350
- let i = Oo(u[0], f * e, $.messageSize), a = [...i, ...t].join("\n");
5446
+ fs.forEach((e, r) => {
5447
+ let i = No(u[0], f * e, $.messageSize), a = [...i, ...t].join("\n");
5351
5448
  if (n.has(a)) return;
5352
5449
  n.add(a);
5353
- let s = Math.max(...i.map((e) => Po(e, $.messageSize, 400)));
5450
+ let s = Math.max(...i.map((e) => zo(e, $.messageSize, 400)));
5354
5451
  m.push({
5355
5452
  variant: {
5356
5453
  lines: [...i, ...t],
@@ -5363,12 +5460,12 @@ function ys(e, t, n, r) {
5363
5460
  });
5364
5461
  });
5365
5462
  }
5366
- let h = l === 0 ? 0 : s / l, g = l === 0 ? 0 : c / l, _ = l / 2 + Math.max(...os) + rs, v = m.flatMap((t) => vs(e, t.variant)), y = {
5463
+ let h = l === 0 ? 0 : s / l, g = l === 0 ? 0 : c / l, _ = l / 2 + Math.max(...ds) + cs, v = m.flatMap((t) => Cs(e, t.variant)), y = {
5367
5464
  x0: Math.min(...v.map((e) => e.x0)) - _,
5368
5465
  x1: Math.max(...v.map((e) => e.x1)) + _,
5369
5466
  y0: Math.min(...v.map((e) => e.y0)) - _,
5370
5467
  y1: Math.max(...v.map((e) => e.y1)) + _
5371
- }, b = (e) => e.x0 < y.x1 && e.x1 > y.x0 && e.y0 < y.y1 && e.y1 > y.y0, x = [...t, ...r].filter(b), S = Math.max(as, l / 200), C = n.filter((e) => b({
5468
+ }, b = (e) => e.x0 < y.x1 && e.x1 > y.x0 && e.y0 < y.y1 && e.y1 > y.y0, x = [...t, ...r].filter(b), S = Math.max(us, l / 200), C = n.filter((e) => b({
5372
5469
  x0: Math.min(...e.map((e) => e.x)),
5373
5470
  x1: Math.max(...e.map((e) => e.x)),
5374
5471
  y0: Math.min(...e.map((e) => e.y)),
@@ -5380,8 +5477,8 @@ function ys(e, t, n, r) {
5380
5477
  y1: Math.max(...e.map((e) => e.y))
5381
5478
  })), T, E = (e) => T?.penalty === 0 && e >= T.cost;
5382
5479
  for (let { variant: t, cost: n } of m) {
5383
- let r = vs(e, t);
5384
- for (let e of os) if (!E(n + 2 * Math.abs(e))) for (let i = 0; i <= l / 2 && !E(n + 2 * Math.abs(e) + i); i += S) for (let a of i === 0 ? [1] : [1, -1]) {
5480
+ let r = Cs(e, t);
5481
+ for (let e of ds) if (!E(n + 2 * Math.abs(e))) for (let i = 0; i <= l / 2 && !E(n + 2 * Math.abs(e) + i); i += S) for (let a of i === 0 ? [1] : [1, -1]) {
5385
5482
  let o = a * i, s = {
5386
5483
  x: o * h - e * g,
5387
5484
  y: o * g + e * h
@@ -5393,11 +5490,11 @@ function ys(e, t, n, r) {
5393
5490
  })), l = 0, u = T?.penalty ?? Infinity;
5394
5491
  for (let e of c) {
5395
5492
  if (l > u) break;
5396
- for (let t of x) if (hs(e, t) && (l += t.weight), l > u) break;
5493
+ for (let t of x) if (bs(e, t) && (l += t.weight), l > u) break;
5397
5494
  if (l > u) break;
5398
5495
  for (let [t, n] of C.entries()) {
5399
5496
  let r = w[t];
5400
- r.x1 <= e.x0 || r.x0 >= e.x1 || r.y1 <= e.y0 || r.y0 >= e.y1 || n.some((t) => t.x > e.x0 && t.x < e.x1 && t.y > e.y0 && t.y < e.y1) && (l += us);
5497
+ r.x1 <= e.x0 || r.x0 >= e.x1 || r.y1 <= e.y0 || r.y0 >= e.y1 || n.some((t) => t.x > e.x0 && t.x < e.x1 && t.y > e.y0 && t.y < e.y1) && (l += hs);
5401
5498
  }
5402
5499
  }
5403
5500
  let d = n + i + 2 * Math.abs(e);
@@ -5413,12 +5510,12 @@ function ys(e, t, n, r) {
5413
5510
  e.labelPosition = {
5414
5511
  x: D.position.x + O.x,
5415
5512
  y: D.position.y + O.y
5416
- }, D.lines !== u && (e.labelLines = D.lines), D.technologyX === void 0 ? delete e.technologyX : e.technologyX = D.technologyX + O.x, r.push(...zo(e).map((e) => ({
5417
- ...ms(e),
5418
- weight: ls
5513
+ }, D.lines !== u && (e.labelLines = D.lines), D.technologyX === void 0 ? delete e.technologyX : e.technologyX = D.technologyX + O.x, r.push(...Wo(e).map((e) => ({
5514
+ ...ys(e),
5515
+ weight: ms
5419
5516
  })));
5420
5517
  }
5421
- function bs(e, t = {}) {
5518
+ function Ts(e, t = {}) {
5422
5519
  if (e.elements.length === 0 && e.boundaries.length === 0) {
5423
5520
  let t = {
5424
5521
  variant: e.variant,
@@ -5430,7 +5527,7 @@ function bs(e, t = {}) {
5430
5527
  };
5431
5528
  return e.title && (t.title = e.title), t;
5432
5529
  }
5433
- let n = Ko(Go(e)), r = e.title ? $.titleExtra : 0, i = $.diagramMarginY + r, a = e.elements.flatMap((e) => {
5530
+ let n = Zo(Xo(e)), r = e.title ? $.titleExtra : 0, i = $.diagramMarginY + r, a = e.elements.flatMap((e) => {
5434
5531
  let t = n.elements.get(e.alias);
5435
5532
  return t ? [{
5436
5533
  ...e,
@@ -5447,14 +5544,14 @@ function bs(e, t = {}) {
5447
5544
  })), s = /* @__PURE__ */ new Map();
5448
5545
  for (let e of n.elements.values()) s.set(e.el.alias, e);
5449
5546
  for (let e of n.boundaries) s.set(e.alias, e);
5450
- let c = e.relationships.map((e, t) => ns(e, t, s, i)), l = [...a.map((e) => ({
5451
- x0: e.x - is,
5452
- x1: e.x + e.width + is,
5453
- y0: e.y - is,
5454
- y1: e.y + e.height + is,
5455
- weight: cs
5456
- })), ..._s(o)], u = c.map(gs), d = [];
5457
- c.forEach((e, t) => ys(e, l, u.filter((e, n) => n !== t), d));
5547
+ let c = e.relationships.map((e, t) => ss(e, t, s, i)), l = [...a.map((e) => ({
5548
+ x0: e.x - ls,
5549
+ x1: e.x + e.width + ls,
5550
+ y0: e.y - ls,
5551
+ y1: e.y + e.height + ls,
5552
+ weight: ps
5553
+ })), ...Ss(o)], u = c.map(xs), d = [];
5554
+ c.forEach((e, t) => ws(e, l, u.filter((e, n) => n !== t), d));
5458
5555
  let f = n.maxX + $.diagramMarginX, p = n.maxY + $.diagramMarginY + r, m = {
5459
5556
  variant: e.variant,
5460
5557
  width: f,
@@ -5470,23 +5567,23 @@ function bs(e, t = {}) {
5470
5567
  }
5471
5568
  //#endregion
5472
5569
  //#region packages/svg-renderer/src/c4/renderer.ts
5473
- function xs(e, n, r = "Inter", i = !1, a = Ie, o, c, u, d = {}) {
5570
+ function Es(e, n, r = "Inter", i = !1, a = Ie, o, c, u, d = {}) {
5474
5571
  let f = [];
5475
- f.push(pi(O(e.width, e.height, n, i, c ?? e.title, u, void 0, d.styleAttribute, d.description), o)), f.push(t(r, !1, d.nonce)), e.title && e.titlePosition && f.push(l`<text class="c4-title" x="${e.titlePosition.x}" y="${e.titlePosition.y}" dy="${z}" ` + l`font-size="16" fill="var(--_text)">${s(e.title)}</text>`);
5476
- for (let t of e.boundaries) f.push(Cs(t));
5477
- for (let t of e.elements) f.push(ws(t));
5478
- for (let t of e.relationships) f.push(Ms(t));
5479
- for (let t of e.relationships) f.push(Ns(t));
5572
+ f.push(mi(O(e.width, e.height, n, i, c ?? e.title, u, void 0, d.styleAttribute, d.description), o)), f.push(t(r, !1, d.nonce)), e.title && e.titlePosition && f.push(l`<text class="c4-title" x="${e.titlePosition.x}" y="${e.titlePosition.y}" dy="${z}" ` + l`font-size="16" fill="var(--_text)">${s(e.title)}</text>`);
5573
+ for (let t of e.boundaries) f.push(Os(t));
5574
+ for (let t of e.elements) f.push(ks(t));
5575
+ for (let t of e.relationships) f.push(Ls(t));
5576
+ for (let t of e.relationships) f.push(Rs(t));
5480
5577
  return f.push("</svg>"), f.filter(Boolean).join("\n");
5481
5578
  }
5482
- function Ss(e, t, n, r, i) {
5579
+ function Ds(e, t, n, r, i) {
5483
5580
  return l` <text x="${t}" y="${n}" text-anchor="middle" dy="${z}" font-size="${r}" ` + l`${i}>${s(e)}</text>`;
5484
5581
  }
5485
- function Cs(e) {
5582
+ function Os(e) {
5486
5583
  let t = [];
5487
5584
  t.push(l`<g class="c4-boundary" data-id="${o(e.alias)}" data-label="${o(e.label)}" data-depth="${e.depth}">`), t.push(l` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="2.5" ry="2.5" ` + "fill=\"none\" stroke=\"var(--_text)\" stroke-width=\"1\" stroke-dasharray=\"7,7\" />");
5488
5585
  let n = e.x + e.width / 2;
5489
- t.push(Ss(e.label, n, e.y + (e.labelY ?? 8), $.boundarySize + 2, "font-weight=\"700\" fill=\"var(--_text)\""));
5586
+ t.push(Ds(e.label, n, e.y + (e.labelY ?? 8), $.boundarySize + 2, "font-weight=\"700\" fill=\"var(--_text)\""));
5490
5587
  let r = N({
5491
5588
  alias: e.alias,
5492
5589
  label: e.label,
@@ -5494,51 +5591,51 @@ function Cs(e) {
5494
5591
  elementAliases: [],
5495
5592
  children: []
5496
5593
  });
5497
- return r && e.typeY !== void 0 && t.push(Ss(r, n, e.y + e.typeY, $.boundarySize, "fill=\"var(--_text)\"")), e.description && e.descrY !== void 0 && t.push(Ss(e.description, n, e.y + e.descrY, $.boundarySize - 2, "fill=\"var(--_text)\"")), t.push("</g>"), t.join("\n");
5594
+ return r && e.typeY !== void 0 && t.push(Ds(r, n, e.y + e.typeY, $.boundarySize, "fill=\"var(--_text)\"")), e.description && e.descrY !== void 0 && t.push(Ds(e.description, n, e.y + e.descrY, $.boundarySize - 2, "fill=\"var(--_text)\"")), t.push("</g>"), t.join("\n");
5498
5595
  }
5499
- function ws(e) {
5500
- let t = Io(e), { x: n, y: r, width: i, height: a } = e, s = n + i / 2, c = Ao(e.nameLines.length, e.descriptionLines.length), u = [];
5596
+ function ks(e) {
5597
+ let t = Vo(e), { x: n, y: r, width: i, height: a } = e, s = n + i / 2, c = Fo(e.nameLines.length, e.descriptionLines.length), u = [];
5501
5598
  u.push(l`<g class="c4-element" data-id="${o(e.alias)}" data-kind="${e.kind}" data-shape="${e.shape}" ` + l`data-external="${e.external}" data-label="${o(e.label)}">`);
5502
5599
  let d, f = s;
5503
- if (e.kind === "person") u.push(...Es(e, t)), d = r + ko(i).pillTop + $.shapePadding;
5600
+ if (e.kind === "person") u.push(...js(e, t)), d = r + Po(i).pillTop + $.shapePadding;
5504
5601
  else if (e.shape === "db") {
5505
- u.push(...Ds(e, t));
5506
- let { ry: n } = Mo(i);
5602
+ u.push(...Ms(e, t));
5603
+ let { ry: n } = Lo(i);
5507
5604
  d = r + (2 * n + a) / 2 - c / 2;
5508
5605
  } else if (e.shape === "queue") {
5509
- u.push(...Os(e, t));
5510
- let { rx: n } = No(a);
5606
+ u.push(...Ns(e, t));
5607
+ let { rx: n } = Ro(a);
5511
5608
  f = s - n, d = r + a / 2 - c / 2;
5512
5609
  } else u.push(l` <rect x="${n}" y="${r}" width="${i}" height="${a}" rx="${$.cornerRadius}" ry="${$.cornerRadius}" ` + l`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}" />`), d = r + $.shapePadding;
5513
5610
  let p = d;
5514
- for (let n of e.nameLines) u.push(Ss(n, f, p + $.nameLine / 2, $.nameSize, l`font-weight="700" fill="${t.text}"`)), p += $.nameLine;
5515
- return u.push(Ss(te(e), f, p + $.typeLine / 2, $.typeSize, l`fill="${t.text}"`)), p += $.typeLine, e.descriptionLines.forEach((e, n) => {
5516
- u.push(Ss(e, f, p + $.descrLine / 2 + n * $.descrExtraLine, $.descrSize, l`fill="${t.text}"`));
5517
- }), p += jo(e.descriptionLines.length), u.push("</g>"), u.join("\n");
5611
+ for (let n of e.nameLines) u.push(Ds(n, f, p + $.nameLine / 2, $.nameSize, l`font-weight="700" fill="${t.text}"`)), p += $.nameLine;
5612
+ return u.push(Ds(te(e), f, p + $.typeLine / 2, $.typeSize, l`fill="${t.text}"`)), p += $.typeLine, e.descriptionLines.forEach((e, n) => {
5613
+ u.push(Ds(e, f, p + $.descrLine / 2 + n * $.descrExtraLine, $.descrSize, l`fill="${t.text}"`));
5614
+ }), p += Io(e.descriptionLines.length), u.push("</g>"), u.join("\n");
5518
5615
  }
5519
- function Ts(e) {
5520
- let { x: t, y: n, width: r, height: i } = e, { rx: a, headRadius: o, pillTop: s } = ko(r, i), c = t + r / 2, u = n + s, d = n + i, f = Math.sqrt(Math.max(0, o * o - (u - (n + o)) ** 2));
5616
+ function As(e) {
5617
+ let { x: t, y: n, width: r, height: i } = e, { rx: a, headRadius: o, pillTop: s } = Po(r, i), c = t + r / 2, u = n + s, d = n + i, f = Math.sqrt(Math.max(0, o * o - (u - (n + o)) ** 2));
5521
5618
  return l`M ${t + a} ${u} H ${c - f} A ${o} ${o} 0 1 1 ${c + f} ${u} ` + l`H ${t + r - a} A ${a} ${a} 0 0 1 ${t + r} ${u + a} V ${d - a} ` + l`A ${a} ${a} 0 0 1 ${t + r - a} ${d} H ${t + a} ` + l`A ${a} ${a} 0 0 1 ${t} ${d - a} V ${u + a} ` + l`A ${a} ${a} 0 0 1 ${t + a} ${u} Z`;
5522
5619
  }
5523
- function Es(e, t) {
5524
- return [l` <path class="c4-person-shape" d="${Ts(e)}" fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}" />`];
5620
+ function js(e, t) {
5621
+ return [l` <path class="c4-person-shape" d="${As(e)}" fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}" />`];
5525
5622
  }
5526
- function Ds(e, t) {
5527
- let { x: n, y: r, width: i, height: a } = e, { rx: o, ry: s } = Mo(i), c = l`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
5623
+ function Ms(e, t) {
5624
+ let { x: n, y: r, width: i, height: a } = e, { rx: o, ry: s } = Lo(i), c = l`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
5528
5625
  return [l` <path d="M ${n} ${r + s} L ${n} ${r + a - s} A ${o} ${s} 0 0 0 ${n + i} ${r + a - s} L ${n + i} ${r + s} Z" ${c} />`, l` <ellipse cx="${n + o}" cy="${r + s}" rx="${o}" ry="${s}" ${c} />`];
5529
5626
  }
5530
- function Os(e, t) {
5531
- let { x: n, y: r, width: i, height: a } = e, { rx: o, ry: s } = No(a), c = l`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
5627
+ function Ns(e, t) {
5628
+ let { x: n, y: r, width: i, height: a } = e, { rx: o, ry: s } = Ro(a), c = l`fill="${t.fill}" stroke="${t.stroke}" stroke-width="${$.strokeWidth}"`;
5532
5629
  return [l` <path d="M ${n + i - o} ${r} H ${n + o} A ${o} ${s} 0 0 0 ${n + o} ${r + a} H ${n + i - o} Z" ${c} />`, l` <ellipse cx="${n + i - o}" cy="${r + s}" rx="${o}" ry="${s}" ${c} />`];
5533
5630
  }
5534
- function ks(e, t) {
5631
+ function Ps(e, t) {
5535
5632
  let n = e.x - t.x, r = e.y - t.y, i = Math.hypot(n, r);
5536
5633
  if (i === 0) return "";
5537
5634
  let a = n / i, o = r / i, s = e.x - a * 10, c = e.y - o * 10;
5538
5635
  return l`<polygon class="c4-arrowhead" points="${e.x},${e.y} ${s - o * 5},${c + a * 5} ${s + o * 5},${c - a * 5}" ` + "fill=\"var(--_text)\" />";
5539
5636
  }
5540
- var As = 3, js = 1;
5541
- function Ms(e) {
5637
+ var Fs = 3, Is = 1;
5638
+ function Ls(e) {
5542
5639
  let [t, n] = [e.points[0], e.points[e.points.length - 1]];
5543
5640
  if (!t || !n || t === n) return "";
5544
5641
  let r = [
@@ -5547,109 +5644,109 @@ function Ms(e) {
5547
5644
  l`data-to="${o(e.to)}"`
5548
5645
  ];
5549
5646
  e.label && r.push(l`data-label="${o(e.label)}"`), e.technology && r.push(l`data-technology="${o(e.technology)}"`);
5550
- let i = e.curve ? l`M ${t.x},${t.y} Q ${e.curve.x},${e.curve.y} ${n.x},${n.y}` : l`M ${t.x},${t.y} L ${n.x},${n.y}`, a = l`<path ${r.join(" ")} d="${i}" fill="none" stroke="var(--_text)" stroke-width="1" />`, s = e.curve ?? t, c = e.curve ?? n, u = ks(n, s), d = ks(t, c);
5647
+ let i = e.curve ? l`M ${t.x},${t.y} Q ${e.curve.x},${e.curve.y} ${n.x},${n.y}` : l`M ${t.x},${t.y} L ${n.x},${n.y}`, a = l`<path ${r.join(" ")} d="${i}" fill="none" stroke="var(--_text)" stroke-width="1" />`, s = e.curve ?? t, c = e.curve ?? n, u = Ps(n, s), d = Ps(t, c);
5551
5648
  return [a, ...e.bidirectional ? [u, d] : [e.reversed ? d : u]].filter(Boolean).join("\n");
5552
5649
  }
5553
- function Ns(e) {
5554
- let t = Ro(e), n = zo(e);
5650
+ function Rs(e) {
5651
+ let t = Uo(e), n = Wo(e);
5555
5652
  if (n.length === 0) return "";
5556
- let r = [l`<g class="c4-relationship-label" data-from="${o(e.from)}" data-to="${o(e.to)}">`], i = Math.min(...n.map((e) => e.cx - e.w / 2)) - As, a = Math.max(...n.map((e) => e.cx + e.w / 2)) + As, s = n[0].cy - n[0].h / 2 - js, c = n[n.length - 1], u = c.cy + c.h / 2 + js;
5653
+ let r = [l`<g class="c4-relationship-label" data-from="${o(e.from)}" data-to="${o(e.to)}">`], i = Math.min(...n.map((e) => e.cx - e.w / 2)) - Fs, a = Math.max(...n.map((e) => e.cx + e.w / 2)) + Fs, s = n[0].cy - n[0].h / 2 - Is, c = n[n.length - 1], u = c.cy + c.h / 2 + Is;
5557
5654
  return r.push(l` <rect class="c4-label-plate" x="${i}" y="${s}" width="${a - i}" height="${u - s}" rx="2" ry="2" fill="var(--bg)" />`), t.forEach((i, a) => {
5558
5655
  let o = e.technology !== void 0 && a === t.length - 1, s = n[a];
5559
- r.push(Ss(i, s.cx, s.cy, $.messageSize, o ? "font-style=\"italic\" fill=\"var(--_text)\"" : "fill=\"var(--_text)\""));
5656
+ r.push(Ds(i, s.cx, s.cy, $.messageSize, o ? "font-style=\"italic\" fill=\"var(--_text)\"" : "fill=\"var(--_text)\""));
5560
5657
  }), r.push("</g>"), r.join("\n");
5561
5658
  }
5562
5659
  //#endregion
5563
5660
  //#region packages/svg-renderer/src/registry.ts
5564
- var Ps = {
5661
+ var zs = {
5565
5662
  type: "xychart",
5566
5663
  parse: ue,
5567
- layoutForSvg: Ka,
5664
+ layoutForSvg: Za,
5568
5665
  renderSvg(e, t, n) {
5569
5666
  let r = n.interactivity === void 0 ? n.interactive ?? !1 : n.interactivity === "full";
5570
- return ao(e, t.colors, t.font, t.transparent, r, t.embedSource, t.title, t.decorative, t.emit);
5667
+ return uo(e, t.colors, t.font, t.transparent, r, t.embedSource, t.title, t.decorative, t.emit);
5571
5668
  }
5572
- }, Fs = {
5669
+ }, Bs = {
5573
5670
  type: "sequence",
5574
5671
  parse: le,
5575
- layoutForSvg: Ca,
5672
+ layoutForSvg: Da,
5576
5673
  renderSvg(e, t) {
5577
- return wa(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
5674
+ return Oa(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
5578
5675
  }
5579
5676
  };
5580
- function Is(e) {
5677
+ function Vs(e) {
5581
5678
  return (e.interactivity ?? "static") !== "none";
5582
5679
  }
5583
- function Ls(e) {
5680
+ function Hs(e) {
5584
5681
  return (e.interactivity ?? "static") === "full";
5585
5682
  }
5586
- var Rs = {
5683
+ var Us = {
5587
5684
  type: "class",
5588
5685
  parse: ae,
5589
- layoutForSvg: Ii,
5686
+ layoutForSvg: Li,
5590
5687
  renderSvg(e, t, n) {
5591
- return Bi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, Is(n), t.emit);
5688
+ return Vi(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, Vs(n), t.emit);
5592
5689
  }
5593
- }, zs = {
5690
+ }, Ws = {
5594
5691
  type: "er",
5595
5692
  parse: oe,
5596
5693
  layoutForSvg(e, t) {
5597
- return aa(A(e, t.direction), t);
5694
+ return sa(A(e, t.direction), t);
5598
5695
  },
5599
5696
  renderSvg(e, t) {
5600
- return ca(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
5697
+ return ua(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
5601
5698
  }
5602
- }, Bs = {
5699
+ }, Gs = {
5603
5700
  type: "flowchart",
5604
5701
  parse: (e, t) => se(t),
5605
5702
  layoutForSvg(e, t) {
5606
5703
  return {
5607
- graph: ar(A(e, t.direction), t),
5704
+ graph: or(A(e, t.direction), t),
5608
5705
  curve: t.curve ?? e.initConfig?.curve ?? "linear"
5609
5706
  };
5610
5707
  },
5611
5708
  renderSvg(e, t, n) {
5612
- return gr(e.graph, t.colors, t.font, t.transparent, t.fontSizes, e.curve, t.embedSource, Ls(n), Is(n), t.title, t.decorative, t.emit);
5709
+ return _r(e.graph, t.colors, t.font, t.transparent, t.fontSizes, e.curve, t.embedSource, Hs(n), Vs(n), t.title, t.decorative, t.emit);
5613
5710
  }
5614
- }, Vs = {
5711
+ }, Ks = {
5615
5712
  type: "c4",
5616
5713
  parse: ie,
5617
5714
  layoutForSvg(e, t) {
5618
- return bs(e, t);
5715
+ return Ts(e, t);
5619
5716
  },
5620
5717
  renderSvg(e, t) {
5621
- return xs(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
5622
- }
5623
- }, Hs = {
5624
- xychart: Ps,
5625
- er: zs,
5626
- sequence: Fs,
5627
- class: Rs,
5628
- flowchart: Bs,
5718
+ return Es(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
5719
+ }
5720
+ }, qs = {
5721
+ xychart: zs,
5722
+ er: Ws,
5723
+ sequence: Bs,
5724
+ class: Us,
5725
+ flowchart: Gs,
5629
5726
  architecture: {
5630
5727
  type: "architecture",
5631
5728
  parse: re,
5632
5729
  layoutForSvg(e, t) {
5633
5730
  return {
5634
- graph: rr(A(M(e), t.direction), t),
5731
+ graph: ir(A(M(e), t.direction), t),
5635
5732
  curve: t.curve ?? "linear"
5636
5733
  };
5637
5734
  },
5638
- renderSvg: Bs.renderSvg
5735
+ renderSvg: Gs.renderSvg
5639
5736
  },
5640
- c4: Vs,
5737
+ c4: Ks,
5641
5738
  pie: {
5642
5739
  type: "pie",
5643
5740
  parse: (e, t) => ce(t),
5644
- layoutForSvg: vo,
5741
+ layoutForSvg: Co,
5645
5742
  renderSvg(e, t) {
5646
- return So(e, t.colors, t.font, t.transparent, t.embedSource, t.title, t.decorative, t.emit);
5743
+ return Do(e, t.colors, t.font, t.transparent, t.embedSource, t.title, t.decorative, t.emit);
5647
5744
  }
5648
5745
  }
5649
5746
  };
5650
5747
  //#endregion
5651
5748
  //#region packages/svg-renderer/src/index.ts
5652
- function Us(t) {
5749
+ function Js(t) {
5653
5750
  return {
5654
5751
  bg: t.bg ?? e.bg,
5655
5752
  fg: t.fg ?? e.fg,
@@ -5660,20 +5757,20 @@ function Us(t) {
5660
5757
  border: t.border
5661
5758
  };
5662
5759
  }
5663
- function Ws(e = {}) {
5664
- return k(Us(e), e.transparent);
5760
+ function Ys(e = {}) {
5761
+ return k(Js(e), e.transparent);
5665
5762
  }
5666
- function Gs(e) {
5763
+ function Xs(e) {
5667
5764
  return {
5668
5765
  nonce: e.nonce,
5669
5766
  styleAttribute: e.styleAttribute
5670
5767
  };
5671
5768
  }
5672
- function Ks(e, t = {}) {
5673
- let n = qs(Ys(e, t));
5674
- return t.resolveColors ? Oi(n, Us(t)) : n;
5769
+ function Zs(e, t = {}) {
5770
+ let n = Qs(ec(e, t));
5771
+ return t.resolveColors ? ki(n, Js(t)) : n;
5675
5772
  }
5676
- function qs(e) {
5773
+ function Qs(e) {
5677
5774
  let t = new Set(Array.from(e.matchAll(/\sid="([^"]+)"/g), (e) => e[1] ?? ""));
5678
5775
  if (t.size === 0) return e;
5679
5776
  let n = 2166136261;
@@ -5681,18 +5778,18 @@ function qs(e) {
5681
5778
  let r = `zm${(n >>> 0).toString(36)}-`, i = (e) => t.has(e) && !e.startsWith("zm-") ? r + e : e;
5682
5779
  return e.replace(/(\sid=")([^"]+)"/g, (e, t, n) => `${t}${i(n)}"`).replace(/url\(#([^)]+)\)/g, (e, t) => `url(#${i(t)})`).replace(/(href=")#([^"]+)"/g, (e, t, n) => `${t}#${i(n)}"`);
5683
5780
  }
5684
- function Js(e) {
5781
+ function $s(e) {
5685
5782
  let t = c(de(e)).text;
5686
- Hs[i(t)].parse(T(t), t);
5783
+ qs[i(t)].parse(T(t), t);
5687
5784
  }
5688
- function Ys(e, t) {
5785
+ function ec(e, t) {
5689
5786
  r("maxInputLength", e.length, t.limits);
5690
- let a = c(de(e)), o = a.text, s = Us(t), l = t.font ?? "Inter";
5787
+ let a = c(de(e)), o = a.text, s = Js(t), l = t.font ?? "Inter";
5691
5788
  w(f(l));
5692
5789
  let u = t.transparent ?? !1, d = Le(t.fontSizes), p = i(o), m = t.embedSource ? e : void 0, h = t.title ?? a.accTitle, g = t.decorative, _ = {
5693
- ...Gs(t),
5790
+ ...Xs(t),
5694
5791
  description: a.accDescr
5695
- }, v = T(o), y = Hs[p], b = y.parse(v, o), x = b;
5792
+ }, v = T(o), y = qs[p], b = y.parse(v, o), x = b;
5696
5793
  x.nodes instanceof Map && Array.isArray(x.edges) && n(x.nodes.size, x.edges.length, t.limits);
5697
5794
  let S = y.layoutForSvg(b, t), C = {
5698
5795
  colors: s,
@@ -5706,11 +5803,11 @@ function Ys(e, t) {
5706
5803
  };
5707
5804
  return y.renderSvg(S, C, t);
5708
5805
  }
5709
- async function Xs(e, t = {}) {
5710
- return Ks(e, t);
5806
+ async function tc(e, t = {}) {
5807
+ return Zs(e, t);
5711
5808
  }
5712
- var Zs = Ks, Qs = Xs;
5809
+ var nc = Zs, rc = tc;
5713
5810
  //#endregion
5714
- export { ya as ACTOR_LABEL_OFFSET, Be as ARROW_HEAD, W as CLS, We as ELK_DIRECTION_FALLBACK, Se as ElkNotRegisteredError, Ie as FONT_SIZES, L as FONT_WEIGHTS, Re as GROUP_HEADER_CONTENT_PAD, Ye as INLINE_CENTERED_EDGE_LABEL, Pe as MONO_FONT, Fe as MONO_FONT_STACK, ze as NODE_PADDING, Z as PIE, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, qe as baseElkLayoutOptions, va as boxLabelHeight, Ze as buildElkEdge, Xe as buildElkEdgeLabel, Je as buildElkLeafNode, Ve as buildSvgStyleBlock, Ni as classBackEdges, ki as classNoteId, vt as clipEdgeToShape, or as convertToElkFormat, De as createLayoutCache, Ge as directionToElk, Ae as elkLayoutSync, Ke as elkPadding, Ne as estimateMonoTextWidth, I as estimateTextWidth, Si as evaluateCssColorValue, Pt as extractEdgeLabelPosition, Nt as extractEdgePoints, no as formatTickLabels, Ii as layoutClassDiagramSync, aa as layoutErDiagramSync, ar as layoutFlowchartSync, rr as layoutGraphSync, vo as layoutPieChart, Ca as layoutSequenceDiagram, Ka as layoutXYChart, g as niceTickValues, bo as pieColorValue, _e as pointsToPath, Ce as registerElk, Bi as renderClassSvg, ca as renderErSvg, Qs as renderMermaid, Ks as renderMermaidSVG, Xs as renderMermaidSVGAsync, Zs as renderMermaidSync, So as renderPieSvg, wa as renderSequenceSvg, gr as renderSvg, ao as renderXYChartSvg, Oi as resolveCssColors, Le as resolveFontSizes, lo as smoothCurvePath, Ws as themeCssVariables, Js as validateMermaid, pi as withDataSrc, Qa as xLabelStep };
5811
+ export { xa as ACTOR_LABEL_OFFSET, B as ARROW_HEAD, G as CLS, We as ELK_DIRECTION_FALLBACK, Se as ElkNotRegisteredError, Ie as FONT_SIZES, L as FONT_WEIGHTS, Re as GROUP_HEADER_CONTENT_PAD, Ye as INLINE_CENTERED_EDGE_LABEL, Pe as MONO_FONT, Fe as MONO_FONT_STACK, ze as NODE_PADDING, Z as PIE, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, qe as baseElkLayoutOptions, ba as boxLabelHeight, Ze as buildElkEdge, Xe as buildElkEdgeLabel, Je as buildElkLeafNode, Be as buildSvgStyleBlock, Pi as classBackEdges, Ai as classNoteId, yt as clipEdgeToShape, sr as convertToElkFormat, De as createLayoutCache, Ge as directionToElk, Ae as elkLayoutSync, Ke as elkPadding, Ne as estimateMonoTextWidth, I as estimateTextWidth, Ci as evaluateCssColorValue, Ft as extractEdgeLabelPosition, Pt as extractEdgePoints, so as formatTickLabels, Ca as hasLabelBelowIcon, Li as layoutClassDiagramSync, sa as layoutErDiagramSync, or as layoutFlowchartSync, ir as layoutGraphSync, Co as layoutPieChart, Da as layoutSequenceDiagram, Za as layoutXYChart, g as niceTickValues, To as pieColorValue, _e as pointsToPath, Ce as registerElk, Vi as renderClassSvg, ua as renderErSvg, rc as renderMermaid, Zs as renderMermaidSVG, tc as renderMermaidSVGAsync, nc as renderMermaidSync, Do as renderPieSvg, Oa as renderSequenceSvg, _r as renderSvg, uo as renderXYChartSvg, ki as resolveCssColors, Le as resolveFontSizes, ho as smoothCurvePath, Ys as themeCssVariables, $s as validateMermaid, mi as withDataSrc, ro as xLabelStep };
5715
5812
 
5716
5813
  //# sourceMappingURL=index.js.map