@orangelogic/design-system 2.176.0 → 2.178.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/library/chunks/{abnfDiagram-VRR7QNED.DKqYa5p7.js → abnfDiagram-N423BO3Z.DmbxJEYP.js} +3 -3
  2. package/library/chunks/architectureDiagram-T3A2C74G.B3-MGxdy.js +4782 -0
  3. package/library/chunks/{asset-link-format.NhSLWk_Y.js → asset-link-format.Ckb6Eq0e.js} +5 -5
  4. package/library/chunks/{blockDiagram-677ZJIJ3.CeQxLPwj.js → blockDiagram-VBNYF7ZC.Dw_7h8Aq.js} +3 -3
  5. package/library/chunks/{button.zWaIO1sl.js → button.Bj14A10c.js} +1 -1
  6. package/library/chunks/{c4Diagram-LMCZKHZV.B73xdpNh.js → c4Diagram-5PPSVZJV.sgkQad3b.js} +2 -2
  7. package/library/chunks/{channel.s_XjcUYI.js → channel.BgACV0Fb.js} +1 -1
  8. package/library/chunks/{chunk-32BRIVSS.BbIrVi3j.js → chunk-2GRJ4B5K.r19kfrEk.js} +1 -1
  9. package/library/chunks/{chunk-2Q5K7J3B.Dy1Z-bMH.js → chunk-2Q5K7J3B.DR95kRDU.js} +1 -1
  10. package/library/chunks/{chunk-EX3LRPZG.L693y8d4.js → chunk-5RXB4S5H.4NblUr61.js} +4 -4
  11. package/library/chunks/{chunk-5VM5RSS4.D0-lddDM.js → chunk-5VM5RSS4.DjAk9wN1.js} +1 -1
  12. package/library/chunks/{chunk-MOJQB5TN.BZstBMYC.js → chunk-6Q2QTUOP.RrRW6s5_.js} +1 -1
  13. package/library/chunks/{chunk-V7JOEXUC.DcJlyQO0.js → chunk-GF5L2VYU.DBI3JTKM.js} +5 -5
  14. package/library/chunks/{chunk-JWPE2WC7.BV0i4LDu.js → chunk-JWPE2WC7.Bw21g4Xj.js} +1 -1
  15. package/library/chunks/{chunk-VR4S4FIN.BpryBs7q.js → chunk-KBJHAD2P.DfRrJw9t.js} +1 -1
  16. package/library/chunks/{chunk-RYQCIY6F.BMsuG7ya.js → chunk-RYQCIY6F.DkJNx6hl.js} +1 -1
  17. package/library/chunks/{chunk-XXDRQBXY.CSOjab1V.js → chunk-XXDRQBXY.CLvgdAsG.js} +1 -1
  18. package/library/chunks/{classDiagram-OUVF2IWQ.Dvz7CNwe.js → classDiagram-JCYQIIEL.DQ9axGI4.js} +2 -2
  19. package/library/chunks/{classDiagram-v2-EOCWNBFH.Dvz7CNwe.js → classDiagram-v2-OCEON4UE.DQ9axGI4.js} +2 -2
  20. package/library/chunks/{color-swatch-group.NJnbc24w.js → color-swatch-group.JIvuSR7O.js} +6 -6
  21. package/library/chunks/{confirm-popover.Cn1BaP0W.js → confirm-popover.BVWtAu5T.js} +1 -1
  22. package/library/chunks/{cose-bilkent-JH36ORCC.cfzS2XsK.js → cose-bilkent-JH36ORCC.DaEeg-T2.js} +1 -1
  23. package/library/chunks/{cynefinDiagram-TSTJHNR4.C8SgNXWI.js → cynefinDiagram-MW4NZA55.BPUjzF-9.js} +2 -2
  24. package/library/chunks/{dagre-VKFMJZFB.D5B1cAri.js → dagre-VZM6K2ZE.D8ZW6jWn.js} +2 -2
  25. package/library/chunks/{diagram-OA4YK3LP.Dm5WJs91.js → diagram-7IWD3JNH.DEn-8Nyk.js} +3 -3
  26. package/library/chunks/{diagram-FQU43EPY.DJukDcLl.js → diagram-B4RE2ZJO.D8OadPQp.js} +2 -2
  27. package/library/chunks/{diagram-NH7WQ7WH.DOpRwmC2.js → diagram-LBJQPF4R.uE98W6WL.js} +2 -2
  28. package/library/chunks/{diagram-G47NLZAW.BBOvcbcR.js → diagram-Q27KOJAE.yof_N5m5.js} +3 -3
  29. package/library/chunks/{diagram-WEI45ONY.COuzdmSR.js → diagram-UB23O5K3.Ch7qaZ8N.js} +66 -64
  30. package/library/chunks/{document-viewer.DxPw7xHV.js → document-viewer.5jZ0djNd.js} +3 -3
  31. package/library/chunks/{dom.C5aVLhKS.js → dom.gRV2cDjL.js} +1 -1
  32. package/library/chunks/{ebnfDiagram-CCIWWBDH.Dz-QBH6Y.js → ebnfDiagram-BXEA7PRR.BCGi4Or-.js} +3 -3
  33. package/library/chunks/{endpoints.CwgTrs4A.js → endpoints.mJ5S-tIs.js} +51 -52
  34. package/library/chunks/{erDiagram-Q63AITRT.sSw_w-2B.js → erDiagram-JOGREHBK.Dj_WQ9-P.js} +4 -4
  35. package/library/chunks/{flowDiagram-23GEKE2U.CMMbuUHf.js → flowDiagram-UKHOOZJN.C0pE4e9K.js} +25 -25
  36. package/library/chunks/{folder-select.Di9wfqIU.js → folder-select.CXrAwaij.js} +4 -4
  37. package/library/chunks/{form.CP9KLGjF.js → form.DSsy3Fcy.js} +1 -1
  38. package/library/chunks/{ganttDiagram-NO4QXBWP.DZdwd0O4.js → ganttDiagram-PKOTCBZU.Cz_H5LNn.js} +1 -1
  39. package/library/chunks/{gitGraphDiagram-IHSO6WYX.F6mwS3uS.js → gitGraphDiagram-DS77QQ5N.BwyVHdCu.js} +3 -3
  40. package/library/chunks/{infoDiagram-FWYZ7A6U.BnktKL7i.js → infoDiagram-6WML65LV.D986xkxa.js} +2 -2
  41. package/library/chunks/{input.B-c9KEAH.js → input.CftMH3MT.js} +1 -1
  42. package/library/chunks/{ishikawaDiagram-FXEZZL3T.CFp-9Kes.js → ishikawaDiagram-WSZJBQD7.DS_s73xV.js} +1 -1
  43. package/library/chunks/{journeyDiagram-5HDEW3XC.BxO1aPu_.js → journeyDiagram-NVQOT4AX.CpnBzO_7.js} +3 -3
  44. package/library/chunks/{kanban-definition-HUTT4EX6.Bk8vmLFK.js → kanban-definition-27J2QSJJ.BWQ1LbN9.js} +2 -2
  45. package/library/chunks/{markdown.CESgIEEE.js → markdown.ClRfC7SP.js} +665 -653
  46. package/library/chunks/{mermaid.core.Dspbw7Ig.js → mermaid.core.CPVTuCpJ.js} +1202 -1167
  47. package/library/chunks/{mindmap-definition-LN4V7U3C.DuCBBYwE.js → mindmap-definition-FAOFIHXS.tV221P-F.js} +3 -3
  48. package/library/chunks/{pagination.Do36kaZK.js → pagination.CW3yynt_.js} +2 -2
  49. package/library/chunks/{pegDiagram-2B236MQR.DQrkEdJr.js → pegDiagram-VL7TDLO6.SjdhjwPL.js} +3 -3
  50. package/library/chunks/{pieDiagram-ENE6RG2P.B6nPW8Pj.js → pieDiagram-7S7Q4E2Y.BCRXd1yD.js} +2 -2
  51. package/library/chunks/{quadrantDiagram-ABIIQ3AL.BFy9moxz.js → quadrantDiagram-CIZ2JOQS.BMNbRkIQ.js} +1 -1
  52. package/library/chunks/{railroadDiagram-RFXS5EU6.CSao8YZX.js → railroadDiagram-AXF67PYL.2IwXOeL6.js} +3 -3
  53. package/library/chunks/{requirementDiagram-TGXJPOKE.CjpliZnF.js → requirementDiagram-LRYGKXZP.BtyA_EuA.js} +3 -3
  54. package/library/chunks/{sankeyDiagram-HTMAVEWB.D8aAxVGe.js → sankeyDiagram-W5VNT64P.BUBAWIOI.js} +1 -1
  55. package/library/chunks/{sequenceDiagram-DBY2YBRQ.Cu9MV3h-.js → sequenceDiagram-SI44F4Z6.Cys6U73s.js} +3 -3
  56. package/library/chunks/{sizeCapture-X5ZJPWSS.BDByEFcW.js → sizeCapture-X5ZJPWSS.CEEU5-VT.js} +1 -1
  57. package/library/chunks/{stateDiagram-2N3HPSRC.DvrAW9Ck.js → stateDiagram-OKZ733FA.r1-hE_hN.js} +2 -2
  58. package/library/chunks/{stateDiagram-v2-6OUMAXLB.CFfuaFM1.js → stateDiagram-v2-UEYNNEHI.BMfu2Zly.js} +2 -2
  59. package/library/chunks/{string.BhJ0Zogu.js → string.CfI2ejyR.js} +60 -63
  60. package/library/chunks/{swimlanes-5IMT3BWC.AtMD47q7.js → swimlanes-SLNWSIFB.X2WxIaD_.js} +3 -3
  61. package/library/chunks/{swimlanesDiagram-G3AALYLV.26A1eX7s.js → swimlanesDiagram-ULZ7WXOC.BTivMnAR.js} +2 -2
  62. package/library/chunks/{tab-group.DYywhd3A.js → tab-group.DvPwuInt.js} +2 -2
  63. package/library/chunks/{timeline-definition-FHXFAJF6.CYSh6xl5.js → timeline-definition-Z64GVDOM.DFfCN4wg.js} +1 -1
  64. package/library/chunks/{vennDiagram-L72KCM5P.CSk1WWlu.js → vennDiagram-T6HMQDX7.C-CHsl0o.js} +1 -1
  65. package/library/chunks/{wardleyDiagram-EHGQE667.C7UzXYG7.js → wardleyDiagram-T6FBY63Y.BauqS3ST.js} +2 -2
  66. package/library/chunks/{xychartDiagram-FW5EYKEG.idiZWvYS.js → xychartDiagram-ELKLHX3M.BgPK-qcM.js} +76 -73
  67. package/library/components/asset-link-format.js +2 -2
  68. package/library/components/atoms.js +6 -6
  69. package/library/components/avatar.js +7 -7
  70. package/library/components/border-input-group.js +1 -1
  71. package/library/components/button.js +2 -2
  72. package/library/components/checkbox.js +1 -1
  73. package/library/components/color-picker.js +3 -3
  74. package/library/components/color-swatch-group.js +1 -1
  75. package/library/components/confirm-popover.js +2 -2
  76. package/library/components/corner-position-input-group.js +1 -1
  77. package/library/components/diff.js +1 -1
  78. package/library/components/document-viewer.js +1 -1
  79. package/library/components/dropdown.js +1 -1
  80. package/library/components/dynamic-select.js +1 -1
  81. package/library/components/element-clamp.js +1 -1
  82. package/library/components/file-on-demand.js +5 -5
  83. package/library/components/folder-select.js +4 -4
  84. package/library/components/input.js +2 -2
  85. package/library/components/line-clamp.js +1 -1
  86. package/library/components/markdown.js +2 -2
  87. package/library/components/molecules.js +2 -2
  88. package/library/components/organisms.js +2 -2
  89. package/library/components/padding-input-group.js +1 -1
  90. package/library/components/pagination.js +3 -3
  91. package/library/components/radio-group.js +1 -1
  92. package/library/components/range.js +1 -1
  93. package/library/components/select.js +1 -1
  94. package/library/components/shadow-input-group.js +1 -1
  95. package/library/components/share-option-list.js +1 -1
  96. package/library/components/size-input-group.js +1 -1
  97. package/library/components/switch.js +1 -1
  98. package/library/components/tab-group.js +3 -3
  99. package/library/components/textarea.js +1 -1
  100. package/library/components/timecode.js +1 -1
  101. package/library/components/types.js +48203 -49659
  102. package/library/package.json +1 -1
  103. package/library/packages/atoms/src/components/avatar/avatar.d.ts +2 -0
  104. package/library/packages/events/src/cx-video-annotation-layer-change.d.ts +8 -0
  105. package/library/packages/events/src/cx-video-closed.d.ts +6 -0
  106. package/library/packages/events/src/cx-video-comment-click.d.ts +8 -0
  107. package/library/packages/events/src/cx-video-comment-mouseleave.d.ts +8 -0
  108. package/library/packages/events/src/cx-video-comment-mouseover.d.ts +8 -0
  109. package/library/packages/events/src/cx-video-context-change.d.ts +27 -0
  110. package/library/packages/events/src/cx-video-enter-fullscreen.d.ts +6 -0
  111. package/library/packages/events/src/cx-video-event.d.ts +9 -0
  112. package/library/packages/events/src/cx-video-exit-fullscreen.d.ts +6 -0
  113. package/library/packages/events/src/cx-video-next-frame.d.ts +6 -0
  114. package/library/packages/events/src/cx-video-paused.d.ts +8 -0
  115. package/library/packages/events/src/cx-video-played.d.ts +8 -0
  116. package/library/packages/events/src/cx-video-prev-frame.d.ts +6 -0
  117. package/library/packages/events/src/cx-video-seeked.d.ts +8 -0
  118. package/library/packages/events/src/cx-video-segment-change.d.ts +9 -0
  119. package/library/packages/events/src/cx-video-time-update.d.ts +8 -0
  120. package/library/packages/events/src/events.d.ts +16 -0
  121. package/library/packages/organisms/src/annotator-comment/annotator-comment.d.ts +6 -0
  122. package/library/packages/organisms/src/content-builder/plugins/telemetry/metrics.d.ts +1 -0
  123. package/library/packages/organisms/src/index.d.ts +0 -2
  124. package/library/react-web-component.d.ts +243 -4
  125. package/library/utils.js +5 -5
  126. package/package.json +1 -1
  127. package/library/chunks/architectureDiagram-ZJ3FMSHR.CBIOk9Kp.js +0 -4757
  128. package/library/packages/organisms/src/video-chapters-manager/video-chapters-manager.d.ts +0 -71
  129. package/library/packages/organisms/src/video-chapters-manager/video-chapters-manager.styles.d.ts +0 -2
  130. package/library/packages/organisms/src/video-chapters-manager/video-chapters-manager.utils.d.ts +0 -25
  131. package/library/packages/organisms/src/video-editor/components/video-editor-timeline/video-editor-timeline.d.ts +0 -66
  132. package/library/packages/organisms/src/video-editor/components/video-editor-timeline/video-editor-timeline.styles.d.ts +0 -2
  133. package/library/packages/organisms/src/video-editor/components/video-editor-toolbar/video-editor-toolbar.d.ts +0 -84
  134. package/library/packages/organisms/src/video-editor/components/video-editor-toolbar/video-editor-toolbar.styles.d.ts +0 -2
  135. package/library/packages/organisms/src/video-editor/components/video-editor-track/video-editor-track.d.ts +0 -59
  136. package/library/packages/organisms/src/video-editor/components/video-editor-track/video-editor-track.styles.d.ts +0 -2
  137. package/library/packages/organisms/src/video-editor/components/video-editor-tracks/video-editor-tracks.d.ts +0 -79
  138. package/library/packages/organisms/src/video-editor/components/video-editor-tracks/video-editor-tracks.styles.d.ts +0 -2
  139. package/library/packages/organisms/src/video-editor/components/video-editor-transition/video-editor-transition.d.ts +0 -26
  140. package/library/packages/organisms/src/video-editor/components/video-editor-transition/video-editor-transition.styles.d.ts +0 -2
  141. package/library/packages/organisms/src/video-editor/video-editor.d.ts +0 -102
  142. package/library/packages/organisms/src/video-editor/video-editor.styles.d.ts +0 -2
  143. package/library/packages/services/src/api/chapter/chapter.d.ts +0 -7
@@ -1,4757 +0,0 @@
1
- import { p as Ze } from "./chunk-JWPE2WC7.BV0i4LDu.js";
2
- import { _ as gt, E as qe, V as Qe, l as Fe, b as Je, a as Ke, n as je, o as _e, g as tr, s as er, p as rr, A as ir, y as ar, B as nr, c as Ee, aM as Te, a1 as pe, h as or, q as sr, a2 as hr, aS as lr } from "./mermaid.core.Dspbw7Ig.js";
3
- import { p as fr } from "./cynefin-VYW2F7L2.c7H5z9nQ.js";
4
- import { c as be } from "./cytoscape.esm.Cbrwqewp.js";
5
- import { a as cr } from "./_commonjsHelpers.DQNKXVTB.js";
6
- import "./index.CrhRU5m8.js";
7
- import "./transform.BuqENXeT.js";
8
- import { s as gr } from "./select.C6_sM3Pr.js";
9
- var he = { exports: {} }, le = { exports: {} }, fe = { exports: {} }, ur = fe.exports, Oe;
10
- function dr() {
11
- return Oe || (Oe = 1, function(x, A) {
12
- (function(R, N) {
13
- x.exports = N();
14
- })(ur, function() {
15
- return (
16
- /******/
17
- function(C) {
18
- var R = {};
19
- function N(v) {
20
- if (R[v])
21
- return R[v].exports;
22
- var h = R[v] = {
23
- /******/
24
- i: v,
25
- /******/
26
- l: !1,
27
- /******/
28
- exports: {}
29
- /******/
30
- };
31
- return C[v].call(h.exports, h, h.exports, N), h.l = !0, h.exports;
32
- }
33
- return N.m = C, N.c = R, N.i = function(v) {
34
- return v;
35
- }, N.d = function(v, h, a) {
36
- N.o(v, h) || Object.defineProperty(v, h, {
37
- /******/
38
- configurable: !1,
39
- /******/
40
- enumerable: !0,
41
- /******/
42
- get: a
43
- /******/
44
- });
45
- }, N.n = function(v) {
46
- var h = v && v.__esModule ? (
47
- /******/
48
- function() {
49
- return v.default;
50
- }
51
- ) : (
52
- /******/
53
- function() {
54
- return v;
55
- }
56
- );
57
- return N.d(h, "a", h), h;
58
- }, N.o = function(v, h) {
59
- return Object.prototype.hasOwnProperty.call(v, h);
60
- }, N.p = "", N(N.s = 28);
61
- }([
62
- /* 0 */
63
- /***/
64
- function(C, R, N) {
65
- function v() {
66
- }
67
- v.QUALITY = 1, v.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, v.DEFAULT_INCREMENTAL = !1, v.DEFAULT_ANIMATION_ON_LAYOUT = !0, v.DEFAULT_ANIMATION_DURING_LAYOUT = !1, v.DEFAULT_ANIMATION_PERIOD = 50, v.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, v.DEFAULT_GRAPH_MARGIN = 15, v.NODE_DIMENSIONS_INCLUDE_LABELS = !1, v.SIMPLE_NODE_SIZE = 40, v.SIMPLE_NODE_HALF_SIZE = v.SIMPLE_NODE_SIZE / 2, v.EMPTY_COMPOUND_NODE_SIZE = 40, v.MIN_EDGE_LENGTH = 1, v.WORLD_BOUNDARY = 1e6, v.INITIAL_WORLD_BOUNDARY = v.WORLD_BOUNDARY / 1e3, v.WORLD_CENTER_X = 1200, v.WORLD_CENTER_Y = 900, C.exports = v;
68
- },
69
- /* 1 */
70
- /***/
71
- function(C, R, N) {
72
- var v = N(2), h = N(8), a = N(9);
73
- function r(f, e, g) {
74
- v.call(this, g), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = g, this.bendpoints = [], this.source = f, this.target = e;
75
- }
76
- r.prototype = Object.create(v.prototype);
77
- for (var i in v)
78
- r[i] = v[i];
79
- r.prototype.getSource = function() {
80
- return this.source;
81
- }, r.prototype.getTarget = function() {
82
- return this.target;
83
- }, r.prototype.isInterGraph = function() {
84
- return this.isInterGraph;
85
- }, r.prototype.getLength = function() {
86
- return this.length;
87
- }, r.prototype.isOverlapingSourceAndTarget = function() {
88
- return this.isOverlapingSourceAndTarget;
89
- }, r.prototype.getBendpoints = function() {
90
- return this.bendpoints;
91
- }, r.prototype.getLca = function() {
92
- return this.lca;
93
- }, r.prototype.getSourceInLca = function() {
94
- return this.sourceInLca;
95
- }, r.prototype.getTargetInLca = function() {
96
- return this.targetInLca;
97
- }, r.prototype.getOtherEnd = function(f) {
98
- if (this.source === f)
99
- return this.target;
100
- if (this.target === f)
101
- return this.source;
102
- throw "Node is not incident with this edge";
103
- }, r.prototype.getOtherEndInGraph = function(f, e) {
104
- for (var g = this.getOtherEnd(f), t = e.getGraphManager().getRoot(); ; ) {
105
- if (g.getOwner() == e)
106
- return g;
107
- if (g.getOwner() == t)
108
- break;
109
- g = g.getOwner().getParent();
110
- }
111
- return null;
112
- }, r.prototype.updateLength = function() {
113
- var f = new Array(4);
114
- this.isOverlapingSourceAndTarget = h.getIntersection(this.target.getRect(), this.source.getRect(), f), this.isOverlapingSourceAndTarget || (this.lengthX = f[0] - f[2], this.lengthY = f[1] - f[3], Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
115
- }, r.prototype.updateLengthSimple = function() {
116
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
117
- }, C.exports = r;
118
- },
119
- /* 2 */
120
- /***/
121
- function(C, R, N) {
122
- function v(h) {
123
- this.vGraphObject = h;
124
- }
125
- C.exports = v;
126
- },
127
- /* 3 */
128
- /***/
129
- function(C, R, N) {
130
- var v = N(2), h = N(10), a = N(13), r = N(0), i = N(16), f = N(5);
131
- function e(t, s, n, c) {
132
- n == null && c == null && (c = s), v.call(this, c), t.graphManager != null && (t = t.graphManager), this.estimatedSize = h.MIN_VALUE, this.inclusionTreeDepth = h.MAX_VALUE, this.vGraphObject = c, this.edges = [], this.graphManager = t, n != null && s != null ? this.rect = new a(s.x, s.y, n.width, n.height) : this.rect = new a();
133
- }
134
- e.prototype = Object.create(v.prototype);
135
- for (var g in v)
136
- e[g] = v[g];
137
- e.prototype.getEdges = function() {
138
- return this.edges;
139
- }, e.prototype.getChild = function() {
140
- return this.child;
141
- }, e.prototype.getOwner = function() {
142
- return this.owner;
143
- }, e.prototype.getWidth = function() {
144
- return this.rect.width;
145
- }, e.prototype.setWidth = function(t) {
146
- this.rect.width = t;
147
- }, e.prototype.getHeight = function() {
148
- return this.rect.height;
149
- }, e.prototype.setHeight = function(t) {
150
- this.rect.height = t;
151
- }, e.prototype.getCenterX = function() {
152
- return this.rect.x + this.rect.width / 2;
153
- }, e.prototype.getCenterY = function() {
154
- return this.rect.y + this.rect.height / 2;
155
- }, e.prototype.getCenter = function() {
156
- return new f(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
157
- }, e.prototype.getLocation = function() {
158
- return new f(this.rect.x, this.rect.y);
159
- }, e.prototype.getRect = function() {
160
- return this.rect;
161
- }, e.prototype.getDiagonal = function() {
162
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
163
- }, e.prototype.getHalfTheDiagonal = function() {
164
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
165
- }, e.prototype.setRect = function(t, s) {
166
- this.rect.x = t.x, this.rect.y = t.y, this.rect.width = s.width, this.rect.height = s.height;
167
- }, e.prototype.setCenter = function(t, s) {
168
- this.rect.x = t - this.rect.width / 2, this.rect.y = s - this.rect.height / 2;
169
- }, e.prototype.setLocation = function(t, s) {
170
- this.rect.x = t, this.rect.y = s;
171
- }, e.prototype.moveBy = function(t, s) {
172
- this.rect.x += t, this.rect.y += s;
173
- }, e.prototype.getEdgeListToNode = function(t) {
174
- var s = [], n = this;
175
- return n.edges.forEach(function(c) {
176
- if (c.target == t) {
177
- if (c.source != n) throw "Incorrect edge source!";
178
- s.push(c);
179
- }
180
- }), s;
181
- }, e.prototype.getEdgesBetween = function(t) {
182
- var s = [], n = this;
183
- return n.edges.forEach(function(c) {
184
- if (!(c.source == n || c.target == n)) throw "Incorrect edge source and/or target";
185
- (c.target == t || c.source == t) && s.push(c);
186
- }), s;
187
- }, e.prototype.getNeighborsList = function() {
188
- var t = /* @__PURE__ */ new Set(), s = this;
189
- return s.edges.forEach(function(n) {
190
- if (n.source == s)
191
- t.add(n.target);
192
- else {
193
- if (n.target != s)
194
- throw "Incorrect incidency!";
195
- t.add(n.source);
196
- }
197
- }), t;
198
- }, e.prototype.withChildren = function() {
199
- var t = /* @__PURE__ */ new Set(), s, n;
200
- if (t.add(this), this.child != null)
201
- for (var c = this.child.getNodes(), l = 0; l < c.length; l++)
202
- s = c[l], n = s.withChildren(), n.forEach(function(T) {
203
- t.add(T);
204
- });
205
- return t;
206
- }, e.prototype.getNoOfChildren = function() {
207
- var t = 0, s;
208
- if (this.child == null)
209
- t = 1;
210
- else
211
- for (var n = this.child.getNodes(), c = 0; c < n.length; c++)
212
- s = n[c], t += s.getNoOfChildren();
213
- return t == 0 && (t = 1), t;
214
- }, e.prototype.getEstimatedSize = function() {
215
- if (this.estimatedSize == h.MIN_VALUE)
216
- throw "assert failed";
217
- return this.estimatedSize;
218
- }, e.prototype.calcEstimatedSize = function() {
219
- return this.child == null ? this.estimatedSize = (this.rect.width + this.rect.height) / 2 : (this.estimatedSize = this.child.calcEstimatedSize(), this.rect.width = this.estimatedSize, this.rect.height = this.estimatedSize, this.estimatedSize);
220
- }, e.prototype.scatter = function() {
221
- var t, s, n = -r.INITIAL_WORLD_BOUNDARY, c = r.INITIAL_WORLD_BOUNDARY;
222
- t = r.WORLD_CENTER_X + i.nextDouble() * (c - n) + n;
223
- var l = -r.INITIAL_WORLD_BOUNDARY, T = r.INITIAL_WORLD_BOUNDARY;
224
- s = r.WORLD_CENTER_Y + i.nextDouble() * (T - l) + l, this.rect.x = t, this.rect.y = s;
225
- }, e.prototype.updateBounds = function() {
226
- if (this.getChild() == null)
227
- throw "assert failed";
228
- if (this.getChild().getNodes().length != 0) {
229
- var t = this.getChild();
230
- if (t.updateBounds(!0), this.rect.x = t.getLeft(), this.rect.y = t.getTop(), this.setWidth(t.getRight() - t.getLeft()), this.setHeight(t.getBottom() - t.getTop()), r.NODE_DIMENSIONS_INCLUDE_LABELS) {
231
- var s = t.getRight() - t.getLeft(), n = t.getBottom() - t.getTop();
232
- this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(s + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > s ? (this.rect.x -= (this.labelWidth - s) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(s + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(n + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > n ? (this.rect.y -= (this.labelHeight - n) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(n + this.labelHeight));
233
- }
234
- }
235
- }, e.prototype.getInclusionTreeDepth = function() {
236
- if (this.inclusionTreeDepth == h.MAX_VALUE)
237
- throw "assert failed";
238
- return this.inclusionTreeDepth;
239
- }, e.prototype.transform = function(t) {
240
- var s = this.rect.x;
241
- s > r.WORLD_BOUNDARY ? s = r.WORLD_BOUNDARY : s < -r.WORLD_BOUNDARY && (s = -r.WORLD_BOUNDARY);
242
- var n = this.rect.y;
243
- n > r.WORLD_BOUNDARY ? n = r.WORLD_BOUNDARY : n < -r.WORLD_BOUNDARY && (n = -r.WORLD_BOUNDARY);
244
- var c = new f(s, n), l = t.inverseTransformPoint(c);
245
- this.setLocation(l.x, l.y);
246
- }, e.prototype.getLeft = function() {
247
- return this.rect.x;
248
- }, e.prototype.getRight = function() {
249
- return this.rect.x + this.rect.width;
250
- }, e.prototype.getTop = function() {
251
- return this.rect.y;
252
- }, e.prototype.getBottom = function() {
253
- return this.rect.y + this.rect.height;
254
- }, e.prototype.getParent = function() {
255
- return this.owner == null ? null : this.owner.getParent();
256
- }, C.exports = e;
257
- },
258
- /* 4 */
259
- /***/
260
- function(C, R, N) {
261
- var v = N(0);
262
- function h() {
263
- }
264
- for (var a in v)
265
- h[a] = v[a];
266
- h.MAX_ITERATIONS = 2500, h.DEFAULT_EDGE_LENGTH = 50, h.DEFAULT_SPRING_STRENGTH = 0.45, h.DEFAULT_REPULSION_STRENGTH = 4500, h.DEFAULT_GRAVITY_STRENGTH = 0.4, h.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, h.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, h.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, h.COOLING_ADAPTATION_FACTOR = 0.33, h.ADAPTATION_LOWER_NODE_LIMIT = 1e3, h.ADAPTATION_UPPER_NODE_LIMIT = 5e3, h.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, h.MAX_NODE_DISPLACEMENT = h.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, h.MIN_REPULSION_DIST = h.DEFAULT_EDGE_LENGTH / 10, h.CONVERGENCE_CHECK_PERIOD = 100, h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, h.MIN_EDGE_LENGTH = 1, h.GRID_CALCULATION_CHECK_PERIOD = 10, C.exports = h;
267
- },
268
- /* 5 */
269
- /***/
270
- function(C, R, N) {
271
- function v(h, a) {
272
- h == null && a == null ? (this.x = 0, this.y = 0) : (this.x = h, this.y = a);
273
- }
274
- v.prototype.getX = function() {
275
- return this.x;
276
- }, v.prototype.getY = function() {
277
- return this.y;
278
- }, v.prototype.setX = function(h) {
279
- this.x = h;
280
- }, v.prototype.setY = function(h) {
281
- this.y = h;
282
- }, v.prototype.getDifference = function(h) {
283
- return new DimensionD(this.x - h.x, this.y - h.y);
284
- }, v.prototype.getCopy = function() {
285
- return new v(this.x, this.y);
286
- }, v.prototype.translate = function(h) {
287
- return this.x += h.width, this.y += h.height, this;
288
- }, C.exports = v;
289
- },
290
- /* 6 */
291
- /***/
292
- function(C, R, N) {
293
- var v = N(2), h = N(10), a = N(0), r = N(7), i = N(3), f = N(1), e = N(13), g = N(12), t = N(11);
294
- function s(c, l, T) {
295
- v.call(this, T), this.estimatedSize = h.MIN_VALUE, this.margin = a.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = c, l != null && l instanceof r ? this.graphManager = l : l != null && l instanceof Layout && (this.graphManager = l.graphManager);
296
- }
297
- s.prototype = Object.create(v.prototype);
298
- for (var n in v)
299
- s[n] = v[n];
300
- s.prototype.getNodes = function() {
301
- return this.nodes;
302
- }, s.prototype.getEdges = function() {
303
- return this.edges;
304
- }, s.prototype.getGraphManager = function() {
305
- return this.graphManager;
306
- }, s.prototype.getParent = function() {
307
- return this.parent;
308
- }, s.prototype.getLeft = function() {
309
- return this.left;
310
- }, s.prototype.getRight = function() {
311
- return this.right;
312
- }, s.prototype.getTop = function() {
313
- return this.top;
314
- }, s.prototype.getBottom = function() {
315
- return this.bottom;
316
- }, s.prototype.isConnected = function() {
317
- return this.isConnected;
318
- }, s.prototype.add = function(c, l, T) {
319
- if (l == null && T == null) {
320
- var u = c;
321
- if (this.graphManager == null)
322
- throw "Graph has no graph mgr!";
323
- if (this.getNodes().indexOf(u) > -1)
324
- throw "Node already in graph!";
325
- return u.owner = this, this.getNodes().push(u), u;
326
- } else {
327
- var d = c;
328
- if (!(this.getNodes().indexOf(l) > -1 && this.getNodes().indexOf(T) > -1))
329
- throw "Source or target not in graph!";
330
- if (!(l.owner == T.owner && l.owner == this))
331
- throw "Both owners must be this graph!";
332
- return l.owner != T.owner ? null : (d.source = l, d.target = T, d.isInterGraph = !1, this.getEdges().push(d), l.edges.push(d), T != l && T.edges.push(d), d);
333
- }
334
- }, s.prototype.remove = function(c) {
335
- var l = c;
336
- if (c instanceof i) {
337
- if (l == null)
338
- throw "Node is null!";
339
- if (!(l.owner != null && l.owner == this))
340
- throw "Owner graph is invalid!";
341
- if (this.graphManager == null)
342
- throw "Owner graph manager is invalid!";
343
- for (var T = l.edges.slice(), u, d = T.length, L = 0; L < d; L++)
344
- u = T[L], u.isInterGraph ? this.graphManager.remove(u) : u.source.owner.remove(u);
345
- var b = this.nodes.indexOf(l);
346
- if (b == -1)
347
- throw "Node not in owner node list!";
348
- this.nodes.splice(b, 1);
349
- } else if (c instanceof f) {
350
- var u = c;
351
- if (u == null)
352
- throw "Edge is null!";
353
- if (!(u.source != null && u.target != null))
354
- throw "Source and/or target is null!";
355
- if (!(u.source.owner != null && u.target.owner != null && u.source.owner == this && u.target.owner == this))
356
- throw "Source and/or target owner is invalid!";
357
- var w = u.source.edges.indexOf(u), G = u.target.edges.indexOf(u);
358
- if (!(w > -1 && G > -1))
359
- throw "Source and/or target doesn't know this edge!";
360
- u.source.edges.splice(w, 1), u.target != u.source && u.target.edges.splice(G, 1);
361
- var b = u.source.owner.getEdges().indexOf(u);
362
- if (b == -1)
363
- throw "Not in owner's edge list!";
364
- u.source.owner.getEdges().splice(b, 1);
365
- }
366
- }, s.prototype.updateLeftTop = function() {
367
- for (var c = h.MAX_VALUE, l = h.MAX_VALUE, T, u, d, L = this.getNodes(), b = L.length, w = 0; w < b; w++) {
368
- var G = L[w];
369
- T = G.getTop(), u = G.getLeft(), c > T && (c = T), l > u && (l = u);
370
- }
371
- return c == h.MAX_VALUE ? null : (L[0].getParent().paddingLeft != null ? d = L[0].getParent().paddingLeft : d = this.margin, this.left = l - d, this.top = c - d, new g(this.left, this.top));
372
- }, s.prototype.updateBounds = function(c) {
373
- for (var l = h.MAX_VALUE, T = -h.MAX_VALUE, u = h.MAX_VALUE, d = -h.MAX_VALUE, L, b, w, G, B, U = this.nodes, V = U.length, M = 0; M < V; M++) {
374
- var _ = U[M];
375
- c && _.child != null && _.updateBounds(), L = _.getLeft(), b = _.getRight(), w = _.getTop(), G = _.getBottom(), l > L && (l = L), T < b && (T = b), u > w && (u = w), d < G && (d = G);
376
- }
377
- var o = new e(l, u, T - l, d - u);
378
- l == h.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), U[0].getParent().paddingLeft != null ? B = U[0].getParent().paddingLeft : B = this.margin, this.left = o.x - B, this.right = o.x + o.width + B, this.top = o.y - B, this.bottom = o.y + o.height + B;
379
- }, s.calculateBounds = function(c) {
380
- for (var l = h.MAX_VALUE, T = -h.MAX_VALUE, u = h.MAX_VALUE, d = -h.MAX_VALUE, L, b, w, G, B = c.length, U = 0; U < B; U++) {
381
- var V = c[U];
382
- L = V.getLeft(), b = V.getRight(), w = V.getTop(), G = V.getBottom(), l > L && (l = L), T < b && (T = b), u > w && (u = w), d < G && (d = G);
383
- }
384
- var M = new e(l, u, T - l, d - u);
385
- return M;
386
- }, s.prototype.getInclusionTreeDepth = function() {
387
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
388
- }, s.prototype.getEstimatedSize = function() {
389
- if (this.estimatedSize == h.MIN_VALUE)
390
- throw "assert failed";
391
- return this.estimatedSize;
392
- }, s.prototype.calcEstimatedSize = function() {
393
- for (var c = 0, l = this.nodes, T = l.length, u = 0; u < T; u++) {
394
- var d = l[u];
395
- c += d.calcEstimatedSize();
396
- }
397
- return c == 0 ? this.estimatedSize = a.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = c / Math.sqrt(this.nodes.length), this.estimatedSize;
398
- }, s.prototype.updateConnected = function() {
399
- var c = this;
400
- if (this.nodes.length == 0) {
401
- this.isConnected = !0;
402
- return;
403
- }
404
- var l = new t(), T = /* @__PURE__ */ new Set(), u = this.nodes[0], d, L, b = u.withChildren();
405
- for (b.forEach(function(M) {
406
- l.push(M), T.add(M);
407
- }); l.length !== 0; ) {
408
- u = l.shift(), d = u.getEdges();
409
- for (var w = d.length, G = 0; G < w; G++) {
410
- var B = d[G];
411
- if (L = B.getOtherEndInGraph(u, this), L != null && !T.has(L)) {
412
- var U = L.withChildren();
413
- U.forEach(function(M) {
414
- l.push(M), T.add(M);
415
- });
416
- }
417
- }
418
- }
419
- if (this.isConnected = !1, T.size >= this.nodes.length) {
420
- var V = 0;
421
- T.forEach(function(M) {
422
- M.owner == c && V++;
423
- }), V == this.nodes.length && (this.isConnected = !0);
424
- }
425
- }, C.exports = s;
426
- },
427
- /* 7 */
428
- /***/
429
- function(C, R, N) {
430
- var v, h = N(1);
431
- function a(r) {
432
- v = N(6), this.layout = r, this.graphs = [], this.edges = [];
433
- }
434
- a.prototype.addRoot = function() {
435
- var r = this.layout.newGraph(), i = this.layout.newNode(null), f = this.add(r, i);
436
- return this.setRootGraph(f), this.rootGraph;
437
- }, a.prototype.add = function(r, i, f, e, g) {
438
- if (f == null && e == null && g == null) {
439
- if (r == null)
440
- throw "Graph is null!";
441
- if (i == null)
442
- throw "Parent node is null!";
443
- if (this.graphs.indexOf(r) > -1)
444
- throw "Graph already in this graph mgr!";
445
- if (this.graphs.push(r), r.parent != null)
446
- throw "Already has a parent!";
447
- if (i.child != null)
448
- throw "Already has a child!";
449
- return r.parent = i, i.child = r, r;
450
- } else {
451
- g = f, e = i, f = r;
452
- var t = e.getOwner(), s = g.getOwner();
453
- if (!(t != null && t.getGraphManager() == this))
454
- throw "Source not in this graph mgr!";
455
- if (!(s != null && s.getGraphManager() == this))
456
- throw "Target not in this graph mgr!";
457
- if (t == s)
458
- return f.isInterGraph = !1, t.add(f, e, g);
459
- if (f.isInterGraph = !0, f.source = e, f.target = g, this.edges.indexOf(f) > -1)
460
- throw "Edge already in inter-graph edge list!";
461
- if (this.edges.push(f), !(f.source != null && f.target != null))
462
- throw "Edge source and/or target is null!";
463
- if (!(f.source.edges.indexOf(f) == -1 && f.target.edges.indexOf(f) == -1))
464
- throw "Edge already in source and/or target incidency list!";
465
- return f.source.edges.push(f), f.target.edges.push(f), f;
466
- }
467
- }, a.prototype.remove = function(r) {
468
- if (r instanceof v) {
469
- var i = r;
470
- if (i.getGraphManager() != this)
471
- throw "Graph not in this graph mgr";
472
- if (!(i == this.rootGraph || i.parent != null && i.parent.graphManager == this))
473
- throw "Invalid parent node!";
474
- var f = [];
475
- f = f.concat(i.getEdges());
476
- for (var e, g = f.length, t = 0; t < g; t++)
477
- e = f[t], i.remove(e);
478
- var s = [];
479
- s = s.concat(i.getNodes());
480
- var n;
481
- g = s.length;
482
- for (var t = 0; t < g; t++)
483
- n = s[t], i.remove(n);
484
- i == this.rootGraph && this.setRootGraph(null);
485
- var c = this.graphs.indexOf(i);
486
- this.graphs.splice(c, 1), i.parent = null;
487
- } else if (r instanceof h) {
488
- if (e = r, e == null)
489
- throw "Edge is null!";
490
- if (!e.isInterGraph)
491
- throw "Not an inter-graph edge!";
492
- if (!(e.source != null && e.target != null))
493
- throw "Source and/or target is null!";
494
- if (!(e.source.edges.indexOf(e) != -1 && e.target.edges.indexOf(e) != -1))
495
- throw "Source and/or target doesn't know this edge!";
496
- var c = e.source.edges.indexOf(e);
497
- if (e.source.edges.splice(c, 1), c = e.target.edges.indexOf(e), e.target.edges.splice(c, 1), !(e.source.owner != null && e.source.owner.getGraphManager() != null))
498
- throw "Edge owner graph or owner graph manager is null!";
499
- if (e.source.owner.getGraphManager().edges.indexOf(e) == -1)
500
- throw "Not in owner graph manager's edge list!";
501
- var c = e.source.owner.getGraphManager().edges.indexOf(e);
502
- e.source.owner.getGraphManager().edges.splice(c, 1);
503
- }
504
- }, a.prototype.updateBounds = function() {
505
- this.rootGraph.updateBounds(!0);
506
- }, a.prototype.getGraphs = function() {
507
- return this.graphs;
508
- }, a.prototype.getAllNodes = function() {
509
- if (this.allNodes == null) {
510
- for (var r = [], i = this.getGraphs(), f = i.length, e = 0; e < f; e++)
511
- r = r.concat(i[e].getNodes());
512
- this.allNodes = r;
513
- }
514
- return this.allNodes;
515
- }, a.prototype.resetAllNodes = function() {
516
- this.allNodes = null;
517
- }, a.prototype.resetAllEdges = function() {
518
- this.allEdges = null;
519
- }, a.prototype.resetAllNodesToApplyGravitation = function() {
520
- this.allNodesToApplyGravitation = null;
521
- }, a.prototype.getAllEdges = function() {
522
- if (this.allEdges == null) {
523
- var r = [], i = this.getGraphs();
524
- i.length;
525
- for (var f = 0; f < i.length; f++)
526
- r = r.concat(i[f].getEdges());
527
- r = r.concat(this.edges), this.allEdges = r;
528
- }
529
- return this.allEdges;
530
- }, a.prototype.getAllNodesToApplyGravitation = function() {
531
- return this.allNodesToApplyGravitation;
532
- }, a.prototype.setAllNodesToApplyGravitation = function(r) {
533
- if (this.allNodesToApplyGravitation != null)
534
- throw "assert failed";
535
- this.allNodesToApplyGravitation = r;
536
- }, a.prototype.getRoot = function() {
537
- return this.rootGraph;
538
- }, a.prototype.setRootGraph = function(r) {
539
- if (r.getGraphManager() != this)
540
- throw "Root not in this graph mgr!";
541
- this.rootGraph = r, r.parent == null && (r.parent = this.layout.newNode("Root node"));
542
- }, a.prototype.getLayout = function() {
543
- return this.layout;
544
- }, a.prototype.isOneAncestorOfOther = function(r, i) {
545
- if (!(r != null && i != null))
546
- throw "assert failed";
547
- if (r == i)
548
- return !0;
549
- var f = r.getOwner(), e;
550
- do {
551
- if (e = f.getParent(), e == null)
552
- break;
553
- if (e == i)
554
- return !0;
555
- if (f = e.getOwner(), f == null)
556
- break;
557
- } while (!0);
558
- f = i.getOwner();
559
- do {
560
- if (e = f.getParent(), e == null)
561
- break;
562
- if (e == r)
563
- return !0;
564
- if (f = e.getOwner(), f == null)
565
- break;
566
- } while (!0);
567
- return !1;
568
- }, a.prototype.calcLowestCommonAncestors = function() {
569
- for (var r, i, f, e, g, t = this.getAllEdges(), s = t.length, n = 0; n < s; n++) {
570
- if (r = t[n], i = r.source, f = r.target, r.lca = null, r.sourceInLca = i, r.targetInLca = f, i == f) {
571
- r.lca = i.getOwner();
572
- continue;
573
- }
574
- for (e = i.getOwner(); r.lca == null; ) {
575
- for (r.targetInLca = f, g = f.getOwner(); r.lca == null; ) {
576
- if (g == e) {
577
- r.lca = g;
578
- break;
579
- }
580
- if (g == this.rootGraph)
581
- break;
582
- if (r.lca != null)
583
- throw "assert failed";
584
- r.targetInLca = g.getParent(), g = r.targetInLca.getOwner();
585
- }
586
- if (e == this.rootGraph)
587
- break;
588
- r.lca == null && (r.sourceInLca = e.getParent(), e = r.sourceInLca.getOwner());
589
- }
590
- if (r.lca == null)
591
- throw "assert failed";
592
- }
593
- }, a.prototype.calcLowestCommonAncestor = function(r, i) {
594
- if (r == i)
595
- return r.getOwner();
596
- var f = r.getOwner();
597
- do {
598
- if (f == null)
599
- break;
600
- var e = i.getOwner();
601
- do {
602
- if (e == null)
603
- break;
604
- if (e == f)
605
- return e;
606
- e = e.getParent().getOwner();
607
- } while (!0);
608
- f = f.getParent().getOwner();
609
- } while (!0);
610
- return f;
611
- }, a.prototype.calcInclusionTreeDepths = function(r, i) {
612
- r == null && i == null && (r = this.rootGraph, i = 1);
613
- for (var f, e = r.getNodes(), g = e.length, t = 0; t < g; t++)
614
- f = e[t], f.inclusionTreeDepth = i, f.child != null && this.calcInclusionTreeDepths(f.child, i + 1);
615
- }, a.prototype.includesInvalidEdge = function() {
616
- for (var r, i = [], f = this.edges.length, e = 0; e < f; e++)
617
- r = this.edges[e], this.isOneAncestorOfOther(r.source, r.target) && i.push(r);
618
- for (var e = 0; e < i.length; e++)
619
- this.remove(i[e]);
620
- return !1;
621
- }, C.exports = a;
622
- },
623
- /* 8 */
624
- /***/
625
- function(C, R, N) {
626
- var v = N(12);
627
- function h() {
628
- }
629
- h.calcSeparationAmount = function(a, r, i, f) {
630
- if (!a.intersects(r))
631
- throw "assert failed";
632
- var e = new Array(2);
633
- this.decideDirectionsForOverlappingNodes(a, r, e), i[0] = Math.min(a.getRight(), r.getRight()) - Math.max(a.x, r.x), i[1] = Math.min(a.getBottom(), r.getBottom()) - Math.max(a.y, r.y), a.getX() <= r.getX() && a.getRight() >= r.getRight() ? i[0] += Math.min(r.getX() - a.getX(), a.getRight() - r.getRight()) : r.getX() <= a.getX() && r.getRight() >= a.getRight() && (i[0] += Math.min(a.getX() - r.getX(), r.getRight() - a.getRight())), a.getY() <= r.getY() && a.getBottom() >= r.getBottom() ? i[1] += Math.min(r.getY() - a.getY(), a.getBottom() - r.getBottom()) : r.getY() <= a.getY() && r.getBottom() >= a.getBottom() && (i[1] += Math.min(a.getY() - r.getY(), r.getBottom() - a.getBottom()));
634
- var g = Math.abs((r.getCenterY() - a.getCenterY()) / (r.getCenterX() - a.getCenterX()));
635
- r.getCenterY() === a.getCenterY() && r.getCenterX() === a.getCenterX() && (g = 1);
636
- var t = g * i[0], s = i[1] / g;
637
- i[0] < s ? s = i[0] : t = i[1], i[0] = -1 * e[0] * (s / 2 + f), i[1] = -1 * e[1] * (t / 2 + f);
638
- }, h.decideDirectionsForOverlappingNodes = function(a, r, i) {
639
- a.getCenterX() < r.getCenterX() ? i[0] = -1 : i[0] = 1, a.getCenterY() < r.getCenterY() ? i[1] = -1 : i[1] = 1;
640
- }, h.getIntersection2 = function(a, r, i) {
641
- var f = a.getCenterX(), e = a.getCenterY(), g = r.getCenterX(), t = r.getCenterY();
642
- if (a.intersects(r))
643
- return i[0] = f, i[1] = e, i[2] = g, i[3] = t, !0;
644
- var s = a.getX(), n = a.getY(), c = a.getRight(), l = a.getX(), T = a.getBottom(), u = a.getRight(), d = a.getWidthHalf(), L = a.getHeightHalf(), b = r.getX(), w = r.getY(), G = r.getRight(), B = r.getX(), U = r.getBottom(), V = r.getRight(), M = r.getWidthHalf(), _ = r.getHeightHalf(), o = !1, E = !1;
645
- if (f === g) {
646
- if (e > t)
647
- return i[0] = f, i[1] = n, i[2] = g, i[3] = U, !1;
648
- if (e < t)
649
- return i[0] = f, i[1] = T, i[2] = g, i[3] = w, !1;
650
- } else if (e === t) {
651
- if (f > g)
652
- return i[0] = s, i[1] = e, i[2] = G, i[3] = t, !1;
653
- if (f < g)
654
- return i[0] = c, i[1] = e, i[2] = b, i[3] = t, !1;
655
- } else {
656
- var p = a.height / a.width, m = r.height / r.width, y = (t - e) / (g - f), S = void 0, O = void 0, F = void 0, W = void 0, I = void 0, Q = void 0;
657
- if (-p === y ? f > g ? (i[0] = l, i[1] = T, o = !0) : (i[0] = c, i[1] = n, o = !0) : p === y && (f > g ? (i[0] = s, i[1] = n, o = !0) : (i[0] = u, i[1] = T, o = !0)), -m === y ? g > f ? (i[2] = B, i[3] = U, E = !0) : (i[2] = G, i[3] = w, E = !0) : m === y && (g > f ? (i[2] = b, i[3] = w, E = !0) : (i[2] = V, i[3] = U, E = !0)), o && E)
658
- return !1;
659
- if (f > g ? e > t ? (S = this.getCardinalDirection(p, y, 4), O = this.getCardinalDirection(m, y, 2)) : (S = this.getCardinalDirection(-p, y, 3), O = this.getCardinalDirection(-m, y, 1)) : e > t ? (S = this.getCardinalDirection(-p, y, 1), O = this.getCardinalDirection(-m, y, 3)) : (S = this.getCardinalDirection(p, y, 2), O = this.getCardinalDirection(m, y, 4)), !o)
660
- switch (S) {
661
- case 1:
662
- W = n, F = f + -L / y, i[0] = F, i[1] = W;
663
- break;
664
- case 2:
665
- F = u, W = e + d * y, i[0] = F, i[1] = W;
666
- break;
667
- case 3:
668
- W = T, F = f + L / y, i[0] = F, i[1] = W;
669
- break;
670
- case 4:
671
- F = l, W = e + -d * y, i[0] = F, i[1] = W;
672
- break;
673
- }
674
- if (!E)
675
- switch (O) {
676
- case 1:
677
- Q = w, I = g + -_ / y, i[2] = I, i[3] = Q;
678
- break;
679
- case 2:
680
- I = V, Q = t + M * y, i[2] = I, i[3] = Q;
681
- break;
682
- case 3:
683
- Q = U, I = g + _ / y, i[2] = I, i[3] = Q;
684
- break;
685
- case 4:
686
- I = B, Q = t + -M * y, i[2] = I, i[3] = Q;
687
- break;
688
- }
689
- }
690
- return !1;
691
- }, h.getCardinalDirection = function(a, r, i) {
692
- return a > r ? i : 1 + i % 4;
693
- }, h.getIntersection = function(a, r, i, f) {
694
- if (f == null)
695
- return this.getIntersection2(a, r, i);
696
- var e = a.x, g = a.y, t = r.x, s = r.y, n = i.x, c = i.y, l = f.x, T = f.y, u = void 0, d = void 0, L = void 0, b = void 0, w = void 0, G = void 0, B = void 0, U = void 0, V = void 0;
697
- return L = s - g, w = e - t, B = t * g - e * s, b = T - c, G = n - l, U = l * c - n * T, V = L * G - b * w, V === 0 ? null : (u = (w * U - G * B) / V, d = (b * B - L * U) / V, new v(u, d));
698
- }, h.angleOfVector = function(a, r, i, f) {
699
- var e = void 0;
700
- return a !== i ? (e = Math.atan((f - r) / (i - a)), i < a ? e += Math.PI : f < r && (e += this.TWO_PI)) : f < r ? e = this.ONE_AND_HALF_PI : e = this.HALF_PI, e;
701
- }, h.doIntersect = function(a, r, i, f) {
702
- var e = a.x, g = a.y, t = r.x, s = r.y, n = i.x, c = i.y, l = f.x, T = f.y, u = (t - e) * (T - c) - (l - n) * (s - g);
703
- if (u === 0)
704
- return !1;
705
- var d = ((T - c) * (l - e) + (n - l) * (T - g)) / u, L = ((g - s) * (l - e) + (t - e) * (T - g)) / u;
706
- return 0 < d && d < 1 && 0 < L && L < 1;
707
- }, h.findCircleLineIntersections = function(a, r, i, f, e, g, t) {
708
- var s = (i - a) * (i - a) + (f - r) * (f - r), n = 2 * ((a - e) * (i - a) + (r - g) * (f - r)), c = (a - e) * (a - e) + (r - g) * (r - g) - t * t, l = n * n - 4 * s * c;
709
- if (l >= 0) {
710
- var T = (-n + Math.sqrt(n * n - 4 * s * c)) / (2 * s), u = (-n - Math.sqrt(n * n - 4 * s * c)) / (2 * s), d = null;
711
- return T >= 0 && T <= 1 ? [T] : u >= 0 && u <= 1 ? [u] : d;
712
- } else return null;
713
- }, h.HALF_PI = 0.5 * Math.PI, h.ONE_AND_HALF_PI = 1.5 * Math.PI, h.TWO_PI = 2 * Math.PI, h.THREE_PI = 3 * Math.PI, C.exports = h;
714
- },
715
- /* 9 */
716
- /***/
717
- function(C, R, N) {
718
- function v() {
719
- }
720
- v.sign = function(h) {
721
- return h > 0 ? 1 : h < 0 ? -1 : 0;
722
- }, v.floor = function(h) {
723
- return h < 0 ? Math.ceil(h) : Math.floor(h);
724
- }, v.ceil = function(h) {
725
- return h < 0 ? Math.floor(h) : Math.ceil(h);
726
- }, C.exports = v;
727
- },
728
- /* 10 */
729
- /***/
730
- function(C, R, N) {
731
- function v() {
732
- }
733
- v.MAX_VALUE = 2147483647, v.MIN_VALUE = -2147483648, C.exports = v;
734
- },
735
- /* 11 */
736
- /***/
737
- function(C, R, N) {
738
- var v = /* @__PURE__ */ function() {
739
- function e(g, t) {
740
- for (var s = 0; s < t.length; s++) {
741
- var n = t[s];
742
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(g, n.key, n);
743
- }
744
- }
745
- return function(g, t, s) {
746
- return t && e(g.prototype, t), s && e(g, s), g;
747
- };
748
- }();
749
- function h(e, g) {
750
- if (!(e instanceof g))
751
- throw new TypeError("Cannot call a class as a function");
752
- }
753
- var a = function(g) {
754
- return { value: g, next: null, prev: null };
755
- }, r = function(g, t, s, n) {
756
- return g !== null ? g.next = t : n.head = t, s !== null ? s.prev = t : n.tail = t, t.prev = g, t.next = s, n.length++, t;
757
- }, i = function(g, t) {
758
- var s = g.prev, n = g.next;
759
- return s !== null ? s.next = n : t.head = n, n !== null ? n.prev = s : t.tail = s, g.prev = g.next = null, t.length--, g;
760
- }, f = function() {
761
- function e(g) {
762
- var t = this;
763
- h(this, e), this.length = 0, this.head = null, this.tail = null, g?.forEach(function(s) {
764
- return t.push(s);
765
- });
766
- }
767
- return v(e, [{
768
- key: "size",
769
- value: function() {
770
- return this.length;
771
- }
772
- }, {
773
- key: "insertBefore",
774
- value: function(t, s) {
775
- return r(s.prev, a(t), s, this);
776
- }
777
- }, {
778
- key: "insertAfter",
779
- value: function(t, s) {
780
- return r(s, a(t), s.next, this);
781
- }
782
- }, {
783
- key: "insertNodeBefore",
784
- value: function(t, s) {
785
- return r(s.prev, t, s, this);
786
- }
787
- }, {
788
- key: "insertNodeAfter",
789
- value: function(t, s) {
790
- return r(s, t, s.next, this);
791
- }
792
- }, {
793
- key: "push",
794
- value: function(t) {
795
- return r(this.tail, a(t), null, this);
796
- }
797
- }, {
798
- key: "unshift",
799
- value: function(t) {
800
- return r(null, a(t), this.head, this);
801
- }
802
- }, {
803
- key: "remove",
804
- value: function(t) {
805
- return i(t, this);
806
- }
807
- }, {
808
- key: "pop",
809
- value: function() {
810
- return i(this.tail, this).value;
811
- }
812
- }, {
813
- key: "popNode",
814
- value: function() {
815
- return i(this.tail, this);
816
- }
817
- }, {
818
- key: "shift",
819
- value: function() {
820
- return i(this.head, this).value;
821
- }
822
- }, {
823
- key: "shiftNode",
824
- value: function() {
825
- return i(this.head, this);
826
- }
827
- }, {
828
- key: "get_object_at",
829
- value: function(t) {
830
- if (t <= this.length()) {
831
- for (var s = 1, n = this.head; s < t; )
832
- n = n.next, s++;
833
- return n.value;
834
- }
835
- }
836
- }, {
837
- key: "set_object_at",
838
- value: function(t, s) {
839
- if (t <= this.length()) {
840
- for (var n = 1, c = this.head; n < t; )
841
- c = c.next, n++;
842
- c.value = s;
843
- }
844
- }
845
- }]), e;
846
- }();
847
- C.exports = f;
848
- },
849
- /* 12 */
850
- /***/
851
- function(C, R, N) {
852
- function v(h, a, r) {
853
- this.x = null, this.y = null, h == null && a == null && r == null ? (this.x = 0, this.y = 0) : typeof h == "number" && typeof a == "number" && r == null ? (this.x = h, this.y = a) : h.constructor.name == "Point" && a == null && r == null && (r = h, this.x = r.x, this.y = r.y);
854
- }
855
- v.prototype.getX = function() {
856
- return this.x;
857
- }, v.prototype.getY = function() {
858
- return this.y;
859
- }, v.prototype.getLocation = function() {
860
- return new v(this.x, this.y);
861
- }, v.prototype.setLocation = function(h, a, r) {
862
- h.constructor.name == "Point" && a == null && r == null ? (r = h, this.setLocation(r.x, r.y)) : typeof h == "number" && typeof a == "number" && r == null && (parseInt(h) == h && parseInt(a) == a ? this.move(h, a) : (this.x = Math.floor(h + 0.5), this.y = Math.floor(a + 0.5)));
863
- }, v.prototype.move = function(h, a) {
864
- this.x = h, this.y = a;
865
- }, v.prototype.translate = function(h, a) {
866
- this.x += h, this.y += a;
867
- }, v.prototype.equals = function(h) {
868
- if (h.constructor.name == "Point") {
869
- var a = h;
870
- return this.x == a.x && this.y == a.y;
871
- }
872
- return this == h;
873
- }, v.prototype.toString = function() {
874
- return new v().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
875
- }, C.exports = v;
876
- },
877
- /* 13 */
878
- /***/
879
- function(C, R, N) {
880
- function v(h, a, r, i) {
881
- this.x = 0, this.y = 0, this.width = 0, this.height = 0, h != null && a != null && r != null && i != null && (this.x = h, this.y = a, this.width = r, this.height = i);
882
- }
883
- v.prototype.getX = function() {
884
- return this.x;
885
- }, v.prototype.setX = function(h) {
886
- this.x = h;
887
- }, v.prototype.getY = function() {
888
- return this.y;
889
- }, v.prototype.setY = function(h) {
890
- this.y = h;
891
- }, v.prototype.getWidth = function() {
892
- return this.width;
893
- }, v.prototype.setWidth = function(h) {
894
- this.width = h;
895
- }, v.prototype.getHeight = function() {
896
- return this.height;
897
- }, v.prototype.setHeight = function(h) {
898
- this.height = h;
899
- }, v.prototype.getRight = function() {
900
- return this.x + this.width;
901
- }, v.prototype.getBottom = function() {
902
- return this.y + this.height;
903
- }, v.prototype.intersects = function(h) {
904
- return !(this.getRight() < h.x || this.getBottom() < h.y || h.getRight() < this.x || h.getBottom() < this.y);
905
- }, v.prototype.getCenterX = function() {
906
- return this.x + this.width / 2;
907
- }, v.prototype.getMinX = function() {
908
- return this.getX();
909
- }, v.prototype.getMaxX = function() {
910
- return this.getX() + this.width;
911
- }, v.prototype.getCenterY = function() {
912
- return this.y + this.height / 2;
913
- }, v.prototype.getMinY = function() {
914
- return this.getY();
915
- }, v.prototype.getMaxY = function() {
916
- return this.getY() + this.height;
917
- }, v.prototype.getWidthHalf = function() {
918
- return this.width / 2;
919
- }, v.prototype.getHeightHalf = function() {
920
- return this.height / 2;
921
- }, C.exports = v;
922
- },
923
- /* 14 */
924
- /***/
925
- function(C, R, N) {
926
- var v = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) {
927
- return typeof a;
928
- } : function(a) {
929
- return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a;
930
- };
931
- function h() {
932
- }
933
- h.lastID = 0, h.createID = function(a) {
934
- return h.isPrimitive(a) ? a : (a.uniqueID != null || (a.uniqueID = h.getString(), h.lastID++), a.uniqueID);
935
- }, h.getString = function(a) {
936
- return a == null && (a = h.lastID), "Object#" + a;
937
- }, h.isPrimitive = function(a) {
938
- var r = typeof a > "u" ? "undefined" : v(a);
939
- return a == null || r != "object" && r != "function";
940
- }, C.exports = h;
941
- },
942
- /* 15 */
943
- /***/
944
- function(C, R, N) {
945
- function v(n) {
946
- if (Array.isArray(n)) {
947
- for (var c = 0, l = Array(n.length); c < n.length; c++)
948
- l[c] = n[c];
949
- return l;
950
- } else
951
- return Array.from(n);
952
- }
953
- var h = N(0), a = N(7), r = N(3), i = N(1), f = N(6), e = N(5), g = N(17), t = N(29);
954
- function s(n) {
955
- t.call(this), this.layoutQuality = h.QUALITY, this.createBendsAsNeeded = h.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = h.DEFAULT_INCREMENTAL, this.animationOnLayout = h.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = h.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = h.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = h.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new a(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, n != null && (this.isRemoteUse = n);
956
- }
957
- s.RANDOM_SEED = 1, s.prototype = Object.create(t.prototype), s.prototype.getGraphManager = function() {
958
- return this.graphManager;
959
- }, s.prototype.getAllNodes = function() {
960
- return this.graphManager.getAllNodes();
961
- }, s.prototype.getAllEdges = function() {
962
- return this.graphManager.getAllEdges();
963
- }, s.prototype.getAllNodesToApplyGravitation = function() {
964
- return this.graphManager.getAllNodesToApplyGravitation();
965
- }, s.prototype.newGraphManager = function() {
966
- var n = new a(this);
967
- return this.graphManager = n, n;
968
- }, s.prototype.newGraph = function(n) {
969
- return new f(null, this.graphManager, n);
970
- }, s.prototype.newNode = function(n) {
971
- return new r(this.graphManager, n);
972
- }, s.prototype.newEdge = function(n) {
973
- return new i(null, null, n);
974
- }, s.prototype.checkLayoutSuccess = function() {
975
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
976
- }, s.prototype.runLayout = function() {
977
- this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
978
- var n;
979
- return this.checkLayoutSuccess() ? n = !1 : n = this.layout(), h.ANIMATE === "during" ? !1 : (n && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, n);
980
- }, s.prototype.doPostLayout = function() {
981
- this.incremental || this.transform(), this.update();
982
- }, s.prototype.update2 = function() {
983
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
984
- for (var n = this.graphManager.getAllEdges(), c = 0; c < n.length; c++)
985
- n[c];
986
- for (var l = this.graphManager.getRoot().getNodes(), c = 0; c < l.length; c++)
987
- l[c];
988
- this.update(this.graphManager.getRoot());
989
- }
990
- }, s.prototype.update = function(n) {
991
- if (n == null)
992
- this.update2();
993
- else if (n instanceof r) {
994
- var c = n;
995
- if (c.getChild() != null)
996
- for (var l = c.getChild().getNodes(), T = 0; T < l.length; T++)
997
- update(l[T]);
998
- if (c.vGraphObject != null) {
999
- var u = c.vGraphObject;
1000
- u.update(c);
1001
- }
1002
- } else if (n instanceof i) {
1003
- var d = n;
1004
- if (d.vGraphObject != null) {
1005
- var L = d.vGraphObject;
1006
- L.update(d);
1007
- }
1008
- } else if (n instanceof f) {
1009
- var b = n;
1010
- if (b.vGraphObject != null) {
1011
- var w = b.vGraphObject;
1012
- w.update(b);
1013
- }
1014
- }
1015
- }, s.prototype.initParameters = function() {
1016
- this.isSubLayout || (this.layoutQuality = h.QUALITY, this.animationDuringLayout = h.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = h.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = h.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = h.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = h.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = h.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1017
- }, s.prototype.transform = function(n) {
1018
- if (n == null)
1019
- this.transform(new e(0, 0));
1020
- else {
1021
- var c = new g(), l = this.graphManager.getRoot().updateLeftTop();
1022
- if (l != null) {
1023
- c.setWorldOrgX(n.x), c.setWorldOrgY(n.y), c.setDeviceOrgX(l.x), c.setDeviceOrgY(l.y);
1024
- for (var T = this.getAllNodes(), u, d = 0; d < T.length; d++)
1025
- u = T[d], u.transform(c);
1026
- }
1027
- }
1028
- }, s.prototype.positionNodesRandomly = function(n) {
1029
- if (n == null)
1030
- this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1031
- else
1032
- for (var c, l, T = n.getNodes(), u = 0; u < T.length; u++)
1033
- c = T[u], l = c.getChild(), l == null || l.getNodes().length == 0 ? c.scatter() : (this.positionNodesRandomly(l), c.updateBounds());
1034
- }, s.prototype.getFlatForest = function() {
1035
- for (var n = [], c = !0, l = this.graphManager.getRoot().getNodes(), T = !0, u = 0; u < l.length; u++)
1036
- l[u].getChild() != null && (T = !1);
1037
- if (!T)
1038
- return n;
1039
- var d = /* @__PURE__ */ new Set(), L = [], b = /* @__PURE__ */ new Map(), w = [];
1040
- for (w = w.concat(l); w.length > 0 && c; ) {
1041
- for (L.push(w[0]); L.length > 0 && c; ) {
1042
- var G = L[0];
1043
- L.splice(0, 1), d.add(G);
1044
- for (var B = G.getEdges(), u = 0; u < B.length; u++) {
1045
- var U = B[u].getOtherEnd(G);
1046
- if (b.get(G) != U)
1047
- if (!d.has(U))
1048
- L.push(U), b.set(U, G);
1049
- else {
1050
- c = !1;
1051
- break;
1052
- }
1053
- }
1054
- }
1055
- if (!c)
1056
- n = [];
1057
- else {
1058
- var V = [].concat(v(d));
1059
- n.push(V);
1060
- for (var u = 0; u < V.length; u++) {
1061
- var M = V[u], _ = w.indexOf(M);
1062
- _ > -1 && w.splice(_, 1);
1063
- }
1064
- d = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map();
1065
- }
1066
- }
1067
- return n;
1068
- }, s.prototype.createDummyNodesForBendpoints = function(n) {
1069
- for (var c = [], l = n.source, T = this.graphManager.calcLowestCommonAncestor(n.source, n.target), u = 0; u < n.bendpoints.length; u++) {
1070
- var d = this.newNode(null);
1071
- d.setRect(new Point(0, 0), new Dimension(1, 1)), T.add(d);
1072
- var L = this.newEdge(null);
1073
- this.graphManager.add(L, l, d), c.add(d), l = d;
1074
- }
1075
- var L = this.newEdge(null);
1076
- return this.graphManager.add(L, l, n.target), this.edgeToDummyNodes.set(n, c), n.isInterGraph() ? this.graphManager.remove(n) : T.remove(n), c;
1077
- }, s.prototype.createBendpointsFromDummyNodes = function() {
1078
- var n = [];
1079
- n = n.concat(this.graphManager.getAllEdges()), n = [].concat(v(this.edgeToDummyNodes.keys())).concat(n);
1080
- for (var c = 0; c < n.length; c++) {
1081
- var l = n[c];
1082
- if (l.bendpoints.length > 0) {
1083
- for (var T = this.edgeToDummyNodes.get(l), u = 0; u < T.length; u++) {
1084
- var d = T[u], L = new e(d.getCenterX(), d.getCenterY()), b = l.bendpoints.get(u);
1085
- b.x = L.x, b.y = L.y, d.getOwner().remove(d);
1086
- }
1087
- this.graphManager.add(l, l.source, l.target);
1088
- }
1089
- }
1090
- }, s.transform = function(n, c, l, T) {
1091
- if (l != null && T != null) {
1092
- var u = c;
1093
- if (n <= 50) {
1094
- var d = c / l;
1095
- u -= (c - d) / 50 * (50 - n);
1096
- } else {
1097
- var L = c * T;
1098
- u += (L - c) / 50 * (n - 50);
1099
- }
1100
- return u;
1101
- } else {
1102
- var b, w;
1103
- return n <= 50 ? (b = 9 * c / 500, w = c / 10) : (b = 9 * c / 50, w = -8 * c), b * n + w;
1104
- }
1105
- }, s.findCenterOfTree = function(n) {
1106
- var c = [];
1107
- c = c.concat(n);
1108
- var l = [], T = /* @__PURE__ */ new Map(), u = !1, d = null;
1109
- (c.length == 1 || c.length == 2) && (u = !0, d = c[0]);
1110
- for (var L = 0; L < c.length; L++) {
1111
- var b = c[L], w = b.getNeighborsList().size;
1112
- T.set(b, b.getNeighborsList().size), w == 1 && l.push(b);
1113
- }
1114
- var G = [];
1115
- for (G = G.concat(l); !u; ) {
1116
- var B = [];
1117
- B = B.concat(G), G = [];
1118
- for (var L = 0; L < c.length; L++) {
1119
- var b = c[L], U = c.indexOf(b);
1120
- U >= 0 && c.splice(U, 1);
1121
- var V = b.getNeighborsList();
1122
- V.forEach(function(o) {
1123
- if (l.indexOf(o) < 0) {
1124
- var E = T.get(o), p = E - 1;
1125
- p == 1 && G.push(o), T.set(o, p);
1126
- }
1127
- });
1128
- }
1129
- l = l.concat(G), (c.length == 1 || c.length == 2) && (u = !0, d = c[0]);
1130
- }
1131
- return d;
1132
- }, s.prototype.setGraphManager = function(n) {
1133
- this.graphManager = n;
1134
- }, C.exports = s;
1135
- },
1136
- /* 16 */
1137
- /***/
1138
- function(C, R, N) {
1139
- function v() {
1140
- }
1141
- v.seed = 1, v.x = 0, v.nextDouble = function() {
1142
- return v.x = Math.sin(v.seed++) * 1e4, v.x - Math.floor(v.x);
1143
- }, C.exports = v;
1144
- },
1145
- /* 17 */
1146
- /***/
1147
- function(C, R, N) {
1148
- var v = N(5);
1149
- function h(a, r) {
1150
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1151
- }
1152
- h.prototype.getWorldOrgX = function() {
1153
- return this.lworldOrgX;
1154
- }, h.prototype.setWorldOrgX = function(a) {
1155
- this.lworldOrgX = a;
1156
- }, h.prototype.getWorldOrgY = function() {
1157
- return this.lworldOrgY;
1158
- }, h.prototype.setWorldOrgY = function(a) {
1159
- this.lworldOrgY = a;
1160
- }, h.prototype.getWorldExtX = function() {
1161
- return this.lworldExtX;
1162
- }, h.prototype.setWorldExtX = function(a) {
1163
- this.lworldExtX = a;
1164
- }, h.prototype.getWorldExtY = function() {
1165
- return this.lworldExtY;
1166
- }, h.prototype.setWorldExtY = function(a) {
1167
- this.lworldExtY = a;
1168
- }, h.prototype.getDeviceOrgX = function() {
1169
- return this.ldeviceOrgX;
1170
- }, h.prototype.setDeviceOrgX = function(a) {
1171
- this.ldeviceOrgX = a;
1172
- }, h.prototype.getDeviceOrgY = function() {
1173
- return this.ldeviceOrgY;
1174
- }, h.prototype.setDeviceOrgY = function(a) {
1175
- this.ldeviceOrgY = a;
1176
- }, h.prototype.getDeviceExtX = function() {
1177
- return this.ldeviceExtX;
1178
- }, h.prototype.setDeviceExtX = function(a) {
1179
- this.ldeviceExtX = a;
1180
- }, h.prototype.getDeviceExtY = function() {
1181
- return this.ldeviceExtY;
1182
- }, h.prototype.setDeviceExtY = function(a) {
1183
- this.ldeviceExtY = a;
1184
- }, h.prototype.transformX = function(a) {
1185
- var r = 0, i = this.lworldExtX;
1186
- return i != 0 && (r = this.ldeviceOrgX + (a - this.lworldOrgX) * this.ldeviceExtX / i), r;
1187
- }, h.prototype.transformY = function(a) {
1188
- var r = 0, i = this.lworldExtY;
1189
- return i != 0 && (r = this.ldeviceOrgY + (a - this.lworldOrgY) * this.ldeviceExtY / i), r;
1190
- }, h.prototype.inverseTransformX = function(a) {
1191
- var r = 0, i = this.ldeviceExtX;
1192
- return i != 0 && (r = this.lworldOrgX + (a - this.ldeviceOrgX) * this.lworldExtX / i), r;
1193
- }, h.prototype.inverseTransformY = function(a) {
1194
- var r = 0, i = this.ldeviceExtY;
1195
- return i != 0 && (r = this.lworldOrgY + (a - this.ldeviceOrgY) * this.lworldExtY / i), r;
1196
- }, h.prototype.inverseTransformPoint = function(a) {
1197
- var r = new v(this.inverseTransformX(a.x), this.inverseTransformY(a.y));
1198
- return r;
1199
- }, C.exports = h;
1200
- },
1201
- /* 18 */
1202
- /***/
1203
- function(C, R, N) {
1204
- function v(t) {
1205
- if (Array.isArray(t)) {
1206
- for (var s = 0, n = Array(t.length); s < t.length; s++)
1207
- n[s] = t[s];
1208
- return n;
1209
- } else
1210
- return Array.from(t);
1211
- }
1212
- var h = N(15), a = N(4), r = N(0), i = N(8), f = N(9);
1213
- function e() {
1214
- h.call(this), this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = a.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = a.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = a.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = a.MAX_ITERATIONS;
1215
- }
1216
- e.prototype = Object.create(h.prototype);
1217
- for (var g in h)
1218
- e[g] = h[g];
1219
- e.prototype.initParameters = function() {
1220
- h.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1221
- }, e.prototype.calcIdealEdgeLengths = function() {
1222
- for (var t, s, n, c, l, T, u, d = this.getGraphManager().getAllEdges(), L = 0; L < d.length; L++)
1223
- t = d[L], s = t.idealLength, t.isInterGraph && (c = t.getSource(), l = t.getTarget(), T = t.getSourceInLca().getEstimatedSize(), u = t.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (t.idealLength += T + u - 2 * r.SIMPLE_NODE_SIZE), n = t.getLca().getInclusionTreeDepth(), t.idealLength += s * a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (c.getInclusionTreeDepth() + l.getInclusionTreeDepth() - 2 * n));
1224
- }, e.prototype.initSpringEmbedder = function() {
1225
- var t = this.getAllNodes().length;
1226
- this.incremental ? (t > a.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * a.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (t - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - a.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (t > a.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(a.COOLING_ADAPTATION_FACTOR, 1 - (t - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * (1 - a.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1227
- }, e.prototype.calcSpringForces = function() {
1228
- for (var t = this.getAllEdges(), s, n = 0; n < t.length; n++)
1229
- s = t[n], this.calcSpringForce(s, s.idealLength);
1230
- }, e.prototype.calcRepulsionForces = function() {
1231
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n, c, l, T, u = this.getAllNodes(), d;
1232
- if (this.useFRGridVariant)
1233
- for (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && t && this.updateGrid(), d = /* @__PURE__ */ new Set(), n = 0; n < u.length; n++)
1234
- l = u[n], this.calculateRepulsionForceOfANode(l, d, t, s), d.add(l);
1235
- else
1236
- for (n = 0; n < u.length; n++)
1237
- for (l = u[n], c = n + 1; c < u.length; c++)
1238
- T = u[c], l.getOwner() == T.getOwner() && this.calcRepulsionForce(l, T);
1239
- }, e.prototype.calcGravitationalForces = function() {
1240
- for (var t, s = this.getAllNodesToApplyGravitation(), n = 0; n < s.length; n++)
1241
- t = s[n], this.calcGravitationalForce(t);
1242
- }, e.prototype.moveNodes = function() {
1243
- for (var t = this.getAllNodes(), s, n = 0; n < t.length; n++)
1244
- s = t[n], s.move();
1245
- }, e.prototype.calcSpringForce = function(t, s) {
1246
- var n = t.getSource(), c = t.getTarget(), l, T, u, d;
1247
- if (this.uniformLeafNodeSizes && n.getChild() == null && c.getChild() == null)
1248
- t.updateLengthSimple();
1249
- else if (t.updateLength(), t.isOverlapingSourceAndTarget)
1250
- return;
1251
- l = t.getLength(), l != 0 && (T = t.edgeElasticity * (l - s), u = T * (t.lengthX / l), d = T * (t.lengthY / l), n.springForceX += u, n.springForceY += d, c.springForceX -= u, c.springForceY -= d);
1252
- }, e.prototype.calcRepulsionForce = function(t, s) {
1253
- var n = t.getRect(), c = s.getRect(), l = new Array(2), T = new Array(4), u, d, L, b, w, G, B;
1254
- if (n.intersects(c)) {
1255
- i.calcSeparationAmount(n, c, l, a.DEFAULT_EDGE_LENGTH / 2), G = 2 * l[0], B = 2 * l[1];
1256
- var U = t.noOfChildren * s.noOfChildren / (t.noOfChildren + s.noOfChildren);
1257
- t.repulsionForceX -= U * G, t.repulsionForceY -= U * B, s.repulsionForceX += U * G, s.repulsionForceY += U * B;
1258
- } else
1259
- this.uniformLeafNodeSizes && t.getChild() == null && s.getChild() == null ? (u = c.getCenterX() - n.getCenterX(), d = c.getCenterY() - n.getCenterY()) : (i.getIntersection(n, c, T), u = T[2] - T[0], d = T[3] - T[1]), Math.abs(u) < a.MIN_REPULSION_DIST && (u = f.sign(u) * a.MIN_REPULSION_DIST), Math.abs(d) < a.MIN_REPULSION_DIST && (d = f.sign(d) * a.MIN_REPULSION_DIST), L = u * u + d * d, b = Math.sqrt(L), w = (t.nodeRepulsion / 2 + s.nodeRepulsion / 2) * t.noOfChildren * s.noOfChildren / L, G = w * u / b, B = w * d / b, t.repulsionForceX -= G, t.repulsionForceY -= B, s.repulsionForceX += G, s.repulsionForceY += B;
1260
- }, e.prototype.calcGravitationalForce = function(t) {
1261
- var s, n, c, l, T, u, d, L;
1262
- s = t.getOwner(), n = (s.getRight() + s.getLeft()) / 2, c = (s.getTop() + s.getBottom()) / 2, l = t.getCenterX() - n, T = t.getCenterY() - c, u = Math.abs(l) + t.getWidth() / 2, d = Math.abs(T) + t.getHeight() / 2, t.getOwner() == this.graphManager.getRoot() ? (L = s.getEstimatedSize() * this.gravityRangeFactor, (u > L || d > L) && (t.gravitationForceX = -this.gravityConstant * l, t.gravitationForceY = -this.gravityConstant * T)) : (L = s.getEstimatedSize() * this.compoundGravityRangeFactor, (u > L || d > L) && (t.gravitationForceX = -this.gravityConstant * l * this.compoundGravityConstant, t.gravitationForceY = -this.gravityConstant * T * this.compoundGravityConstant));
1263
- }, e.prototype.isConverged = function() {
1264
- var t, s = !1;
1265
- return this.totalIterations > this.maxIterations / 3 && (s = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), t = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, t || s;
1266
- }, e.prototype.animate = function() {
1267
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1268
- }, e.prototype.calcNoOfChildrenForAllNodes = function() {
1269
- for (var t, s = this.graphManager.getAllNodes(), n = 0; n < s.length; n++)
1270
- t = s[n], t.noOfChildren = t.getNoOfChildren();
1271
- }, e.prototype.calcGrid = function(t) {
1272
- var s = 0, n = 0;
1273
- s = parseInt(Math.ceil((t.getRight() - t.getLeft()) / this.repulsionRange)), n = parseInt(Math.ceil((t.getBottom() - t.getTop()) / this.repulsionRange));
1274
- for (var c = new Array(s), l = 0; l < s; l++)
1275
- c[l] = new Array(n);
1276
- for (var l = 0; l < s; l++)
1277
- for (var T = 0; T < n; T++)
1278
- c[l][T] = new Array();
1279
- return c;
1280
- }, e.prototype.addNodeToGrid = function(t, s, n) {
1281
- var c = 0, l = 0, T = 0, u = 0;
1282
- c = parseInt(Math.floor((t.getRect().x - s) / this.repulsionRange)), l = parseInt(Math.floor((t.getRect().width + t.getRect().x - s) / this.repulsionRange)), T = parseInt(Math.floor((t.getRect().y - n) / this.repulsionRange)), u = parseInt(Math.floor((t.getRect().height + t.getRect().y - n) / this.repulsionRange));
1283
- for (var d = c; d <= l; d++)
1284
- for (var L = T; L <= u; L++)
1285
- this.grid[d][L].push(t), t.setGridCoordinates(c, l, T, u);
1286
- }, e.prototype.updateGrid = function() {
1287
- var t, s, n = this.getAllNodes();
1288
- for (this.grid = this.calcGrid(this.graphManager.getRoot()), t = 0; t < n.length; t++)
1289
- s = n[t], this.addNodeToGrid(s, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1290
- }, e.prototype.calculateRepulsionForceOfANode = function(t, s, n, c) {
1291
- if (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && n || c) {
1292
- var l = /* @__PURE__ */ new Set();
1293
- t.surrounding = new Array();
1294
- for (var T, u = this.grid, d = t.startX - 1; d < t.finishX + 2; d++)
1295
- for (var L = t.startY - 1; L < t.finishY + 2; L++)
1296
- if (!(d < 0 || L < 0 || d >= u.length || L >= u[0].length)) {
1297
- for (var b = 0; b < u[d][L].length; b++)
1298
- if (T = u[d][L][b], !(t.getOwner() != T.getOwner() || t == T) && !s.has(T) && !l.has(T)) {
1299
- var w = Math.abs(t.getCenterX() - T.getCenterX()) - (t.getWidth() / 2 + T.getWidth() / 2), G = Math.abs(t.getCenterY() - T.getCenterY()) - (t.getHeight() / 2 + T.getHeight() / 2);
1300
- w <= this.repulsionRange && G <= this.repulsionRange && l.add(T);
1301
- }
1302
- }
1303
- t.surrounding = [].concat(v(l));
1304
- }
1305
- for (d = 0; d < t.surrounding.length; d++)
1306
- this.calcRepulsionForce(t, t.surrounding[d]);
1307
- }, e.prototype.calcRepulsionRange = function() {
1308
- return 0;
1309
- }, C.exports = e;
1310
- },
1311
- /* 19 */
1312
- /***/
1313
- function(C, R, N) {
1314
- var v = N(1), h = N(4);
1315
- function a(i, f, e) {
1316
- v.call(this, i, f, e), this.idealLength = h.DEFAULT_EDGE_LENGTH, this.edgeElasticity = h.DEFAULT_SPRING_STRENGTH;
1317
- }
1318
- a.prototype = Object.create(v.prototype);
1319
- for (var r in v)
1320
- a[r] = v[r];
1321
- C.exports = a;
1322
- },
1323
- /* 20 */
1324
- /***/
1325
- function(C, R, N) {
1326
- var v = N(3), h = N(4);
1327
- function a(i, f, e, g) {
1328
- v.call(this, i, f, e, g), this.nodeRepulsion = h.DEFAULT_REPULSION_STRENGTH, this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0, this.startX = 0, this.finishX = 0, this.startY = 0, this.finishY = 0, this.surrounding = [];
1329
- }
1330
- a.prototype = Object.create(v.prototype);
1331
- for (var r in v)
1332
- a[r] = v[r];
1333
- a.prototype.setGridCoordinates = function(i, f, e, g) {
1334
- this.startX = i, this.finishX = f, this.startY = e, this.finishY = g;
1335
- }, C.exports = a;
1336
- },
1337
- /* 21 */
1338
- /***/
1339
- function(C, R, N) {
1340
- function v(h, a) {
1341
- this.width = 0, this.height = 0, h !== null && a !== null && (this.height = a, this.width = h);
1342
- }
1343
- v.prototype.getWidth = function() {
1344
- return this.width;
1345
- }, v.prototype.setWidth = function(h) {
1346
- this.width = h;
1347
- }, v.prototype.getHeight = function() {
1348
- return this.height;
1349
- }, v.prototype.setHeight = function(h) {
1350
- this.height = h;
1351
- }, C.exports = v;
1352
- },
1353
- /* 22 */
1354
- /***/
1355
- function(C, R, N) {
1356
- var v = N(14);
1357
- function h() {
1358
- this.map = {}, this.keys = [];
1359
- }
1360
- h.prototype.put = function(a, r) {
1361
- var i = v.createID(a);
1362
- this.contains(i) || (this.map[i] = r, this.keys.push(a));
1363
- }, h.prototype.contains = function(a) {
1364
- return v.createID(a), this.map[a] != null;
1365
- }, h.prototype.get = function(a) {
1366
- var r = v.createID(a);
1367
- return this.map[r];
1368
- }, h.prototype.keySet = function() {
1369
- return this.keys;
1370
- }, C.exports = h;
1371
- },
1372
- /* 23 */
1373
- /***/
1374
- function(C, R, N) {
1375
- var v = N(14);
1376
- function h() {
1377
- this.set = {};
1378
- }
1379
- h.prototype.add = function(a) {
1380
- var r = v.createID(a);
1381
- this.contains(r) || (this.set[r] = a);
1382
- }, h.prototype.remove = function(a) {
1383
- delete this.set[v.createID(a)];
1384
- }, h.prototype.clear = function() {
1385
- this.set = {};
1386
- }, h.prototype.contains = function(a) {
1387
- return this.set[v.createID(a)] == a;
1388
- }, h.prototype.isEmpty = function() {
1389
- return this.size() === 0;
1390
- }, h.prototype.size = function() {
1391
- return Object.keys(this.set).length;
1392
- }, h.prototype.addAllTo = function(a) {
1393
- for (var r = Object.keys(this.set), i = r.length, f = 0; f < i; f++)
1394
- a.push(this.set[r[f]]);
1395
- }, h.prototype.size = function() {
1396
- return Object.keys(this.set).length;
1397
- }, h.prototype.addAll = function(a) {
1398
- for (var r = a.length, i = 0; i < r; i++) {
1399
- var f = a[i];
1400
- this.add(f);
1401
- }
1402
- }, C.exports = h;
1403
- },
1404
- /* 24 */
1405
- /***/
1406
- function(C, R, N) {
1407
- function v() {
1408
- }
1409
- v.multMat = function(h, a) {
1410
- for (var r = [], i = 0; i < h.length; i++) {
1411
- r[i] = [];
1412
- for (var f = 0; f < a[0].length; f++) {
1413
- r[i][f] = 0;
1414
- for (var e = 0; e < h[0].length; e++)
1415
- r[i][f] += h[i][e] * a[e][f];
1416
- }
1417
- }
1418
- return r;
1419
- }, v.transpose = function(h) {
1420
- for (var a = [], r = 0; r < h[0].length; r++) {
1421
- a[r] = [];
1422
- for (var i = 0; i < h.length; i++)
1423
- a[r][i] = h[i][r];
1424
- }
1425
- return a;
1426
- }, v.multCons = function(h, a) {
1427
- for (var r = [], i = 0; i < h.length; i++)
1428
- r[i] = h[i] * a;
1429
- return r;
1430
- }, v.minusOp = function(h, a) {
1431
- for (var r = [], i = 0; i < h.length; i++)
1432
- r[i] = h[i] - a[i];
1433
- return r;
1434
- }, v.dotProduct = function(h, a) {
1435
- for (var r = 0, i = 0; i < h.length; i++)
1436
- r += h[i] * a[i];
1437
- return r;
1438
- }, v.mag = function(h) {
1439
- return Math.sqrt(this.dotProduct(h, h));
1440
- }, v.normalize = function(h) {
1441
- for (var a = [], r = this.mag(h), i = 0; i < h.length; i++)
1442
- a[i] = h[i] / r;
1443
- return a;
1444
- }, v.multGamma = function(h) {
1445
- for (var a = [], r = 0, i = 0; i < h.length; i++)
1446
- r += h[i];
1447
- r *= -1 / h.length;
1448
- for (var f = 0; f < h.length; f++)
1449
- a[f] = r + h[f];
1450
- return a;
1451
- }, v.multL = function(h, a, r) {
1452
- for (var i = [], f = [], e = [], g = 0; g < a[0].length; g++) {
1453
- for (var t = 0, s = 0; s < a.length; s++)
1454
- t += -0.5 * a[s][g] * h[s];
1455
- f[g] = t;
1456
- }
1457
- for (var n = 0; n < r.length; n++) {
1458
- for (var c = 0, l = 0; l < r.length; l++)
1459
- c += r[n][l] * f[l];
1460
- e[n] = c;
1461
- }
1462
- for (var T = 0; T < a.length; T++) {
1463
- for (var u = 0, d = 0; d < a[0].length; d++)
1464
- u += a[T][d] * e[d];
1465
- i[T] = u;
1466
- }
1467
- return i;
1468
- }, C.exports = v;
1469
- },
1470
- /* 25 */
1471
- /***/
1472
- function(C, R, N) {
1473
- var v = /* @__PURE__ */ function() {
1474
- function i(f, e) {
1475
- for (var g = 0; g < e.length; g++) {
1476
- var t = e[g];
1477
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(f, t.key, t);
1478
- }
1479
- }
1480
- return function(f, e, g) {
1481
- return e && i(f.prototype, e), g && i(f, g), f;
1482
- };
1483
- }();
1484
- function h(i, f) {
1485
- if (!(i instanceof f))
1486
- throw new TypeError("Cannot call a class as a function");
1487
- }
1488
- var a = N(11), r = function() {
1489
- function i(f, e) {
1490
- h(this, i), (e !== null || e !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1491
- var g = void 0;
1492
- f instanceof a ? g = f.size() : g = f.length, this._quicksort(f, 0, g - 1);
1493
- }
1494
- return v(i, [{
1495
- key: "_quicksort",
1496
- value: function(e, g, t) {
1497
- if (g < t) {
1498
- var s = this._partition(e, g, t);
1499
- this._quicksort(e, g, s), this._quicksort(e, s + 1, t);
1500
- }
1501
- }
1502
- }, {
1503
- key: "_partition",
1504
- value: function(e, g, t) {
1505
- for (var s = this._get(e, g), n = g, c = t; ; ) {
1506
- for (; this.compareFunction(s, this._get(e, c)); )
1507
- c--;
1508
- for (; this.compareFunction(this._get(e, n), s); )
1509
- n++;
1510
- if (n < c)
1511
- this._swap(e, n, c), n++, c--;
1512
- else return c;
1513
- }
1514
- }
1515
- }, {
1516
- key: "_get",
1517
- value: function(e, g) {
1518
- return e instanceof a ? e.get_object_at(g) : e[g];
1519
- }
1520
- }, {
1521
- key: "_set",
1522
- value: function(e, g, t) {
1523
- e instanceof a ? e.set_object_at(g, t) : e[g] = t;
1524
- }
1525
- }, {
1526
- key: "_swap",
1527
- value: function(e, g, t) {
1528
- var s = this._get(e, g);
1529
- this._set(e, g, this._get(e, t)), this._set(e, t, s);
1530
- }
1531
- }, {
1532
- key: "_defaultCompareFunction",
1533
- value: function(e, g) {
1534
- return g > e;
1535
- }
1536
- }]), i;
1537
- }();
1538
- C.exports = r;
1539
- },
1540
- /* 26 */
1541
- /***/
1542
- function(C, R, N) {
1543
- function v() {
1544
- }
1545
- v.svd = function(h) {
1546
- this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = h.length, this.n = h[0].length;
1547
- var a = Math.min(this.m, this.n);
1548
- this.s = function(Tt) {
1549
- for (var Ct = []; Tt-- > 0; )
1550
- Ct.push(0);
1551
- return Ct;
1552
- }(Math.min(this.m + 1, this.n)), this.U = function(Tt) {
1553
- var Ct = function Bt(bt) {
1554
- if (bt.length == 0)
1555
- return 0;
1556
- for (var zt = [], St = 0; St < bt[0]; St++)
1557
- zt.push(Bt(bt.slice(1)));
1558
- return zt;
1559
- };
1560
- return Ct(Tt);
1561
- }([this.m, a]), this.V = function(Tt) {
1562
- var Ct = function Bt(bt) {
1563
- if (bt.length == 0)
1564
- return 0;
1565
- for (var zt = [], St = 0; St < bt[0]; St++)
1566
- zt.push(Bt(bt.slice(1)));
1567
- return zt;
1568
- };
1569
- return Ct(Tt);
1570
- }([this.n, this.n]);
1571
- for (var r = function(Tt) {
1572
- for (var Ct = []; Tt-- > 0; )
1573
- Ct.push(0);
1574
- return Ct;
1575
- }(this.n), i = function(Tt) {
1576
- for (var Ct = []; Tt-- > 0; )
1577
- Ct.push(0);
1578
- return Ct;
1579
- }(this.m), f = !0, e = Math.min(this.m - 1, this.n), g = Math.max(0, Math.min(this.n - 2, this.m)), t = 0; t < Math.max(e, g); t++) {
1580
- if (t < e) {
1581
- this.s[t] = 0;
1582
- for (var s = t; s < this.m; s++)
1583
- this.s[t] = v.hypot(this.s[t], h[s][t]);
1584
- if (this.s[t] !== 0) {
1585
- h[t][t] < 0 && (this.s[t] = -this.s[t]);
1586
- for (var n = t; n < this.m; n++)
1587
- h[n][t] /= this.s[t];
1588
- h[t][t] += 1;
1589
- }
1590
- this.s[t] = -this.s[t];
1591
- }
1592
- for (var c = t + 1; c < this.n; c++) {
1593
- if (/* @__PURE__ */ function(Tt, Ct) {
1594
- return Tt && Ct;
1595
- }(t < e, this.s[t] !== 0)) {
1596
- for (var l = 0, T = t; T < this.m; T++)
1597
- l += h[T][t] * h[T][c];
1598
- l = -l / h[t][t];
1599
- for (var u = t; u < this.m; u++)
1600
- h[u][c] += l * h[u][t];
1601
- }
1602
- r[c] = h[t][c];
1603
- }
1604
- if (/* @__PURE__ */ function(Tt, Ct) {
1605
- return Ct;
1606
- }(f, t < e))
1607
- for (var d = t; d < this.m; d++)
1608
- this.U[d][t] = h[d][t];
1609
- if (t < g) {
1610
- r[t] = 0;
1611
- for (var L = t + 1; L < this.n; L++)
1612
- r[t] = v.hypot(r[t], r[L]);
1613
- if (r[t] !== 0) {
1614
- r[t + 1] < 0 && (r[t] = -r[t]);
1615
- for (var b = t + 1; b < this.n; b++)
1616
- r[b] /= r[t];
1617
- r[t + 1] += 1;
1618
- }
1619
- if (r[t] = -r[t], /* @__PURE__ */ function(Tt, Ct) {
1620
- return Tt && Ct;
1621
- }(t + 1 < this.m, r[t] !== 0)) {
1622
- for (var w = t + 1; w < this.m; w++)
1623
- i[w] = 0;
1624
- for (var G = t + 1; G < this.n; G++)
1625
- for (var B = t + 1; B < this.m; B++)
1626
- i[B] += r[G] * h[B][G];
1627
- for (var U = t + 1; U < this.n; U++)
1628
- for (var V = -r[U] / r[t + 1], M = t + 1; M < this.m; M++)
1629
- h[M][U] += V * i[M];
1630
- }
1631
- for (var _ = t + 1; _ < this.n; _++)
1632
- this.V[_][t] = r[_];
1633
- }
1634
- }
1635
- var o = Math.min(this.n, this.m + 1);
1636
- e < this.n && (this.s[e] = h[e][e]), this.m < o && (this.s[o - 1] = 0), g + 1 < o && (r[g] = h[g][o - 1]), r[o - 1] = 0;
1637
- {
1638
- for (var E = e; E < a; E++) {
1639
- for (var p = 0; p < this.m; p++)
1640
- this.U[p][E] = 0;
1641
- this.U[E][E] = 1;
1642
- }
1643
- for (var m = e - 1; m >= 0; m--)
1644
- if (this.s[m] !== 0) {
1645
- for (var y = m + 1; y < a; y++) {
1646
- for (var S = 0, O = m; O < this.m; O++)
1647
- S += this.U[O][m] * this.U[O][y];
1648
- S = -S / this.U[m][m];
1649
- for (var F = m; F < this.m; F++)
1650
- this.U[F][y] += S * this.U[F][m];
1651
- }
1652
- for (var W = m; W < this.m; W++)
1653
- this.U[W][m] = -this.U[W][m];
1654
- this.U[m][m] = 1 + this.U[m][m];
1655
- for (var I = 0; I < m - 1; I++)
1656
- this.U[I][m] = 0;
1657
- } else {
1658
- for (var Q = 0; Q < this.m; Q++)
1659
- this.U[Q][m] = 0;
1660
- this.U[m][m] = 1;
1661
- }
1662
- }
1663
- for (var z = this.n - 1; z >= 0; z--) {
1664
- if (/* @__PURE__ */ function(Tt, Ct) {
1665
- return Tt && Ct;
1666
- }(z < g, r[z] !== 0))
1667
- for (var X = z + 1; X < a; X++) {
1668
- for (var rt = 0, $ = z + 1; $ < this.n; $++)
1669
- rt += this.V[$][z] * this.V[$][X];
1670
- rt = -rt / this.V[z + 1][z];
1671
- for (var D = z + 1; D < this.n; D++)
1672
- this.V[D][X] += rt * this.V[D][z];
1673
- }
1674
- for (var H = 0; H < this.n; H++)
1675
- this.V[H][z] = 0;
1676
- this.V[z][z] = 1;
1677
- }
1678
- for (var k = o - 1, tt = Math.pow(2, -52), ht = Math.pow(2, -966); o > 0; ) {
1679
- var J = void 0, It = void 0;
1680
- for (J = o - 2; J >= -1 && J !== -1; J--)
1681
- if (Math.abs(r[J]) <= ht + tt * (Math.abs(this.s[J]) + Math.abs(this.s[J + 1]))) {
1682
- r[J] = 0;
1683
- break;
1684
- }
1685
- if (J === o - 2)
1686
- It = 4;
1687
- else {
1688
- var Nt = void 0;
1689
- for (Nt = o - 1; Nt >= J && Nt !== J; Nt--) {
1690
- var vt = (Nt !== o ? Math.abs(r[Nt]) : 0) + (Nt !== J + 1 ? Math.abs(r[Nt - 1]) : 0);
1691
- if (Math.abs(this.s[Nt]) <= ht + tt * vt) {
1692
- this.s[Nt] = 0;
1693
- break;
1694
- }
1695
- }
1696
- Nt === J ? It = 3 : Nt === o - 1 ? It = 1 : (It = 2, J = Nt);
1697
- }
1698
- switch (J++, It) {
1699
- case 1:
1700
- {
1701
- var it = r[o - 2];
1702
- r[o - 2] = 0;
1703
- for (var ut = o - 2; ut >= J; ut--) {
1704
- var Et = v.hypot(this.s[ut], it), wt = this.s[ut] / Et, Ot = it / Et;
1705
- this.s[ut] = Et, ut !== J && (it = -Ot * r[ut - 1], r[ut - 1] = wt * r[ut - 1]);
1706
- for (var mt = 0; mt < this.n; mt++)
1707
- Et = wt * this.V[mt][ut] + Ot * this.V[mt][o - 1], this.V[mt][o - 1] = -Ot * this.V[mt][ut] + wt * this.V[mt][o - 1], this.V[mt][ut] = Et;
1708
- }
1709
- }
1710
- break;
1711
- case 2:
1712
- {
1713
- var Dt = r[J - 1];
1714
- r[J - 1] = 0;
1715
- for (var Rt = J; Rt < o; Rt++) {
1716
- var Ht = v.hypot(this.s[Rt], Dt), Ut = this.s[Rt] / Ht, Pt = Dt / Ht;
1717
- this.s[Rt] = Ht, Dt = -Pt * r[Rt], r[Rt] = Ut * r[Rt];
1718
- for (var Ft = 0; Ft < this.m; Ft++)
1719
- Ht = Ut * this.U[Ft][Rt] + Pt * this.U[Ft][J - 1], this.U[Ft][J - 1] = -Pt * this.U[Ft][Rt] + Ut * this.U[Ft][J - 1], this.U[Ft][Rt] = Ht;
1720
- }
1721
- }
1722
- break;
1723
- case 3:
1724
- {
1725
- var Yt = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[o - 1]), Math.abs(this.s[o - 2])), Math.abs(r[o - 2])), Math.abs(this.s[J])), Math.abs(r[J])), Vt = this.s[o - 1] / Yt, P = this.s[o - 2] / Yt, Y = r[o - 2] / Yt, Z = this.s[J] / Yt, K = r[J] / Yt, q = ((P + Vt) * (P - Vt) + Y * Y) / 2, at = Vt * Y * (Vt * Y), ct = 0;
1726
- /* @__PURE__ */ (function(Tt, Ct) {
1727
- return Tt || Ct;
1728
- })(q !== 0, at !== 0) && (ct = Math.sqrt(q * q + at), q < 0 && (ct = -ct), ct = at / (q + ct));
1729
- for (var nt = (Z + Vt) * (Z - Vt) + ct, et = Z * K, j = J; j < o - 1; j++) {
1730
- var dt = v.hypot(nt, et), At = nt / dt, pt = et / dt;
1731
- j !== J && (r[j - 1] = dt), nt = At * this.s[j] + pt * r[j], r[j] = At * r[j] - pt * this.s[j], et = pt * this.s[j + 1], this.s[j + 1] = At * this.s[j + 1];
1732
- for (var xt = 0; xt < this.n; xt++)
1733
- dt = At * this.V[xt][j] + pt * this.V[xt][j + 1], this.V[xt][j + 1] = -pt * this.V[xt][j] + At * this.V[xt][j + 1], this.V[xt][j] = dt;
1734
- if (dt = v.hypot(nt, et), At = nt / dt, pt = et / dt, this.s[j] = dt, nt = At * r[j] + pt * this.s[j + 1], this.s[j + 1] = -pt * r[j] + At * this.s[j + 1], et = pt * r[j + 1], r[j + 1] = At * r[j + 1], j < this.m - 1)
1735
- for (var lt = 0; lt < this.m; lt++)
1736
- dt = At * this.U[lt][j] + pt * this.U[lt][j + 1], this.U[lt][j + 1] = -pt * this.U[lt][j] + At * this.U[lt][j + 1], this.U[lt][j] = dt;
1737
- }
1738
- r[o - 2] = nt;
1739
- }
1740
- break;
1741
- case 4:
1742
- {
1743
- if (this.s[J] <= 0) {
1744
- this.s[J] = this.s[J] < 0 ? -this.s[J] : 0;
1745
- for (var ot = 0; ot <= k; ot++)
1746
- this.V[ot][J] = -this.V[ot][J];
1747
- }
1748
- for (; J < k && !(this.s[J] >= this.s[J + 1]); ) {
1749
- var Lt = this.s[J];
1750
- if (this.s[J] = this.s[J + 1], this.s[J + 1] = Lt, J < this.n - 1)
1751
- for (var ft = 0; ft < this.n; ft++)
1752
- Lt = this.V[ft][J + 1], this.V[ft][J + 1] = this.V[ft][J], this.V[ft][J] = Lt;
1753
- if (J < this.m - 1)
1754
- for (var st = 0; st < this.m; st++)
1755
- Lt = this.U[st][J + 1], this.U[st][J + 1] = this.U[st][J], this.U[st][J] = Lt;
1756
- J++;
1757
- }
1758
- o--;
1759
- }
1760
- break;
1761
- }
1762
- }
1763
- var Xt = { U: this.U, V: this.V, S: this.s };
1764
- return Xt;
1765
- }, v.hypot = function(h, a) {
1766
- var r = void 0;
1767
- return Math.abs(h) > Math.abs(a) ? (r = a / h, r = Math.abs(h) * Math.sqrt(1 + r * r)) : a != 0 ? (r = h / a, r = Math.abs(a) * Math.sqrt(1 + r * r)) : r = 0, r;
1768
- }, C.exports = v;
1769
- },
1770
- /* 27 */
1771
- /***/
1772
- function(C, R, N) {
1773
- var v = /* @__PURE__ */ function() {
1774
- function r(i, f) {
1775
- for (var e = 0; e < f.length; e++) {
1776
- var g = f[e];
1777
- g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(i, g.key, g);
1778
- }
1779
- }
1780
- return function(i, f, e) {
1781
- return f && r(i.prototype, f), e && r(i, e), i;
1782
- };
1783
- }();
1784
- function h(r, i) {
1785
- if (!(r instanceof i))
1786
- throw new TypeError("Cannot call a class as a function");
1787
- }
1788
- var a = function() {
1789
- function r(i, f) {
1790
- var e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, g = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, t = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1791
- h(this, r), this.sequence1 = i, this.sequence2 = f, this.match_score = e, this.mismatch_penalty = g, this.gap_penalty = t, this.iMax = i.length + 1, this.jMax = f.length + 1, this.grid = new Array(this.iMax);
1792
- for (var s = 0; s < this.iMax; s++) {
1793
- this.grid[s] = new Array(this.jMax);
1794
- for (var n = 0; n < this.jMax; n++)
1795
- this.grid[s][n] = 0;
1796
- }
1797
- this.tracebackGrid = new Array(this.iMax);
1798
- for (var c = 0; c < this.iMax; c++) {
1799
- this.tracebackGrid[c] = new Array(this.jMax);
1800
- for (var l = 0; l < this.jMax; l++)
1801
- this.tracebackGrid[c][l] = [null, null, null];
1802
- }
1803
- this.alignments = [], this.score = -1, this.computeGrids();
1804
- }
1805
- return v(r, [{
1806
- key: "getScore",
1807
- value: function() {
1808
- return this.score;
1809
- }
1810
- }, {
1811
- key: "getAlignments",
1812
- value: function() {
1813
- return this.alignments;
1814
- }
1815
- // Main dynamic programming procedure
1816
- }, {
1817
- key: "computeGrids",
1818
- value: function() {
1819
- for (var f = 1; f < this.jMax; f++)
1820
- this.grid[0][f] = this.grid[0][f - 1] + this.gap_penalty, this.tracebackGrid[0][f] = [!1, !1, !0];
1821
- for (var e = 1; e < this.iMax; e++)
1822
- this.grid[e][0] = this.grid[e - 1][0] + this.gap_penalty, this.tracebackGrid[e][0] = [!1, !0, !1];
1823
- for (var g = 1; g < this.iMax; g++)
1824
- for (var t = 1; t < this.jMax; t++) {
1825
- var s = void 0;
1826
- this.sequence1[g - 1] === this.sequence2[t - 1] ? s = this.grid[g - 1][t - 1] + this.match_score : s = this.grid[g - 1][t - 1] + this.mismatch_penalty;
1827
- var n = this.grid[g - 1][t] + this.gap_penalty, c = this.grid[g][t - 1] + this.gap_penalty, l = [s, n, c], T = this.arrayAllMaxIndexes(l);
1828
- this.grid[g][t] = l[T[0]], this.tracebackGrid[g][t] = [T.includes(0), T.includes(1), T.includes(2)];
1829
- }
1830
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1831
- }
1832
- // Gets all possible valid sequence combinations
1833
- }, {
1834
- key: "alignmentTraceback",
1835
- value: function() {
1836
- var f = [];
1837
- for (f.push({
1838
- pos: [this.sequence1.length, this.sequence2.length],
1839
- seq1: "",
1840
- seq2: ""
1841
- }); f[0]; ) {
1842
- var e = f[0], g = this.tracebackGrid[e.pos[0]][e.pos[1]];
1843
- g[0] && f.push({
1844
- pos: [e.pos[0] - 1, e.pos[1] - 1],
1845
- seq1: this.sequence1[e.pos[0] - 1] + e.seq1,
1846
- seq2: this.sequence2[e.pos[1] - 1] + e.seq2
1847
- }), g[1] && f.push({
1848
- pos: [e.pos[0] - 1, e.pos[1]],
1849
- seq1: this.sequence1[e.pos[0] - 1] + e.seq1,
1850
- seq2: "-" + e.seq2
1851
- }), g[2] && f.push({
1852
- pos: [e.pos[0], e.pos[1] - 1],
1853
- seq1: "-" + e.seq1,
1854
- seq2: this.sequence2[e.pos[1] - 1] + e.seq2
1855
- }), e.pos[0] === 0 && e.pos[1] === 0 && this.alignments.push({
1856
- sequence1: e.seq1,
1857
- sequence2: e.seq2
1858
- }), f.shift();
1859
- }
1860
- return this.alignments;
1861
- }
1862
- // Helper Functions
1863
- }, {
1864
- key: "getAllIndexes",
1865
- value: function(f, e) {
1866
- for (var g = [], t = -1; (t = f.indexOf(e, t + 1)) !== -1; )
1867
- g.push(t);
1868
- return g;
1869
- }
1870
- }, {
1871
- key: "arrayAllMaxIndexes",
1872
- value: function(f) {
1873
- return this.getAllIndexes(f, Math.max.apply(null, f));
1874
- }
1875
- }]), r;
1876
- }();
1877
- C.exports = a;
1878
- },
1879
- /* 28 */
1880
- /***/
1881
- function(C, R, N) {
1882
- var v = function() {
1883
- };
1884
- v.FDLayout = N(18), v.FDLayoutConstants = N(4), v.FDLayoutEdge = N(19), v.FDLayoutNode = N(20), v.DimensionD = N(21), v.HashMap = N(22), v.HashSet = N(23), v.IGeometry = N(8), v.IMath = N(9), v.Integer = N(10), v.Point = N(12), v.PointD = N(5), v.RandomSeed = N(16), v.RectangleD = N(13), v.Transform = N(17), v.UniqueIDGeneretor = N(14), v.Quicksort = N(25), v.LinkedList = N(11), v.LGraphObject = N(2), v.LGraph = N(6), v.LEdge = N(1), v.LGraphManager = N(7), v.LNode = N(3), v.Layout = N(15), v.LayoutConstants = N(0), v.NeedlemanWunsch = N(27), v.Matrix = N(24), v.SVD = N(26), C.exports = v;
1885
- },
1886
- /* 29 */
1887
- /***/
1888
- function(C, R, N) {
1889
- function v() {
1890
- this.listeners = [];
1891
- }
1892
- var h = v.prototype;
1893
- h.addListener = function(a, r) {
1894
- this.listeners.push({
1895
- event: a,
1896
- callback: r
1897
- });
1898
- }, h.removeListener = function(a, r) {
1899
- for (var i = this.listeners.length; i >= 0; i--) {
1900
- var f = this.listeners[i];
1901
- f.event === a && f.callback === r && this.listeners.splice(i, 1);
1902
- }
1903
- }, h.emit = function(a, r) {
1904
- for (var i = 0; i < this.listeners.length; i++) {
1905
- var f = this.listeners[i];
1906
- a === f.event && f.callback(r);
1907
- }
1908
- }, C.exports = v;
1909
- }
1910
- /******/
1911
- ])
1912
- );
1913
- });
1914
- }(fe)), fe.exports;
1915
- }
1916
- var vr = le.exports, De;
1917
- function pr() {
1918
- return De || (De = 1, function(x, A) {
1919
- (function(R, N) {
1920
- x.exports = N(dr());
1921
- })(vr, function(C) {
1922
- return (
1923
- /******/
1924
- (() => {
1925
- var R = {
1926
- /***/
1927
- 45: (
1928
- /***/
1929
- (a, r, i) => {
1930
- var f = {};
1931
- f.layoutBase = i(551), f.CoSEConstants = i(806), f.CoSEEdge = i(767), f.CoSEGraph = i(880), f.CoSEGraphManager = i(578), f.CoSELayout = i(765), f.CoSENode = i(991), f.ConstraintHandler = i(902), a.exports = f;
1932
- }
1933
- ),
1934
- /***/
1935
- 806: (
1936
- /***/
1937
- (a, r, i) => {
1938
- var f = i(551).FDLayoutConstants;
1939
- function e() {
1940
- }
1941
- for (var g in f)
1942
- e[g] = f[g];
1943
- e.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, e.DEFAULT_RADIAL_SEPARATION = f.DEFAULT_EDGE_LENGTH, e.DEFAULT_COMPONENT_SEPERATION = 60, e.TILE = !0, e.TILING_PADDING_VERTICAL = 10, e.TILING_PADDING_HORIZONTAL = 10, e.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, e.ENFORCE_CONSTRAINTS = !0, e.APPLY_LAYOUT = !0, e.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, e.TREE_REDUCTION_ON_INCREMENTAL = !0, e.PURE_INCREMENTAL = e.DEFAULT_INCREMENTAL, a.exports = e;
1944
- }
1945
- ),
1946
- /***/
1947
- 767: (
1948
- /***/
1949
- (a, r, i) => {
1950
- var f = i(551).FDLayoutEdge;
1951
- function e(t, s, n) {
1952
- f.call(this, t, s, n);
1953
- }
1954
- e.prototype = Object.create(f.prototype);
1955
- for (var g in f)
1956
- e[g] = f[g];
1957
- a.exports = e;
1958
- }
1959
- ),
1960
- /***/
1961
- 880: (
1962
- /***/
1963
- (a, r, i) => {
1964
- var f = i(551).LGraph;
1965
- function e(t, s, n) {
1966
- f.call(this, t, s, n);
1967
- }
1968
- e.prototype = Object.create(f.prototype);
1969
- for (var g in f)
1970
- e[g] = f[g];
1971
- a.exports = e;
1972
- }
1973
- ),
1974
- /***/
1975
- 578: (
1976
- /***/
1977
- (a, r, i) => {
1978
- var f = i(551).LGraphManager;
1979
- function e(t) {
1980
- f.call(this, t);
1981
- }
1982
- e.prototype = Object.create(f.prototype);
1983
- for (var g in f)
1984
- e[g] = f[g];
1985
- a.exports = e;
1986
- }
1987
- ),
1988
- /***/
1989
- 765: (
1990
- /***/
1991
- (a, r, i) => {
1992
- var f = i(551).FDLayout, e = i(578), g = i(880), t = i(991), s = i(767), n = i(806), c = i(902), l = i(551).FDLayoutConstants, T = i(551).LayoutConstants, u = i(551).Point, d = i(551).PointD, L = i(551).DimensionD, b = i(551).Layout, w = i(551).Integer, G = i(551).IGeometry, B = i(551).LGraph, U = i(551).Transform, V = i(551).LinkedList;
1993
- function M() {
1994
- f.call(this), this.toBeTiled = {}, this.constraints = {};
1995
- }
1996
- M.prototype = Object.create(f.prototype);
1997
- for (var _ in f)
1998
- M[_] = f[_];
1999
- M.prototype.newGraphManager = function() {
2000
- var o = new e(this);
2001
- return this.graphManager = o, o;
2002
- }, M.prototype.newGraph = function(o) {
2003
- return new g(null, this.graphManager, o);
2004
- }, M.prototype.newNode = function(o) {
2005
- return new t(this.graphManager, o);
2006
- }, M.prototype.newEdge = function(o) {
2007
- return new s(null, null, o);
2008
- }, M.prototype.initParameters = function() {
2009
- f.prototype.initParameters.call(this, arguments), this.isSubLayout || (n.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = n.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = l.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = l.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
2010
- }, M.prototype.initSpringEmbedder = function() {
2011
- f.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
2012
- }, M.prototype.layout = function() {
2013
- var o = T.DEFAULT_CREATE_BENDS_AS_NEEDED;
2014
- return o && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
2015
- }, M.prototype.classicLayout = function() {
2016
- if (this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(), this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), this.calcNoOfChildrenForAllNodes(), this.graphManager.calcLowestCommonAncestors(), this.graphManager.calcInclusionTreeDepths(), this.graphManager.getRoot().calcEstimatedSize(), this.calcIdealEdgeLengths(), this.incremental) {
2017
- if (n.TREE_REDUCTION_ON_INCREMENTAL) {
2018
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2019
- var E = new Set(this.getAllNodes()), p = this.nodesWithGravity.filter(function(S) {
2020
- return E.has(S);
2021
- });
2022
- this.graphManager.setAllNodesToApplyGravitation(p);
2023
- }
2024
- } else {
2025
- var o = this.getFlatForest();
2026
- if (o.length > 0)
2027
- this.positionNodesRadially(o);
2028
- else {
2029
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2030
- var E = new Set(this.getAllNodes()), p = this.nodesWithGravity.filter(function(m) {
2031
- return E.has(m);
2032
- });
2033
- this.graphManager.setAllNodesToApplyGravitation(p), this.positionNodesRandomly();
2034
- }
2035
- }
2036
- return Object.keys(this.constraints).length > 0 && (c.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), n.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
2037
- }, M.prototype.tick = function() {
2038
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
2039
- if (this.prunedNodesAll.length > 0)
2040
- this.isTreeGrowing = !0;
2041
- else
2042
- return !0;
2043
- if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
2044
- if (this.isConverged())
2045
- if (this.prunedNodesAll.length > 0)
2046
- this.isTreeGrowing = !0;
2047
- else
2048
- return !0;
2049
- this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
2050
- }
2051
- if (this.isTreeGrowing) {
2052
- if (this.growTreeIterations % 10 == 0)
2053
- if (this.prunedNodesAll.length > 0) {
2054
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
2055
- var o = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(y) {
2056
- return o.has(y);
2057
- });
2058
- this.graphManager.setAllNodesToApplyGravitation(E), this.graphManager.updateBounds(), this.updateGrid(), n.PURE_INCREMENTAL ? this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
2059
- } else
2060
- this.isTreeGrowing = !1, this.isGrowthFinished = !0;
2061
- this.growTreeIterations++;
2062
- }
2063
- if (this.isGrowthFinished) {
2064
- if (this.isConverged())
2065
- return !0;
2066
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), n.PURE_INCREMENTAL ? this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
2067
- }
2068
- var p = !this.isTreeGrowing && !this.isGrowthFinished, m = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
2069
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(p, m), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
2070
- }, M.prototype.getPositionsData = function() {
2071
- for (var o = this.graphManager.getAllNodes(), E = {}, p = 0; p < o.length; p++) {
2072
- var m = o[p].rect, y = o[p].id;
2073
- E[y] = {
2074
- id: y,
2075
- x: m.getCenterX(),
2076
- y: m.getCenterY(),
2077
- w: m.width,
2078
- h: m.height
2079
- };
2080
- }
2081
- return E;
2082
- }, M.prototype.runSpringEmbedder = function() {
2083
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
2084
- var o = !1;
2085
- if (l.ANIMATE === "during")
2086
- this.emit("layoutstarted");
2087
- else {
2088
- for (; !o; )
2089
- o = this.tick();
2090
- this.graphManager.updateBounds();
2091
- }
2092
- }, M.prototype.moveNodes = function() {
2093
- for (var o = this.getAllNodes(), E, p = 0; p < o.length; p++)
2094
- E = o[p], E.calculateDisplacement();
2095
- Object.keys(this.constraints).length > 0 && this.updateDisplacements();
2096
- for (var p = 0; p < o.length; p++)
2097
- E = o[p], E.move();
2098
- }, M.prototype.initConstraintVariables = function() {
2099
- var o = this;
2100
- this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
2101
- for (var E = this.graphManager.getAllNodes(), p = 0; p < E.length; p++) {
2102
- var m = E[p];
2103
- this.idToNodeMap.set(m.id, m);
2104
- }
2105
- var y = function D(H) {
2106
- for (var k = H.getChild().getNodes(), tt, ht = 0, J = 0; J < k.length; J++)
2107
- tt = k[J], tt.getChild() == null ? o.fixedNodeSet.has(tt.id) && (ht += 100) : ht += D(tt);
2108
- return ht;
2109
- };
2110
- if (this.constraints.fixedNodeConstraint) {
2111
- this.constraints.fixedNodeConstraint.forEach(function(k) {
2112
- o.fixedNodeSet.add(k.nodeId);
2113
- });
2114
- for (var E = this.graphManager.getAllNodes(), m, p = 0; p < E.length; p++)
2115
- if (m = E[p], m.getChild() != null) {
2116
- var S = y(m);
2117
- S > 0 && (m.fixedNodeWeight = S);
2118
- }
2119
- }
2120
- if (this.constraints.relativePlacementConstraint) {
2121
- var O = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
2122
- if (this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(), this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(), this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(), this.fixedNodesOnVertical = /* @__PURE__ */ new Set(), this.fixedNodeSet.forEach(function(D) {
2123
- o.fixedNodesOnHorizontal.add(D), o.fixedNodesOnVertical.add(D);
2124
- }), this.constraints.alignmentConstraint) {
2125
- if (this.constraints.alignmentConstraint.vertical)
2126
- for (var W = this.constraints.alignmentConstraint.vertical, p = 0; p < W.length; p++)
2127
- this.dummyToNodeForVerticalAlignment.set("dummy" + p, []), W[p].forEach(function(H) {
2128
- O.set(H, "dummy" + p), o.dummyToNodeForVerticalAlignment.get("dummy" + p).push(H), o.fixedNodeSet.has(H) && o.fixedNodesOnHorizontal.add("dummy" + p);
2129
- });
2130
- if (this.constraints.alignmentConstraint.horizontal)
2131
- for (var I = this.constraints.alignmentConstraint.horizontal, p = 0; p < I.length; p++)
2132
- this.dummyToNodeForHorizontalAlignment.set("dummy" + p, []), I[p].forEach(function(H) {
2133
- F.set(H, "dummy" + p), o.dummyToNodeForHorizontalAlignment.get("dummy" + p).push(H), o.fixedNodeSet.has(H) && o.fixedNodesOnVertical.add("dummy" + p);
2134
- });
2135
- }
2136
- if (n.RELAX_MOVEMENT_ON_CONSTRAINTS)
2137
- this.shuffle = function(D) {
2138
- var H, k, tt;
2139
- for (tt = D.length - 1; tt >= 2 * D.length / 3; tt--)
2140
- H = Math.floor(Math.random() * (tt + 1)), k = D[tt], D[tt] = D[H], D[H] = k;
2141
- return D;
2142
- }, this.nodesInRelativeHorizontal = [], this.nodesInRelativeVertical = [], this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(), this.constraints.relativePlacementConstraint.forEach(function(D) {
2143
- if (D.left) {
2144
- var H = O.has(D.left) ? O.get(D.left) : D.left, k = O.has(D.right) ? O.get(D.right) : D.right;
2145
- o.nodesInRelativeHorizontal.includes(H) || (o.nodesInRelativeHorizontal.push(H), o.nodeToRelativeConstraintMapHorizontal.set(H, []), o.dummyToNodeForVerticalAlignment.has(H) ? o.nodeToTempPositionMapHorizontal.set(H, o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()) : o.nodeToTempPositionMapHorizontal.set(H, o.idToNodeMap.get(H).getCenterX())), o.nodesInRelativeHorizontal.includes(k) || (o.nodesInRelativeHorizontal.push(k), o.nodeToRelativeConstraintMapHorizontal.set(k, []), o.dummyToNodeForVerticalAlignment.has(k) ? o.nodeToTempPositionMapHorizontal.set(k, o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()) : o.nodeToTempPositionMapHorizontal.set(k, o.idToNodeMap.get(k).getCenterX())), o.nodeToRelativeConstraintMapHorizontal.get(H).push({ right: k, gap: D.gap }), o.nodeToRelativeConstraintMapHorizontal.get(k).push({ left: H, gap: D.gap });
2146
- } else {
2147
- var tt = F.has(D.top) ? F.get(D.top) : D.top, ht = F.has(D.bottom) ? F.get(D.bottom) : D.bottom;
2148
- o.nodesInRelativeVertical.includes(tt) || (o.nodesInRelativeVertical.push(tt), o.nodeToRelativeConstraintMapVertical.set(tt, []), o.dummyToNodeForHorizontalAlignment.has(tt) ? o.nodeToTempPositionMapVertical.set(tt, o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()) : o.nodeToTempPositionMapVertical.set(tt, o.idToNodeMap.get(tt).getCenterY())), o.nodesInRelativeVertical.includes(ht) || (o.nodesInRelativeVertical.push(ht), o.nodeToRelativeConstraintMapVertical.set(ht, []), o.dummyToNodeForHorizontalAlignment.has(ht) ? o.nodeToTempPositionMapVertical.set(ht, o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()) : o.nodeToTempPositionMapVertical.set(ht, o.idToNodeMap.get(ht).getCenterY())), o.nodeToRelativeConstraintMapVertical.get(tt).push({ bottom: ht, gap: D.gap }), o.nodeToRelativeConstraintMapVertical.get(ht).push({ top: tt, gap: D.gap });
2149
- }
2150
- });
2151
- else {
2152
- var Q = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
2153
- this.constraints.relativePlacementConstraint.forEach(function(D) {
2154
- if (D.left) {
2155
- var H = O.has(D.left) ? O.get(D.left) : D.left, k = O.has(D.right) ? O.get(D.right) : D.right;
2156
- Q.has(H) ? Q.get(H).push(k) : Q.set(H, [k]), Q.has(k) ? Q.get(k).push(H) : Q.set(k, [H]);
2157
- } else {
2158
- var tt = F.has(D.top) ? F.get(D.top) : D.top, ht = F.has(D.bottom) ? F.get(D.bottom) : D.bottom;
2159
- z.has(tt) ? z.get(tt).push(ht) : z.set(tt, [ht]), z.has(ht) ? z.get(ht).push(tt) : z.set(ht, [tt]);
2160
- }
2161
- });
2162
- var X = function(H, k) {
2163
- var tt = [], ht = [], J = new V(), It = /* @__PURE__ */ new Set(), Nt = 0;
2164
- return H.forEach(function(vt, it) {
2165
- if (!It.has(it)) {
2166
- tt[Nt] = [], ht[Nt] = !1;
2167
- var ut = it;
2168
- for (J.push(ut), It.add(ut), tt[Nt].push(ut); J.length != 0; ) {
2169
- ut = J.shift(), k.has(ut) && (ht[Nt] = !0);
2170
- var Et = H.get(ut);
2171
- Et.forEach(function(wt) {
2172
- It.has(wt) || (J.push(wt), It.add(wt), tt[Nt].push(wt));
2173
- });
2174
- }
2175
- Nt++;
2176
- }
2177
- }), { components: tt, isFixed: ht };
2178
- }, rt = X(Q, o.fixedNodesOnHorizontal);
2179
- this.componentsOnHorizontal = rt.components, this.fixedComponentsOnHorizontal = rt.isFixed;
2180
- var $ = X(z, o.fixedNodesOnVertical);
2181
- this.componentsOnVertical = $.components, this.fixedComponentsOnVertical = $.isFixed;
2182
- }
2183
- }
2184
- }, M.prototype.updateDisplacements = function() {
2185
- var o = this;
2186
- if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function($) {
2187
- var D = o.idToNodeMap.get($.nodeId);
2188
- D.displacementX = 0, D.displacementY = 0;
2189
- }), this.constraints.alignmentConstraint) {
2190
- if (this.constraints.alignmentConstraint.vertical)
2191
- for (var E = this.constraints.alignmentConstraint.vertical, p = 0; p < E.length; p++) {
2192
- for (var m = 0, y = 0; y < E[p].length; y++) {
2193
- if (this.fixedNodeSet.has(E[p][y])) {
2194
- m = 0;
2195
- break;
2196
- }
2197
- m += this.idToNodeMap.get(E[p][y]).displacementX;
2198
- }
2199
- for (var S = m / E[p].length, y = 0; y < E[p].length; y++)
2200
- this.idToNodeMap.get(E[p][y]).displacementX = S;
2201
- }
2202
- if (this.constraints.alignmentConstraint.horizontal)
2203
- for (var O = this.constraints.alignmentConstraint.horizontal, p = 0; p < O.length; p++) {
2204
- for (var F = 0, y = 0; y < O[p].length; y++) {
2205
- if (this.fixedNodeSet.has(O[p][y])) {
2206
- F = 0;
2207
- break;
2208
- }
2209
- F += this.idToNodeMap.get(O[p][y]).displacementY;
2210
- }
2211
- for (var W = F / O[p].length, y = 0; y < O[p].length; y++)
2212
- this.idToNodeMap.get(O[p][y]).displacementY = W;
2213
- }
2214
- }
2215
- if (this.constraints.relativePlacementConstraint)
2216
- if (n.RELAX_MOVEMENT_ON_CONSTRAINTS)
2217
- this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function($) {
2218
- if (!o.fixedNodesOnHorizontal.has($)) {
2219
- var D = 0;
2220
- o.dummyToNodeForVerticalAlignment.has($) ? D = o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get($)[0]).displacementX : D = o.idToNodeMap.get($).displacementX, o.nodeToRelativeConstraintMapHorizontal.get($).forEach(function(H) {
2221
- if (H.right) {
2222
- var k = o.nodeToTempPositionMapHorizontal.get(H.right) - o.nodeToTempPositionMapHorizontal.get($) - D;
2223
- k < H.gap && (D -= H.gap - k);
2224
- } else {
2225
- var k = o.nodeToTempPositionMapHorizontal.get($) - o.nodeToTempPositionMapHorizontal.get(H.left) + D;
2226
- k < H.gap && (D += H.gap - k);
2227
- }
2228
- }), o.nodeToTempPositionMapHorizontal.set($, o.nodeToTempPositionMapHorizontal.get($) + D), o.dummyToNodeForVerticalAlignment.has($) ? o.dummyToNodeForVerticalAlignment.get($).forEach(function(H) {
2229
- o.idToNodeMap.get(H).displacementX = D;
2230
- }) : o.idToNodeMap.get($).displacementX = D;
2231
- }
2232
- }), this.nodesInRelativeVertical.forEach(function($) {
2233
- if (!o.fixedNodesOnHorizontal.has($)) {
2234
- var D = 0;
2235
- o.dummyToNodeForHorizontalAlignment.has($) ? D = o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get($)[0]).displacementY : D = o.idToNodeMap.get($).displacementY, o.nodeToRelativeConstraintMapVertical.get($).forEach(function(H) {
2236
- if (H.bottom) {
2237
- var k = o.nodeToTempPositionMapVertical.get(H.bottom) - o.nodeToTempPositionMapVertical.get($) - D;
2238
- k < H.gap && (D -= H.gap - k);
2239
- } else {
2240
- var k = o.nodeToTempPositionMapVertical.get($) - o.nodeToTempPositionMapVertical.get(H.top) + D;
2241
- k < H.gap && (D += H.gap - k);
2242
- }
2243
- }), o.nodeToTempPositionMapVertical.set($, o.nodeToTempPositionMapVertical.get($) + D), o.dummyToNodeForHorizontalAlignment.has($) ? o.dummyToNodeForHorizontalAlignment.get($).forEach(function(H) {
2244
- o.idToNodeMap.get(H).displacementY = D;
2245
- }) : o.idToNodeMap.get($).displacementY = D;
2246
- }
2247
- });
2248
- else {
2249
- for (var p = 0; p < this.componentsOnHorizontal.length; p++) {
2250
- var I = this.componentsOnHorizontal[p];
2251
- if (this.fixedComponentsOnHorizontal[p])
2252
- for (var y = 0; y < I.length; y++)
2253
- this.dummyToNodeForVerticalAlignment.has(I[y]) ? this.dummyToNodeForVerticalAlignment.get(I[y]).forEach(function(H) {
2254
- o.idToNodeMap.get(H).displacementX = 0;
2255
- }) : this.idToNodeMap.get(I[y]).displacementX = 0;
2256
- else {
2257
- for (var Q = 0, z = 0, y = 0; y < I.length; y++)
2258
- if (this.dummyToNodeForVerticalAlignment.has(I[y])) {
2259
- var X = this.dummyToNodeForVerticalAlignment.get(I[y]);
2260
- Q += X.length * this.idToNodeMap.get(X[0]).displacementX, z += X.length;
2261
- } else
2262
- Q += this.idToNodeMap.get(I[y]).displacementX, z++;
2263
- for (var rt = Q / z, y = 0; y < I.length; y++)
2264
- this.dummyToNodeForVerticalAlignment.has(I[y]) ? this.dummyToNodeForVerticalAlignment.get(I[y]).forEach(function(H) {
2265
- o.idToNodeMap.get(H).displacementX = rt;
2266
- }) : this.idToNodeMap.get(I[y]).displacementX = rt;
2267
- }
2268
- }
2269
- for (var p = 0; p < this.componentsOnVertical.length; p++) {
2270
- var I = this.componentsOnVertical[p];
2271
- if (this.fixedComponentsOnVertical[p])
2272
- for (var y = 0; y < I.length; y++)
2273
- this.dummyToNodeForHorizontalAlignment.has(I[y]) ? this.dummyToNodeForHorizontalAlignment.get(I[y]).forEach(function(k) {
2274
- o.idToNodeMap.get(k).displacementY = 0;
2275
- }) : this.idToNodeMap.get(I[y]).displacementY = 0;
2276
- else {
2277
- for (var Q = 0, z = 0, y = 0; y < I.length; y++)
2278
- if (this.dummyToNodeForHorizontalAlignment.has(I[y])) {
2279
- var X = this.dummyToNodeForHorizontalAlignment.get(I[y]);
2280
- Q += X.length * this.idToNodeMap.get(X[0]).displacementY, z += X.length;
2281
- } else
2282
- Q += this.idToNodeMap.get(I[y]).displacementY, z++;
2283
- for (var rt = Q / z, y = 0; y < I.length; y++)
2284
- this.dummyToNodeForHorizontalAlignment.has(I[y]) ? this.dummyToNodeForHorizontalAlignment.get(I[y]).forEach(function(J) {
2285
- o.idToNodeMap.get(J).displacementY = rt;
2286
- }) : this.idToNodeMap.get(I[y]).displacementY = rt;
2287
- }
2288
- }
2289
- }
2290
- }, M.prototype.calculateNodesToApplyGravitationTo = function() {
2291
- var o = [], E, p = this.graphManager.getGraphs(), m = p.length, y;
2292
- for (y = 0; y < m; y++)
2293
- E = p[y], E.updateConnected(), E.isConnected || (o = o.concat(E.getNodes()));
2294
- return o;
2295
- }, M.prototype.createBendpoints = function() {
2296
- var o = [];
2297
- o = o.concat(this.graphManager.getAllEdges());
2298
- var E = /* @__PURE__ */ new Set(), p;
2299
- for (p = 0; p < o.length; p++) {
2300
- var m = o[p];
2301
- if (!E.has(m)) {
2302
- var y = m.getSource(), S = m.getTarget();
2303
- if (y == S)
2304
- m.getBendpoints().push(new d()), m.getBendpoints().push(new d()), this.createDummyNodesForBendpoints(m), E.add(m);
2305
- else {
2306
- var O = [];
2307
- if (O = O.concat(y.getEdgeListToNode(S)), O = O.concat(S.getEdgeListToNode(y)), !E.has(O[0])) {
2308
- if (O.length > 1) {
2309
- var F;
2310
- for (F = 0; F < O.length; F++) {
2311
- var W = O[F];
2312
- W.getBendpoints().push(new d()), this.createDummyNodesForBendpoints(W);
2313
- }
2314
- }
2315
- O.forEach(function(I) {
2316
- E.add(I);
2317
- });
2318
- }
2319
- }
2320
- }
2321
- if (E.size == o.length)
2322
- break;
2323
- }
2324
- }, M.prototype.positionNodesRadially = function(o) {
2325
- for (var E = new u(0, 0), p = Math.ceil(Math.sqrt(o.length)), m = 0, y = 0, S = 0, O = new d(0, 0), F = 0; F < o.length; F++) {
2326
- F % p == 0 && (S = 0, y = m, F != 0 && (y += n.DEFAULT_COMPONENT_SEPERATION), m = 0);
2327
- var W = o[F], I = b.findCenterOfTree(W);
2328
- E.x = S, E.y = y, O = M.radialLayout(W, I, E), O.y > m && (m = Math.floor(O.y)), S = Math.floor(O.x + n.DEFAULT_COMPONENT_SEPERATION);
2329
- }
2330
- this.transform(new d(T.WORLD_CENTER_X - O.x / 2, T.WORLD_CENTER_Y - O.y / 2));
2331
- }, M.radialLayout = function(o, E, p) {
2332
- var m = Math.max(this.maxDiagonalInTree(o), n.DEFAULT_RADIAL_SEPARATION);
2333
- M.branchRadialLayout(E, null, 0, 359, 0, m);
2334
- var y = B.calculateBounds(o), S = new U();
2335
- S.setDeviceOrgX(y.getMinX()), S.setDeviceOrgY(y.getMinY()), S.setWorldOrgX(p.x), S.setWorldOrgY(p.y);
2336
- for (var O = 0; O < o.length; O++) {
2337
- var F = o[O];
2338
- F.transform(S);
2339
- }
2340
- var W = new d(y.getMaxX(), y.getMaxY());
2341
- return S.inverseTransformPoint(W);
2342
- }, M.branchRadialLayout = function(o, E, p, m, y, S) {
2343
- var O = (m - p + 1) / 2;
2344
- O < 0 && (O += 180);
2345
- var F = (O + p) % 360, W = F * G.TWO_PI / 360, I = y * Math.cos(W), Q = y * Math.sin(W);
2346
- o.setCenter(I, Q);
2347
- var z = [];
2348
- z = z.concat(o.getEdges());
2349
- var X = z.length;
2350
- E != null && X--;
2351
- for (var rt = 0, $ = z.length, D, H = o.getEdgesBetween(E); H.length > 1; ) {
2352
- var k = H[0];
2353
- H.splice(0, 1);
2354
- var tt = z.indexOf(k);
2355
- tt >= 0 && z.splice(tt, 1), $--, X--;
2356
- }
2357
- E != null ? D = (z.indexOf(H[0]) + 1) % $ : D = 0;
2358
- for (var ht = Math.abs(m - p) / X, J = D; rt != X; J = ++J % $) {
2359
- var It = z[J].getOtherEnd(o);
2360
- if (It != E) {
2361
- var Nt = (p + rt * ht) % 360, vt = (Nt + ht) % 360;
2362
- M.branchRadialLayout(It, o, Nt, vt, y + S, S), rt++;
2363
- }
2364
- }
2365
- }, M.maxDiagonalInTree = function(o) {
2366
- for (var E = w.MIN_VALUE, p = 0; p < o.length; p++) {
2367
- var m = o[p], y = m.getDiagonal();
2368
- y > E && (E = y);
2369
- }
2370
- return E;
2371
- }, M.prototype.calcRepulsionRange = function() {
2372
- return 2 * (this.level + 1) * this.idealEdgeLength;
2373
- }, M.prototype.groupZeroDegreeMembers = function() {
2374
- var o = this, E = {};
2375
- this.memberGroups = {}, this.idToDummyNode = {};
2376
- for (var p = [], m = this.graphManager.getAllNodes(), y = 0; y < m.length; y++) {
2377
- var S = m[y], O = S.getParent();
2378
- this.getNodeDegreeWithChildren(S) === 0 && (O.id == null || !this.getToBeTiled(O)) && p.push(S);
2379
- }
2380
- for (var y = 0; y < p.length; y++) {
2381
- var S = p[y], F = S.getParent().id;
2382
- typeof E[F] > "u" && (E[F] = []), E[F] = E[F].concat(S);
2383
- }
2384
- Object.keys(E).forEach(function(W) {
2385
- if (E[W].length > 1) {
2386
- var I = "DummyCompound_" + W;
2387
- o.memberGroups[I] = E[W];
2388
- var Q = E[W][0].getParent(), z = new t(o.graphManager);
2389
- z.id = I, z.paddingLeft = Q.paddingLeft || 0, z.paddingRight = Q.paddingRight || 0, z.paddingBottom = Q.paddingBottom || 0, z.paddingTop = Q.paddingTop || 0, o.idToDummyNode[I] = z;
2390
- var X = o.getGraphManager().add(o.newGraph(), z), rt = Q.getChild();
2391
- rt.add(z);
2392
- for (var $ = 0; $ < E[W].length; $++) {
2393
- var D = E[W][$];
2394
- rt.remove(D), X.add(D);
2395
- }
2396
- }
2397
- });
2398
- }, M.prototype.clearCompounds = function() {
2399
- var o = {}, E = {};
2400
- this.performDFSOnCompounds();
2401
- for (var p = 0; p < this.compoundOrder.length; p++)
2402
- E[this.compoundOrder[p].id] = this.compoundOrder[p], o[this.compoundOrder[p].id] = [].concat(this.compoundOrder[p].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[p].getChild()), this.compoundOrder[p].child = null;
2403
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(o, E);
2404
- }, M.prototype.clearZeroDegreeMembers = function() {
2405
- var o = this, E = this.tiledZeroDegreePack = [];
2406
- Object.keys(this.memberGroups).forEach(function(p) {
2407
- var m = o.idToDummyNode[p];
2408
- if (E[p] = o.tileNodes(o.memberGroups[p], m.paddingLeft + m.paddingRight), m.rect.width = E[p].width, m.rect.height = E[p].height, m.setCenter(E[p].centerX, E[p].centerY), m.labelMarginLeft = 0, m.labelMarginTop = 0, n.NODE_DIMENSIONS_INCLUDE_LABELS) {
2409
- var y = m.rect.width, S = m.rect.height;
2410
- m.labelWidth && (m.labelPosHorizontal == "left" ? (m.rect.x -= m.labelWidth, m.setWidth(y + m.labelWidth), m.labelMarginLeft = m.labelWidth) : m.labelPosHorizontal == "center" && m.labelWidth > y ? (m.rect.x -= (m.labelWidth - y) / 2, m.setWidth(m.labelWidth), m.labelMarginLeft = (m.labelWidth - y) / 2) : m.labelPosHorizontal == "right" && m.setWidth(y + m.labelWidth)), m.labelHeight && (m.labelPosVertical == "top" ? (m.rect.y -= m.labelHeight, m.setHeight(S + m.labelHeight), m.labelMarginTop = m.labelHeight) : m.labelPosVertical == "center" && m.labelHeight > S ? (m.rect.y -= (m.labelHeight - S) / 2, m.setHeight(m.labelHeight), m.labelMarginTop = (m.labelHeight - S) / 2) : m.labelPosVertical == "bottom" && m.setHeight(S + m.labelHeight));
2411
- }
2412
- });
2413
- }, M.prototype.repopulateCompounds = function() {
2414
- for (var o = this.compoundOrder.length - 1; o >= 0; o--) {
2415
- var E = this.compoundOrder[o], p = E.id, m = E.paddingLeft, y = E.paddingTop, S = E.labelMarginLeft, O = E.labelMarginTop;
2416
- this.adjustLocations(this.tiledMemberPack[p], E.rect.x, E.rect.y, m, y, S, O);
2417
- }
2418
- }, M.prototype.repopulateZeroDegreeMembers = function() {
2419
- var o = this, E = this.tiledZeroDegreePack;
2420
- Object.keys(E).forEach(function(p) {
2421
- var m = o.idToDummyNode[p], y = m.paddingLeft, S = m.paddingTop, O = m.labelMarginLeft, F = m.labelMarginTop;
2422
- o.adjustLocations(E[p], m.rect.x, m.rect.y, y, S, O, F);
2423
- });
2424
- }, M.prototype.getToBeTiled = function(o) {
2425
- var E = o.id;
2426
- if (this.toBeTiled[E] != null)
2427
- return this.toBeTiled[E];
2428
- var p = o.getChild();
2429
- if (p == null)
2430
- return this.toBeTiled[E] = !1, !1;
2431
- for (var m = p.getNodes(), y = 0; y < m.length; y++) {
2432
- var S = m[y];
2433
- if (this.getNodeDegree(S) > 0)
2434
- return this.toBeTiled[E] = !1, !1;
2435
- if (S.getChild() == null) {
2436
- this.toBeTiled[S.id] = !1;
2437
- continue;
2438
- }
2439
- if (!this.getToBeTiled(S))
2440
- return this.toBeTiled[E] = !1, !1;
2441
- }
2442
- return this.toBeTiled[E] = !0, !0;
2443
- }, M.prototype.getNodeDegree = function(o) {
2444
- o.id;
2445
- for (var E = o.getEdges(), p = 0, m = 0; m < E.length; m++) {
2446
- var y = E[m];
2447
- y.getSource().id !== y.getTarget().id && (p = p + 1);
2448
- }
2449
- return p;
2450
- }, M.prototype.getNodeDegreeWithChildren = function(o) {
2451
- var E = this.getNodeDegree(o);
2452
- if (o.getChild() == null)
2453
- return E;
2454
- for (var p = o.getChild().getNodes(), m = 0; m < p.length; m++) {
2455
- var y = p[m];
2456
- E += this.getNodeDegreeWithChildren(y);
2457
- }
2458
- return E;
2459
- }, M.prototype.performDFSOnCompounds = function() {
2460
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2461
- }, M.prototype.fillCompexOrderByDFS = function(o) {
2462
- for (var E = 0; E < o.length; E++) {
2463
- var p = o[E];
2464
- p.getChild() != null && this.fillCompexOrderByDFS(p.getChild().getNodes()), this.getToBeTiled(p) && this.compoundOrder.push(p);
2465
- }
2466
- }, M.prototype.adjustLocations = function(o, E, p, m, y, S, O) {
2467
- E += m + S, p += y + O;
2468
- for (var F = E, W = 0; W < o.rows.length; W++) {
2469
- var I = o.rows[W];
2470
- E = F;
2471
- for (var Q = 0, z = 0; z < I.length; z++) {
2472
- var X = I[z];
2473
- X.rect.x = E, X.rect.y = p, E += X.rect.width + o.horizontalPadding, X.rect.height > Q && (Q = X.rect.height);
2474
- }
2475
- p += Q + o.verticalPadding;
2476
- }
2477
- }, M.prototype.tileCompoundMembers = function(o, E) {
2478
- var p = this;
2479
- this.tiledMemberPack = [], Object.keys(o).forEach(function(m) {
2480
- var y = E[m];
2481
- if (p.tiledMemberPack[m] = p.tileNodes(o[m], y.paddingLeft + y.paddingRight), y.rect.width = p.tiledMemberPack[m].width, y.rect.height = p.tiledMemberPack[m].height, y.setCenter(p.tiledMemberPack[m].centerX, p.tiledMemberPack[m].centerY), y.labelMarginLeft = 0, y.labelMarginTop = 0, n.NODE_DIMENSIONS_INCLUDE_LABELS) {
2482
- var S = y.rect.width, O = y.rect.height;
2483
- y.labelWidth && (y.labelPosHorizontal == "left" ? (y.rect.x -= y.labelWidth, y.setWidth(S + y.labelWidth), y.labelMarginLeft = y.labelWidth) : y.labelPosHorizontal == "center" && y.labelWidth > S ? (y.rect.x -= (y.labelWidth - S) / 2, y.setWidth(y.labelWidth), y.labelMarginLeft = (y.labelWidth - S) / 2) : y.labelPosHorizontal == "right" && y.setWidth(S + y.labelWidth)), y.labelHeight && (y.labelPosVertical == "top" ? (y.rect.y -= y.labelHeight, y.setHeight(O + y.labelHeight), y.labelMarginTop = y.labelHeight) : y.labelPosVertical == "center" && y.labelHeight > O ? (y.rect.y -= (y.labelHeight - O) / 2, y.setHeight(y.labelHeight), y.labelMarginTop = (y.labelHeight - O) / 2) : y.labelPosVertical == "bottom" && y.setHeight(O + y.labelHeight));
2484
- }
2485
- });
2486
- }, M.prototype.tileNodes = function(o, E) {
2487
- var p = this.tileNodesByFavoringDim(o, E, !0), m = this.tileNodesByFavoringDim(o, E, !1), y = this.getOrgRatio(p), S = this.getOrgRatio(m), O;
2488
- return S < y ? O = m : O = p, O;
2489
- }, M.prototype.getOrgRatio = function(o) {
2490
- var E = o.width, p = o.height, m = E / p;
2491
- return m < 1 && (m = 1 / m), m;
2492
- }, M.prototype.calcIdealRowWidth = function(o, E) {
2493
- var p = n.TILING_PADDING_VERTICAL, m = n.TILING_PADDING_HORIZONTAL, y = o.length, S = 0, O = 0, F = 0;
2494
- o.forEach(function($) {
2495
- S += $.getWidth(), O += $.getHeight(), $.getWidth() > F && (F = $.getWidth());
2496
- });
2497
- var W = S / y, I = O / y, Q = Math.pow(p - m, 2) + 4 * (W + m) * (I + p) * y, z = (m - p + Math.sqrt(Q)) / (2 * (W + m)), X;
2498
- E ? (X = Math.ceil(z), X == z && X++) : X = Math.floor(z);
2499
- var rt = X * (W + m) - m;
2500
- return F > rt && (rt = F), rt += m * 2, rt;
2501
- }, M.prototype.tileNodesByFavoringDim = function(o, E, p) {
2502
- var m = n.TILING_PADDING_VERTICAL, y = n.TILING_PADDING_HORIZONTAL, S = n.TILING_COMPARE_BY, O = {
2503
- rows: [],
2504
- rowWidth: [],
2505
- rowHeight: [],
2506
- width: 0,
2507
- height: E,
2508
- // assume minHeight equals to minWidth
2509
- verticalPadding: m,
2510
- horizontalPadding: y,
2511
- centerX: 0,
2512
- centerY: 0
2513
- };
2514
- S && (O.idealRowWidth = this.calcIdealRowWidth(o, p));
2515
- var F = function(D) {
2516
- return D.rect.width * D.rect.height;
2517
- }, W = function(D, H) {
2518
- return F(H) - F(D);
2519
- };
2520
- o.sort(function($, D) {
2521
- var H = W;
2522
- return O.idealRowWidth ? (H = S, H($.id, D.id)) : H($, D);
2523
- });
2524
- for (var I = 0, Q = 0, z = 0; z < o.length; z++) {
2525
- var X = o[z];
2526
- I += X.getCenterX(), Q += X.getCenterY();
2527
- }
2528
- O.centerX = I / o.length, O.centerY = Q / o.length;
2529
- for (var z = 0; z < o.length; z++) {
2530
- var X = o[z];
2531
- if (O.rows.length == 0)
2532
- this.insertNodeToRow(O, X, 0, E);
2533
- else if (this.canAddHorizontal(O, X.rect.width, X.rect.height)) {
2534
- var rt = O.rows.length - 1;
2535
- O.idealRowWidth || (rt = this.getShortestRowIndex(O)), this.insertNodeToRow(O, X, rt, E);
2536
- } else
2537
- this.insertNodeToRow(O, X, O.rows.length, E);
2538
- this.shiftToLastRow(O);
2539
- }
2540
- return O;
2541
- }, M.prototype.insertNodeToRow = function(o, E, p, m) {
2542
- var y = m;
2543
- if (p == o.rows.length) {
2544
- var S = [];
2545
- o.rows.push(S), o.rowWidth.push(y), o.rowHeight.push(0);
2546
- }
2547
- var O = o.rowWidth[p] + E.rect.width;
2548
- o.rows[p].length > 0 && (O += o.horizontalPadding), o.rowWidth[p] = O, o.width < O && (o.width = O);
2549
- var F = E.rect.height;
2550
- p > 0 && (F += o.verticalPadding);
2551
- var W = 0;
2552
- F > o.rowHeight[p] && (W = o.rowHeight[p], o.rowHeight[p] = F, W = o.rowHeight[p] - W), o.height += W, o.rows[p].push(E);
2553
- }, M.prototype.getShortestRowIndex = function(o) {
2554
- for (var E = -1, p = Number.MAX_VALUE, m = 0; m < o.rows.length; m++)
2555
- o.rowWidth[m] < p && (E = m, p = o.rowWidth[m]);
2556
- return E;
2557
- }, M.prototype.getLongestRowIndex = function(o) {
2558
- for (var E = -1, p = Number.MIN_VALUE, m = 0; m < o.rows.length; m++)
2559
- o.rowWidth[m] > p && (E = m, p = o.rowWidth[m]);
2560
- return E;
2561
- }, M.prototype.canAddHorizontal = function(o, E, p) {
2562
- if (o.idealRowWidth) {
2563
- var m = o.rows.length - 1, y = o.rowWidth[m];
2564
- return y + E + o.horizontalPadding <= o.idealRowWidth;
2565
- }
2566
- var S = this.getShortestRowIndex(o);
2567
- if (S < 0)
2568
- return !0;
2569
- var O = o.rowWidth[S];
2570
- if (O + o.horizontalPadding + E <= o.width) return !0;
2571
- var F = 0;
2572
- o.rowHeight[S] < p && S > 0 && (F = p + o.verticalPadding - o.rowHeight[S]);
2573
- var W;
2574
- o.width - O >= E + o.horizontalPadding ? W = (o.height + F) / (O + E + o.horizontalPadding) : W = (o.height + F) / o.width, F = p + o.verticalPadding;
2575
- var I;
2576
- return o.width < E ? I = (o.height + F) / E : I = (o.height + F) / o.width, I < 1 && (I = 1 / I), W < 1 && (W = 1 / W), W < I;
2577
- }, M.prototype.shiftToLastRow = function(o) {
2578
- var E = this.getLongestRowIndex(o), p = o.rowWidth.length - 1, m = o.rows[E], y = m[m.length - 1], S = y.width + o.horizontalPadding;
2579
- if (o.width - o.rowWidth[p] > S && E != p) {
2580
- m.splice(-1, 1), o.rows[p].push(y), o.rowWidth[E] = o.rowWidth[E] - S, o.rowWidth[p] = o.rowWidth[p] + S, o.width = o.rowWidth[instance.getLongestRowIndex(o)];
2581
- for (var O = Number.MIN_VALUE, F = 0; F < m.length; F++)
2582
- m[F].height > O && (O = m[F].height);
2583
- E > 0 && (O += o.verticalPadding);
2584
- var W = o.rowHeight[E] + o.rowHeight[p];
2585
- o.rowHeight[E] = O, o.rowHeight[p] < y.height + o.verticalPadding && (o.rowHeight[p] = y.height + o.verticalPadding);
2586
- var I = o.rowHeight[E] + o.rowHeight[p];
2587
- o.height += I - W, this.shiftToLastRow(o);
2588
- }
2589
- }, M.prototype.tilingPreLayout = function() {
2590
- n.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2591
- }, M.prototype.tilingPostLayout = function() {
2592
- n.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2593
- }, M.prototype.reduceTrees = function() {
2594
- for (var o = [], E = !0, p; E; ) {
2595
- var m = this.graphManager.getAllNodes(), y = [];
2596
- E = !1;
2597
- for (var S = 0; S < m.length; S++)
2598
- if (p = m[S], p.getEdges().length == 1 && !p.getEdges()[0].isInterGraph && p.getChild() == null) {
2599
- if (n.PURE_INCREMENTAL) {
2600
- var O = p.getEdges()[0].getOtherEnd(p), F = new L(p.getCenterX() - O.getCenterX(), p.getCenterY() - O.getCenterY());
2601
- y.push([p, p.getEdges()[0], p.getOwner(), F]);
2602
- } else
2603
- y.push([p, p.getEdges()[0], p.getOwner()]);
2604
- E = !0;
2605
- }
2606
- if (E == !0) {
2607
- for (var W = [], I = 0; I < y.length; I++)
2608
- y[I][0].getEdges().length == 1 && (W.push(y[I]), y[I][0].getOwner().remove(y[I][0]));
2609
- o.push(W), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2610
- }
2611
- }
2612
- this.prunedNodesAll = o;
2613
- }, M.prototype.growTree = function(o) {
2614
- for (var E = o.length, p = o[E - 1], m, y = 0; y < p.length; y++)
2615
- m = p[y], this.findPlaceforPrunedNode(m), m[2].add(m[0]), m[2].add(m[1], m[1].source, m[1].target);
2616
- o.splice(o.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2617
- }, M.prototype.findPlaceforPrunedNode = function(o) {
2618
- var E, p, m = o[0];
2619
- if (m == o[1].source ? p = o[1].target : p = o[1].source, n.PURE_INCREMENTAL)
2620
- m.setCenter(p.getCenterX() + o[3].getWidth(), p.getCenterY() + o[3].getHeight());
2621
- else {
2622
- var y = p.startX, S = p.finishX, O = p.startY, F = p.finishY, W = 0, I = 0, Q = 0, z = 0, X = [W, Q, I, z];
2623
- if (O > 0)
2624
- for (var rt = y; rt <= S; rt++)
2625
- X[0] += this.grid[rt][O - 1].length + this.grid[rt][O].length - 1;
2626
- if (S < this.grid.length - 1)
2627
- for (var rt = O; rt <= F; rt++)
2628
- X[1] += this.grid[S + 1][rt].length + this.grid[S][rt].length - 1;
2629
- if (F < this.grid[0].length - 1)
2630
- for (var rt = y; rt <= S; rt++)
2631
- X[2] += this.grid[rt][F + 1].length + this.grid[rt][F].length - 1;
2632
- if (y > 0)
2633
- for (var rt = O; rt <= F; rt++)
2634
- X[3] += this.grid[y - 1][rt].length + this.grid[y][rt].length - 1;
2635
- for (var $ = w.MAX_VALUE, D, H, k = 0; k < X.length; k++)
2636
- X[k] < $ ? ($ = X[k], D = 1, H = k) : X[k] == $ && D++;
2637
- if (D == 3 && $ == 0)
2638
- X[0] == 0 && X[1] == 0 && X[2] == 0 ? E = 1 : X[0] == 0 && X[1] == 0 && X[3] == 0 ? E = 0 : X[0] == 0 && X[2] == 0 && X[3] == 0 ? E = 3 : X[1] == 0 && X[2] == 0 && X[3] == 0 && (E = 2);
2639
- else if (D == 2 && $ == 0) {
2640
- var tt = Math.floor(Math.random() * 2);
2641
- X[0] == 0 && X[1] == 0 ? tt == 0 ? E = 0 : E = 1 : X[0] == 0 && X[2] == 0 ? tt == 0 ? E = 0 : E = 2 : X[0] == 0 && X[3] == 0 ? tt == 0 ? E = 0 : E = 3 : X[1] == 0 && X[2] == 0 ? tt == 0 ? E = 1 : E = 2 : X[1] == 0 && X[3] == 0 ? tt == 0 ? E = 1 : E = 3 : tt == 0 ? E = 2 : E = 3;
2642
- } else if (D == 4 && $ == 0) {
2643
- var tt = Math.floor(Math.random() * 4);
2644
- E = tt;
2645
- } else
2646
- E = H;
2647
- E == 0 ? m.setCenter(p.getCenterX(), p.getCenterY() - p.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - m.getHeight() / 2) : E == 1 ? m.setCenter(p.getCenterX() + p.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + m.getWidth() / 2, p.getCenterY()) : E == 2 ? m.setCenter(p.getCenterX(), p.getCenterY() + p.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + m.getHeight() / 2) : m.setCenter(p.getCenterX() - p.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - m.getWidth() / 2, p.getCenterY());
2648
- }
2649
- }, a.exports = M;
2650
- }
2651
- ),
2652
- /***/
2653
- 991: (
2654
- /***/
2655
- (a, r, i) => {
2656
- var f = i(551).FDLayoutNode, e = i(551).IMath;
2657
- function g(s, n, c, l) {
2658
- f.call(this, s, n, c, l);
2659
- }
2660
- g.prototype = Object.create(f.prototype);
2661
- for (var t in f)
2662
- g[t] = f[t];
2663
- g.prototype.calculateDisplacement = function() {
2664
- var s = this.graphManager.getLayout();
2665
- this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += s.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += s.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += s.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += s.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > s.coolingFactor * s.maxNodeDisplacement && (this.displacementX = s.coolingFactor * s.maxNodeDisplacement * e.sign(this.displacementX)), Math.abs(this.displacementY) > s.coolingFactor * s.maxNodeDisplacement && (this.displacementY = s.coolingFactor * s.maxNodeDisplacement * e.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
2666
- }, g.prototype.propogateDisplacementToChildren = function(s, n) {
2667
- for (var c = this.getChild().getNodes(), l, T = 0; T < c.length; T++)
2668
- l = c[T], l.getChild() == null ? (l.displacementX += s, l.displacementY += n) : l.propogateDisplacementToChildren(s, n);
2669
- }, g.prototype.move = function() {
2670
- var s = this.graphManager.getLayout();
2671
- (this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), s.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY)), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
2672
- }, g.prototype.setPred1 = function(s) {
2673
- this.pred1 = s;
2674
- }, g.prototype.getPred1 = function() {
2675
- return pred1;
2676
- }, g.prototype.getPred2 = function() {
2677
- return pred2;
2678
- }, g.prototype.setNext = function(s) {
2679
- this.next = s;
2680
- }, g.prototype.getNext = function() {
2681
- return next;
2682
- }, g.prototype.setProcessed = function(s) {
2683
- this.processed = s;
2684
- }, g.prototype.isProcessed = function() {
2685
- return processed;
2686
- }, a.exports = g;
2687
- }
2688
- ),
2689
- /***/
2690
- 902: (
2691
- /***/
2692
- (a, r, i) => {
2693
- function f(c) {
2694
- if (Array.isArray(c)) {
2695
- for (var l = 0, T = Array(c.length); l < c.length; l++)
2696
- T[l] = c[l];
2697
- return T;
2698
- } else
2699
- return Array.from(c);
2700
- }
2701
- var e = i(806), g = i(551).LinkedList, t = i(551).Matrix, s = i(551).SVD;
2702
- function n() {
2703
- }
2704
- n.handleConstraints = function(c) {
2705
- var l = {};
2706
- l.fixedNodeConstraint = c.constraints.fixedNodeConstraint, l.alignmentConstraint = c.constraints.alignmentConstraint, l.relativePlacementConstraint = c.constraints.relativePlacementConstraint;
2707
- for (var T = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = [], L = [], b = c.getAllNodes(), w = 0, G = 0; G < b.length; G++) {
2708
- var B = b[G];
2709
- B.getChild() == null && (u.set(B.id, w++), d.push(B.getCenterX()), L.push(B.getCenterY()), T.set(B.id, B));
2710
- }
2711
- l.relativePlacementConstraint && l.relativePlacementConstraint.forEach(function(P) {
2712
- !P.gap && P.gap != 0 && (P.left ? P.gap = e.DEFAULT_EDGE_LENGTH + T.get(P.left).getWidth() / 2 + T.get(P.right).getWidth() / 2 : P.gap = e.DEFAULT_EDGE_LENGTH + T.get(P.top).getHeight() / 2 + T.get(P.bottom).getHeight() / 2);
2713
- });
2714
- var U = function(Y, Z) {
2715
- return { x: Y.x - Z.x, y: Y.y - Z.y };
2716
- }, V = function(Y) {
2717
- var Z = 0, K = 0;
2718
- return Y.forEach(function(q) {
2719
- Z += d[u.get(q)], K += L[u.get(q)];
2720
- }), { x: Z / Y.size, y: K / Y.size };
2721
- }, M = function(Y, Z, K, q, at) {
2722
- function ct(lt, ot) {
2723
- var Lt = new Set(lt), ft = !0, st = !1, Xt = void 0;
2724
- try {
2725
- for (var Tt = ot[Symbol.iterator](), Ct; !(ft = (Ct = Tt.next()).done); ft = !0) {
2726
- var Bt = Ct.value;
2727
- Lt.add(Bt);
2728
- }
2729
- } catch (bt) {
2730
- st = !0, Xt = bt;
2731
- } finally {
2732
- try {
2733
- !ft && Tt.return && Tt.return();
2734
- } finally {
2735
- if (st)
2736
- throw Xt;
2737
- }
2738
- }
2739
- return Lt;
2740
- }
2741
- var nt = /* @__PURE__ */ new Map();
2742
- Y.forEach(function(lt, ot) {
2743
- nt.set(ot, 0);
2744
- }), Y.forEach(function(lt, ot) {
2745
- lt.forEach(function(Lt) {
2746
- nt.set(Lt.id, nt.get(Lt.id) + 1);
2747
- });
2748
- });
2749
- var et = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), dt = new g();
2750
- nt.forEach(function(lt, ot) {
2751
- lt == 0 ? (dt.push(ot), K || (Z == "horizontal" ? et.set(ot, u.has(ot) ? d[u.get(ot)] : q.get(ot)) : et.set(ot, u.has(ot) ? L[u.get(ot)] : q.get(ot)))) : et.set(ot, Number.NEGATIVE_INFINITY), K && j.set(ot, /* @__PURE__ */ new Set([ot]));
2752
- }), K && at.forEach(function(lt) {
2753
- var ot = [];
2754
- if (lt.forEach(function(st) {
2755
- K.has(st) && ot.push(st);
2756
- }), ot.length > 0) {
2757
- var Lt = 0;
2758
- ot.forEach(function(st) {
2759
- Z == "horizontal" ? (et.set(st, u.has(st) ? d[u.get(st)] : q.get(st)), Lt += et.get(st)) : (et.set(st, u.has(st) ? L[u.get(st)] : q.get(st)), Lt += et.get(st));
2760
- }), Lt = Lt / ot.length, lt.forEach(function(st) {
2761
- K.has(st) || et.set(st, Lt);
2762
- });
2763
- } else {
2764
- var ft = 0;
2765
- lt.forEach(function(st) {
2766
- Z == "horizontal" ? ft += u.has(st) ? d[u.get(st)] : q.get(st) : ft += u.has(st) ? L[u.get(st)] : q.get(st);
2767
- }), ft = ft / lt.length, lt.forEach(function(st) {
2768
- et.set(st, ft);
2769
- });
2770
- }
2771
- });
2772
- for (var At = function() {
2773
- var ot = dt.shift(), Lt = Y.get(ot);
2774
- Lt.forEach(function(ft) {
2775
- if (et.get(ft.id) < et.get(ot) + ft.gap)
2776
- if (K && K.has(ft.id)) {
2777
- var st = void 0;
2778
- if (Z == "horizontal" ? st = u.has(ft.id) ? d[u.get(ft.id)] : q.get(ft.id) : st = u.has(ft.id) ? L[u.get(ft.id)] : q.get(ft.id), et.set(ft.id, st), st < et.get(ot) + ft.gap) {
2779
- var Xt = et.get(ot) + ft.gap - st;
2780
- j.get(ot).forEach(function(Tt) {
2781
- et.set(Tt, et.get(Tt) - Xt);
2782
- });
2783
- }
2784
- } else
2785
- et.set(ft.id, et.get(ot) + ft.gap);
2786
- nt.set(ft.id, nt.get(ft.id) - 1), nt.get(ft.id) == 0 && dt.push(ft.id), K && j.set(ft.id, ct(j.get(ot), j.get(ft.id)));
2787
- });
2788
- }; dt.length != 0; )
2789
- At();
2790
- if (K) {
2791
- var pt = /* @__PURE__ */ new Set();
2792
- Y.forEach(function(lt, ot) {
2793
- lt.length == 0 && pt.add(ot);
2794
- });
2795
- var xt = [];
2796
- j.forEach(function(lt, ot) {
2797
- if (pt.has(ot)) {
2798
- var Lt = !1, ft = !0, st = !1, Xt = void 0;
2799
- try {
2800
- for (var Tt = lt[Symbol.iterator](), Ct; !(ft = (Ct = Tt.next()).done); ft = !0) {
2801
- var Bt = Ct.value;
2802
- K.has(Bt) && (Lt = !0);
2803
- }
2804
- } catch (St) {
2805
- st = !0, Xt = St;
2806
- } finally {
2807
- try {
2808
- !ft && Tt.return && Tt.return();
2809
- } finally {
2810
- if (st)
2811
- throw Xt;
2812
- }
2813
- }
2814
- if (!Lt) {
2815
- var bt = !1, zt = void 0;
2816
- xt.forEach(function(St, kt) {
2817
- St.has([].concat(f(lt))[0]) && (bt = !0, zt = kt);
2818
- }), bt ? lt.forEach(function(St) {
2819
- xt[zt].add(St);
2820
- }) : xt.push(new Set(lt));
2821
- }
2822
- }
2823
- }), xt.forEach(function(lt, ot) {
2824
- var Lt = Number.POSITIVE_INFINITY, ft = Number.POSITIVE_INFINITY, st = Number.NEGATIVE_INFINITY, Xt = Number.NEGATIVE_INFINITY, Tt = !0, Ct = !1, Bt = void 0;
2825
- try {
2826
- for (var bt = lt[Symbol.iterator](), zt; !(Tt = (zt = bt.next()).done); Tt = !0) {
2827
- var St = zt.value, kt = void 0;
2828
- Z == "horizontal" ? kt = u.has(St) ? d[u.get(St)] : q.get(St) : kt = u.has(St) ? L[u.get(St)] : q.get(St);
2829
- var Kt = et.get(St);
2830
- kt < Lt && (Lt = kt), kt > st && (st = kt), Kt < ft && (ft = Kt), Kt > Xt && (Xt = Kt);
2831
- }
2832
- } catch (ee) {
2833
- Ct = !0, Bt = ee;
2834
- } finally {
2835
- try {
2836
- !Tt && bt.return && bt.return();
2837
- } finally {
2838
- if (Ct)
2839
- throw Bt;
2840
- }
2841
- }
2842
- var ce = (Lt + st) / 2 - (ft + Xt) / 2, Qt = !0, jt = !1, _t = void 0;
2843
- try {
2844
- for (var Jt = lt[Symbol.iterator](), oe; !(Qt = (oe = Jt.next()).done); Qt = !0) {
2845
- var te = oe.value;
2846
- et.set(te, et.get(te) + ce);
2847
- }
2848
- } catch (ee) {
2849
- jt = !0, _t = ee;
2850
- } finally {
2851
- try {
2852
- !Qt && Jt.return && Jt.return();
2853
- } finally {
2854
- if (jt)
2855
- throw _t;
2856
- }
2857
- }
2858
- });
2859
- }
2860
- return et;
2861
- }, _ = function(Y) {
2862
- var Z = 0, K = 0, q = 0, at = 0;
2863
- if (Y.forEach(function(j) {
2864
- j.left ? d[u.get(j.left)] - d[u.get(j.right)] >= 0 ? Z++ : K++ : L[u.get(j.top)] - L[u.get(j.bottom)] >= 0 ? q++ : at++;
2865
- }), Z > K && q > at)
2866
- for (var ct = 0; ct < u.size; ct++)
2867
- d[ct] = -1 * d[ct], L[ct] = -1 * L[ct];
2868
- else if (Z > K)
2869
- for (var nt = 0; nt < u.size; nt++)
2870
- d[nt] = -1 * d[nt];
2871
- else if (q > at)
2872
- for (var et = 0; et < u.size; et++)
2873
- L[et] = -1 * L[et];
2874
- }, o = function(Y) {
2875
- var Z = [], K = new g(), q = /* @__PURE__ */ new Set(), at = 0;
2876
- return Y.forEach(function(ct, nt) {
2877
- if (!q.has(nt)) {
2878
- Z[at] = [];
2879
- var et = nt;
2880
- for (K.push(et), q.add(et), Z[at].push(et); K.length != 0; ) {
2881
- et = K.shift();
2882
- var j = Y.get(et);
2883
- j.forEach(function(dt) {
2884
- q.has(dt.id) || (K.push(dt.id), q.add(dt.id), Z[at].push(dt.id));
2885
- });
2886
- }
2887
- at++;
2888
- }
2889
- }), Z;
2890
- }, E = function(Y) {
2891
- var Z = /* @__PURE__ */ new Map();
2892
- return Y.forEach(function(K, q) {
2893
- Z.set(q, []);
2894
- }), Y.forEach(function(K, q) {
2895
- K.forEach(function(at) {
2896
- Z.get(q).push(at), Z.get(at.id).push({ id: q, gap: at.gap, direction: at.direction });
2897
- });
2898
- }), Z;
2899
- }, p = function(Y) {
2900
- var Z = /* @__PURE__ */ new Map();
2901
- return Y.forEach(function(K, q) {
2902
- Z.set(q, []);
2903
- }), Y.forEach(function(K, q) {
2904
- K.forEach(function(at) {
2905
- Z.get(at.id).push({ id: q, gap: at.gap, direction: at.direction });
2906
- });
2907
- }), Z;
2908
- }, m = [], y = [], S = !1, O = !1, F = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), Q = [];
2909
- if (l.fixedNodeConstraint && l.fixedNodeConstraint.forEach(function(P) {
2910
- F.add(P.nodeId);
2911
- }), l.relativePlacementConstraint && (l.relativePlacementConstraint.forEach(function(P) {
2912
- P.left ? (W.has(P.left) ? W.get(P.left).push({ id: P.right, gap: P.gap, direction: "horizontal" }) : W.set(P.left, [{ id: P.right, gap: P.gap, direction: "horizontal" }]), W.has(P.right) || W.set(P.right, [])) : (W.has(P.top) ? W.get(P.top).push({ id: P.bottom, gap: P.gap, direction: "vertical" }) : W.set(P.top, [{ id: P.bottom, gap: P.gap, direction: "vertical" }]), W.has(P.bottom) || W.set(P.bottom, []));
2913
- }), I = E(W), Q = o(I)), e.TRANSFORM_ON_CONSTRAINT_HANDLING) {
2914
- if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 1)
2915
- l.fixedNodeConstraint.forEach(function(P, Y) {
2916
- m[Y] = [P.position.x, P.position.y], y[Y] = [d[u.get(P.nodeId)], L[u.get(P.nodeId)]];
2917
- }), S = !0;
2918
- else if (l.alignmentConstraint)
2919
- (function() {
2920
- var P = 0;
2921
- if (l.alignmentConstraint.vertical) {
2922
- for (var Y = l.alignmentConstraint.vertical, Z = function(et) {
2923
- var j = /* @__PURE__ */ new Set();
2924
- Y[et].forEach(function(pt) {
2925
- j.add(pt);
2926
- });
2927
- var dt = new Set([].concat(f(j)).filter(function(pt) {
2928
- return F.has(pt);
2929
- })), At = void 0;
2930
- dt.size > 0 ? At = d[u.get(dt.values().next().value)] : At = V(j).x, Y[et].forEach(function(pt) {
2931
- m[P] = [At, L[u.get(pt)]], y[P] = [d[u.get(pt)], L[u.get(pt)]], P++;
2932
- });
2933
- }, K = 0; K < Y.length; K++)
2934
- Z(K);
2935
- S = !0;
2936
- }
2937
- if (l.alignmentConstraint.horizontal) {
2938
- for (var q = l.alignmentConstraint.horizontal, at = function(et) {
2939
- var j = /* @__PURE__ */ new Set();
2940
- q[et].forEach(function(pt) {
2941
- j.add(pt);
2942
- });
2943
- var dt = new Set([].concat(f(j)).filter(function(pt) {
2944
- return F.has(pt);
2945
- })), At = void 0;
2946
- dt.size > 0 ? At = d[u.get(dt.values().next().value)] : At = V(j).y, q[et].forEach(function(pt) {
2947
- m[P] = [d[u.get(pt)], At], y[P] = [d[u.get(pt)], L[u.get(pt)]], P++;
2948
- });
2949
- }, ct = 0; ct < q.length; ct++)
2950
- at(ct);
2951
- S = !0;
2952
- }
2953
- l.relativePlacementConstraint && (O = !0);
2954
- })();
2955
- else if (l.relativePlacementConstraint) {
2956
- for (var z = 0, X = 0, rt = 0; rt < Q.length; rt++)
2957
- Q[rt].length > z && (z = Q[rt].length, X = rt);
2958
- if (z < I.size / 2)
2959
- _(l.relativePlacementConstraint), S = !1, O = !1;
2960
- else {
2961
- var $ = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), H = [];
2962
- Q[X].forEach(function(P) {
2963
- W.get(P).forEach(function(Y) {
2964
- Y.direction == "horizontal" ? ($.has(P) ? $.get(P).push(Y) : $.set(P, [Y]), $.has(Y.id) || $.set(Y.id, []), H.push({ left: P, right: Y.id })) : (D.has(P) ? D.get(P).push(Y) : D.set(P, [Y]), D.has(Y.id) || D.set(Y.id, []), H.push({ top: P, bottom: Y.id }));
2965
- });
2966
- }), _(H), O = !1;
2967
- var k = M($, "horizontal"), tt = M(D, "vertical");
2968
- Q[X].forEach(function(P, Y) {
2969
- y[Y] = [d[u.get(P)], L[u.get(P)]], m[Y] = [], k.has(P) ? m[Y][0] = k.get(P) : m[Y][0] = d[u.get(P)], tt.has(P) ? m[Y][1] = tt.get(P) : m[Y][1] = L[u.get(P)];
2970
- }), S = !0;
2971
- }
2972
- }
2973
- if (S) {
2974
- for (var ht = void 0, J = t.transpose(m), It = t.transpose(y), Nt = 0; Nt < J.length; Nt++)
2975
- J[Nt] = t.multGamma(J[Nt]), It[Nt] = t.multGamma(It[Nt]);
2976
- var vt = t.multMat(J, t.transpose(It)), it = s.svd(vt);
2977
- ht = t.multMat(it.V, t.transpose(it.U));
2978
- for (var ut = 0; ut < u.size; ut++) {
2979
- var Et = [d[ut], L[ut]], wt = [ht[0][0], ht[1][0]], Ot = [ht[0][1], ht[1][1]];
2980
- d[ut] = t.dotProduct(Et, wt), L[ut] = t.dotProduct(Et, Ot);
2981
- }
2982
- O && _(l.relativePlacementConstraint);
2983
- }
2984
- }
2985
- if (e.ENFORCE_CONSTRAINTS) {
2986
- if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 0) {
2987
- var mt = { x: 0, y: 0 };
2988
- l.fixedNodeConstraint.forEach(function(P, Y) {
2989
- var Z = { x: d[u.get(P.nodeId)], y: L[u.get(P.nodeId)] }, K = P.position, q = U(K, Z);
2990
- mt.x += q.x, mt.y += q.y;
2991
- }), mt.x /= l.fixedNodeConstraint.length, mt.y /= l.fixedNodeConstraint.length, d.forEach(function(P, Y) {
2992
- d[Y] += mt.x;
2993
- }), L.forEach(function(P, Y) {
2994
- L[Y] += mt.y;
2995
- }), l.fixedNodeConstraint.forEach(function(P) {
2996
- d[u.get(P.nodeId)] = P.position.x, L[u.get(P.nodeId)] = P.position.y;
2997
- });
2998
- }
2999
- if (l.alignmentConstraint) {
3000
- if (l.alignmentConstraint.vertical)
3001
- for (var Dt = l.alignmentConstraint.vertical, Rt = function(Y) {
3002
- var Z = /* @__PURE__ */ new Set();
3003
- Dt[Y].forEach(function(at) {
3004
- Z.add(at);
3005
- });
3006
- var K = new Set([].concat(f(Z)).filter(function(at) {
3007
- return F.has(at);
3008
- })), q = void 0;
3009
- K.size > 0 ? q = d[u.get(K.values().next().value)] : q = V(Z).x, Z.forEach(function(at) {
3010
- F.has(at) || (d[u.get(at)] = q);
3011
- });
3012
- }, Ht = 0; Ht < Dt.length; Ht++)
3013
- Rt(Ht);
3014
- if (l.alignmentConstraint.horizontal)
3015
- for (var Ut = l.alignmentConstraint.horizontal, Pt = function(Y) {
3016
- var Z = /* @__PURE__ */ new Set();
3017
- Ut[Y].forEach(function(at) {
3018
- Z.add(at);
3019
- });
3020
- var K = new Set([].concat(f(Z)).filter(function(at) {
3021
- return F.has(at);
3022
- })), q = void 0;
3023
- K.size > 0 ? q = L[u.get(K.values().next().value)] : q = V(Z).y, Z.forEach(function(at) {
3024
- F.has(at) || (L[u.get(at)] = q);
3025
- });
3026
- }, Ft = 0; Ft < Ut.length; Ft++)
3027
- Pt(Ft);
3028
- }
3029
- l.relativePlacementConstraint && function() {
3030
- var P = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Set(), nt = /* @__PURE__ */ new Set();
3031
- if (F.forEach(function(Gt) {
3032
- ct.add(Gt), nt.add(Gt);
3033
- }), l.alignmentConstraint) {
3034
- if (l.alignmentConstraint.vertical)
3035
- for (var et = l.alignmentConstraint.vertical, j = function(yt) {
3036
- Z.set("dummy" + yt, []), et[yt].forEach(function(Mt) {
3037
- P.set(Mt, "dummy" + yt), Z.get("dummy" + yt).push(Mt), F.has(Mt) && ct.add("dummy" + yt);
3038
- }), q.set("dummy" + yt, d[u.get(et[yt][0])]);
3039
- }, dt = 0; dt < et.length; dt++)
3040
- j(dt);
3041
- if (l.alignmentConstraint.horizontal)
3042
- for (var At = l.alignmentConstraint.horizontal, pt = function(yt) {
3043
- K.set("dummy" + yt, []), At[yt].forEach(function(Mt) {
3044
- Y.set(Mt, "dummy" + yt), K.get("dummy" + yt).push(Mt), F.has(Mt) && nt.add("dummy" + yt);
3045
- }), at.set("dummy" + yt, L[u.get(At[yt][0])]);
3046
- }, xt = 0; xt < At.length; xt++)
3047
- pt(xt);
3048
- }
3049
- var lt = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), Lt = function(yt) {
3050
- W.get(yt).forEach(function(Mt) {
3051
- var Zt = void 0, $t = void 0;
3052
- Mt.direction == "horizontal" ? (Zt = P.get(yt) ? P.get(yt) : yt, P.get(Mt.id) ? $t = { id: P.get(Mt.id), gap: Mt.gap, direction: Mt.direction } : $t = Mt, lt.has(Zt) ? lt.get(Zt).push($t) : lt.set(Zt, [$t]), lt.has($t.id) || lt.set($t.id, [])) : (Zt = Y.get(yt) ? Y.get(yt) : yt, Y.get(Mt.id) ? $t = { id: Y.get(Mt.id), gap: Mt.gap, direction: Mt.direction } : $t = Mt, ot.has(Zt) ? ot.get(Zt).push($t) : ot.set(Zt, [$t]), ot.has($t.id) || ot.set($t.id, []));
3053
- });
3054
- }, ft = !0, st = !1, Xt = void 0;
3055
- try {
3056
- for (var Tt = W.keys()[Symbol.iterator](), Ct; !(ft = (Ct = Tt.next()).done); ft = !0) {
3057
- var Bt = Ct.value;
3058
- Lt(Bt);
3059
- }
3060
- } catch (Gt) {
3061
- st = !0, Xt = Gt;
3062
- } finally {
3063
- try {
3064
- !ft && Tt.return && Tt.return();
3065
- } finally {
3066
- if (st)
3067
- throw Xt;
3068
- }
3069
- }
3070
- var bt = E(lt), zt = E(ot), St = o(bt), kt = o(zt), Kt = p(lt), ce = p(ot), Qt = [], jt = [];
3071
- St.forEach(function(Gt, yt) {
3072
- Qt[yt] = [], Gt.forEach(function(Mt) {
3073
- Kt.get(Mt).length == 0 && Qt[yt].push(Mt);
3074
- });
3075
- }), kt.forEach(function(Gt, yt) {
3076
- jt[yt] = [], Gt.forEach(function(Mt) {
3077
- ce.get(Mt).length == 0 && jt[yt].push(Mt);
3078
- });
3079
- });
3080
- var _t = M(lt, "horizontal", ct, q, Qt), Jt = M(ot, "vertical", nt, at, jt), oe = function(yt) {
3081
- Z.get(yt) ? Z.get(yt).forEach(function(Mt) {
3082
- d[u.get(Mt)] = _t.get(yt);
3083
- }) : d[u.get(yt)] = _t.get(yt);
3084
- }, te = !0, ee = !1, Le = void 0;
3085
- try {
3086
- for (var ge = _t.keys()[Symbol.iterator](), Ce; !(te = (Ce = ge.next()).done); te = !0) {
3087
- var ue = Ce.value;
3088
- oe(ue);
3089
- }
3090
- } catch (Gt) {
3091
- ee = !0, Le = Gt;
3092
- } finally {
3093
- try {
3094
- !te && ge.return && ge.return();
3095
- } finally {
3096
- if (ee)
3097
- throw Le;
3098
- }
3099
- }
3100
- var ke = function(yt) {
3101
- K.get(yt) ? K.get(yt).forEach(function(Mt) {
3102
- L[u.get(Mt)] = Jt.get(yt);
3103
- }) : L[u.get(yt)] = Jt.get(yt);
3104
- }, de = !0, we = !1, Ae = void 0;
3105
- try {
3106
- for (var ve = Jt.keys()[Symbol.iterator](), Me; !(de = (Me = ve.next()).done); de = !0) {
3107
- var ue = Me.value;
3108
- ke(ue);
3109
- }
3110
- } catch (Gt) {
3111
- we = !0, Ae = Gt;
3112
- } finally {
3113
- try {
3114
- !de && ve.return && ve.return();
3115
- } finally {
3116
- if (we)
3117
- throw Ae;
3118
- }
3119
- }
3120
- }();
3121
- }
3122
- for (var Yt = 0; Yt < b.length; Yt++) {
3123
- var Vt = b[Yt];
3124
- Vt.getChild() == null && Vt.setCenter(d[u.get(Vt.id)], L[u.get(Vt.id)]);
3125
- }
3126
- }, a.exports = n;
3127
- }
3128
- ),
3129
- /***/
3130
- 551: (
3131
- /***/
3132
- (a) => {
3133
- a.exports = C;
3134
- }
3135
- )
3136
- /******/
3137
- }, N = {};
3138
- function v(a) {
3139
- var r = N[a];
3140
- if (r !== void 0)
3141
- return r.exports;
3142
- var i = N[a] = {
3143
- /******/
3144
- // no module.id needed
3145
- /******/
3146
- // no module.loaded needed
3147
- /******/
3148
- exports: {}
3149
- /******/
3150
- };
3151
- return R[a](i, i.exports, v), i.exports;
3152
- }
3153
- var h = v(45);
3154
- return h;
3155
- })()
3156
- );
3157
- });
3158
- }(le)), le.exports;
3159
- }
3160
- var yr = he.exports, xe;
3161
- function mr() {
3162
- return xe || (xe = 1, function(x, A) {
3163
- (function(R, N) {
3164
- x.exports = N(pr());
3165
- })(yr, function(C) {
3166
- return (
3167
- /******/
3168
- (() => {
3169
- var R = {
3170
- /***/
3171
- 658: (
3172
- /***/
3173
- (a) => {
3174
- a.exports = Object.assign != null ? Object.assign.bind(Object) : function(r) {
3175
- for (var i = arguments.length, f = Array(i > 1 ? i - 1 : 0), e = 1; e < i; e++)
3176
- f[e - 1] = arguments[e];
3177
- return f.forEach(function(g) {
3178
- Object.keys(g).forEach(function(t) {
3179
- return r[t] = g[t];
3180
- });
3181
- }), r;
3182
- };
3183
- }
3184
- ),
3185
- /***/
3186
- 548: (
3187
- /***/
3188
- (a, r, i) => {
3189
- var f = /* @__PURE__ */ function() {
3190
- function t(s, n) {
3191
- var c = [], l = !0, T = !1, u = void 0;
3192
- try {
3193
- for (var d = s[Symbol.iterator](), L; !(l = (L = d.next()).done) && (c.push(L.value), !(n && c.length === n)); l = !0)
3194
- ;
3195
- } catch (b) {
3196
- T = !0, u = b;
3197
- } finally {
3198
- try {
3199
- !l && d.return && d.return();
3200
- } finally {
3201
- if (T) throw u;
3202
- }
3203
- }
3204
- return c;
3205
- }
3206
- return function(s, n) {
3207
- if (Array.isArray(s))
3208
- return s;
3209
- if (Symbol.iterator in Object(s))
3210
- return t(s, n);
3211
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
3212
- };
3213
- }(), e = i(140).layoutBase.LinkedList, g = {};
3214
- g.getTopMostNodes = function(t) {
3215
- for (var s = {}, n = 0; n < t.length; n++)
3216
- s[t[n].id()] = !0;
3217
- var c = t.filter(function(l, T) {
3218
- typeof l == "number" && (l = T);
3219
- for (var u = l.parent()[0]; u != null; ) {
3220
- if (s[u.id()])
3221
- return !1;
3222
- u = u.parent()[0];
3223
- }
3224
- return !0;
3225
- });
3226
- return c;
3227
- }, g.connectComponents = function(t, s, n, c) {
3228
- var l = new e(), T = /* @__PURE__ */ new Set(), u = [], d = void 0, L = void 0, b = void 0, w = !1, G = 1, B = [], U = [], V = function() {
3229
- var _ = t.collection();
3230
- U.push(_);
3231
- var o = n[0], E = t.collection();
3232
- E.merge(o).merge(o.descendants().intersection(s)), u.push(o), E.forEach(function(y) {
3233
- l.push(y), T.add(y), _.merge(y);
3234
- });
3235
- for (var p = function() {
3236
- o = l.shift();
3237
- var S = t.collection();
3238
- o.neighborhood().nodes().forEach(function(I) {
3239
- s.intersection(o.edgesWith(I)).length > 0 && S.merge(I);
3240
- });
3241
- for (var O = 0; O < S.length; O++) {
3242
- var F = S[O];
3243
- if (d = n.intersection(F.union(F.ancestors())), d != null && !T.has(d[0])) {
3244
- var W = d.union(d.descendants());
3245
- W.forEach(function(I) {
3246
- l.push(I), T.add(I), _.merge(I), n.has(I) && u.push(I);
3247
- });
3248
- }
3249
- }
3250
- }; l.length != 0; )
3251
- p();
3252
- if (_.forEach(function(y) {
3253
- s.intersection(y.connectedEdges()).forEach(function(S) {
3254
- _.has(S.source()) && _.has(S.target()) && _.merge(S);
3255
- });
3256
- }), u.length == n.length && (w = !0), !w || w && G > 1) {
3257
- L = u[0], b = L.connectedEdges().length, u.forEach(function(y) {
3258
- y.connectedEdges().length < b && (b = y.connectedEdges().length, L = y);
3259
- }), B.push(L.id());
3260
- var m = t.collection();
3261
- m.merge(u[0]), u.forEach(function(y) {
3262
- m.merge(y);
3263
- }), u = [], n = n.difference(m), G++;
3264
- }
3265
- };
3266
- do
3267
- V();
3268
- while (!w);
3269
- return c && B.length > 0 && c.set("dummy" + (c.size + 1), B), U;
3270
- }, g.relocateComponent = function(t, s, n) {
3271
- if (!n.fixedNodeConstraint) {
3272
- var c = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY, T = Number.POSITIVE_INFINITY, u = Number.NEGATIVE_INFINITY;
3273
- if (n.quality == "draft") {
3274
- var d = !0, L = !1, b = void 0;
3275
- try {
3276
- for (var w = s.nodeIndexes[Symbol.iterator](), G; !(d = (G = w.next()).done); d = !0) {
3277
- var B = G.value, U = f(B, 2), V = U[0], M = U[1], _ = n.cy.getElementById(V);
3278
- if (_) {
3279
- var o = _.boundingBox(), E = s.xCoords[M] - o.w / 2, p = s.xCoords[M] + o.w / 2, m = s.yCoords[M] - o.h / 2, y = s.yCoords[M] + o.h / 2;
3280
- E < c && (c = E), p > l && (l = p), m < T && (T = m), y > u && (u = y);
3281
- }
3282
- }
3283
- } catch (I) {
3284
- L = !0, b = I;
3285
- } finally {
3286
- try {
3287
- !d && w.return && w.return();
3288
- } finally {
3289
- if (L)
3290
- throw b;
3291
- }
3292
- }
3293
- var S = t.x - (l + c) / 2, O = t.y - (u + T) / 2;
3294
- s.xCoords = s.xCoords.map(function(I) {
3295
- return I + S;
3296
- }), s.yCoords = s.yCoords.map(function(I) {
3297
- return I + O;
3298
- });
3299
- } else {
3300
- Object.keys(s).forEach(function(I) {
3301
- var Q = s[I], z = Q.getRect().x, X = Q.getRect().x + Q.getRect().width, rt = Q.getRect().y, $ = Q.getRect().y + Q.getRect().height;
3302
- z < c && (c = z), X > l && (l = X), rt < T && (T = rt), $ > u && (u = $);
3303
- });
3304
- var F = t.x - (l + c) / 2, W = t.y - (u + T) / 2;
3305
- Object.keys(s).forEach(function(I) {
3306
- var Q = s[I];
3307
- Q.setCenter(Q.getCenterX() + F, Q.getCenterY() + W);
3308
- });
3309
- }
3310
- }
3311
- }, g.calcBoundingBox = function(t, s, n, c) {
3312
- for (var l = Number.MAX_SAFE_INTEGER, T = Number.MIN_SAFE_INTEGER, u = Number.MAX_SAFE_INTEGER, d = Number.MIN_SAFE_INTEGER, L = void 0, b = void 0, w = void 0, G = void 0, B = t.descendants().not(":parent"), U = B.length, V = 0; V < U; V++) {
3313
- var M = B[V];
3314
- L = s[c.get(M.id())] - M.width() / 2, b = s[c.get(M.id())] + M.width() / 2, w = n[c.get(M.id())] - M.height() / 2, G = n[c.get(M.id())] + M.height() / 2, l > L && (l = L), T < b && (T = b), u > w && (u = w), d < G && (d = G);
3315
- }
3316
- var _ = {};
3317
- return _.topLeftX = l, _.topLeftY = u, _.width = T - l, _.height = d - u, _;
3318
- }, g.calcParentsWithoutChildren = function(t, s) {
3319
- var n = t.collection();
3320
- return s.nodes(":parent").forEach(function(c) {
3321
- var l = !1;
3322
- c.children().forEach(function(T) {
3323
- T.css("display") != "none" && (l = !0);
3324
- }), l || n.merge(c);
3325
- }), n;
3326
- }, a.exports = g;
3327
- }
3328
- ),
3329
- /***/
3330
- 816: (
3331
- /***/
3332
- (a, r, i) => {
3333
- var f = i(548), e = i(140).CoSELayout, g = i(140).CoSENode, t = i(140).layoutBase.PointD, s = i(140).layoutBase.DimensionD, n = i(140).layoutBase.LayoutConstants, c = i(140).layoutBase.FDLayoutConstants, l = i(140).CoSEConstants, T = function(d, L) {
3334
- var b = d.cy, w = d.eles, G = w.nodes(), B = w.edges(), U = void 0, V = void 0, M = void 0, _ = {};
3335
- d.randomize && (U = L.nodeIndexes, V = L.xCoords, M = L.yCoords);
3336
- var o = function(I) {
3337
- return typeof I == "function";
3338
- }, E = function(I, Q) {
3339
- return o(I) ? I(Q) : I;
3340
- }, p = f.calcParentsWithoutChildren(b, w), m = function W(I, Q, z, X) {
3341
- for (var rt = Q.length, $ = 0; $ < rt; $++) {
3342
- var D = Q[$], H = null;
3343
- D.intersection(p).length == 0 && (H = D.children());
3344
- var k = void 0, tt = D.layoutDimensions({
3345
- nodeDimensionsIncludeLabels: X.nodeDimensionsIncludeLabels
3346
- });
3347
- if (D.outerWidth() != null && D.outerHeight() != null)
3348
- if (X.randomize)
3349
- if (!D.isParent())
3350
- k = I.add(new g(z.graphManager, new t(V[U.get(D.id())] - tt.w / 2, M[U.get(D.id())] - tt.h / 2), new s(parseFloat(tt.w), parseFloat(tt.h))));
3351
- else {
3352
- var ht = f.calcBoundingBox(D, V, M, U);
3353
- D.intersection(p).length == 0 ? k = I.add(new g(z.graphManager, new t(ht.topLeftX, ht.topLeftY), new s(ht.width, ht.height))) : k = I.add(new g(z.graphManager, new t(ht.topLeftX, ht.topLeftY), new s(parseFloat(tt.w), parseFloat(tt.h))));
3354
- }
3355
- else
3356
- k = I.add(new g(z.graphManager, new t(D.position("x") - tt.w / 2, D.position("y") - tt.h / 2), new s(parseFloat(tt.w), parseFloat(tt.h))));
3357
- else
3358
- k = I.add(new g(this.graphManager));
3359
- if (k.id = D.data("id"), k.nodeRepulsion = E(X.nodeRepulsion, D), k.paddingLeft = parseInt(D.css("padding")), k.paddingTop = parseInt(D.css("padding")), k.paddingRight = parseInt(D.css("padding")), k.paddingBottom = parseInt(D.css("padding")), X.nodeDimensionsIncludeLabels && (k.labelWidth = D.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).w, k.labelHeight = D.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).h, k.labelPosVertical = D.css("text-valign"), k.labelPosHorizontal = D.css("text-halign")), _[D.data("id")] = k, isNaN(k.rect.x) && (k.rect.x = 0), isNaN(k.rect.y) && (k.rect.y = 0), H != null && H.length > 0) {
3360
- var J = void 0;
3361
- J = z.getGraphManager().add(z.newGraph(), k), W(J, H, z, X);
3362
- }
3363
- }
3364
- }, y = function(I, Q, z) {
3365
- for (var X = 0, rt = 0, $ = 0; $ < z.length; $++) {
3366
- var D = z[$], H = _[D.data("source")], k = _[D.data("target")];
3367
- if (H && k && H !== k && H.getEdgesBetween(k).length == 0) {
3368
- var tt = Q.add(I.newEdge(), H, k);
3369
- tt.id = D.id(), tt.idealLength = E(d.idealEdgeLength, D), tt.edgeElasticity = E(d.edgeElasticity, D), X += tt.idealLength, rt++;
3370
- }
3371
- }
3372
- d.idealEdgeLength != null && (rt > 0 ? l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = X / rt : o(d.idealEdgeLength) ? l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = 50 : l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = d.idealEdgeLength, l.MIN_REPULSION_DIST = c.MIN_REPULSION_DIST = c.DEFAULT_EDGE_LENGTH / 10, l.DEFAULT_RADIAL_SEPARATION = c.DEFAULT_EDGE_LENGTH);
3373
- }, S = function(I, Q) {
3374
- Q.fixedNodeConstraint && (I.constraints.fixedNodeConstraint = Q.fixedNodeConstraint), Q.alignmentConstraint && (I.constraints.alignmentConstraint = Q.alignmentConstraint), Q.relativePlacementConstraint && (I.constraints.relativePlacementConstraint = Q.relativePlacementConstraint);
3375
- };
3376
- d.nestingFactor != null && (l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = d.nestingFactor), d.gravity != null && (l.DEFAULT_GRAVITY_STRENGTH = c.DEFAULT_GRAVITY_STRENGTH = d.gravity), d.numIter != null && (l.MAX_ITERATIONS = c.MAX_ITERATIONS = d.numIter), d.gravityRange != null && (l.DEFAULT_GRAVITY_RANGE_FACTOR = c.DEFAULT_GRAVITY_RANGE_FACTOR = d.gravityRange), d.gravityCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_STRENGTH = c.DEFAULT_COMPOUND_GRAVITY_STRENGTH = d.gravityCompound), d.gravityRangeCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = d.gravityRangeCompound), d.initialEnergyOnIncremental != null && (l.DEFAULT_COOLING_FACTOR_INCREMENTAL = c.DEFAULT_COOLING_FACTOR_INCREMENTAL = d.initialEnergyOnIncremental), d.tilingCompareBy != null && (l.TILING_COMPARE_BY = d.tilingCompareBy), d.quality == "proof" ? n.QUALITY = 2 : n.QUALITY = 0, l.NODE_DIMENSIONS_INCLUDE_LABELS = c.NODE_DIMENSIONS_INCLUDE_LABELS = n.NODE_DIMENSIONS_INCLUDE_LABELS = d.nodeDimensionsIncludeLabels, l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = !d.randomize, l.ANIMATE = c.ANIMATE = n.ANIMATE = d.animate, l.TILE = d.tile, l.TILING_PADDING_VERTICAL = typeof d.tilingPaddingVertical == "function" ? d.tilingPaddingVertical.call() : d.tilingPaddingVertical, l.TILING_PADDING_HORIZONTAL = typeof d.tilingPaddingHorizontal == "function" ? d.tilingPaddingHorizontal.call() : d.tilingPaddingHorizontal, l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = !0, l.PURE_INCREMENTAL = !d.randomize, n.DEFAULT_UNIFORM_LEAF_NODE_SIZES = d.uniformNodeDimensions, d.step == "transformed" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !1), d.step == "enforced" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !1), d.step == "cose" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !0), d.step == "all" && (d.randomize ? l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !0), d.fixedNodeConstraint || d.alignmentConstraint || d.relativePlacementConstraint ? l.TREE_REDUCTION_ON_INCREMENTAL = !1 : l.TREE_REDUCTION_ON_INCREMENTAL = !0;
3377
- var O = new e(), F = O.newGraphManager();
3378
- return m(F.addRoot(), f.getTopMostNodes(G), O, d), y(O, F, B), S(O, d), O.runLayout(), _;
3379
- };
3380
- a.exports = { coseLayout: T };
3381
- }
3382
- ),
3383
- /***/
3384
- 212: (
3385
- /***/
3386
- (a, r, i) => {
3387
- var f = /* @__PURE__ */ function() {
3388
- function d(L, b) {
3389
- for (var w = 0; w < b.length; w++) {
3390
- var G = b[w];
3391
- G.enumerable = G.enumerable || !1, G.configurable = !0, "value" in G && (G.writable = !0), Object.defineProperty(L, G.key, G);
3392
- }
3393
- }
3394
- return function(L, b, w) {
3395
- return b && d(L.prototype, b), w && d(L, w), L;
3396
- };
3397
- }();
3398
- function e(d, L) {
3399
- if (!(d instanceof L))
3400
- throw new TypeError("Cannot call a class as a function");
3401
- }
3402
- var g = i(658), t = i(548), s = i(657), n = s.spectralLayout, c = i(816), l = c.coseLayout, T = Object.freeze({
3403
- // 'draft', 'default' or 'proof'
3404
- // - 'draft' only applies spectral layout
3405
- // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
3406
- // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate)
3407
- quality: "default",
3408
- // Use random node positions at beginning of layout
3409
- // if this is set to false, then quality option must be "proof"
3410
- randomize: !0,
3411
- // Whether or not to animate the layout
3412
- animate: !0,
3413
- // Duration of animation in ms, if enabled
3414
- animationDuration: 1e3,
3415
- // Easing of animation, if enabled
3416
- animationEasing: void 0,
3417
- // Fit the viewport to the repositioned nodes
3418
- fit: !0,
3419
- // Padding around layout
3420
- padding: 30,
3421
- // Whether to include labels in node dimensions. Valid in "proof" quality
3422
- nodeDimensionsIncludeLabels: !1,
3423
- // Whether or not simple nodes (non-compound nodes) are of uniform dimensions
3424
- uniformNodeDimensions: !1,
3425
- // Whether to pack disconnected components - valid only if randomize: true
3426
- packComponents: !0,
3427
- // Layout step - all, transformed, enforced, cose - for debug purpose only
3428
- step: "all",
3429
- /* spectral layout options */
3430
- // False for random, true for greedy
3431
- samplingType: !0,
3432
- // Sample size to construct distance matrix
3433
- sampleSize: 25,
3434
- // Separation amount between nodes
3435
- nodeSeparation: 75,
3436
- // Power iteration tolerance
3437
- piTol: 1e-7,
3438
- /* CoSE layout options */
3439
- // Node repulsion (non overlapping) multiplier
3440
- nodeRepulsion: function(L) {
3441
- return 4500;
3442
- },
3443
- // Ideal edge (non nested) length
3444
- idealEdgeLength: function(L) {
3445
- return 50;
3446
- },
3447
- // Divisor to compute edge forces
3448
- edgeElasticity: function(L) {
3449
- return 0.45;
3450
- },
3451
- // Nesting factor (multiplier) to compute ideal edge length for nested edges
3452
- nestingFactor: 0.1,
3453
- // Gravity force (constant)
3454
- gravity: 0.25,
3455
- // Maximum number of iterations to perform
3456
- numIter: 2500,
3457
- // For enabling tiling
3458
- tile: !0,
3459
- // The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
3460
- // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
3461
- tilingCompareBy: void 0,
3462
- // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
3463
- tilingPaddingVertical: 10,
3464
- // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
3465
- tilingPaddingHorizontal: 10,
3466
- // Gravity range (constant) for compounds
3467
- gravityRangeCompound: 1.5,
3468
- // Gravity force (constant) for compounds
3469
- gravityCompound: 1,
3470
- // Gravity range (constant)
3471
- gravityRange: 3.8,
3472
- // Initial cooling factor for incremental layout
3473
- initialEnergyOnIncremental: 0.3,
3474
- /* constraint options */
3475
- // Fix required nodes to predefined positions
3476
- // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
3477
- fixedNodeConstraint: void 0,
3478
- // Align required nodes in vertical/horizontal direction
3479
- // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
3480
- alignmentConstraint: void 0,
3481
- // Place two nodes relatively in vertical/horizontal direction
3482
- // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
3483
- relativePlacementConstraint: void 0,
3484
- /* layout event callbacks */
3485
- ready: function() {
3486
- },
3487
- // on layoutready
3488
- stop: function() {
3489
- }
3490
- // on layoutstop
3491
- }), u = function() {
3492
- function d(L) {
3493
- e(this, d), this.options = g({}, T, L);
3494
- }
3495
- return f(d, [{
3496
- key: "run",
3497
- value: function() {
3498
- var b = this, w = this.options, G = w.cy, B = w.eles, U = [], V = [], M = void 0, _ = [];
3499
- w.fixedNodeConstraint && (!Array.isArray(w.fixedNodeConstraint) || w.fixedNodeConstraint.length == 0) && (w.fixedNodeConstraint = void 0), w.alignmentConstraint && (w.alignmentConstraint.vertical && (!Array.isArray(w.alignmentConstraint.vertical) || w.alignmentConstraint.vertical.length == 0) && (w.alignmentConstraint.vertical = void 0), w.alignmentConstraint.horizontal && (!Array.isArray(w.alignmentConstraint.horizontal) || w.alignmentConstraint.horizontal.length == 0) && (w.alignmentConstraint.horizontal = void 0)), w.relativePlacementConstraint && (!Array.isArray(w.relativePlacementConstraint) || w.relativePlacementConstraint.length == 0) && (w.relativePlacementConstraint = void 0);
3500
- var o = w.fixedNodeConstraint || w.alignmentConstraint || w.relativePlacementConstraint;
3501
- o && (w.tile = !1, w.packComponents = !1);
3502
- var E = void 0, p = !1;
3503
- if (G.layoutUtilities && w.packComponents && (E = G.layoutUtilities("get"), E || (E = G.layoutUtilities()), p = !0), B.nodes().length > 0)
3504
- if (p) {
3505
- var S = t.getTopMostNodes(w.eles.nodes());
3506
- if (M = t.connectComponents(G, w.eles, S), M.forEach(function(vt) {
3507
- var it = vt.boundingBox();
3508
- _.push({ x: it.x1 + it.w / 2, y: it.y1 + it.h / 2 });
3509
- }), w.randomize && M.forEach(function(vt) {
3510
- w.eles = vt, U.push(n(w));
3511
- }), w.quality == "default" || w.quality == "proof") {
3512
- var O = G.collection();
3513
- if (w.tile) {
3514
- var F = /* @__PURE__ */ new Map(), W = [], I = [], Q = 0, z = { nodeIndexes: F, xCoords: W, yCoords: I }, X = [];
3515
- if (M.forEach(function(vt, it) {
3516
- vt.edges().length == 0 && (vt.nodes().forEach(function(ut, Et) {
3517
- O.merge(vt.nodes()[Et]), ut.isParent() || (z.nodeIndexes.set(vt.nodes()[Et].id(), Q++), z.xCoords.push(vt.nodes()[0].position().x), z.yCoords.push(vt.nodes()[0].position().y));
3518
- }), X.push(it));
3519
- }), O.length > 1) {
3520
- var rt = O.boundingBox();
3521
- _.push({ x: rt.x1 + rt.w / 2, y: rt.y1 + rt.h / 2 }), M.push(O), U.push(z);
3522
- for (var $ = X.length - 1; $ >= 0; $--)
3523
- M.splice(X[$], 1), U.splice(X[$], 1), _.splice(X[$], 1);
3524
- }
3525
- }
3526
- M.forEach(function(vt, it) {
3527
- w.eles = vt, V.push(l(w, U[it])), t.relocateComponent(_[it], V[it], w);
3528
- });
3529
- } else
3530
- M.forEach(function(vt, it) {
3531
- t.relocateComponent(_[it], U[it], w);
3532
- });
3533
- var D = /* @__PURE__ */ new Set();
3534
- if (M.length > 1) {
3535
- var H = [], k = B.filter(function(vt) {
3536
- return vt.css("display") == "none";
3537
- });
3538
- M.forEach(function(vt, it) {
3539
- var ut = void 0;
3540
- if (w.quality == "draft" && (ut = U[it].nodeIndexes), vt.nodes().not(k).length > 0) {
3541
- var Et = {};
3542
- Et.edges = [], Et.nodes = [];
3543
- var wt = void 0;
3544
- vt.nodes().not(k).forEach(function(Ot) {
3545
- if (w.quality == "draft")
3546
- if (!Ot.isParent())
3547
- wt = ut.get(Ot.id()), Et.nodes.push({ x: U[it].xCoords[wt] - Ot.boundingbox().w / 2, y: U[it].yCoords[wt] - Ot.boundingbox().h / 2, width: Ot.boundingbox().w, height: Ot.boundingbox().h });
3548
- else {
3549
- var mt = t.calcBoundingBox(Ot, U[it].xCoords, U[it].yCoords, ut);
3550
- Et.nodes.push({ x: mt.topLeftX, y: mt.topLeftY, width: mt.width, height: mt.height });
3551
- }
3552
- else
3553
- V[it][Ot.id()] && Et.nodes.push({ x: V[it][Ot.id()].getLeft(), y: V[it][Ot.id()].getTop(), width: V[it][Ot.id()].getWidth(), height: V[it][Ot.id()].getHeight() });
3554
- }), vt.edges().forEach(function(Ot) {
3555
- var mt = Ot.source(), Dt = Ot.target();
3556
- if (mt.css("display") != "none" && Dt.css("display") != "none")
3557
- if (w.quality == "draft") {
3558
- var Rt = ut.get(mt.id()), Ht = ut.get(Dt.id()), Ut = [], Pt = [];
3559
- if (mt.isParent()) {
3560
- var Ft = t.calcBoundingBox(mt, U[it].xCoords, U[it].yCoords, ut);
3561
- Ut.push(Ft.topLeftX + Ft.width / 2), Ut.push(Ft.topLeftY + Ft.height / 2);
3562
- } else
3563
- Ut.push(U[it].xCoords[Rt]), Ut.push(U[it].yCoords[Rt]);
3564
- if (Dt.isParent()) {
3565
- var Yt = t.calcBoundingBox(Dt, U[it].xCoords, U[it].yCoords, ut);
3566
- Pt.push(Yt.topLeftX + Yt.width / 2), Pt.push(Yt.topLeftY + Yt.height / 2);
3567
- } else
3568
- Pt.push(U[it].xCoords[Ht]), Pt.push(U[it].yCoords[Ht]);
3569
- Et.edges.push({ startX: Ut[0], startY: Ut[1], endX: Pt[0], endY: Pt[1] });
3570
- } else
3571
- V[it][mt.id()] && V[it][Dt.id()] && Et.edges.push({ startX: V[it][mt.id()].getCenterX(), startY: V[it][mt.id()].getCenterY(), endX: V[it][Dt.id()].getCenterX(), endY: V[it][Dt.id()].getCenterY() });
3572
- }), Et.nodes.length > 0 && (H.push(Et), D.add(it));
3573
- }
3574
- });
3575
- var tt = E.packComponents(H, w.randomize).shifts;
3576
- if (w.quality == "draft")
3577
- U.forEach(function(vt, it) {
3578
- var ut = vt.xCoords.map(function(wt) {
3579
- return wt + tt[it].dx;
3580
- }), Et = vt.yCoords.map(function(wt) {
3581
- return wt + tt[it].dy;
3582
- });
3583
- vt.xCoords = ut, vt.yCoords = Et;
3584
- });
3585
- else {
3586
- var ht = 0;
3587
- D.forEach(function(vt) {
3588
- Object.keys(V[vt]).forEach(function(it) {
3589
- var ut = V[vt][it];
3590
- ut.setCenter(ut.getCenterX() + tt[ht].dx, ut.getCenterY() + tt[ht].dy);
3591
- }), ht++;
3592
- });
3593
- }
3594
- }
3595
- } else {
3596
- var m = w.eles.boundingBox();
3597
- if (_.push({ x: m.x1 + m.w / 2, y: m.y1 + m.h / 2 }), w.randomize) {
3598
- var y = n(w);
3599
- U.push(y);
3600
- }
3601
- w.quality == "default" || w.quality == "proof" ? (V.push(l(w, U[0])), t.relocateComponent(_[0], V[0], w)) : t.relocateComponent(_[0], U[0], w);
3602
- }
3603
- var J = function(it, ut) {
3604
- if (w.quality == "default" || w.quality == "proof") {
3605
- typeof it == "number" && (it = ut);
3606
- var Et = void 0, wt = void 0, Ot = it.data("id");
3607
- return V.forEach(function(Dt) {
3608
- Ot in Dt && (Et = { x: Dt[Ot].getRect().getCenterX(), y: Dt[Ot].getRect().getCenterY() }, wt = Dt[Ot]);
3609
- }), w.nodeDimensionsIncludeLabels && (wt.labelWidth && (wt.labelPosHorizontal == "left" ? Et.x += wt.labelWidth / 2 : wt.labelPosHorizontal == "right" && (Et.x -= wt.labelWidth / 2)), wt.labelHeight && (wt.labelPosVertical == "top" ? Et.y += wt.labelHeight / 2 : wt.labelPosVertical == "bottom" && (Et.y -= wt.labelHeight / 2))), Et == null && (Et = { x: it.position("x"), y: it.position("y") }), {
3610
- x: Et.x,
3611
- y: Et.y
3612
- };
3613
- } else {
3614
- var mt = void 0;
3615
- return U.forEach(function(Dt) {
3616
- var Rt = Dt.nodeIndexes.get(it.id());
3617
- Rt != null && (mt = { x: Dt.xCoords[Rt], y: Dt.yCoords[Rt] });
3618
- }), mt == null && (mt = { x: it.position("x"), y: it.position("y") }), {
3619
- x: mt.x,
3620
- y: mt.y
3621
- };
3622
- }
3623
- };
3624
- if (w.quality == "default" || w.quality == "proof" || w.randomize) {
3625
- var It = t.calcParentsWithoutChildren(G, B), Nt = B.filter(function(vt) {
3626
- return vt.css("display") == "none";
3627
- });
3628
- w.eles = B.not(Nt), B.nodes().not(":parent").not(Nt).layoutPositions(b, w, J), It.length > 0 && It.forEach(function(vt) {
3629
- vt.position(J(vt));
3630
- });
3631
- } else
3632
- console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
3633
- }
3634
- }]), d;
3635
- }();
3636
- a.exports = u;
3637
- }
3638
- ),
3639
- /***/
3640
- 657: (
3641
- /***/
3642
- (a, r, i) => {
3643
- var f = i(548), e = i(140).layoutBase.Matrix, g = i(140).layoutBase.SVD, t = function(n) {
3644
- var c = n.cy, l = n.eles, T = l.nodes(), u = l.nodes(":parent"), d = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), w = [], G = [], B = [], U = [], V = [], M = [], _ = [], o = [], E = void 0, p = 1e8, m = 1e-9, y = n.piTol, S = n.samplingType, O = n.nodeSeparation, F = void 0, W = function() {
3645
- for (var Y = 0, Z = 0, K = !1; Z < F; ) {
3646
- Y = Math.floor(Math.random() * E), K = !1;
3647
- for (var q = 0; q < Z; q++)
3648
- if (U[q] == Y) {
3649
- K = !0;
3650
- break;
3651
- }
3652
- if (!K)
3653
- U[Z] = Y, Z++;
3654
- else
3655
- continue;
3656
- }
3657
- }, I = function(Y, Z, K) {
3658
- for (var q = [], at = 0, ct = 0, nt = 0, et = void 0, j = [], dt = 0, At = 1, pt = 0; pt < E; pt++)
3659
- j[pt] = p;
3660
- for (q[ct] = Y, j[Y] = 0; ct >= at; ) {
3661
- nt = q[at++];
3662
- for (var xt = w[nt], lt = 0; lt < xt.length; lt++)
3663
- et = L.get(xt[lt]), j[et] == p && (j[et] = j[nt] + 1, q[++ct] = et);
3664
- M[nt][Z] = j[nt] * O;
3665
- }
3666
- if (K) {
3667
- for (var ot = 0; ot < E; ot++)
3668
- M[ot][Z] < V[ot] && (V[ot] = M[ot][Z]);
3669
- for (var Lt = 0; Lt < E; Lt++)
3670
- V[Lt] > dt && (dt = V[Lt], At = Lt);
3671
- }
3672
- return At;
3673
- }, Q = function(Y) {
3674
- var Z = void 0;
3675
- if (Y) {
3676
- Z = Math.floor(Math.random() * E);
3677
- for (var q = 0; q < E; q++)
3678
- V[q] = p;
3679
- for (var at = 0; at < F; at++)
3680
- U[at] = Z, Z = I(Z, at, Y);
3681
- } else {
3682
- W();
3683
- for (var K = 0; K < F; K++)
3684
- I(U[K], K, Y);
3685
- }
3686
- for (var ct = 0; ct < E; ct++)
3687
- for (var nt = 0; nt < F; nt++)
3688
- M[ct][nt] *= M[ct][nt];
3689
- for (var et = 0; et < F; et++)
3690
- _[et] = [];
3691
- for (var j = 0; j < F; j++)
3692
- for (var dt = 0; dt < F; dt++)
3693
- _[j][dt] = M[U[dt]][j];
3694
- }, z = function() {
3695
- for (var Y = g.svd(_), Z = Y.S, K = Y.U, q = Y.V, at = Z[0] * Z[0] * Z[0], ct = [], nt = 0; nt < F; nt++) {
3696
- ct[nt] = [];
3697
- for (var et = 0; et < F; et++)
3698
- ct[nt][et] = 0, nt == et && (ct[nt][et] = Z[nt] / (Z[nt] * Z[nt] + at / (Z[nt] * Z[nt])));
3699
- }
3700
- o = e.multMat(e.multMat(q, ct), e.transpose(K));
3701
- }, X = function() {
3702
- for (var Y = void 0, Z = void 0, K = [], q = [], at = [], ct = [], nt = 0; nt < E; nt++)
3703
- K[nt] = Math.random(), q[nt] = Math.random();
3704
- K = e.normalize(K), q = e.normalize(q);
3705
- for (var et = m, j = m, dt = void 0; ; ) {
3706
- for (var At = 0; At < E; At++)
3707
- at[At] = K[At];
3708
- if (K = e.multGamma(e.multL(e.multGamma(at), M, o)), Y = e.dotProduct(at, K), K = e.normalize(K), et = e.dotProduct(at, K), dt = Math.abs(et / j), dt <= 1 + y && dt >= 1)
3709
- break;
3710
- j = et;
3711
- }
3712
- for (var pt = 0; pt < E; pt++)
3713
- at[pt] = K[pt];
3714
- for (j = m; ; ) {
3715
- for (var xt = 0; xt < E; xt++)
3716
- ct[xt] = q[xt];
3717
- if (ct = e.minusOp(ct, e.multCons(at, e.dotProduct(at, ct))), q = e.multGamma(e.multL(e.multGamma(ct), M, o)), Z = e.dotProduct(ct, q), q = e.normalize(q), et = e.dotProduct(ct, q), dt = Math.abs(et / j), dt <= 1 + y && dt >= 1)
3718
- break;
3719
- j = et;
3720
- }
3721
- for (var lt = 0; lt < E; lt++)
3722
- ct[lt] = q[lt];
3723
- G = e.multCons(at, Math.sqrt(Math.abs(Y))), B = e.multCons(ct, Math.sqrt(Math.abs(Z)));
3724
- };
3725
- f.connectComponents(c, l, f.getTopMostNodes(T), d), u.forEach(function(P) {
3726
- f.connectComponents(c, l, f.getTopMostNodes(P.descendants().intersection(l)), d);
3727
- });
3728
- for (var rt = 0, $ = 0; $ < T.length; $++)
3729
- T[$].isParent() || L.set(T[$].id(), rt++);
3730
- var D = !0, H = !1, k = void 0;
3731
- try {
3732
- for (var tt = d.keys()[Symbol.iterator](), ht; !(D = (ht = tt.next()).done); D = !0) {
3733
- var J = ht.value;
3734
- L.set(J, rt++);
3735
- }
3736
- } catch (P) {
3737
- H = !0, k = P;
3738
- } finally {
3739
- try {
3740
- !D && tt.return && tt.return();
3741
- } finally {
3742
- if (H)
3743
- throw k;
3744
- }
3745
- }
3746
- for (var It = 0; It < L.size; It++)
3747
- w[It] = [];
3748
- u.forEach(function(P) {
3749
- for (var Y = P.children().intersection(l); Y.nodes(":childless").length == 0; )
3750
- Y = Y.nodes()[0].children().intersection(l);
3751
- var Z = 0, K = Y.nodes(":childless")[0].connectedEdges().length;
3752
- Y.nodes(":childless").forEach(function(q, at) {
3753
- q.connectedEdges().length < K && (K = q.connectedEdges().length, Z = at);
3754
- }), b.set(P.id(), Y.nodes(":childless")[Z].id());
3755
- }), T.forEach(function(P) {
3756
- var Y = void 0;
3757
- P.isParent() ? Y = L.get(b.get(P.id())) : Y = L.get(P.id()), P.neighborhood().nodes().forEach(function(Z) {
3758
- l.intersection(P.edgesWith(Z)).length > 0 && (Z.isParent() ? w[Y].push(b.get(Z.id())) : w[Y].push(Z.id()));
3759
- });
3760
- });
3761
- var Nt = function(Y) {
3762
- var Z = L.get(Y), K = void 0;
3763
- d.get(Y).forEach(function(q) {
3764
- c.getElementById(q).isParent() ? K = b.get(q) : K = q, w[Z].push(K), w[L.get(K)].push(Y);
3765
- });
3766
- }, vt = !0, it = !1, ut = void 0;
3767
- try {
3768
- for (var Et = d.keys()[Symbol.iterator](), wt; !(vt = (wt = Et.next()).done); vt = !0) {
3769
- var Ot = wt.value;
3770
- Nt(Ot);
3771
- }
3772
- } catch (P) {
3773
- it = !0, ut = P;
3774
- } finally {
3775
- try {
3776
- !vt && Et.return && Et.return();
3777
- } finally {
3778
- if (it)
3779
- throw ut;
3780
- }
3781
- }
3782
- E = L.size;
3783
- var mt = void 0;
3784
- if (E > 2) {
3785
- F = E < n.sampleSize ? E : n.sampleSize;
3786
- for (var Dt = 0; Dt < E; Dt++)
3787
- M[Dt] = [];
3788
- for (var Rt = 0; Rt < F; Rt++)
3789
- o[Rt] = [];
3790
- return n.quality == "draft" || n.step == "all" ? (Q(S), z(), X(), mt = { nodeIndexes: L, xCoords: G, yCoords: B }) : (L.forEach(function(P, Y) {
3791
- G.push(c.getElementById(Y).position("x")), B.push(c.getElementById(Y).position("y"));
3792
- }), mt = { nodeIndexes: L, xCoords: G, yCoords: B }), mt;
3793
- } else {
3794
- var Ht = L.keys(), Ut = c.getElementById(Ht.next().value), Pt = Ut.position(), Ft = Ut.outerWidth();
3795
- if (G.push(Pt.x), B.push(Pt.y), E == 2) {
3796
- var Yt = c.getElementById(Ht.next().value), Vt = Yt.outerWidth();
3797
- G.push(Pt.x + Ft / 2 + Vt / 2 + n.idealEdgeLength), B.push(Pt.y);
3798
- }
3799
- return mt = { nodeIndexes: L, xCoords: G, yCoords: B }, mt;
3800
- }
3801
- };
3802
- a.exports = { spectralLayout: t };
3803
- }
3804
- ),
3805
- /***/
3806
- 579: (
3807
- /***/
3808
- (a, r, i) => {
3809
- var f = i(212), e = function(t) {
3810
- t && t("layout", "fcose", f);
3811
- };
3812
- typeof cytoscape < "u" && e(cytoscape), a.exports = e;
3813
- }
3814
- ),
3815
- /***/
3816
- 140: (
3817
- /***/
3818
- (a) => {
3819
- a.exports = C;
3820
- }
3821
- )
3822
- /******/
3823
- }, N = {};
3824
- function v(a) {
3825
- var r = N[a];
3826
- if (r !== void 0)
3827
- return r.exports;
3828
- var i = N[a] = {
3829
- /******/
3830
- // no module.id needed
3831
- /******/
3832
- // no module.loaded needed
3833
- /******/
3834
- exports: {}
3835
- /******/
3836
- };
3837
- return R[a](i, i.exports, v), i.exports;
3838
- }
3839
- var h = v(579);
3840
- return h;
3841
- })()
3842
- );
3843
- });
3844
- }(he)), he.exports;
3845
- }
3846
- var Er = mr();
3847
- const Tr = /* @__PURE__ */ cr(Er);
3848
- var Ie = {
3849
- L: "left",
3850
- R: "right",
3851
- T: "top",
3852
- B: "bottom"
3853
- }, Re = {
3854
- L: /* @__PURE__ */ gt((x) => `${x},${x / 2} 0,${x} 0,0`, "L"),
3855
- R: /* @__PURE__ */ gt((x) => `0,${x / 2} ${x},0 ${x},${x}`, "R"),
3856
- T: /* @__PURE__ */ gt((x) => `0,0 ${x},0 ${x / 2},${x}`, "T"),
3857
- B: /* @__PURE__ */ gt((x) => `${x / 2},0 ${x},${x} 0,${x}`, "B")
3858
- }, se = {
3859
- L: /* @__PURE__ */ gt((x, A) => x - A + 2, "L"),
3860
- R: /* @__PURE__ */ gt((x, A) => x - 2, "R"),
3861
- T: /* @__PURE__ */ gt((x, A) => x - A + 2, "T"),
3862
- B: /* @__PURE__ */ gt((x, A) => x - 2, "B")
3863
- }, Nr = /* @__PURE__ */ gt(function(x) {
3864
- return Wt(x) ? x === "L" ? "R" : "L" : x === "T" ? "B" : "T";
3865
- }, "getOppositeArchitectureDirection"), Se = /* @__PURE__ */ gt(function(x) {
3866
- const A = x;
3867
- return A === "L" || A === "R" || A === "T" || A === "B";
3868
- }, "isArchitectureDirection"), Wt = /* @__PURE__ */ gt(function(x) {
3869
- const A = x;
3870
- return A === "L" || A === "R";
3871
- }, "isArchitectureDirectionX"), qt = /* @__PURE__ */ gt(function(x) {
3872
- const A = x;
3873
- return A === "T" || A === "B";
3874
- }, "isArchitectureDirectionY"), Ne = /* @__PURE__ */ gt(function(x, A) {
3875
- const C = Wt(x) && qt(A), R = qt(x) && Wt(A);
3876
- return C || R;
3877
- }, "isArchitectureDirectionXY"), Lr = /* @__PURE__ */ gt(function(x) {
3878
- const A = x[0], C = x[1], R = Wt(A) && qt(C), N = qt(A) && Wt(C);
3879
- return R || N;
3880
- }, "isArchitecturePairXY"), Cr = /* @__PURE__ */ gt(function(x) {
3881
- return x !== "LL" && x !== "RR" && x !== "TT" && x !== "BB";
3882
- }, "isValidArchitectureDirectionPair"), ye = /* @__PURE__ */ gt(function(x, A) {
3883
- const C = `${x}${A}`;
3884
- return Cr(C) ? C : void 0;
3885
- }, "getArchitectureDirectionPair"), wr = /* @__PURE__ */ gt(function([x, A], C) {
3886
- const R = C[0], N = C[1];
3887
- return Wt(R) ? qt(N) ? [x + (R === "L" ? -1 : 1), A + (N === "T" ? 1 : -1)] : [x + (R === "L" ? -1 : 1), A] : Wt(N) ? [x + (N === "L" ? 1 : -1), A + (R === "T" ? 1 : -1)] : [x, A + (R === "T" ? 1 : -1)];
3888
- }, "shiftPositionByArchitectureDirectionPair"), Ar = /* @__PURE__ */ gt(function(x) {
3889
- return x === "LT" || x === "TL" ? [1, 1] : x === "BL" || x === "LB" ? [1, -1] : x === "BR" || x === "RB" ? [-1, -1] : [-1, 1];
3890
- }, "getArchitectureDirectionXYFactors"), Mr = /* @__PURE__ */ gt(function(x, A) {
3891
- return Ne(x, A) ? "bend" : Wt(x) ? "horizontal" : "vertical";
3892
- }, "getArchitectureDirectionAlignment"), Or = /* @__PURE__ */ gt(function(x) {
3893
- return x.type === "service";
3894
- }, "isArchitectureService"), Dr = /* @__PURE__ */ gt(function(x) {
3895
- return x.type === "junction";
3896
- }, "isArchitectureJunction"), Pe = /* @__PURE__ */ gt((x) => x.data(), "edgeData"), ie = /* @__PURE__ */ gt((x) => x.data(), "nodeData"), xr = nr.architecture, ae, Ge = (ae = class {
3897
- constructor() {
3898
- this.nodes = {}, this.groups = {}, this.edges = [], this.layoutHints = [], this.registeredIds = {}, this.elements = {}, this.diagramId = "", this.setAccTitle = Je, this.getAccTitle = Ke, this.setDiagramTitle = je, this.getDiagramTitle = _e, this.getAccDescription = tr, this.setAccDescription = er, this.clear();
3899
- }
3900
- setDiagramId(A) {
3901
- this.diagramId = A;
3902
- }
3903
- getDiagramId() {
3904
- return this.diagramId;
3905
- }
3906
- clear() {
3907
- this.nodes = {}, this.groups = {}, this.edges = [], this.layoutHints = [], this.registeredIds = {}, this.dataStructures = void 0, this.elements = {}, this.diagramId = "", rr();
3908
- }
3909
- addService({
3910
- id: A,
3911
- icon: C,
3912
- in: R,
3913
- title: N,
3914
- iconText: v
3915
- }) {
3916
- if (this.registeredIds[A] !== void 0)
3917
- throw new Error(
3918
- `The service id [${A}] is already in use by another ${this.registeredIds[A]}`
3919
- );
3920
- if (R !== void 0) {
3921
- if (A === R)
3922
- throw new Error(`The service [${A}] cannot be placed within itself`);
3923
- if (this.registeredIds[R] === void 0)
3924
- throw new Error(
3925
- `The service [${A}]'s parent does not exist. Please make sure the parent is created before this service`
3926
- );
3927
- if (this.registeredIds[R] === "node")
3928
- throw new Error(`The service [${A}]'s parent is not a group`);
3929
- }
3930
- this.registeredIds[A] = "node", this.nodes[A] = {
3931
- id: A,
3932
- type: "service",
3933
- icon: C,
3934
- iconText: v,
3935
- title: N,
3936
- edges: [],
3937
- in: R
3938
- };
3939
- }
3940
- getServices() {
3941
- return Object.values(this.nodes).filter(Or);
3942
- }
3943
- addJunction({ id: A, in: C }) {
3944
- if (this.registeredIds[A] !== void 0)
3945
- throw new Error(
3946
- `The junction id [${A}] is already in use by another ${this.registeredIds[A]}`
3947
- );
3948
- if (C !== void 0) {
3949
- if (A === C)
3950
- throw new Error(`The junction [${A}] cannot be placed within itself`);
3951
- if (this.registeredIds[C] === void 0)
3952
- throw new Error(
3953
- `The junction [${A}]'s parent does not exist. Please make sure the parent is created before this junction`
3954
- );
3955
- if (this.registeredIds[C] === "node")
3956
- throw new Error(`The junction [${A}]'s parent is not a group`);
3957
- }
3958
- this.registeredIds[A] = "node", this.nodes[A] = {
3959
- id: A,
3960
- type: "junction",
3961
- edges: [],
3962
- in: C
3963
- };
3964
- }
3965
- getJunctions() {
3966
- return Object.values(this.nodes).filter(Dr);
3967
- }
3968
- getNodes() {
3969
- return Object.values(this.nodes);
3970
- }
3971
- getNode(A) {
3972
- return this.nodes[A] ?? null;
3973
- }
3974
- addGroup({ id: A, icon: C, in: R, title: N }) {
3975
- if (this.registeredIds?.[A] !== void 0)
3976
- throw new Error(
3977
- `The group id [${A}] is already in use by another ${this.registeredIds[A]}`
3978
- );
3979
- if (R !== void 0) {
3980
- if (A === R)
3981
- throw new Error(`The group [${A}] cannot be placed within itself`);
3982
- if (this.registeredIds?.[R] === void 0)
3983
- throw new Error(
3984
- `The group [${A}]'s parent does not exist. Please make sure the parent is created before this group`
3985
- );
3986
- if (this.registeredIds?.[R] === "node")
3987
- throw new Error(`The group [${A}]'s parent is not a group`);
3988
- }
3989
- this.registeredIds[A] = "group", this.groups[A] = {
3990
- id: A,
3991
- icon: C,
3992
- title: N,
3993
- in: R
3994
- };
3995
- }
3996
- getGroups() {
3997
- return Object.values(this.groups);
3998
- }
3999
- addEdge({
4000
- lhsId: A,
4001
- rhsId: C,
4002
- lhsDir: R,
4003
- rhsDir: N,
4004
- lhsInto: v,
4005
- rhsInto: h,
4006
- lhsGroup: a,
4007
- rhsGroup: r,
4008
- title: i
4009
- }) {
4010
- if (!Se(R))
4011
- throw new Error(
4012
- `Invalid direction given for left hand side of edge ${A}--${C}. Expected (L,R,T,B) got ${String(R)}`
4013
- );
4014
- if (!Se(N))
4015
- throw new Error(
4016
- `Invalid direction given for right hand side of edge ${A}--${C}. Expected (L,R,T,B) got ${String(N)}`
4017
- );
4018
- if (this.nodes[A] === void 0 && this.groups[A] === void 0)
4019
- throw new Error(
4020
- `The left-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`
4021
- );
4022
- if (this.nodes[C] === void 0 && this.groups[C] === void 0)
4023
- throw new Error(
4024
- `The right-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`
4025
- );
4026
- const f = this.nodes[A].in, e = this.nodes[C].in;
4027
- if (a && f && e && f == e)
4028
- throw new Error(
4029
- `The left-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
4030
- );
4031
- if (r && f && e && f == e)
4032
- throw new Error(
4033
- `The right-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
4034
- );
4035
- const g = {
4036
- lhsId: A,
4037
- lhsDir: R,
4038
- lhsInto: v,
4039
- lhsGroup: a,
4040
- rhsId: C,
4041
- rhsDir: N,
4042
- rhsInto: h,
4043
- rhsGroup: r,
4044
- title: i
4045
- };
4046
- this.edges.push(g), this.nodes[A] && this.nodes[C] && (this.nodes[A].edges.push(this.edges[this.edges.length - 1]), this.nodes[C].edges.push(this.edges[this.edges.length - 1]));
4047
- }
4048
- getEdges() {
4049
- return this.edges;
4050
- }
4051
- addLayoutHint(A) {
4052
- if (A.members.length < 2)
4053
- throw new Error(
4054
- `An align directive requires at least two members; got ${A.members.length}`
4055
- );
4056
- const C = /* @__PURE__ */ new Set();
4057
- A.members.forEach((R) => {
4058
- if (this.registeredIds[R] !== "node")
4059
- throw new Error(
4060
- `align ${A.direction} references [${R}], which is not a service or junction`
4061
- );
4062
- if (C.has(R))
4063
- throw new Error(`align ${A.direction} lists [${R}] more than once`);
4064
- C.add(R);
4065
- }), this.layoutHints.push(A);
4066
- }
4067
- getLayoutHints() {
4068
- return this.layoutHints;
4069
- }
4070
- /**
4071
- * Returns the current diagram's adjacency list, spatial map, & group alignments.
4072
- * If they have not been created, run the algorithms to generate them.
4073
- * @returns
4074
- */
4075
- getDataStructures() {
4076
- if (this.dataStructures === void 0) {
4077
- const A = {}, C = Object.entries(this.nodes).reduce((r, [i, f]) => (r[i] = f.edges.reduce((e, g) => {
4078
- const t = this.getNode(g.lhsId)?.in, s = this.getNode(g.rhsId)?.in;
4079
- if (t && s && t !== s) {
4080
- const n = Mr(g.lhsDir, g.rhsDir);
4081
- n !== "bend" && (A[t] ??= {}, A[t][s] = n, A[s] ??= {}, A[s][t] = n);
4082
- }
4083
- if (g.lhsId === i) {
4084
- const n = ye(g.lhsDir, g.rhsDir);
4085
- n && (e[n] = g.rhsId);
4086
- } else {
4087
- const n = ye(g.rhsDir, g.lhsDir);
4088
- n && (e[n] = g.lhsId);
4089
- }
4090
- return e;
4091
- }, {}), r), {}), R = Object.keys(C)[0], N = { [R]: 1 }, v = Object.keys(C).reduce(
4092
- (r, i) => i === R ? r : { ...r, [i]: 1 },
4093
- {}
4094
- ), h = /* @__PURE__ */ gt((r) => {
4095
- const i = { [r]: [0, 0] }, f = [r];
4096
- for (; f.length > 0; ) {
4097
- const e = f.shift();
4098
- if (e) {
4099
- N[e] = 1, delete v[e];
4100
- const g = C[e], [t, s] = i[e];
4101
- Object.entries(g).forEach(([n, c]) => {
4102
- N[c] || (i[c] = wr(
4103
- [t, s],
4104
- n
4105
- ), f.push(c));
4106
- });
4107
- }
4108
- }
4109
- return i;
4110
- }, "BFS"), a = [h(R)];
4111
- for (; Object.keys(v).length > 0; )
4112
- a.push(h(Object.keys(v)[0]));
4113
- this.dataStructures = {
4114
- adjList: C,
4115
- spatialMaps: a,
4116
- groupAlignments: A
4117
- };
4118
- }
4119
- return this.dataStructures;
4120
- }
4121
- setElementForId(A, C) {
4122
- this.elements[A] = C;
4123
- }
4124
- getElementById(A) {
4125
- return this.elements[A];
4126
- }
4127
- getConfig() {
4128
- return ir({
4129
- ...xr,
4130
- ...ar().architecture
4131
- });
4132
- }
4133
- getConfigField(A) {
4134
- return this.getConfig()[A];
4135
- }
4136
- }, gt(ae, "ArchitectureDB"), ae), Ir = /* @__PURE__ */ gt((x, A) => {
4137
- Ze(x, A), x.groups.map((C) => A.addGroup(C)), x.services.map((C) => A.addService({ ...C, type: "service" })), x.junctions.map((C) => A.addJunction({ ...C, type: "junction" })), x.edges.map((C) => A.addEdge(C)), x.alignments?.map(
4138
- (C) => A.addLayoutHint({ direction: C.direction, members: [...C.members] })
4139
- );
4140
- }, "populateDb"), Ue = {
4141
- parser: {
4142
- // @ts-expect-error - ArchitectureDB is not assignable to DiagramDB
4143
- yy: void 0
4144
- },
4145
- parse: /* @__PURE__ */ gt(async (x) => {
4146
- const A = await fr("architecture", x);
4147
- Fe.debug(A);
4148
- const C = Ue.parser?.yy;
4149
- if (!(C instanceof Ge))
4150
- throw new Error(
4151
- "parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
4152
- );
4153
- Ir(A, C);
4154
- }, "parse")
4155
- }, Rr = /* @__PURE__ */ gt((x) => `
4156
- .edge {
4157
- stroke-width: ${x.archEdgeWidth};
4158
- stroke: ${x.archEdgeColor};
4159
- fill: none;
4160
- }
4161
-
4162
- .arrow {
4163
- fill: ${x.archEdgeArrowColor};
4164
- }
4165
-
4166
- .node-bkg {
4167
- fill: none;
4168
- stroke: ${x.archGroupBorderColor};
4169
- stroke-width: ${x.archGroupBorderWidth};
4170
- stroke-dasharray: 8;
4171
- }
4172
- .node-icon-text {
4173
- display: flex;
4174
- align-items: center;
4175
- }
4176
-
4177
- .node-icon-text > div {
4178
- color: #fff;
4179
- margin: 1px;
4180
- height: fit-content;
4181
- text-align: center;
4182
- overflow: hidden;
4183
- display: -webkit-box;
4184
- -webkit-box-orient: vertical;
4185
- }
4186
- `, "getStyles"), Sr = Rr;
4187
- function me(x, A) {
4188
- if (x === 0)
4189
- return A();
4190
- const C = Math.random;
4191
- let R = x >>> 0;
4192
- Math.random = function() {
4193
- R = R + 1831565813 >>> 0;
4194
- let N = R;
4195
- return N = Math.imul(N ^ N >>> 15, N | 1), N ^= N + Math.imul(N ^ N >>> 7, N | 61), ((N ^ N >>> 14) >>> 0) / 4294967296;
4196
- };
4197
- try {
4198
- return A();
4199
- } finally {
4200
- Math.random = C;
4201
- }
4202
- }
4203
- gt(me, "withSeededRandom");
4204
- var re = /* @__PURE__ */ gt((x) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${x}</g>`, "wrapIcon"), ne = {
4205
- prefix: "mermaid-architecture",
4206
- height: 80,
4207
- width: 80,
4208
- icons: {
4209
- database: {
4210
- body: re(
4211
- '<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4212
- )
4213
- },
4214
- server: {
4215
- body: re(
4216
- '<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>'
4217
- )
4218
- },
4219
- disk: {
4220
- body: re(
4221
- '<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>'
4222
- )
4223
- },
4224
- internet: {
4225
- body: re(
4226
- '<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4227
- )
4228
- },
4229
- cloud: {
4230
- body: re(
4231
- '<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4232
- )
4233
- },
4234
- unknown: lr,
4235
- blank: {
4236
- body: re("")
4237
- }
4238
- }
4239
- }, Fr = /* @__PURE__ */ gt(async function(x, A, C, R) {
4240
- const N = C.getConfigField("padding"), v = C.getConfigField("iconSize"), h = v / 2, a = v / 6, r = a / 2;
4241
- await Promise.all(
4242
- A.edges().map(async (i) => {
4243
- const {
4244
- source: f,
4245
- sourceDir: e,
4246
- sourceArrow: g,
4247
- sourceGroup: t,
4248
- target: s,
4249
- targetDir: n,
4250
- targetArrow: c,
4251
- targetGroup: l,
4252
- label: T
4253
- } = Pe(i);
4254
- let { x: u, y: d } = i[0].sourceEndpoint();
4255
- const { x: L, y: b } = i[0].midpoint();
4256
- let { x: w, y: G } = i[0].targetEndpoint();
4257
- const B = N + 4;
4258
- if (t && (Wt(e) ? u += e === "L" ? -B : B : d += e === "T" ? -B : B + 18), l && (Wt(n) ? w += n === "L" ? -B : B : G += n === "T" ? -B : B + 18), !t && C.getNode(f)?.type === "junction" && (Wt(e) ? u += e === "L" ? h : -h : d += e === "T" ? h : -h), !l && C.getNode(s)?.type === "junction" && (Wt(n) ? w += n === "L" ? h : -h : G += n === "T" ? h : -h), i[0]._private.rscratch) {
4259
- const U = x.insert("g");
4260
- if (U.insert("path").attr("d", `M ${u},${d} L ${L},${b} L${w},${G} `).attr("class", "edge").attr("id", `${R}-${sr(f, s, { prefix: "L" })}`), g) {
4261
- const V = Wt(e) ? se[e](u, a) : u - r, M = qt(e) ? se[e](d, a) : d - r;
4262
- U.insert("polygon").attr("points", Re[e](a)).attr("transform", `translate(${V},${M})`).attr("class", "arrow");
4263
- }
4264
- if (c) {
4265
- const V = Wt(n) ? se[n](w, a) : w - r, M = qt(n) ? se[n](G, a) : G - r;
4266
- U.insert("polygon").attr("points", Re[n](a)).attr("transform", `translate(${V},${M})`).attr("class", "arrow");
4267
- }
4268
- if (T) {
4269
- const V = Ne(e, n) ? "XY" : Wt(e) ? "X" : "Y";
4270
- let M = 0;
4271
- V === "X" ? M = Math.abs(u - w) : V === "Y" ? M = Math.abs(d - G) / 1.5 : M = Math.abs(u - w) / 2;
4272
- const _ = U.append("g");
4273
- if (await Te(
4274
- _,
4275
- T,
4276
- {
4277
- useHtmlLabels: !1,
4278
- width: M,
4279
- classes: "architecture-service-label"
4280
- },
4281
- Ee()
4282
- ), _.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), V === "X")
4283
- _.attr("transform", "translate(" + L + ", " + b + ")");
4284
- else if (V === "Y")
4285
- _.attr("transform", "translate(" + L + ", " + b + ") rotate(-90)");
4286
- else if (V === "XY") {
4287
- const o = ye(e, n);
4288
- if (o && Lr(o)) {
4289
- const E = _.node().getBoundingClientRect(), [p, m] = Ar(o);
4290
- _.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * p * m * 45})`);
4291
- const y = _.node().getBoundingClientRect();
4292
- _.attr(
4293
- "transform",
4294
- `
4295
- translate(${L}, ${b - E.height / 2})
4296
- translate(${p * y.width / 2}, ${m * y.height / 2})
4297
- rotate(${-1 * p * m * 45}, 0, ${E.height / 2})
4298
- `
4299
- );
4300
- }
4301
- }
4302
- }
4303
- }
4304
- })
4305
- );
4306
- }, "drawEdges"), br = /* @__PURE__ */ gt(async function(x, A, C, R) {
4307
- const v = C.getConfigField("padding") * 0.75, h = C.getConfigField("fontSize"), r = C.getConfigField("iconSize") / 2;
4308
- await Promise.all(
4309
- A.nodes().map(async (i) => {
4310
- const f = ie(i);
4311
- if (f.type === "group") {
4312
- const { h: e, w: g, x1: t, y1: s } = i.boundingBox(), n = x.append("rect");
4313
- n.attr("id", `${R}-group-${f.id}`).attr("x", t + r).attr("y", s + r).attr("width", g).attr("height", e).attr("class", "node-bkg");
4314
- const c = x.append("g");
4315
- let l = t, T = s;
4316
- if (f.icon) {
4317
- const u = c.append("g");
4318
- u.html(
4319
- `<g>${await pe(f.icon, { height: v, width: v, fallbackPrefix: ne.prefix })}</g>`
4320
- ), u.attr(
4321
- "transform",
4322
- "translate(" + (l + r + 1) + ", " + (T + r + 1) + ")"
4323
- ), l += v, T += h / 2 - 1 - 2;
4324
- }
4325
- if (f.label) {
4326
- const u = c.append("g");
4327
- await Te(
4328
- u,
4329
- f.label,
4330
- {
4331
- useHtmlLabels: !1,
4332
- width: g,
4333
- classes: "architecture-service-label"
4334
- },
4335
- Ee()
4336
- ), u.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), u.attr(
4337
- "transform",
4338
- "translate(" + (l + r + 4) + ", " + (T + r + 2) + ")"
4339
- );
4340
- }
4341
- C.setElementForId(f.id, n);
4342
- }
4343
- })
4344
- );
4345
- }, "drawGroups"), Pr = /* @__PURE__ */ gt(async function(x, A, C, R) {
4346
- const N = Ee();
4347
- for (const v of C) {
4348
- const h = A.append("g"), a = x.getConfigField("iconSize");
4349
- if (v.title) {
4350
- const e = h.append("g");
4351
- await Te(
4352
- e,
4353
- v.title,
4354
- {
4355
- useHtmlLabels: !1,
4356
- width: a * 1.5,
4357
- classes: "architecture-service-label"
4358
- },
4359
- N
4360
- ), e.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), e.attr("transform", "translate(" + a / 2 + ", " + a + ")");
4361
- }
4362
- const r = h.append("g");
4363
- if (v.icon)
4364
- r.html(
4365
- `<g>${await pe(v.icon, { height: a, width: a, fallbackPrefix: ne.prefix })}</g>`
4366
- );
4367
- else if (v.iconText) {
4368
- r.html(
4369
- `<g>${await pe("blank", { height: a, width: a, fallbackPrefix: ne.prefix })}</g>`
4370
- );
4371
- const t = r.append("g").append("foreignObject").attr("width", a).attr("height", a).append("div").attr("class", "node-icon-text").attr("style", `height: ${a}px;`).append("div").html(or(v.iconText, N)), s = parseInt(
4372
- window.getComputedStyle(t.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
4373
- ) ?? 16;
4374
- t.attr("style", `-webkit-line-clamp: ${Math.floor((a - 2) / s)};`);
4375
- } else
4376
- r.append("path").attr("class", "node-bkg").attr("id", `${R}-node-${v.id}`).attr(
4377
- "d",
4378
- `M0,${a} V5 Q0,0 5,0 H${a - 5} Q${a},0 ${a},5 V${a} Z`
4379
- );
4380
- h.attr("id", `${R}-service-${v.id}`).attr("class", "architecture-service");
4381
- const { width: i, height: f } = h.node().getBBox();
4382
- v.width = i, v.height = f, x.setElementForId(v.id, h);
4383
- }
4384
- return 0;
4385
- }, "drawServices"), Gr = /* @__PURE__ */ gt(function(x, A, C, R) {
4386
- C.forEach((N) => {
4387
- const v = A.append("g"), h = x.getConfigField("iconSize");
4388
- v.append("g").append("rect").attr("id", `${R}-node-${N.id}`).attr("fill-opacity", "0").attr("width", h).attr("height", h), v.attr("class", "architecture-junction");
4389
- const { width: r, height: i } = v._groups[0][0].getBBox();
4390
- v.width = r, v.height = i, x.setElementForId(N.id, v);
4391
- });
4392
- }, "drawJunctions");
4393
- hr([
4394
- {
4395
- name: ne.prefix,
4396
- icons: ne
4397
- }
4398
- ]);
4399
- be.use(Tr);
4400
- function Ye(x, A, C) {
4401
- x.forEach((R) => {
4402
- A.add({
4403
- group: "nodes",
4404
- data: {
4405
- type: "service",
4406
- id: R.id,
4407
- icon: R.icon,
4408
- label: R.title,
4409
- parent: R.in,
4410
- width: C.getConfigField("iconSize"),
4411
- height: C.getConfigField("iconSize")
4412
- },
4413
- classes: "node-service"
4414
- });
4415
- });
4416
- }
4417
- gt(Ye, "addServices");
4418
- function Xe(x, A, C) {
4419
- x.forEach((R) => {
4420
- A.add({
4421
- group: "nodes",
4422
- data: {
4423
- type: "junction",
4424
- id: R.id,
4425
- parent: R.in,
4426
- width: C.getConfigField("iconSize"),
4427
- height: C.getConfigField("iconSize")
4428
- },
4429
- classes: "node-junction"
4430
- });
4431
- });
4432
- }
4433
- gt(Xe, "addJunctions");
4434
- function He(x, A) {
4435
- A.nodes().map((C) => {
4436
- const R = ie(C);
4437
- if (R.type === "group")
4438
- return;
4439
- R.x = C.position().x, R.y = C.position().y, x.getElementById(R.id).attr("transform", "translate(" + (R.x || 0) + "," + (R.y || 0) + ")");
4440
- });
4441
- }
4442
- gt(He, "positionNodes");
4443
- function We(x, A) {
4444
- x.forEach((C) => {
4445
- A.add({
4446
- group: "nodes",
4447
- data: {
4448
- type: "group",
4449
- id: C.id,
4450
- icon: C.icon,
4451
- label: C.title,
4452
- parent: C.in
4453
- },
4454
- classes: "node-group"
4455
- });
4456
- });
4457
- }
4458
- gt(We, "addGroups");
4459
- function Ve(x, A) {
4460
- x.forEach((C) => {
4461
- const { lhsId: R, rhsId: N, lhsInto: v, lhsGroup: h, rhsInto: a, lhsDir: r, rhsDir: i, rhsGroup: f, title: e } = C, g = Ne(C.lhsDir, C.rhsDir) ? "segments" : "straight", t = {
4462
- id: `${R}-${N}`,
4463
- label: e,
4464
- source: R,
4465
- sourceDir: r,
4466
- sourceArrow: v,
4467
- sourceGroup: h,
4468
- sourceEndpoint: r === "L" ? "0 50%" : r === "R" ? "100% 50%" : r === "T" ? "50% 0" : "50% 100%",
4469
- target: N,
4470
- targetDir: i,
4471
- targetArrow: a,
4472
- targetGroup: f,
4473
- targetEndpoint: i === "L" ? "0 50%" : i === "R" ? "100% 50%" : i === "T" ? "50% 0" : "50% 100%"
4474
- };
4475
- A.add({
4476
- group: "edges",
4477
- data: t,
4478
- classes: g
4479
- });
4480
- });
4481
- }
4482
- gt(Ve, "addEdges");
4483
- function ze(x, A, C, R = []) {
4484
- const N = /* @__PURE__ */ gt((g, t) => Object.entries(g).reduce(
4485
- (s, [n, c]) => {
4486
- let l = 0;
4487
- const T = Object.entries(c);
4488
- if (T.length === 1)
4489
- return s[n] = T[0][1], s;
4490
- for (let u = 0; u < T.length - 1; u++)
4491
- for (let d = u + 1; d < T.length; d++) {
4492
- const [L, b] = T[u], [w, G] = T[d];
4493
- if (C[L]?.[w] === t)
4494
- s[n] ??= [], s[n] = [...s[n], ...b, ...G];
4495
- else if (L === "default" || w === "default")
4496
- s[n] ??= [], s[n] = [...s[n], ...b, ...G];
4497
- else {
4498
- const U = `${n}-${l++}`;
4499
- s[U] = b;
4500
- const V = `${n}-${l++}`;
4501
- s[V] = G;
4502
- }
4503
- }
4504
- return s;
4505
- },
4506
- {}
4507
- ), "flattenAlignments"), v = A.map((g) => {
4508
- const t = {}, s = {};
4509
- return Object.entries(g).forEach(([n, [c, l]]) => {
4510
- const T = x.getNode(n)?.in ?? "default";
4511
- t[l] ??= {}, t[l][T] ??= [], t[l][T].push(n), s[c] ??= {}, s[c][T] ??= [], s[c][T].push(n);
4512
- }), {
4513
- horiz: Object.values(N(t, "horizontal")).filter(
4514
- (n) => n.length > 1
4515
- ),
4516
- vert: Object.values(N(s, "vertical")).filter(
4517
- (n) => n.length > 1
4518
- )
4519
- };
4520
- }), [h, a] = v.reduce(
4521
- ([g, t], { horiz: s, vert: n }) => [
4522
- [...g, ...s],
4523
- [...t, ...n]
4524
- ],
4525
- [[], []]
4526
- ), r = /* @__PURE__ */ new Set();
4527
- R.forEach((g) => g.members.forEach((t) => r.add(t)));
4528
- const i = /* @__PURE__ */ gt((g) => g.filter((t) => !t.some((s) => r.has(s))), "dropOverlapping"), f = i(h), e = i(a);
4529
- return R.forEach((g) => {
4530
- g.members.length < 2 || (g.direction === "row" ? f.push([...g.members]) : e.push([...g.members]));
4531
- }), {
4532
- horizontal: f,
4533
- vertical: e
4534
- };
4535
- }
4536
- gt(ze, "getAlignments");
4537
- function Be(x, A, C = []) {
4538
- const R = [], N = A.getConfigField("iconSize"), v = A.getConfigField("idealEdgeLengthMultiplier"), h = v * N, a = /* @__PURE__ */ new Set();
4539
- C.forEach((f) => {
4540
- for (let e = 0; e < f.members.length - 1; e++) {
4541
- const g = f.members[e], t = f.members[e + 1];
4542
- a.add(`${g}|${t}`), a.add(`${t}|${g}`), f.direction === "row" ? R.push({ left: g, right: t, gap: h }) : R.push({ top: g, bottom: t, gap: h });
4543
- }
4544
- });
4545
- const r = /* @__PURE__ */ gt((f) => `${f[0]},${f[1]}`, "posToStr"), i = /* @__PURE__ */ gt((f) => f.split(",").map((e) => parseInt(e)), "strToPos");
4546
- return x.forEach((f) => {
4547
- const e = Object.fromEntries(
4548
- Object.entries(f).map(([n, c]) => [r(c), n])
4549
- ), g = [r([0, 0])], t = {}, s = {
4550
- L: [-1, 0],
4551
- R: [1, 0],
4552
- T: [0, 1],
4553
- B: [0, -1]
4554
- };
4555
- for (; g.length > 0; ) {
4556
- const n = g.shift();
4557
- if (n) {
4558
- t[n] = 1;
4559
- const c = e[n];
4560
- if (c) {
4561
- const l = i(n);
4562
- Object.entries(s).forEach(([T, u]) => {
4563
- const d = r([l[0] + u[0], l[1] + u[1]]), L = e[d];
4564
- if (L && !t[d]) {
4565
- if (g.push(d), a.has(`${c}|${L}`))
4566
- return;
4567
- R.push({
4568
- [Ie[T]]: L,
4569
- [Ie[Nr(T)]]: c,
4570
- gap: v * N
4571
- });
4572
- }
4573
- });
4574
- }
4575
- }
4576
- }
4577
- }), R;
4578
- }
4579
- gt(Be, "getRelativeConstraints");
4580
- function $e(x, A, C, R, N, { spatialMaps: v, groupAlignments: h }) {
4581
- return new Promise((a) => {
4582
- const r = gr("body").append("div").attr("id", "cy").attr("style", "display:none"), i = be({
4583
- container: document.getElementById("cy"),
4584
- style: [
4585
- {
4586
- selector: "edge",
4587
- style: {
4588
- "curve-style": "straight",
4589
- "source-endpoint": "data(sourceEndpoint)",
4590
- "target-endpoint": "data(targetEndpoint)"
4591
- }
4592
- },
4593
- {
4594
- selector: "edge[label]",
4595
- style: {
4596
- label: "data(label)"
4597
- }
4598
- },
4599
- {
4600
- selector: "edge.segments",
4601
- style: {
4602
- "curve-style": "segments",
4603
- "segment-weights": "0",
4604
- "segment-distances": [0.5],
4605
- // @ts-ignore Incorrect library types
4606
- "edge-distances": "endpoints",
4607
- "source-endpoint": "data(sourceEndpoint)",
4608
- "target-endpoint": "data(targetEndpoint)"
4609
- }
4610
- },
4611
- {
4612
- selector: "node",
4613
- style: {
4614
- // @ts-ignore Incorrect library types
4615
- "compound-sizing-wrt-labels": "include"
4616
- }
4617
- },
4618
- {
4619
- selector: "node[label]",
4620
- style: {
4621
- "text-valign": "bottom",
4622
- "text-halign": "center",
4623
- "font-size": `${N.getConfigField("fontSize")}px`
4624
- }
4625
- },
4626
- {
4627
- selector: ".node-service",
4628
- style: {
4629
- label: "data(label)",
4630
- width: "data(width)",
4631
- height: "data(height)"
4632
- }
4633
- },
4634
- {
4635
- selector: ".node-junction",
4636
- style: {
4637
- width: "data(width)",
4638
- height: "data(height)"
4639
- }
4640
- },
4641
- {
4642
- selector: ".node-group",
4643
- style: {
4644
- // @ts-ignore Incorrect library types
4645
- padding: `${N.getConfigField("padding")}px`
4646
- }
4647
- }
4648
- ],
4649
- layout: {
4650
- name: "grid",
4651
- boundingBox: {
4652
- x1: 0,
4653
- x2: 100,
4654
- y1: 0,
4655
- y2: 100
4656
- }
4657
- }
4658
- });
4659
- r.remove(), We(C, i), Ye(x, i, N), Xe(A, i, N), Ve(R, i);
4660
- const f = N.getLayoutHints(), e = ze(N, v, h, f), g = Be(v, N, f), t = N.getConfigField("iconSize"), s = N.getConfigField("idealEdgeLengthMultiplier") * t, n = 0.5 * t, c = N.getConfigField("edgeElasticity"), l = N.getConfigField("seed"), T = i.layout({
4661
- name: "fcose",
4662
- quality: "proof",
4663
- randomize: N.getConfigField("randomize"),
4664
- nodeSeparation: N.getConfigField("nodeSeparation"),
4665
- numIter: N.getConfigField("numIter"),
4666
- styleEnabled: !1,
4667
- animate: !1,
4668
- nodeDimensionsIncludeLabels: !1,
4669
- // Adjust the edge parameters if it passes through the border of a group
4670
- // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
4671
- idealEdgeLength(u) {
4672
- const [d, L] = u.connectedNodes(), { parent: b } = ie(d), { parent: w } = ie(L);
4673
- return b === w ? s : n;
4674
- },
4675
- edgeElasticity(u) {
4676
- const [d, L] = u.connectedNodes(), { parent: b } = ie(d), { parent: w } = ie(L);
4677
- return b === w ? c : 1e-3;
4678
- },
4679
- alignmentConstraint: e,
4680
- relativePlacementConstraint: g
4681
- });
4682
- T.one("layoutstop", () => {
4683
- function u(d, L, b, w) {
4684
- let G, B;
4685
- const { x: U, y: V } = d, { x: M, y: _ } = L;
4686
- B = (w - V + (U - b) * (V - _) / (U - M)) / Math.sqrt(1 + Math.pow((V - _) / (U - M), 2)), G = Math.sqrt(Math.pow(w - V, 2) + Math.pow(b - U, 2) - Math.pow(B, 2));
4687
- const o = Math.sqrt(Math.pow(M - U, 2) + Math.pow(_ - V, 2));
4688
- G = G / o;
4689
- let E = (M - U) * (w - V) - (_ - V) * (b - U);
4690
- switch (!0) {
4691
- case E >= 0:
4692
- E = 1;
4693
- break;
4694
- case E < 0:
4695
- E = -1;
4696
- break;
4697
- }
4698
- let p = (M - U) * (b - U) + (_ - V) * (w - V);
4699
- switch (!0) {
4700
- case p >= 0:
4701
- p = 1;
4702
- break;
4703
- case p < 0:
4704
- p = -1;
4705
- break;
4706
- }
4707
- return B = Math.abs(B) * E, G = G * p, {
4708
- distances: B,
4709
- weights: G
4710
- };
4711
- }
4712
- gt(u, "getSegmentWeights"), i.startBatch();
4713
- for (const d of Object.values(i.edges()))
4714
- if (d.data?.()) {
4715
- const { x: L, y: b } = d.source().position(), { x: w, y: G } = d.target().position();
4716
- if (L !== w && b !== G) {
4717
- const B = d.sourceEndpoint(), U = d.targetEndpoint(), { sourceDir: V } = Pe(d), [M, _] = qt(V) ? [B.x, U.y] : [U.x, B.y], { weights: o, distances: E } = u(B, U, M, _);
4718
- d.style("segment-distances", E), d.style("segment-weights", o);
4719
- }
4720
- }
4721
- i.endBatch(), me(l, () => T.run());
4722
- });
4723
- try {
4724
- me(l, () => T.run());
4725
- } catch (u) {
4726
- throw u instanceof RangeError && u.message.includes("Invalid array length") ? new Error(
4727
- "Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."
4728
- ) : u;
4729
- }
4730
- i.ready((u) => {
4731
- Fe.info("Ready", u), a(i);
4732
- });
4733
- });
4734
- }
4735
- gt($e, "layoutArchitecture");
4736
- var Ur = /* @__PURE__ */ gt(async (x, A, C, R) => {
4737
- const N = R.db;
4738
- N.setDiagramId(A);
4739
- const v = N.getServices(), h = N.getJunctions(), a = N.getGroups(), r = N.getEdges(), i = N.getDataStructures(), f = qe(A), e = f.append("g");
4740
- e.attr("class", "architecture-edges");
4741
- const g = f.append("g");
4742
- g.attr("class", "architecture-services");
4743
- const t = f.append("g");
4744
- t.attr("class", "architecture-groups"), await Pr(N, g, v, A), Gr(N, g, h, A);
4745
- const s = await $e(v, h, a, r, N, i);
4746
- await Fr(e, s, N, A), await br(t, s, N, A), He(N, s), Qe(void 0, f, N.getConfigField("padding"), N.getConfigField("useMaxWidth"));
4747
- }, "draw"), Yr = { draw: Ur }, Zr = {
4748
- parser: Ue,
4749
- get db() {
4750
- return new Ge();
4751
- },
4752
- renderer: Yr,
4753
- styles: Sr
4754
- };
4755
- export {
4756
- Zr as diagram
4757
- };