@kong-ui-public/documentation 1.8.13 → 1.8.14-pr.4048.7a10d83bb.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 (168) hide show
  1. package/package.json +2 -2
  2. package/dist/abnfDiagram-VCTEODGH-Bzbg7AHk-DFERbIEu.js +0 -92
  3. package/dist/arc-CKhg5DVn-BIpMje7c.js +0 -80
  4. package/dist/architectureDiagram-5GKGNRK7-CqHVyBRI-CLWcRmoG.js +0 -4149
  5. package/dist/astro-DdQ3Kp7Q-BDE5qFXd.js +0 -18
  6. package/dist/blockDiagram-I7D4REHJ-DWFqHR0L-D8v5LhXM.js +0 -2029
  7. package/dist/c-lfOsiBpu-DMPKLUI8.js +0 -4
  8. package/dist/c4Diagram-7LVT6UL2-DXHigzTJ-BR9440iK.js +0 -3067
  9. package/dist/catppuccin-latte-D9NPLB7Y-sAlQrrP2.js +0 -4
  10. package/dist/channel-DUDXYB-g-BsX3Acdu.js +0 -5
  11. package/dist/chunk-2Q5K7J3B-CQFXhYzi-C3CTUgHo.js +0 -12
  12. package/dist/chunk-5VM5RSS4-DF_fkndM-uFSHkP_V.js +0 -19
  13. package/dist/chunk-F27PBJKO-Bf2CKIqN-CUI4z39H.js +0 -65
  14. package/dist/chunk-IMKFNOWR-DIsz_YLV-B6u2fLNJ.js +0 -2116
  15. package/dist/chunk-JWPE2WC7-DI69CthA-D_FsPQj-.js +0 -8
  16. package/dist/chunk-POPQ4Y6H-DycI9Jzm-BWixWzlU.js +0 -24
  17. package/dist/chunk-SHT3W25Y-CKxDgOBI-OOdqZuVE.js +0 -4307
  18. package/dist/chunk-SVP7TREG-tW_qYlvV-vP5bsK2H.js +0 -500
  19. package/dist/chunk-TICWLB2K-CuiDrX3P-WR-FPNea.js +0 -3451
  20. package/dist/chunk-XXDRQBXY-CSrEKR2C-C6SaSSCC.js +0 -8
  21. package/dist/classDiagram-ZZMXUADV-WzcguFxl-CKKn1Tfx.js +0 -17
  22. package/dist/classDiagram-v2-VYDZK3BY-jdAXYY7W-CKKn1Tfx.js +0 -17
  23. package/dist/cose-bilkent-JH36ORCC-DbS7GVMv-bbQOsy5Y.js +0 -2256
  24. package/dist/csharp-RRkgh3c4-lim_vKPd.js +0 -4
  25. package/dist/css-BbwcBM_4-B_2PRTA_.js +0 -4
  26. package/dist/csv-DFU5sVkH-BPWcOTV4.js +0 -4
  27. package/dist/cynefin-OW5HDTMX-CmxQwqmf-D_GdoNIu.js +0 -21781
  28. package/dist/cynefinDiagram-5FMLGOSQ-BNb88xpJ-DfS9O7P4.js +0 -351
  29. package/dist/cytoscape.esm-YSf_2rtb-CoO8mT3p.js +0 -18279
  30. package/dist/dagre-C9xJrfGe-Di-1Ikh0.js +0 -1667
  31. package/dist/dagre-GXQ25YYZ-uiXfyLw2-PU-qeT6_.js +0 -429
  32. package/dist/defaultLocale-TbxLDlcU-BrdwcF9K.js +0 -180
  33. package/dist/diagram-S7CK7UJ4-g67BXvGR-Cp9bzjGj.js +0 -303
  34. package/dist/diagram-UQ7AKVKN-DfJJIsVs-CC7ekguS.js +0 -210
  35. package/dist/diagram-VSXAHHWV-DmtFfqWN-C9ZLHKzj.js +0 -439
  36. package/dist/diagram-VX7I27RA--gfQ90BY-QNtwG6Ck.js +0 -477
  37. package/dist/diagram-Z3DM3KII-Cu_rSHu0-CCCsIuz4.js +0 -127
  38. package/dist/diff-D_LJiFgV-DenOJuyV.js +0 -4
  39. package/dist/docker-DMpUQ2UE-xX8PDoIv.js +0 -4
  40. package/dist/documentation.es.js +0 -7
  41. package/dist/documentation.umd.js +0 -3715
  42. package/dist/ebnfDiagram-PWID7BFC-B_qfACMJ-D_Xjruh2.js +0 -109
  43. package/dist/erDiagram-RLTQ6QDP-Dt9efGmz-BPS1Iwl5.js +0 -2042
  44. package/dist/flowDiagram-HODETNUW-sAcaB3rt-Ci8x-zG0.js +0 -6
  45. package/dist/ganttDiagram-EL5Y4UJY-CtWGP-hX-qar4oLEq.js +0 -3098
  46. package/dist/git-commit--2NDNcyW-Dw9_h8sQ.js +0 -5
  47. package/dist/git-rebase-CbNvxADk-DAgBrkyL.js +0 -5
  48. package/dist/gitGraphDiagram-WWUBYQGX-B7B7IG_5-x8UcOce8.js +0 -737
  49. package/dist/go-BEdBk4fh-DqSXHrGo.js +0 -4
  50. package/dist/graphql-BMuT9GwB-BP9pcQru.js +0 -14
  51. package/dist/haml-D3QmTYiV-BTaBXoPr.js +0 -10
  52. package/dist/handlebars-C_aYHp26-CWcrQHYv.js +0 -14
  53. package/dist/haskell-DSSJ-2AO-BlmVjKNy.js +0 -4
  54. package/dist/html-derivative-DgZQ_xNe-BAs__2u-.js +0 -5
  55. package/dist/html-zcQqUZxh-Dg8OkMBp.js +0 -10
  56. package/dist/http-BGkfDG8i-lqXytFlH.js +0 -14
  57. package/dist/index-BaAWoj3P.js +0 -43522
  58. package/dist/infoDiagram-27XIBGKW-DAx9hub5-CDUrF89O.js +0 -18
  59. package/dist/ini-CmgEGOBJ-70PBzbbb.js +0 -4
  60. package/dist/init-Cgg2UTSf-BsHkAom2.js +0 -15
  61. package/dist/ishikawaDiagram-5VMMS53U-CnBB9iXH-2YyZ3Nxy.js +0 -729
  62. package/dist/java-CaG1IqbK-D6YBp1XX.js +0 -4
  63. package/dist/javascript--0qAxhnA-BRPKgr3C.js +0 -4
  64. package/dist/journeyDiagram-3NMN7TZE-B0a4pOJX-CgtsuE-Y.js +0 -909
  65. package/dist/json-DVwBUiza-D8uacQj0.js +0 -4
  66. package/dist/json5-D2Eltym1-Biib5ALh.js +0 -4
  67. package/dist/jsonc-BPIJyZ7u-BZEKkMok.js +0 -4
  68. package/dist/jsonl-BGkjXns2-BG2V-IA2.js +0 -4
  69. package/dist/jsx-cVAJ0Z2c-Cl0AMtmu.js +0 -4
  70. package/dist/kanban-definition-UXKFOSKX-BGnOZMUl-CHT2EG_7.js +0 -1029
  71. package/dist/katex-Be3DWdAP-BWcdC2Xb.js +0 -22287
  72. package/dist/kotlin-CQsNEM2o-Dy_91eL4.js +0 -4
  73. package/dist/latex-g3NZbvcl-tKQf8TuW.js +0 -5
  74. package/dist/less-9LYkHheD-tcNg8M2_.js +0 -4
  75. package/dist/linear-Cf872ac2-BjGvLlX5.js +0 -254
  76. package/dist/liquid-CG3ph2-5-wZo8nDay.js +0 -14
  77. package/dist/lua-BdA7_iyX-Fg4s9W4F.js +0 -5
  78. package/dist/make-CE9Hryyp-CrUl7LOH.js +0 -4
  79. package/dist/markdown-Gqx6-FHJ-Bcqt-5kX.js +0 -4
  80. package/dist/material-theme-darker-DL4lHZSa-DMHCIvq5.js +0 -4
  81. package/dist/mdc-C-RLGlI2-DzcUIqJQ.js +0 -12
  82. package/dist/mdx-DswfiFg4-CK6jOqmu.js +0 -4
  83. package/dist/mermaid-CAl3BhSL-CpQh0Vft.js +0 -4
  84. package/dist/mindmap-definition-YA3MSWOX-D0iYuN9C-B3uI77eT.js +0 -1026
  85. package/dist/nginx-CokYOiS8-DjML3dpY.js +0 -5
  86. package/dist/objective-c-DK-EKgyd-C809HPrX.js +0 -4
  87. package/dist/ordinal-CNzaYghg-B_JXdapq.js +0 -63
  88. package/dist/pascal-CRtegPzh-a8whuidZ.js +0 -4
  89. package/dist/pegDiagram-XKGWAZYB-6oG4KeYC-CG27veJ_.js +0 -104
  90. package/dist/perl-C45KUBhP-Q6opd9qO.js +0 -16
  91. package/dist/php-COzTb61D-DW91EkjY.js +0 -18
  92. package/dist/pieDiagram-E7YTZNPT-DsNO0m7t-CMKObJlC.js +0 -191
  93. package/dist/plsql-Bx7tup_v-BJoF2Vrf.js +0 -4
  94. package/dist/postcss-DjDdOEzv-DaHMm3XW.js +0 -4
  95. package/dist/powershell-BeUvHe6o-BC3uPZPS.js +0 -4
  96. package/dist/proto-DGLklcji-w0B_itsp.js +0 -4
  97. package/dist/pug-BQ5MM2xz-DMZvJUHt.js +0 -12
  98. package/dist/python-C_6ySqsv-D_5pfY__.js +0 -4
  99. package/dist/quadrantDiagram-AXDQQJYC-B6Dc7fje-C23uvcHP.js +0 -2046
  100. package/dist/r-CNL4a0Qi-pixge7f9.js +0 -4
  101. package/dist/railroadDiagram-O6MQD6OU-D8qLcD4O-B_Hr3s-n.js +0 -80
  102. package/dist/reg-D6txjqBF-bHAwx9Pm.js +0 -4
  103. package/dist/requirementDiagram-BXWQKSXE-Cx28BZaS-Bu-h1fa9.js +0 -2283
  104. package/dist/rst-xmthoFSf-BdN-iqJu.js +0 -20
  105. package/dist/ruby-CmwqiOyg-B5qGUHPy.js +0 -44
  106. package/dist/rust-BrRMzTsN-CaZtBt24.js +0 -4
  107. package/dist/sankeyDiagram-P5KCCOFB-CqEXebJJ-BrChTi-e.js +0 -948
  108. package/dist/sass-CL6GLiPQ-pslLeRRb.js +0 -4
  109. package/dist/scss-CiLZCexj-CladYQkr.js +0 -5
  110. package/dist/sequenceDiagram-WJ2MYXX4-Bs_1V5D1-Da6JW3KG.js +0 -4263
  111. package/dist/shellscript-Dfpezy65-BtH46UX7.js +0 -4
  112. package/dist/shellsession-CRcAC04a-BFLTslz7.js +0 -5
  113. package/dist/sizeCapture-INFHLROL-Bc4fS2u3-DMniWWy4.js +0 -46
  114. package/dist/splunk-MGILMmew-BP8P7eWt.js +0 -4
  115. package/dist/sql-D_W5grEC-Dcn2WLbD.js +0 -4
  116. package/dist/ssh-config-CFmUyPR7-BB1rrGb9.js +0 -4
  117. package/dist/stateDiagram-D77RDMKH-oTiwIYVV-BphZk0uR.js +0 -210
  118. package/dist/stateDiagram-v2-MP3YSRHH-gbAY2cmo-D78HyGx1.js +0 -17
  119. package/dist/style.css +0 -1
  120. package/dist/stylus-Kh83dApl-DAu5PNZ9.js +0 -4
  121. package/dist/svelte-HVIHTyhe-BdPJXyv7.js +0 -14
  122. package/dist/swift-B7Z-rXzN-CQtmhAMw.js +0 -4
  123. package/dist/swimlanes-42K2YHIH-BSXAPn2j-C7pTnVuk.js +0 -4983
  124. package/dist/swimlanesDiagram-VR7AAH4N-Ror_0lre-Di8OVgei.js +0 -17
  125. package/dist/timeline-definition-24CTP7MA-gOHmAY1H-aIgAzo7s.js +0 -1096
  126. package/dist/toml-CIQJnU5u-DjT9Bjqu.js +0 -4
  127. package/dist/tsx-DiMnnori-B-5hSr15.js +0 -4
  128. package/dist/twig-BXXOiPVV-CmgmU-L-.js +0 -18
  129. package/dist/types/components/DiscardChangesPrompt.vue.d.ts +0 -35
  130. package/dist/types/components/DiscardChangesPrompt.vue.d.ts.map +0 -1
  131. package/dist/types/components/DocumentationContent.vue.d.ts +0 -186
  132. package/dist/types/components/DocumentationContent.vue.d.ts.map +0 -1
  133. package/dist/types/components/DocumentationDisplay.vue.d.ts +0 -105
  134. package/dist/types/components/DocumentationDisplay.vue.d.ts.map +0 -1
  135. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts +0 -31
  136. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts.map +0 -1
  137. package/dist/types/components/ProductDocumentModal.vue.d.ts +0 -72
  138. package/dist/types/components/ProductDocumentModal.vue.d.ts.map +0 -1
  139. package/dist/types/composables/index.d.ts +0 -6
  140. package/dist/types/composables/index.d.ts.map +0 -1
  141. package/dist/types/composables/useI18n.d.ts +0 -9
  142. package/dist/types/composables/useI18n.d.ts.map +0 -1
  143. package/dist/types/external-links.d.ts +0 -5
  144. package/dist/types/external-links.d.ts.map +0 -1
  145. package/dist/types/helpers.d.ts +0 -8
  146. package/dist/types/helpers.d.ts.map +0 -1
  147. package/dist/types/index.d.ts +0 -7
  148. package/dist/types/index.d.ts.map +0 -1
  149. package/dist/types/types/document-list.d.ts +0 -28
  150. package/dist/types/types/document-list.d.ts.map +0 -1
  151. package/dist/types/types/document-modal.d.ts +0 -8
  152. package/dist/types/types/document-modal.d.ts.map +0 -1
  153. package/dist/types/types/index.d.ts +0 -3
  154. package/dist/types/types/index.d.ts.map +0 -1
  155. package/dist/typescript-DFf19o_s-B0ag8pir.js +0 -4
  156. package/dist/v-DbYZLS97-CAPuTPjr.js +0 -4
  157. package/dist/vb-DRaXf86R-Bx9Rwnco.js +0 -4
  158. package/dist/vennDiagram-4TSXK5OY-Cr4BWMuk-BjBvyxCC.js +0 -1911
  159. package/dist/viml-DgaHry3T-BeYQ8dZh.js +0 -4
  160. package/dist/vue-DPI5F0qT-D-Ahkoja.js +0 -22
  161. package/dist/vue-html-D7FCsiW2-DLSUNIPr.js +0 -5
  162. package/dist/wardleyDiagram-VM6X3IG4-a6H91k9Q-CsH4gQQ0.js +0 -639
  163. package/dist/wasm-DXa1gtBd-CfuK9YWP.js +0 -4
  164. package/dist/wgsl-Vcm3Lg52-C2IZ7ENh.js +0 -4
  165. package/dist/xml-DnOpIvRK-C-akVYiK.js +0 -5
  166. package/dist/xsl-K_2BlT3G-D3eRZGNO.js +0 -5
  167. package/dist/xychartDiagram-S5SC5T6Z-7mX_nPmO-CoM4SG9q.js +0 -2218
  168. package/dist/yaml-BswqmnDe-X78l_Ibz.js +0 -4
@@ -1,4149 +0,0 @@
1
- import { a as nt, a2 as ze, bk as Be, m as xe, c as ue, bW as fe, bU as de, Q as Ve, G as We, I as $e, e as je, t as qe, j as Ze, k as Ke, r as Je, n as Qe, $ as ti, z as ei, X as ii, L as ri, C as oi, W as pe, bV as ni, bX as ai } from "./index-BaAWoj3P.js";
2
- import { R as si } from "./cynefin-OW5HDTMX-CmxQwqmf-D_GdoNIu.js";
3
- import { t as hi } from "./chunk-JWPE2WC7-DI69CthA-D_FsPQj-.js";
4
- import { Z as _e } from "./cytoscape.esm-YSf_2rtb-CoO8mT3p.js";
5
- var we = /* @__PURE__ */ pe(((x, L) => {
6
- (function(A, O) {
7
- typeof x == "object" && typeof L == "object" ? L.exports = O() : typeof define == "function" && define.amd ? define([], O) : typeof x == "object" ? x.layoutBase = O() : A.layoutBase = O();
8
- })(x, function() {
9
- return (function(A) {
10
- var O = {};
11
- function N(f) {
12
- if (O[f]) return O[f].exports;
13
- var a = O[f] = {
14
- i: f,
15
- l: !1,
16
- exports: {}
17
- };
18
- return A[f].call(a.exports, a, a.exports, N), a.l = !0, a.exports;
19
- }
20
- return N.m = A, N.c = O, N.i = function(f) {
21
- return f;
22
- }, N.d = function(f, a, o) {
23
- N.o(f, a) || Object.defineProperty(f, a, {
24
- configurable: !1,
25
- enumerable: !0,
26
- get: o
27
- });
28
- }, N.n = function(f) {
29
- var a = f && f.__esModule ? function() {
30
- return f.default;
31
- } : function() {
32
- return f;
33
- };
34
- return N.d(a, "a", a), a;
35
- }, N.o = function(f, a) {
36
- return Object.prototype.hasOwnProperty.call(f, a);
37
- }, N.p = "", N(N.s = 28);
38
- })([
39
- (function(A, O, N) {
40
- function f() {
41
- }
42
- f.QUALITY = 1, f.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, f.DEFAULT_INCREMENTAL = !1, f.DEFAULT_ANIMATION_ON_LAYOUT = !0, f.DEFAULT_ANIMATION_DURING_LAYOUT = !1, f.DEFAULT_ANIMATION_PERIOD = 50, f.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, f.DEFAULT_GRAPH_MARGIN = 15, f.NODE_DIMENSIONS_INCLUDE_LABELS = !1, f.SIMPLE_NODE_SIZE = 40, f.SIMPLE_NODE_HALF_SIZE = f.SIMPLE_NODE_SIZE / 2, f.EMPTY_COMPOUND_NODE_SIZE = 40, f.MIN_EDGE_LENGTH = 1, f.WORLD_BOUNDARY = 1e6, f.INITIAL_WORLD_BOUNDARY = f.WORLD_BOUNDARY / 1e3, f.WORLD_CENTER_X = 1200, f.WORLD_CENTER_Y = 900, A.exports = f;
43
- }),
44
- (function(A, O, N) {
45
- var f = N(2), a = N(8), o = N(9);
46
- function t(s, i, p) {
47
- f.call(this, p), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = p, this.bendpoints = [], this.source = s, this.target = i;
48
- }
49
- for (var e in t.prototype = Object.create(f.prototype), f) t[e] = f[e];
50
- t.prototype.getSource = function() {
51
- return this.source;
52
- }, t.prototype.getTarget = function() {
53
- return this.target;
54
- }, t.prototype.isInterGraph = function() {
55
- return this.isInterGraph;
56
- }, t.prototype.getLength = function() {
57
- return this.length;
58
- }, t.prototype.isOverlapingSourceAndTarget = function() {
59
- return this.isOverlapingSourceAndTarget;
60
- }, t.prototype.getBendpoints = function() {
61
- return this.bendpoints;
62
- }, t.prototype.getLca = function() {
63
- return this.lca;
64
- }, t.prototype.getSourceInLca = function() {
65
- return this.sourceInLca;
66
- }, t.prototype.getTargetInLca = function() {
67
- return this.targetInLca;
68
- }, t.prototype.getOtherEnd = function(s) {
69
- if (this.source === s) return this.target;
70
- if (this.target === s) return this.source;
71
- throw "Node is not incident with this edge";
72
- }, t.prototype.getOtherEndInGraph = function(s, i) {
73
- for (var p = this.getOtherEnd(s), r = i.getGraphManager().getRoot(); ; ) {
74
- if (p.getOwner() == i) return p;
75
- if (p.getOwner() == r) break;
76
- p = p.getOwner().getParent();
77
- }
78
- return null;
79
- }, t.prototype.updateLength = function() {
80
- var s = [
81
- ,
82
- ,
83
- ,
84
- ,
85
- ];
86
- this.isOverlapingSourceAndTarget = a.getIntersection(this.target.getRect(), this.source.getRect(), s), this.isOverlapingSourceAndTarget || (this.lengthX = s[0] - s[2], this.lengthY = s[1] - s[3], Math.abs(this.lengthX) < 1 && (this.lengthX = o.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = o.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
87
- }, t.prototype.updateLengthSimple = function() {
88
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = o.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = o.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
89
- }, A.exports = t;
90
- }),
91
- (function(A, O, N) {
92
- function f(a) {
93
- this.vGraphObject = a;
94
- }
95
- A.exports = f;
96
- }),
97
- (function(A, O, N) {
98
- var f = N(2), a = N(10), o = N(13), t = N(0), e = N(16), s = N(5);
99
- function i(r, n, g, l) {
100
- g == null && l == null && (l = n), f.call(this, l), r.graphManager != null && (r = r.graphManager), this.estimatedSize = a.MIN_VALUE, this.inclusionTreeDepth = a.MAX_VALUE, this.vGraphObject = l, this.edges = [], this.graphManager = r, this.rect = g != null && n != null ? new o(n.x, n.y, g.width, g.height) : new o();
101
- }
102
- for (var p in i.prototype = Object.create(f.prototype), f) i[p] = f[p];
103
- i.prototype.getEdges = function() {
104
- return this.edges;
105
- }, i.prototype.getChild = function() {
106
- return this.child;
107
- }, i.prototype.getOwner = function() {
108
- return this.owner;
109
- }, i.prototype.getWidth = function() {
110
- return this.rect.width;
111
- }, i.prototype.setWidth = function(r) {
112
- this.rect.width = r;
113
- }, i.prototype.getHeight = function() {
114
- return this.rect.height;
115
- }, i.prototype.setHeight = function(r) {
116
- this.rect.height = r;
117
- }, i.prototype.getCenterX = function() {
118
- return this.rect.x + this.rect.width / 2;
119
- }, i.prototype.getCenterY = function() {
120
- return this.rect.y + this.rect.height / 2;
121
- }, i.prototype.getCenter = function() {
122
- return new s(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
123
- }, i.prototype.getLocation = function() {
124
- return new s(this.rect.x, this.rect.y);
125
- }, i.prototype.getRect = function() {
126
- return this.rect;
127
- }, i.prototype.getDiagonal = function() {
128
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
129
- }, i.prototype.getHalfTheDiagonal = function() {
130
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
131
- }, i.prototype.setRect = function(r, n) {
132
- this.rect.x = r.x, this.rect.y = r.y, this.rect.width = n.width, this.rect.height = n.height;
133
- }, i.prototype.setCenter = function(r, n) {
134
- this.rect.x = r - this.rect.width / 2, this.rect.y = n - this.rect.height / 2;
135
- }, i.prototype.setLocation = function(r, n) {
136
- this.rect.x = r, this.rect.y = n;
137
- }, i.prototype.moveBy = function(r, n) {
138
- this.rect.x += r, this.rect.y += n;
139
- }, i.prototype.getEdgeListToNode = function(r) {
140
- var n = [], g = this;
141
- return g.edges.forEach(function(l) {
142
- if (l.target == r) {
143
- if (l.source != g) throw "Incorrect edge source!";
144
- n.push(l);
145
- }
146
- }), n;
147
- }, i.prototype.getEdgesBetween = function(r) {
148
- var n = [], g = this;
149
- return g.edges.forEach(function(l) {
150
- if (l.source != g && l.target != g) throw "Incorrect edge source and/or target";
151
- (l.target == r || l.source == r) && n.push(l);
152
- }), n;
153
- }, i.prototype.getNeighborsList = function() {
154
- var r = /* @__PURE__ */ new Set(), n = this;
155
- return n.edges.forEach(function(g) {
156
- if (g.source == n) r.add(g.target);
157
- else {
158
- if (g.target != n) throw "Incorrect incidency!";
159
- r.add(g.source);
160
- }
161
- }), r;
162
- }, i.prototype.withChildren = function() {
163
- var r = /* @__PURE__ */ new Set(), n, g;
164
- if (r.add(this), this.child != null) for (var l = this.child.getNodes(), c = 0; c < l.length; c++) n = l[c], g = n.withChildren(), g.forEach(function(d) {
165
- r.add(d);
166
- });
167
- return r;
168
- }, i.prototype.getNoOfChildren = function() {
169
- var r = 0, n;
170
- if (this.child == null) r = 1;
171
- else for (var g = this.child.getNodes(), l = 0; l < g.length; l++) n = g[l], r += n.getNoOfChildren();
172
- return r == 0 && (r = 1), r;
173
- }, i.prototype.getEstimatedSize = function() {
174
- if (this.estimatedSize == a.MIN_VALUE) throw "assert failed";
175
- return this.estimatedSize;
176
- }, i.prototype.calcEstimatedSize = function() {
177
- 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);
178
- }, i.prototype.scatter = function() {
179
- var r, n, g = -t.INITIAL_WORLD_BOUNDARY, l = t.INITIAL_WORLD_BOUNDARY;
180
- r = t.WORLD_CENTER_X + e.nextDouble() * (l - g) + g;
181
- var c = -t.INITIAL_WORLD_BOUNDARY, d = t.INITIAL_WORLD_BOUNDARY;
182
- n = t.WORLD_CENTER_Y + e.nextDouble() * (d - c) + c, this.rect.x = r, this.rect.y = n;
183
- }, i.prototype.updateBounds = function() {
184
- if (this.getChild() == null) throw "assert failed";
185
- if (this.getChild().getNodes().length != 0) {
186
- var r = this.getChild();
187
- if (r.updateBounds(!0), this.rect.x = r.getLeft(), this.rect.y = r.getTop(), this.setWidth(r.getRight() - r.getLeft()), this.setHeight(r.getBottom() - r.getTop()), t.NODE_DIMENSIONS_INCLUDE_LABELS) {
188
- var n = r.getRight() - r.getLeft(), g = r.getBottom() - r.getTop();
189
- this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(n + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > n ? (this.rect.x -= (this.labelWidth - n) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(n + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(g + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > g ? (this.rect.y -= (this.labelHeight - g) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(g + this.labelHeight));
190
- }
191
- }
192
- }, i.prototype.getInclusionTreeDepth = function() {
193
- if (this.inclusionTreeDepth == a.MAX_VALUE) throw "assert failed";
194
- return this.inclusionTreeDepth;
195
- }, i.prototype.transform = function(r) {
196
- var n = this.rect.x;
197
- n > t.WORLD_BOUNDARY ? n = t.WORLD_BOUNDARY : n < -t.WORLD_BOUNDARY && (n = -t.WORLD_BOUNDARY);
198
- var g = this.rect.y;
199
- g > t.WORLD_BOUNDARY ? g = t.WORLD_BOUNDARY : g < -t.WORLD_BOUNDARY && (g = -t.WORLD_BOUNDARY);
200
- var l = new s(n, g), c = r.inverseTransformPoint(l);
201
- this.setLocation(c.x, c.y);
202
- }, i.prototype.getLeft = function() {
203
- return this.rect.x;
204
- }, i.prototype.getRight = function() {
205
- return this.rect.x + this.rect.width;
206
- }, i.prototype.getTop = function() {
207
- return this.rect.y;
208
- }, i.prototype.getBottom = function() {
209
- return this.rect.y + this.rect.height;
210
- }, i.prototype.getParent = function() {
211
- return this.owner == null ? null : this.owner.getParent();
212
- }, A.exports = i;
213
- }),
214
- (function(A, O, N) {
215
- var f = N(0);
216
- function a() {
217
- }
218
- for (var o in f) a[o] = f[o];
219
- a.MAX_ITERATIONS = 2500, a.DEFAULT_EDGE_LENGTH = 50, a.DEFAULT_SPRING_STRENGTH = 0.45, a.DEFAULT_REPULSION_STRENGTH = 4500, a.DEFAULT_GRAVITY_STRENGTH = 0.4, a.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, a.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, a.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, a.COOLING_ADAPTATION_FACTOR = 0.33, a.ADAPTATION_LOWER_NODE_LIMIT = 1e3, a.ADAPTATION_UPPER_NODE_LIMIT = 5e3, a.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, a.MAX_NODE_DISPLACEMENT = a.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, a.MIN_REPULSION_DIST = a.DEFAULT_EDGE_LENGTH / 10, a.CONVERGENCE_CHECK_PERIOD = 100, a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, a.MIN_EDGE_LENGTH = 1, a.GRID_CALCULATION_CHECK_PERIOD = 10, A.exports = a;
220
- }),
221
- (function(A, O, N) {
222
- function f(a, o) {
223
- a == null && o == null ? (this.x = 0, this.y = 0) : (this.x = a, this.y = o);
224
- }
225
- f.prototype.getX = function() {
226
- return this.x;
227
- }, f.prototype.getY = function() {
228
- return this.y;
229
- }, f.prototype.setX = function(a) {
230
- this.x = a;
231
- }, f.prototype.setY = function(a) {
232
- this.y = a;
233
- }, f.prototype.getDifference = function(a) {
234
- return new DimensionD(this.x - a.x, this.y - a.y);
235
- }, f.prototype.getCopy = function() {
236
- return new f(this.x, this.y);
237
- }, f.prototype.translate = function(a) {
238
- return this.x += a.width, this.y += a.height, this;
239
- }, A.exports = f;
240
- }),
241
- (function(A, O, N) {
242
- var f = N(2), a = N(10), o = N(0), t = N(7), e = N(3), s = N(1), i = N(13), p = N(12), r = N(11);
243
- function n(l, c, d) {
244
- f.call(this, d), this.estimatedSize = a.MIN_VALUE, this.margin = o.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = l, c != null && c instanceof t ? this.graphManager = c : c != null && c instanceof Layout && (this.graphManager = c.graphManager);
245
- }
246
- for (var g in n.prototype = Object.create(f.prototype), f) n[g] = f[g];
247
- n.prototype.getNodes = function() {
248
- return this.nodes;
249
- }, n.prototype.getEdges = function() {
250
- return this.edges;
251
- }, n.prototype.getGraphManager = function() {
252
- return this.graphManager;
253
- }, n.prototype.getParent = function() {
254
- return this.parent;
255
- }, n.prototype.getLeft = function() {
256
- return this.left;
257
- }, n.prototype.getRight = function() {
258
- return this.right;
259
- }, n.prototype.getTop = function() {
260
- return this.top;
261
- }, n.prototype.getBottom = function() {
262
- return this.bottom;
263
- }, n.prototype.isConnected = function() {
264
- return this.isConnected;
265
- }, n.prototype.add = function(l, c, d) {
266
- if (c == null && d == null) {
267
- var m = l;
268
- if (this.graphManager == null) throw "Graph has no graph mgr!";
269
- if (this.getNodes().indexOf(m) > -1) throw "Node already in graph!";
270
- return m.owner = this, this.getNodes().push(m), m;
271
- }
272
- var E = l;
273
- if (!(this.getNodes().indexOf(c) > -1 && this.getNodes().indexOf(d) > -1)) throw "Source or target not in graph!";
274
- if (c.owner != d.owner || c.owner != this) throw "Both owners must be this graph!";
275
- return c.owner == d.owner ? (E.source = c, E.target = d, E.isInterGraph = !1, this.getEdges().push(E), c.edges.push(E), d != c && d.edges.push(E), E) : null;
276
- }, n.prototype.remove = function(l) {
277
- var c = l;
278
- if (l instanceof e) {
279
- if (c == null) throw "Node is null!";
280
- if (c.owner == null || c.owner != this) throw "Owner graph is invalid!";
281
- if (this.graphManager == null) throw "Owner graph manager is invalid!";
282
- for (var d = c.edges.slice(), m, E = d.length, C = 0; C < E; C++) m = d[C], m.isInterGraph ? this.graphManager.remove(m) : m.source.owner.remove(m);
283
- var R = this.nodes.indexOf(c);
284
- if (R == -1) throw "Node not in owner node list!";
285
- this.nodes.splice(R, 1);
286
- } else if (l instanceof s) {
287
- var m = l;
288
- if (m == null) throw "Edge is null!";
289
- if (m.source == null || m.target == null) throw "Source and/or target is null!";
290
- if (m.source.owner == null || m.target.owner == null || m.source.owner != this || m.target.owner != this) throw "Source and/or target owner is invalid!";
291
- var S = m.source.edges.indexOf(m), G = m.target.edges.indexOf(m);
292
- if (!(S > -1 && G > -1)) throw "Source and/or target doesn't know this edge!";
293
- m.source.edges.splice(S, 1), m.target != m.source && m.target.edges.splice(G, 1);
294
- var R = m.source.owner.getEdges().indexOf(m);
295
- if (R == -1) throw "Not in owner's edge list!";
296
- m.source.owner.getEdges().splice(R, 1);
297
- }
298
- }, n.prototype.updateLeftTop = function() {
299
- for (var l = a.MAX_VALUE, c = a.MAX_VALUE, d, m, E, C = this.getNodes(), R = C.length, S = 0; S < R; S++) {
300
- var G = C[S];
301
- d = G.getTop(), m = G.getLeft(), l > d && (l = d), c > m && (c = m);
302
- }
303
- return l == a.MAX_VALUE ? null : (E = C[0].getParent().paddingLeft == null ? this.margin : C[0].getParent().paddingLeft, this.left = c - E, this.top = l - E, new p(this.left, this.top));
304
- }, n.prototype.updateBounds = function(l) {
305
- for (var c = a.MAX_VALUE, d = -a.MAX_VALUE, m = a.MAX_VALUE, E = -a.MAX_VALUE, C, R, S, G, X, $ = this.nodes, _ = $.length, Z = 0; Z < _; Z++) {
306
- var h = $[Z];
307
- l && h.child != null && h.updateBounds(), C = h.getLeft(), R = h.getRight(), S = h.getTop(), G = h.getBottom(), c > C && (c = C), d < R && (d = R), m > S && (m = S), E < G && (E = G);
308
- }
309
- var T = new i(c, m, d - c, E - m);
310
- c == a.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), X = $[0].getParent().paddingLeft == null ? this.margin : $[0].getParent().paddingLeft, this.left = T.x - X, this.right = T.x + T.width + X, this.top = T.y - X, this.bottom = T.y + T.height + X;
311
- }, n.calculateBounds = function(l) {
312
- for (var c = a.MAX_VALUE, d = -a.MAX_VALUE, m = a.MAX_VALUE, E = -a.MAX_VALUE, C, R, S, G, X = l.length, $ = 0; $ < X; $++) {
313
- var _ = l[$];
314
- C = _.getLeft(), R = _.getRight(), S = _.getTop(), G = _.getBottom(), c > C && (c = C), d < R && (d = R), m > S && (m = S), E < G && (E = G);
315
- }
316
- return new i(c, m, d - c, E - m);
317
- }, n.prototype.getInclusionTreeDepth = function() {
318
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
319
- }, n.prototype.getEstimatedSize = function() {
320
- if (this.estimatedSize == a.MIN_VALUE) throw "assert failed";
321
- return this.estimatedSize;
322
- }, n.prototype.calcEstimatedSize = function() {
323
- for (var l = 0, c = this.nodes, d = c.length, m = 0; m < d; m++) {
324
- var E = c[m];
325
- l += E.calcEstimatedSize();
326
- }
327
- return this.estimatedSize = l == 0 ? o.EMPTY_COMPOUND_NODE_SIZE : l / Math.sqrt(this.nodes.length), this.estimatedSize;
328
- }, n.prototype.updateConnected = function() {
329
- var l = this;
330
- if (this.nodes.length == 0) {
331
- this.isConnected = !0;
332
- return;
333
- }
334
- var c = new r(), d = /* @__PURE__ */ new Set(), m = this.nodes[0], E, C;
335
- for (m.withChildren().forEach(function(X) {
336
- c.push(X), d.add(X);
337
- }); c.length !== 0; ) {
338
- m = c.shift(), E = m.getEdges();
339
- for (var R = E.length, S = 0; S < R; S++) C = E[S].getOtherEndInGraph(m, this), C != null && !d.has(C) && C.withChildren().forEach(function(X) {
340
- c.push(X), d.add(X);
341
- });
342
- }
343
- if (this.isConnected = !1, d.size >= this.nodes.length) {
344
- var G = 0;
345
- d.forEach(function(X) {
346
- X.owner == l && G++;
347
- }), G == this.nodes.length && (this.isConnected = !0);
348
- }
349
- }, A.exports = n;
350
- }),
351
- (function(A, O, N) {
352
- var f, a = N(1);
353
- function o(t) {
354
- f = N(6), this.layout = t, this.graphs = [], this.edges = [];
355
- }
356
- o.prototype.addRoot = function() {
357
- var t = this.layout.newGraph(), e = this.layout.newNode(null), s = this.add(t, e);
358
- return this.setRootGraph(s), this.rootGraph;
359
- }, o.prototype.add = function(t, e, s, i, p) {
360
- if (s == null && i == null && p == null) {
361
- if (t == null) throw "Graph is null!";
362
- if (e == null) throw "Parent node is null!";
363
- if (this.graphs.indexOf(t) > -1) throw "Graph already in this graph mgr!";
364
- if (this.graphs.push(t), t.parent != null) throw "Already has a parent!";
365
- if (e.child != null) throw "Already has a child!";
366
- return t.parent = e, e.child = t, t;
367
- }
368
- p = s, i = e, s = t;
369
- var r = i.getOwner(), n = p.getOwner();
370
- if (r == null || r.getGraphManager() != this) throw "Source not in this graph mgr!";
371
- if (n == null || n.getGraphManager() != this) throw "Target not in this graph mgr!";
372
- if (r == n) return s.isInterGraph = !1, r.add(s, i, p);
373
- if (s.isInterGraph = !0, s.source = i, s.target = p, this.edges.indexOf(s) > -1) throw "Edge already in inter-graph edge list!";
374
- if (this.edges.push(s), s.source == null || s.target == null) throw "Edge source and/or target is null!";
375
- if (s.source.edges.indexOf(s) != -1 || s.target.edges.indexOf(s) != -1) throw "Edge already in source and/or target incidency list!";
376
- return s.source.edges.push(s), s.target.edges.push(s), s;
377
- }, o.prototype.remove = function(t) {
378
- if (t instanceof f) {
379
- var e = t;
380
- if (e.getGraphManager() != this) throw "Graph not in this graph mgr";
381
- if (!(e == this.rootGraph || e.parent != null && e.parent.graphManager == this)) throw "Invalid parent node!";
382
- var s = [];
383
- s = s.concat(e.getEdges());
384
- for (var i, p = s.length, r = 0; r < p; r++) i = s[r], e.remove(i);
385
- var n = [];
386
- n = n.concat(e.getNodes());
387
- var g;
388
- p = n.length;
389
- for (var r = 0; r < p; r++) g = n[r], e.remove(g);
390
- e == this.rootGraph && this.setRootGraph(null);
391
- var l = this.graphs.indexOf(e);
392
- this.graphs.splice(l, 1), e.parent = null;
393
- } else if (t instanceof a) {
394
- if (i = t, i == null) throw "Edge is null!";
395
- if (!i.isInterGraph) throw "Not an inter-graph edge!";
396
- if (i.source == null || i.target == null) throw "Source and/or target is null!";
397
- if (i.source.edges.indexOf(i) == -1 || i.target.edges.indexOf(i) == -1) throw "Source and/or target doesn't know this edge!";
398
- var l = i.source.edges.indexOf(i);
399
- if (i.source.edges.splice(l, 1), l = i.target.edges.indexOf(i), i.target.edges.splice(l, 1), i.source.owner == null || i.source.owner.getGraphManager() == null) throw "Edge owner graph or owner graph manager is null!";
400
- if (i.source.owner.getGraphManager().edges.indexOf(i) == -1) throw "Not in owner graph manager's edge list!";
401
- var l = i.source.owner.getGraphManager().edges.indexOf(i);
402
- i.source.owner.getGraphManager().edges.splice(l, 1);
403
- }
404
- }, o.prototype.updateBounds = function() {
405
- this.rootGraph.updateBounds(!0);
406
- }, o.prototype.getGraphs = function() {
407
- return this.graphs;
408
- }, o.prototype.getAllNodes = function() {
409
- if (this.allNodes == null) {
410
- for (var t = [], e = this.getGraphs(), s = e.length, i = 0; i < s; i++) t = t.concat(e[i].getNodes());
411
- this.allNodes = t;
412
- }
413
- return this.allNodes;
414
- }, o.prototype.resetAllNodes = function() {
415
- this.allNodes = null;
416
- }, o.prototype.resetAllEdges = function() {
417
- this.allEdges = null;
418
- }, o.prototype.resetAllNodesToApplyGravitation = function() {
419
- this.allNodesToApplyGravitation = null;
420
- }, o.prototype.getAllEdges = function() {
421
- if (this.allEdges == null) {
422
- var t = [], e = this.getGraphs();
423
- e.length;
424
- for (var s = 0; s < e.length; s++) t = t.concat(e[s].getEdges());
425
- t = t.concat(this.edges), this.allEdges = t;
426
- }
427
- return this.allEdges;
428
- }, o.prototype.getAllNodesToApplyGravitation = function() {
429
- return this.allNodesToApplyGravitation;
430
- }, o.prototype.setAllNodesToApplyGravitation = function(t) {
431
- if (this.allNodesToApplyGravitation != null) throw "assert failed";
432
- this.allNodesToApplyGravitation = t;
433
- }, o.prototype.getRoot = function() {
434
- return this.rootGraph;
435
- }, o.prototype.setRootGraph = function(t) {
436
- if (t.getGraphManager() != this) throw "Root not in this graph mgr!";
437
- this.rootGraph = t, t.parent ??= this.layout.newNode("Root node");
438
- }, o.prototype.getLayout = function() {
439
- return this.layout;
440
- }, o.prototype.isOneAncestorOfOther = function(t, e) {
441
- if (t == null || e == null) throw "assert failed";
442
- if (t == e) return !0;
443
- var s = t.getOwner(), i;
444
- do {
445
- if (i = s.getParent(), i == null) break;
446
- if (i == e) return !0;
447
- if (s = i.getOwner(), s == null) break;
448
- } while (!0);
449
- s = e.getOwner();
450
- do {
451
- if (i = s.getParent(), i == null) break;
452
- if (i == t) return !0;
453
- if (s = i.getOwner(), s == null) break;
454
- } while (!0);
455
- return !1;
456
- }, o.prototype.calcLowestCommonAncestors = function() {
457
- for (var t, e, s, i, p, r = this.getAllEdges(), n = r.length, g = 0; g < n; g++) {
458
- if (t = r[g], e = t.source, s = t.target, t.lca = null, t.sourceInLca = e, t.targetInLca = s, e == s) {
459
- t.lca = e.getOwner();
460
- continue;
461
- }
462
- for (i = e.getOwner(); t.lca == null; ) {
463
- for (t.targetInLca = s, p = s.getOwner(); t.lca == null; ) {
464
- if (p == i) {
465
- t.lca = p;
466
- break;
467
- }
468
- if (p == this.rootGraph) break;
469
- if (t.lca != null) throw "assert failed";
470
- t.targetInLca = p.getParent(), p = t.targetInLca.getOwner();
471
- }
472
- if (i == this.rootGraph) break;
473
- t.lca ?? (t.sourceInLca = i.getParent(), i = t.sourceInLca.getOwner());
474
- }
475
- if (t.lca == null) throw "assert failed";
476
- }
477
- }, o.prototype.calcLowestCommonAncestor = function(t, e) {
478
- if (t == e) return t.getOwner();
479
- var s = t.getOwner();
480
- do {
481
- if (s == null) break;
482
- var i = e.getOwner();
483
- do {
484
- if (i == null) break;
485
- if (i == s) return i;
486
- i = i.getParent().getOwner();
487
- } while (!0);
488
- s = s.getParent().getOwner();
489
- } while (!0);
490
- return s;
491
- }, o.prototype.calcInclusionTreeDepths = function(t, e) {
492
- t == null && e == null && (t = this.rootGraph, e = 1);
493
- for (var s, i = t.getNodes(), p = i.length, r = 0; r < p; r++) s = i[r], s.inclusionTreeDepth = e, s.child != null && this.calcInclusionTreeDepths(s.child, e + 1);
494
- }, o.prototype.includesInvalidEdge = function() {
495
- for (var t, e = [], s = this.edges.length, i = 0; i < s; i++) t = this.edges[i], this.isOneAncestorOfOther(t.source, t.target) && e.push(t);
496
- for (var i = 0; i < e.length; i++) this.remove(e[i]);
497
- return !1;
498
- }, A.exports = o;
499
- }),
500
- (function(A, O, N) {
501
- var f = N(12);
502
- function a() {
503
- }
504
- a.calcSeparationAmount = function(o, t, e, s) {
505
- if (!o.intersects(t)) throw "assert failed";
506
- var i = [, ,];
507
- this.decideDirectionsForOverlappingNodes(o, t, i), e[0] = Math.min(o.getRight(), t.getRight()) - Math.max(o.x, t.x), e[1] = Math.min(o.getBottom(), t.getBottom()) - Math.max(o.y, t.y), o.getX() <= t.getX() && o.getRight() >= t.getRight() ? e[0] += Math.min(t.getX() - o.getX(), o.getRight() - t.getRight()) : t.getX() <= o.getX() && t.getRight() >= o.getRight() && (e[0] += Math.min(o.getX() - t.getX(), t.getRight() - o.getRight())), o.getY() <= t.getY() && o.getBottom() >= t.getBottom() ? e[1] += Math.min(t.getY() - o.getY(), o.getBottom() - t.getBottom()) : t.getY() <= o.getY() && t.getBottom() >= o.getBottom() && (e[1] += Math.min(o.getY() - t.getY(), t.getBottom() - o.getBottom()));
508
- var p = Math.abs((t.getCenterY() - o.getCenterY()) / (t.getCenterX() - o.getCenterX()));
509
- t.getCenterY() === o.getCenterY() && t.getCenterX() === o.getCenterX() && (p = 1);
510
- var r = p * e[0], n = e[1] / p;
511
- e[0] < n ? n = e[0] : r = e[1], e[0] = -1 * i[0] * (n / 2 + s), e[1] = -1 * i[1] * (r / 2 + s);
512
- }, a.decideDirectionsForOverlappingNodes = function(o, t, e) {
513
- e[0] = o.getCenterX() < t.getCenterX() ? -1 : 1, e[1] = o.getCenterY() < t.getCenterY() ? -1 : 1;
514
- }, a.getIntersection2 = function(o, t, e) {
515
- var s = o.getCenterX(), i = o.getCenterY(), p = t.getCenterX(), r = t.getCenterY();
516
- if (o.intersects(t)) return e[0] = s, e[1] = i, e[2] = p, e[3] = r, !0;
517
- var n = o.getX(), g = o.getY(), l = o.getRight(), c = o.getX(), d = o.getBottom(), m = o.getRight(), E = o.getWidthHalf(), C = o.getHeightHalf(), R = t.getX(), S = t.getY(), G = t.getRight(), X = t.getX(), $ = t.getBottom(), _ = t.getRight(), Z = t.getWidthHalf(), h = t.getHeightHalf(), T = !1, u = !1;
518
- if (s === p) {
519
- if (i > r) return e[0] = s, e[1] = g, e[2] = p, e[3] = $, !1;
520
- if (i < r) return e[0] = s, e[1] = d, e[2] = p, e[3] = S, !1;
521
- } else if (i === r) {
522
- if (s > p) return e[0] = n, e[1] = i, e[2] = G, e[3] = r, !1;
523
- if (s < p) return e[0] = l, e[1] = i, e[2] = R, e[3] = r, !1;
524
- } else {
525
- var v = o.height / o.width, y = t.height / t.width, w = (r - i) / (p - s), I = void 0, F = void 0, P = void 0, b = void 0, H = void 0, W = void 0;
526
- if (-v === w ? s > p ? (e[0] = c, e[1] = d, T = !0) : (e[0] = l, e[1] = g, T = !0) : v === w && (s > p ? (e[0] = n, e[1] = g, T = !0) : (e[0] = m, e[1] = d, T = !0)), -y === w ? p > s ? (e[2] = X, e[3] = $, u = !0) : (e[2] = G, e[3] = S, u = !0) : y === w && (p > s ? (e[2] = R, e[3] = S, u = !0) : (e[2] = _, e[3] = $, u = !0)), T && u) return !1;
527
- if (s > p ? i > r ? (I = this.getCardinalDirection(v, w, 4), F = this.getCardinalDirection(y, w, 2)) : (I = this.getCardinalDirection(-v, w, 3), F = this.getCardinalDirection(-y, w, 1)) : i > r ? (I = this.getCardinalDirection(-v, w, 1), F = this.getCardinalDirection(-y, w, 3)) : (I = this.getCardinalDirection(v, w, 2), F = this.getCardinalDirection(y, w, 4)), !T) switch (I) {
528
- case 1:
529
- b = g, P = s + -C / w, e[0] = P, e[1] = b;
530
- break;
531
- case 2:
532
- P = m, b = i + E * w, e[0] = P, e[1] = b;
533
- break;
534
- case 3:
535
- b = d, P = s + C / w, e[0] = P, e[1] = b;
536
- break;
537
- case 4:
538
- P = c, b = i + -E * w, e[0] = P, e[1] = b;
539
- }
540
- if (!u) switch (F) {
541
- case 1:
542
- W = S, H = p + -h / w, e[2] = H, e[3] = W;
543
- break;
544
- case 2:
545
- H = _, W = r + Z * w, e[2] = H, e[3] = W;
546
- break;
547
- case 3:
548
- W = $, H = p + h / w, e[2] = H, e[3] = W;
549
- break;
550
- case 4:
551
- H = X, W = r + -Z * w, e[2] = H, e[3] = W;
552
- }
553
- }
554
- return !1;
555
- }, a.getCardinalDirection = function(o, t, e) {
556
- return o > t ? e : 1 + e % 4;
557
- }, a.getIntersection = function(o, t, e, s) {
558
- if (s == null) return this.getIntersection2(o, t, e);
559
- var i = o.x, p = o.y, r = t.x, n = t.y, g = e.x, l = e.y, c = s.x, d = s.y, m = void 0, E = void 0, C = void 0, R = void 0, S = void 0, G = void 0, X = void 0, $ = void 0, _ = void 0;
560
- return C = n - p, S = i - r, X = r * p - i * n, R = d - l, G = g - c, $ = c * l - g * d, _ = C * G - R * S, _ === 0 ? null : (m = (S * $ - G * X) / _, E = (R * X - C * $) / _, new f(m, E));
561
- }, a.angleOfVector = function(o, t, e, s) {
562
- var i = void 0;
563
- return o === e ? i = s < t ? this.ONE_AND_HALF_PI : this.HALF_PI : (i = Math.atan((s - t) / (e - o)), e < o ? i += Math.PI : s < t && (i += this.TWO_PI)), i;
564
- }, a.doIntersect = function(o, t, e, s) {
565
- var i = o.x, p = o.y, r = t.x, n = t.y, g = e.x, l = e.y, c = s.x, d = s.y, m = (r - i) * (d - l) - (c - g) * (n - p);
566
- if (m === 0) return !1;
567
- var E = ((d - l) * (c - i) + (g - c) * (d - p)) / m, C = ((p - n) * (c - i) + (r - i) * (d - p)) / m;
568
- return 0 < E && E < 1 && 0 < C && C < 1;
569
- }, a.findCircleLineIntersections = function(o, t, e, s, i, p, r) {
570
- var n = (e - o) * (e - o) + (s - t) * (s - t), g = 2 * ((o - i) * (e - o) + (t - p) * (s - t)), l = (o - i) * (o - i) + (t - p) * (t - p) - r * r;
571
- if (g * g - 4 * n * l >= 0) {
572
- var c = (-g + Math.sqrt(g * g - 4 * n * l)) / (2 * n), d = (-g - Math.sqrt(g * g - 4 * n * l)) / (2 * n);
573
- return c >= 0 && c <= 1 ? [c] : d >= 0 && d <= 1 ? [d] : null;
574
- }
575
- return null;
576
- }, a.HALF_PI = 0.5 * Math.PI, a.ONE_AND_HALF_PI = 1.5 * Math.PI, a.TWO_PI = 2 * Math.PI, a.THREE_PI = 3 * Math.PI, A.exports = a;
577
- }),
578
- (function(A, O, N) {
579
- function f() {
580
- }
581
- f.sign = function(a) {
582
- return a > 0 ? 1 : a < 0 ? -1 : 0;
583
- }, f.floor = function(a) {
584
- return a < 0 ? Math.ceil(a) : Math.floor(a);
585
- }, f.ceil = function(a) {
586
- return a < 0 ? Math.floor(a) : Math.ceil(a);
587
- }, A.exports = f;
588
- }),
589
- (function(A, O, N) {
590
- function f() {
591
- }
592
- f.MAX_VALUE = 2147483647, f.MIN_VALUE = -2147483648, A.exports = f;
593
- }),
594
- (function(A, O, N) {
595
- var f = /* @__PURE__ */ (function() {
596
- function s(i, p) {
597
- for (var r = 0; r < p.length; r++) {
598
- var n = p[r];
599
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(i, n.key, n);
600
- }
601
- }
602
- return function(i, p, r) {
603
- return p && s(i.prototype, p), r && s(i, r), i;
604
- };
605
- })();
606
- function a(s, i) {
607
- if (!(s instanceof i)) throw TypeError("Cannot call a class as a function");
608
- }
609
- var o = function(s) {
610
- return {
611
- value: s,
612
- next: null,
613
- prev: null
614
- };
615
- }, t = function(s, i, p, r) {
616
- return s === null ? r.head = i : s.next = i, p === null ? r.tail = i : p.prev = i, i.prev = s, i.next = p, r.length++, i;
617
- }, e = function(s, i) {
618
- var p = s.prev, r = s.next;
619
- return p === null ? i.head = r : p.next = r, r === null ? i.tail = p : r.prev = p, s.prev = s.next = null, i.length--, s;
620
- };
621
- A.exports = (function() {
622
- function s(i) {
623
- var p = this;
624
- a(this, s), this.length = 0, this.head = null, this.tail = null, i?.forEach(function(r) {
625
- return p.push(r);
626
- });
627
- }
628
- return f(s, [
629
- {
630
- key: "size",
631
- value: function() {
632
- return this.length;
633
- }
634
- },
635
- {
636
- key: "insertBefore",
637
- value: function(i, p) {
638
- return t(p.prev, o(i), p, this);
639
- }
640
- },
641
- {
642
- key: "insertAfter",
643
- value: function(i, p) {
644
- return t(p, o(i), p.next, this);
645
- }
646
- },
647
- {
648
- key: "insertNodeBefore",
649
- value: function(i, p) {
650
- return t(p.prev, i, p, this);
651
- }
652
- },
653
- {
654
- key: "insertNodeAfter",
655
- value: function(i, p) {
656
- return t(p, i, p.next, this);
657
- }
658
- },
659
- {
660
- key: "push",
661
- value: function(i) {
662
- return t(this.tail, o(i), null, this);
663
- }
664
- },
665
- {
666
- key: "unshift",
667
- value: function(i) {
668
- return t(null, o(i), this.head, this);
669
- }
670
- },
671
- {
672
- key: "remove",
673
- value: function(i) {
674
- return e(i, this);
675
- }
676
- },
677
- {
678
- key: "pop",
679
- value: function() {
680
- return e(this.tail, this).value;
681
- }
682
- },
683
- {
684
- key: "popNode",
685
- value: function() {
686
- return e(this.tail, this);
687
- }
688
- },
689
- {
690
- key: "shift",
691
- value: function() {
692
- return e(this.head, this).value;
693
- }
694
- },
695
- {
696
- key: "shiftNode",
697
- value: function() {
698
- return e(this.head, this);
699
- }
700
- },
701
- {
702
- key: "get_object_at",
703
- value: function(i) {
704
- if (i <= this.length()) {
705
- for (var p = 1, r = this.head; p < i; ) r = r.next, p++;
706
- return r.value;
707
- }
708
- }
709
- },
710
- {
711
- key: "set_object_at",
712
- value: function(i, p) {
713
- if (i <= this.length()) {
714
- for (var r = 1, n = this.head; r < i; ) n = n.next, r++;
715
- n.value = p;
716
- }
717
- }
718
- }
719
- ]), s;
720
- })();
721
- }),
722
- (function(A, O, N) {
723
- function f(a, o, t) {
724
- this.x = null, this.y = null, a == null && o == null && t == null ? (this.x = 0, this.y = 0) : typeof a == "number" && typeof o == "number" && t == null ? (this.x = a, this.y = o) : a.constructor.name == "Point" && o == null && t == null && (t = a, this.x = t.x, this.y = t.y);
725
- }
726
- f.prototype.getX = function() {
727
- return this.x;
728
- }, f.prototype.getY = function() {
729
- return this.y;
730
- }, f.prototype.getLocation = function() {
731
- return new f(this.x, this.y);
732
- }, f.prototype.setLocation = function(a, o, t) {
733
- a.constructor.name == "Point" && o == null && t == null ? (t = a, this.setLocation(t.x, t.y)) : typeof a == "number" && typeof o == "number" && t == null && (parseInt(a) == a && parseInt(o) == o ? this.move(a, o) : (this.x = Math.floor(a + 0.5), this.y = Math.floor(o + 0.5)));
734
- }, f.prototype.move = function(a, o) {
735
- this.x = a, this.y = o;
736
- }, f.prototype.translate = function(a, o) {
737
- this.x += a, this.y += o;
738
- }, f.prototype.equals = function(a) {
739
- if (a.constructor.name == "Point") {
740
- var o = a;
741
- return this.x == o.x && this.y == o.y;
742
- }
743
- return this == a;
744
- }, f.prototype.toString = function() {
745
- return new f().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
746
- }, A.exports = f;
747
- }),
748
- (function(A, O, N) {
749
- function f(a, o, t, e) {
750
- this.x = 0, this.y = 0, this.width = 0, this.height = 0, a != null && o != null && t != null && e != null && (this.x = a, this.y = o, this.width = t, this.height = e);
751
- }
752
- f.prototype.getX = function() {
753
- return this.x;
754
- }, f.prototype.setX = function(a) {
755
- this.x = a;
756
- }, f.prototype.getY = function() {
757
- return this.y;
758
- }, f.prototype.setY = function(a) {
759
- this.y = a;
760
- }, f.prototype.getWidth = function() {
761
- return this.width;
762
- }, f.prototype.setWidth = function(a) {
763
- this.width = a;
764
- }, f.prototype.getHeight = function() {
765
- return this.height;
766
- }, f.prototype.setHeight = function(a) {
767
- this.height = a;
768
- }, f.prototype.getRight = function() {
769
- return this.x + this.width;
770
- }, f.prototype.getBottom = function() {
771
- return this.y + this.height;
772
- }, f.prototype.intersects = function(a) {
773
- return !(this.getRight() < a.x || this.getBottom() < a.y || a.getRight() < this.x || a.getBottom() < this.y);
774
- }, f.prototype.getCenterX = function() {
775
- return this.x + this.width / 2;
776
- }, f.prototype.getMinX = function() {
777
- return this.getX();
778
- }, f.prototype.getMaxX = function() {
779
- return this.getX() + this.width;
780
- }, f.prototype.getCenterY = function() {
781
- return this.y + this.height / 2;
782
- }, f.prototype.getMinY = function() {
783
- return this.getY();
784
- }, f.prototype.getMaxY = function() {
785
- return this.getY() + this.height;
786
- }, f.prototype.getWidthHalf = function() {
787
- return this.width / 2;
788
- }, f.prototype.getHeightHalf = function() {
789
- return this.height / 2;
790
- }, A.exports = f;
791
- }),
792
- (function(A, O, N) {
793
- var f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
794
- return typeof o;
795
- } : function(o) {
796
- return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
797
- };
798
- function a() {
799
- }
800
- a.lastID = 0, a.createID = function(o) {
801
- return a.isPrimitive(o) ? o : (o.uniqueID == null && (o.uniqueID = a.getString(), a.lastID++), o.uniqueID);
802
- }, a.getString = function(o) {
803
- return o ??= a.lastID, "Object#" + o;
804
- }, a.isPrimitive = function(o) {
805
- var t = o === void 0 ? "undefined" : f(o);
806
- return o == null || t != "object" && t != "function";
807
- }, A.exports = a;
808
- }),
809
- (function(A, O, N) {
810
- function f(g) {
811
- if (Array.isArray(g)) {
812
- for (var l = 0, c = Array(g.length); l < g.length; l++) c[l] = g[l];
813
- return c;
814
- }
815
- return Array.from(g);
816
- }
817
- var a = N(0), o = N(7), t = N(3), e = N(1), s = N(6), i = N(5), p = N(17), r = N(29);
818
- function n(g) {
819
- r.call(this), this.layoutQuality = a.QUALITY, this.createBendsAsNeeded = a.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = a.DEFAULT_INCREMENTAL, this.animationOnLayout = a.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = a.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = a.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = a.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new o(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, g != null && (this.isRemoteUse = g);
820
- }
821
- n.RANDOM_SEED = 1, n.prototype = Object.create(r.prototype), n.prototype.getGraphManager = function() {
822
- return this.graphManager;
823
- }, n.prototype.getAllNodes = function() {
824
- return this.graphManager.getAllNodes();
825
- }, n.prototype.getAllEdges = function() {
826
- return this.graphManager.getAllEdges();
827
- }, n.prototype.getAllNodesToApplyGravitation = function() {
828
- return this.graphManager.getAllNodesToApplyGravitation();
829
- }, n.prototype.newGraphManager = function() {
830
- var g = new o(this);
831
- return this.graphManager = g, g;
832
- }, n.prototype.newGraph = function(g) {
833
- return new s(null, this.graphManager, g);
834
- }, n.prototype.newNode = function(g) {
835
- return new t(this.graphManager, g);
836
- }, n.prototype.newEdge = function(g) {
837
- return new e(null, null, g);
838
- }, n.prototype.checkLayoutSuccess = function() {
839
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
840
- }, n.prototype.runLayout = function() {
841
- this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
842
- var g = !this.checkLayoutSuccess() && this.layout();
843
- return a.ANIMATE !== "during" && (g && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, g);
844
- }, n.prototype.doPostLayout = function() {
845
- this.incremental || this.transform(), this.update();
846
- }, n.prototype.update2 = function() {
847
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
848
- for (var g = this.graphManager.getAllEdges(), l = 0; l < g.length; l++) g[l];
849
- for (var c = this.graphManager.getRoot().getNodes(), l = 0; l < c.length; l++) c[l];
850
- this.update(this.graphManager.getRoot());
851
- }
852
- }, n.prototype.update = function(g) {
853
- if (g == null) this.update2();
854
- else if (g instanceof t) {
855
- var l = g;
856
- if (l.getChild() != null) for (var c = l.getChild().getNodes(), d = 0; d < c.length; d++) update(c[d]);
857
- l.vGraphObject != null && l.vGraphObject.update(l);
858
- } else if (g instanceof e) {
859
- var m = g;
860
- m.vGraphObject != null && m.vGraphObject.update(m);
861
- } else if (g instanceof s) {
862
- var E = g;
863
- E.vGraphObject != null && E.vGraphObject.update(E);
864
- }
865
- }, n.prototype.initParameters = function() {
866
- this.isSubLayout || (this.layoutQuality = a.QUALITY, this.animationDuringLayout = a.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = a.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = a.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = a.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = a.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = a.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
867
- }, n.prototype.transform = function(g) {
868
- if (g == null) this.transform(new i(0, 0));
869
- else {
870
- var l = new p(), c = this.graphManager.getRoot().updateLeftTop();
871
- if (c != null) {
872
- l.setWorldOrgX(g.x), l.setWorldOrgY(g.y), l.setDeviceOrgX(c.x), l.setDeviceOrgY(c.y);
873
- for (var d = this.getAllNodes(), m, E = 0; E < d.length; E++) m = d[E], m.transform(l);
874
- }
875
- }
876
- }, n.prototype.positionNodesRandomly = function(g) {
877
- if (g == null) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
878
- else for (var l, c, d = g.getNodes(), m = 0; m < d.length; m++) l = d[m], c = l.getChild(), c == null || c.getNodes().length == 0 ? l.scatter() : (this.positionNodesRandomly(c), l.updateBounds());
879
- }, n.prototype.getFlatForest = function() {
880
- for (var g = [], l = !0, c = this.graphManager.getRoot().getNodes(), d = !0, m = 0; m < c.length; m++) c[m].getChild() != null && (d = !1);
881
- if (!d) return g;
882
- var E = /* @__PURE__ */ new Set(), C = [], R = /* @__PURE__ */ new Map(), S = [];
883
- for (S = S.concat(c); S.length > 0 && l; ) {
884
- for (C.push(S[0]); C.length > 0 && l; ) {
885
- var G = C[0];
886
- C.splice(0, 1), E.add(G);
887
- for (var X = G.getEdges(), m = 0; m < X.length; m++) {
888
- var $ = X[m].getOtherEnd(G);
889
- if (R.get(G) != $)
890
- if (!E.has($)) C.push($), R.set($, G);
891
- else {
892
- l = !1;
893
- break;
894
- }
895
- }
896
- }
897
- if (!l) g = [];
898
- else {
899
- var _ = [].concat(f(E));
900
- g.push(_);
901
- for (var m = 0; m < _.length; m++) {
902
- var Z = _[m], h = S.indexOf(Z);
903
- h > -1 && S.splice(h, 1);
904
- }
905
- E = /* @__PURE__ */ new Set(), R = /* @__PURE__ */ new Map();
906
- }
907
- }
908
- return g;
909
- }, n.prototype.createDummyNodesForBendpoints = function(g) {
910
- for (var l = [], c = g.source, d = this.graphManager.calcLowestCommonAncestor(g.source, g.target), m = 0; m < g.bendpoints.length; m++) {
911
- var E = this.newNode(null);
912
- E.setRect(new Point(0, 0), new Dimension(1, 1)), d.add(E);
913
- var C = this.newEdge(null);
914
- this.graphManager.add(C, c, E), l.add(E), c = E;
915
- }
916
- var C = this.newEdge(null);
917
- return this.graphManager.add(C, c, g.target), this.edgeToDummyNodes.set(g, l), g.isInterGraph() ? this.graphManager.remove(g) : d.remove(g), l;
918
- }, n.prototype.createBendpointsFromDummyNodes = function() {
919
- var g = [];
920
- g = g.concat(this.graphManager.getAllEdges()), g = [].concat(f(this.edgeToDummyNodes.keys()), g);
921
- for (var l = 0; l < g.length; l++) {
922
- var c = g[l];
923
- if (c.bendpoints.length > 0) {
924
- for (var d = this.edgeToDummyNodes.get(c), m = 0; m < d.length; m++) {
925
- var E = d[m], C = new i(E.getCenterX(), E.getCenterY()), R = c.bendpoints.get(m);
926
- R.x = C.x, R.y = C.y, E.getOwner().remove(E);
927
- }
928
- this.graphManager.add(c, c.source, c.target);
929
- }
930
- }
931
- }, n.transform = function(g, l, c, d) {
932
- if (c != null && d != null) {
933
- var m = l;
934
- if (g <= 50) {
935
- var E = l / c;
936
- m -= (l - E) / 50 * (50 - g);
937
- } else {
938
- var C = l * d;
939
- m += (C - l) / 50 * (g - 50);
940
- }
941
- return m;
942
- }
943
- var R, S;
944
- return g <= 50 ? (R = 9 * l / 500, S = l / 10) : (R = 9 * l / 50, S = -8 * l), R * g + S;
945
- }, n.findCenterOfTree = function(g) {
946
- var l = [];
947
- l = l.concat(g);
948
- var c = [], d = /* @__PURE__ */ new Map(), m = !1, E = null;
949
- (l.length == 1 || l.length == 2) && (m = !0, E = l[0]);
950
- for (var C = 0; C < l.length; C++) {
951
- var R = l[C], S = R.getNeighborsList().size;
952
- d.set(R, R.getNeighborsList().size), S == 1 && c.push(R);
953
- }
954
- var G = [];
955
- for (G = G.concat(c); !m; ) {
956
- var X = [];
957
- X = X.concat(G), G = [];
958
- for (var C = 0; C < l.length; C++) {
959
- var R = l[C], $ = l.indexOf(R);
960
- $ >= 0 && l.splice($, 1), R.getNeighborsList().forEach(function(h) {
961
- if (c.indexOf(h) < 0) {
962
- var T = d.get(h) - 1;
963
- T == 1 && G.push(h), d.set(h, T);
964
- }
965
- });
966
- }
967
- c = c.concat(G), (l.length == 1 || l.length == 2) && (m = !0, E = l[0]);
968
- }
969
- return E;
970
- }, n.prototype.setGraphManager = function(g) {
971
- this.graphManager = g;
972
- }, A.exports = n;
973
- }),
974
- (function(A, O, N) {
975
- function f() {
976
- }
977
- f.seed = 1, f.x = 0, f.nextDouble = function() {
978
- return f.x = Math.sin(f.seed++) * 1e4, f.x - Math.floor(f.x);
979
- }, A.exports = f;
980
- }),
981
- (function(A, O, N) {
982
- var f = N(5);
983
- function a(o, t) {
984
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
985
- }
986
- a.prototype.getWorldOrgX = function() {
987
- return this.lworldOrgX;
988
- }, a.prototype.setWorldOrgX = function(o) {
989
- this.lworldOrgX = o;
990
- }, a.prototype.getWorldOrgY = function() {
991
- return this.lworldOrgY;
992
- }, a.prototype.setWorldOrgY = function(o) {
993
- this.lworldOrgY = o;
994
- }, a.prototype.getWorldExtX = function() {
995
- return this.lworldExtX;
996
- }, a.prototype.setWorldExtX = function(o) {
997
- this.lworldExtX = o;
998
- }, a.prototype.getWorldExtY = function() {
999
- return this.lworldExtY;
1000
- }, a.prototype.setWorldExtY = function(o) {
1001
- this.lworldExtY = o;
1002
- }, a.prototype.getDeviceOrgX = function() {
1003
- return this.ldeviceOrgX;
1004
- }, a.prototype.setDeviceOrgX = function(o) {
1005
- this.ldeviceOrgX = o;
1006
- }, a.prototype.getDeviceOrgY = function() {
1007
- return this.ldeviceOrgY;
1008
- }, a.prototype.setDeviceOrgY = function(o) {
1009
- this.ldeviceOrgY = o;
1010
- }, a.prototype.getDeviceExtX = function() {
1011
- return this.ldeviceExtX;
1012
- }, a.prototype.setDeviceExtX = function(o) {
1013
- this.ldeviceExtX = o;
1014
- }, a.prototype.getDeviceExtY = function() {
1015
- return this.ldeviceExtY;
1016
- }, a.prototype.setDeviceExtY = function(o) {
1017
- this.ldeviceExtY = o;
1018
- }, a.prototype.transformX = function(o) {
1019
- var t = 0, e = this.lworldExtX;
1020
- return e != 0 && (t = this.ldeviceOrgX + (o - this.lworldOrgX) * this.ldeviceExtX / e), t;
1021
- }, a.prototype.transformY = function(o) {
1022
- var t = 0, e = this.lworldExtY;
1023
- return e != 0 && (t = this.ldeviceOrgY + (o - this.lworldOrgY) * this.ldeviceExtY / e), t;
1024
- }, a.prototype.inverseTransformX = function(o) {
1025
- var t = 0, e = this.ldeviceExtX;
1026
- return e != 0 && (t = this.lworldOrgX + (o - this.ldeviceOrgX) * this.lworldExtX / e), t;
1027
- }, a.prototype.inverseTransformY = function(o) {
1028
- var t = 0, e = this.ldeviceExtY;
1029
- return e != 0 && (t = this.lworldOrgY + (o - this.ldeviceOrgY) * this.lworldExtY / e), t;
1030
- }, a.prototype.inverseTransformPoint = function(o) {
1031
- return new f(this.inverseTransformX(o.x), this.inverseTransformY(o.y));
1032
- }, A.exports = a;
1033
- }),
1034
- (function(A, O, N) {
1035
- function f(r) {
1036
- if (Array.isArray(r)) {
1037
- for (var n = 0, g = Array(r.length); n < r.length; n++) g[n] = r[n];
1038
- return g;
1039
- }
1040
- return Array.from(r);
1041
- }
1042
- var a = N(15), o = N(4), t = N(0), e = N(8), s = N(9);
1043
- function i() {
1044
- a.call(this), this.useSmartIdealEdgeLengthCalculation = o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = o.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = o.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = o.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * o.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = o.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = o.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = o.MAX_ITERATIONS;
1045
- }
1046
- for (var p in i.prototype = Object.create(a.prototype), a) i[p] = a[p];
1047
- i.prototype.initParameters = function() {
1048
- a.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1049
- }, i.prototype.calcIdealEdgeLengths = function() {
1050
- for (var r, n, g, l, c, d, m, E = this.getGraphManager().getAllEdges(), C = 0; C < E.length; C++) r = E[C], n = r.idealLength, r.isInterGraph && (l = r.getSource(), c = r.getTarget(), d = r.getSourceInLca().getEstimatedSize(), m = r.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (r.idealLength += d + m - 2 * t.SIMPLE_NODE_SIZE), g = r.getLca().getInclusionTreeDepth(), r.idealLength += n * o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (l.getInclusionTreeDepth() + c.getInclusionTreeDepth() - 2 * g));
1051
- }, i.prototype.initSpringEmbedder = function() {
1052
- var r = this.getAllNodes().length;
1053
- this.incremental ? (r > o.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * o.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (r - o.ADAPTATION_LOWER_NODE_LIMIT) / (o.ADAPTATION_UPPER_NODE_LIMIT - o.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - o.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = o.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (this.coolingFactor = r > o.ADAPTATION_LOWER_NODE_LIMIT ? Math.max(o.COOLING_ADAPTATION_FACTOR, 1 - (r - o.ADAPTATION_LOWER_NODE_LIMIT) / (o.ADAPTATION_UPPER_NODE_LIMIT - o.ADAPTATION_LOWER_NODE_LIMIT) * (1 - o.COOLING_ADAPTATION_FACTOR)) : 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = o.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * o.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1054
- }, i.prototype.calcSpringForces = function() {
1055
- for (var r = this.getAllEdges(), n, g = 0; g < r.length; g++) n = r[g], this.calcSpringForce(n, n.idealLength);
1056
- }, i.prototype.calcRepulsionForces = function() {
1057
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, n = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], g, l, c, d, m = this.getAllNodes(), E;
1058
- if (this.useFRGridVariant) for (this.totalIterations % o.GRID_CALCULATION_CHECK_PERIOD == 1 && r && this.updateGrid(), E = /* @__PURE__ */ new Set(), g = 0; g < m.length; g++) c = m[g], this.calculateRepulsionForceOfANode(c, E, r, n), E.add(c);
1059
- else for (g = 0; g < m.length; g++) for (c = m[g], l = g + 1; l < m.length; l++) d = m[l], c.getOwner() == d.getOwner() && this.calcRepulsionForce(c, d);
1060
- }, i.prototype.calcGravitationalForces = function() {
1061
- for (var r, n = this.getAllNodesToApplyGravitation(), g = 0; g < n.length; g++) r = n[g], this.calcGravitationalForce(r);
1062
- }, i.prototype.moveNodes = function() {
1063
- for (var r = this.getAllNodes(), n, g = 0; g < r.length; g++) n = r[g], n.move();
1064
- }, i.prototype.calcSpringForce = function(r, n) {
1065
- var g = r.getSource(), l = r.getTarget(), c, d, m, E;
1066
- if (this.uniformLeafNodeSizes && g.getChild() == null && l.getChild() == null) r.updateLengthSimple();
1067
- else if (r.updateLength(), r.isOverlapingSourceAndTarget) return;
1068
- c = r.getLength(), c != 0 && (d = r.edgeElasticity * (c - n), m = d * (r.lengthX / c), E = d * (r.lengthY / c), g.springForceX += m, g.springForceY += E, l.springForceX -= m, l.springForceY -= E);
1069
- }, i.prototype.calcRepulsionForce = function(r, n) {
1070
- var g = r.getRect(), l = n.getRect(), c = [, ,], d = [
1071
- ,
1072
- ,
1073
- ,
1074
- ,
1075
- ], m, E, C, R, S, G, X;
1076
- if (g.intersects(l)) {
1077
- e.calcSeparationAmount(g, l, c, o.DEFAULT_EDGE_LENGTH / 2), G = 2 * c[0], X = 2 * c[1];
1078
- var $ = r.noOfChildren * n.noOfChildren / (r.noOfChildren + n.noOfChildren);
1079
- r.repulsionForceX -= $ * G, r.repulsionForceY -= $ * X, n.repulsionForceX += $ * G, n.repulsionForceY += $ * X;
1080
- } else this.uniformLeafNodeSizes && r.getChild() == null && n.getChild() == null ? (m = l.getCenterX() - g.getCenterX(), E = l.getCenterY() - g.getCenterY()) : (e.getIntersection(g, l, d), m = d[2] - d[0], E = d[3] - d[1]), Math.abs(m) < o.MIN_REPULSION_DIST && (m = s.sign(m) * o.MIN_REPULSION_DIST), Math.abs(E) < o.MIN_REPULSION_DIST && (E = s.sign(E) * o.MIN_REPULSION_DIST), C = m * m + E * E, R = Math.sqrt(C), S = (r.nodeRepulsion / 2 + n.nodeRepulsion / 2) * r.noOfChildren * n.noOfChildren / C, G = S * m / R, X = S * E / R, r.repulsionForceX -= G, r.repulsionForceY -= X, n.repulsionForceX += G, n.repulsionForceY += X;
1081
- }, i.prototype.calcGravitationalForce = function(r) {
1082
- var n = r.getOwner(), g = (n.getRight() + n.getLeft()) / 2, l = (n.getTop() + n.getBottom()) / 2, c = r.getCenterX() - g, d = r.getCenterY() - l, m = Math.abs(c) + r.getWidth() / 2, E = Math.abs(d) + r.getHeight() / 2, C;
1083
- r.getOwner() == this.graphManager.getRoot() ? (C = n.getEstimatedSize() * this.gravityRangeFactor, (m > C || E > C) && (r.gravitationForceX = -this.gravityConstant * c, r.gravitationForceY = -this.gravityConstant * d)) : (C = n.getEstimatedSize() * this.compoundGravityRangeFactor, (m > C || E > C) && (r.gravitationForceX = -this.gravityConstant * c * this.compoundGravityConstant, r.gravitationForceY = -this.gravityConstant * d * this.compoundGravityConstant));
1084
- }, i.prototype.isConverged = function() {
1085
- var r, n = !1;
1086
- return this.totalIterations > this.maxIterations / 3 && (n = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), r = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, r || n;
1087
- }, i.prototype.animate = function() {
1088
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1089
- }, i.prototype.calcNoOfChildrenForAllNodes = function() {
1090
- for (var r, n = this.graphManager.getAllNodes(), g = 0; g < n.length; g++) r = n[g], r.noOfChildren = r.getNoOfChildren();
1091
- }, i.prototype.calcGrid = function(r) {
1092
- var n = 0, g = 0;
1093
- n = parseInt(Math.ceil((r.getRight() - r.getLeft()) / this.repulsionRange)), g = parseInt(Math.ceil((r.getBottom() - r.getTop()) / this.repulsionRange));
1094
- for (var l = Array(n), c = 0; c < n; c++) l[c] = Array(g);
1095
- for (var c = 0; c < n; c++) for (var d = 0; d < g; d++) l[c][d] = [];
1096
- return l;
1097
- }, i.prototype.addNodeToGrid = function(r, n, g) {
1098
- var l = 0, c = 0, d = 0, m = 0;
1099
- l = parseInt(Math.floor((r.getRect().x - n) / this.repulsionRange)), c = parseInt(Math.floor((r.getRect().width + r.getRect().x - n) / this.repulsionRange)), d = parseInt(Math.floor((r.getRect().y - g) / this.repulsionRange)), m = parseInt(Math.floor((r.getRect().height + r.getRect().y - g) / this.repulsionRange));
1100
- for (var E = l; E <= c; E++) for (var C = d; C <= m; C++) this.grid[E][C].push(r), r.setGridCoordinates(l, c, d, m);
1101
- }, i.prototype.updateGrid = function() {
1102
- var r, n, g = this.getAllNodes();
1103
- for (this.grid = this.calcGrid(this.graphManager.getRoot()), r = 0; r < g.length; r++) n = g[r], this.addNodeToGrid(n, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1104
- }, i.prototype.calculateRepulsionForceOfANode = function(r, n, g, l) {
1105
- if (this.totalIterations % o.GRID_CALCULATION_CHECK_PERIOD == 1 && g || l) {
1106
- var c = /* @__PURE__ */ new Set();
1107
- r.surrounding = [];
1108
- for (var d, m = this.grid, E = r.startX - 1; E < r.finishX + 2; E++) for (var C = r.startY - 1; C < r.finishY + 2; C++) if (!(E < 0 || C < 0 || E >= m.length || C >= m[0].length)) {
1109
- for (var R = 0; R < m[E][C].length; R++) if (d = m[E][C][R], r.getOwner() == d.getOwner() && r != d && !n.has(d) && !c.has(d)) {
1110
- var S = Math.abs(r.getCenterX() - d.getCenterX()) - (r.getWidth() / 2 + d.getWidth() / 2), G = Math.abs(r.getCenterY() - d.getCenterY()) - (r.getHeight() / 2 + d.getHeight() / 2);
1111
- S <= this.repulsionRange && G <= this.repulsionRange && c.add(d);
1112
- }
1113
- }
1114
- r.surrounding = [].concat(f(c));
1115
- }
1116
- for (E = 0; E < r.surrounding.length; E++) this.calcRepulsionForce(r, r.surrounding[E]);
1117
- }, i.prototype.calcRepulsionRange = function() {
1118
- return 0;
1119
- }, A.exports = i;
1120
- }),
1121
- (function(A, O, N) {
1122
- var f = N(1), a = N(4);
1123
- function o(e, s, i) {
1124
- f.call(this, e, s, i), this.idealLength = a.DEFAULT_EDGE_LENGTH, this.edgeElasticity = a.DEFAULT_SPRING_STRENGTH;
1125
- }
1126
- for (var t in o.prototype = Object.create(f.prototype), f) o[t] = f[t];
1127
- A.exports = o;
1128
- }),
1129
- (function(A, O, N) {
1130
- var f = N(3), a = N(4);
1131
- function o(e, s, i, p) {
1132
- f.call(this, e, s, i, p), this.nodeRepulsion = a.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 = [];
1133
- }
1134
- for (var t in o.prototype = Object.create(f.prototype), f) o[t] = f[t];
1135
- o.prototype.setGridCoordinates = function(e, s, i, p) {
1136
- this.startX = e, this.finishX = s, this.startY = i, this.finishY = p;
1137
- }, A.exports = o;
1138
- }),
1139
- (function(A, O, N) {
1140
- function f(a, o) {
1141
- this.width = 0, this.height = 0, a !== null && o !== null && (this.height = o, this.width = a);
1142
- }
1143
- f.prototype.getWidth = function() {
1144
- return this.width;
1145
- }, f.prototype.setWidth = function(a) {
1146
- this.width = a;
1147
- }, f.prototype.getHeight = function() {
1148
- return this.height;
1149
- }, f.prototype.setHeight = function(a) {
1150
- this.height = a;
1151
- }, A.exports = f;
1152
- }),
1153
- (function(A, O, N) {
1154
- var f = N(14);
1155
- function a() {
1156
- this.map = {}, this.keys = [];
1157
- }
1158
- a.prototype.put = function(o, t) {
1159
- var e = f.createID(o);
1160
- this.contains(e) || (this.map[e] = t, this.keys.push(o));
1161
- }, a.prototype.contains = function(o) {
1162
- return f.createID(o), this.map[o] != null;
1163
- }, a.prototype.get = function(o) {
1164
- var t = f.createID(o);
1165
- return this.map[t];
1166
- }, a.prototype.keySet = function() {
1167
- return this.keys;
1168
- }, A.exports = a;
1169
- }),
1170
- (function(A, O, N) {
1171
- var f = N(14);
1172
- function a() {
1173
- this.set = {};
1174
- }
1175
- a.prototype.add = function(o) {
1176
- var t = f.createID(o);
1177
- this.contains(t) || (this.set[t] = o);
1178
- }, a.prototype.remove = function(o) {
1179
- delete this.set[f.createID(o)];
1180
- }, a.prototype.clear = function() {
1181
- this.set = {};
1182
- }, a.prototype.contains = function(o) {
1183
- return this.set[f.createID(o)] == o;
1184
- }, a.prototype.isEmpty = function() {
1185
- return this.size() === 0;
1186
- }, a.prototype.size = function() {
1187
- return Object.keys(this.set).length;
1188
- }, a.prototype.addAllTo = function(o) {
1189
- for (var t = Object.keys(this.set), e = t.length, s = 0; s < e; s++) o.push(this.set[t[s]]);
1190
- }, a.prototype.size = function() {
1191
- return Object.keys(this.set).length;
1192
- }, a.prototype.addAll = function(o) {
1193
- for (var t = o.length, e = 0; e < t; e++) {
1194
- var s = o[e];
1195
- this.add(s);
1196
- }
1197
- }, A.exports = a;
1198
- }),
1199
- (function(A, O, N) {
1200
- function f() {
1201
- }
1202
- f.multMat = function(a, o) {
1203
- for (var t = [], e = 0; e < a.length; e++) {
1204
- t[e] = [];
1205
- for (var s = 0; s < o[0].length; s++) {
1206
- t[e][s] = 0;
1207
- for (var i = 0; i < a[0].length; i++) t[e][s] += a[e][i] * o[i][s];
1208
- }
1209
- }
1210
- return t;
1211
- }, f.transpose = function(a) {
1212
- for (var o = [], t = 0; t < a[0].length; t++) {
1213
- o[t] = [];
1214
- for (var e = 0; e < a.length; e++) o[t][e] = a[e][t];
1215
- }
1216
- return o;
1217
- }, f.multCons = function(a, o) {
1218
- for (var t = [], e = 0; e < a.length; e++) t[e] = a[e] * o;
1219
- return t;
1220
- }, f.minusOp = function(a, o) {
1221
- for (var t = [], e = 0; e < a.length; e++) t[e] = a[e] - o[e];
1222
- return t;
1223
- }, f.dotProduct = function(a, o) {
1224
- for (var t = 0, e = 0; e < a.length; e++) t += a[e] * o[e];
1225
- return t;
1226
- }, f.mag = function(a) {
1227
- return Math.sqrt(this.dotProduct(a, a));
1228
- }, f.normalize = function(a) {
1229
- for (var o = [], t = this.mag(a), e = 0; e < a.length; e++) o[e] = a[e] / t;
1230
- return o;
1231
- }, f.multGamma = function(a) {
1232
- for (var o = [], t = 0, e = 0; e < a.length; e++) t += a[e];
1233
- t *= -1 / a.length;
1234
- for (var s = 0; s < a.length; s++) o[s] = t + a[s];
1235
- return o;
1236
- }, f.multL = function(a, o, t) {
1237
- for (var e = [], s = [], i = [], p = 0; p < o[0].length; p++) {
1238
- for (var r = 0, n = 0; n < o.length; n++) r += -0.5 * o[n][p] * a[n];
1239
- s[p] = r;
1240
- }
1241
- for (var g = 0; g < t.length; g++) {
1242
- for (var l = 0, c = 0; c < t.length; c++) l += t[g][c] * s[c];
1243
- i[g] = l;
1244
- }
1245
- for (var d = 0; d < o.length; d++) {
1246
- for (var m = 0, E = 0; E < o[0].length; E++) m += o[d][E] * i[E];
1247
- e[d] = m;
1248
- }
1249
- return e;
1250
- }, A.exports = f;
1251
- }),
1252
- (function(A, O, N) {
1253
- var f = /* @__PURE__ */ (function() {
1254
- function t(e, s) {
1255
- for (var i = 0; i < s.length; i++) {
1256
- var p = s[i];
1257
- p.enumerable = p.enumerable || !1, p.configurable = !0, "value" in p && (p.writable = !0), Object.defineProperty(e, p.key, p);
1258
- }
1259
- }
1260
- return function(e, s, i) {
1261
- return s && t(e.prototype, s), i && t(e, i), e;
1262
- };
1263
- })();
1264
- function a(t, e) {
1265
- if (!(t instanceof e)) throw TypeError("Cannot call a class as a function");
1266
- }
1267
- var o = N(11);
1268
- A.exports = (function() {
1269
- function t(e, s) {
1270
- a(this, t), (s !== null || s !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1271
- var i = void 0;
1272
- i = e instanceof o ? e.size() : e.length, this._quicksort(e, 0, i - 1);
1273
- }
1274
- return f(t, [
1275
- {
1276
- key: "_quicksort",
1277
- value: function(e, s, i) {
1278
- if (s < i) {
1279
- var p = this._partition(e, s, i);
1280
- this._quicksort(e, s, p), this._quicksort(e, p + 1, i);
1281
- }
1282
- }
1283
- },
1284
- {
1285
- key: "_partition",
1286
- value: function(e, s, i) {
1287
- for (var p = this._get(e, s), r = s, n = i; ; ) {
1288
- for (; this.compareFunction(p, this._get(e, n)); ) n--;
1289
- for (; this.compareFunction(this._get(e, r), p); ) r++;
1290
- if (r < n) this._swap(e, r, n), r++, n--;
1291
- else return n;
1292
- }
1293
- }
1294
- },
1295
- {
1296
- key: "_get",
1297
- value: function(e, s) {
1298
- return e instanceof o ? e.get_object_at(s) : e[s];
1299
- }
1300
- },
1301
- {
1302
- key: "_set",
1303
- value: function(e, s, i) {
1304
- e instanceof o ? e.set_object_at(s, i) : e[s] = i;
1305
- }
1306
- },
1307
- {
1308
- key: "_swap",
1309
- value: function(e, s, i) {
1310
- var p = this._get(e, s);
1311
- this._set(e, s, this._get(e, i)), this._set(e, i, p);
1312
- }
1313
- },
1314
- {
1315
- key: "_defaultCompareFunction",
1316
- value: function(e, s) {
1317
- return s > e;
1318
- }
1319
- }
1320
- ]), t;
1321
- })();
1322
- }),
1323
- (function(A, O, N) {
1324
- function f() {
1325
- }
1326
- f.svd = function(a) {
1327
- this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = a.length, this.n = a[0].length;
1328
- var o = Math.min(this.m, this.n);
1329
- this.s = (function(Tt) {
1330
- for (var Nt = []; Tt-- > 0; ) Nt.push(0);
1331
- return Nt;
1332
- })(Math.min(this.m + 1, this.n)), this.U = (function(Tt) {
1333
- return (function Nt(_t) {
1334
- if (_t.length == 0) return 0;
1335
- for (var St = [], Ut = 0; Ut < _t[0]; Ut++) St.push(Nt(_t.slice(1)));
1336
- return St;
1337
- })(Tt);
1338
- })([this.m, o]), this.V = (function(Tt) {
1339
- return (function Nt(_t) {
1340
- if (_t.length == 0) return 0;
1341
- for (var St = [], Ut = 0; Ut < _t[0]; Ut++) St.push(Nt(_t.slice(1)));
1342
- return St;
1343
- })(Tt);
1344
- })([this.n, this.n]);
1345
- for (var t = (function(Tt) {
1346
- for (var Nt = []; Tt-- > 0; ) Nt.push(0);
1347
- return Nt;
1348
- })(this.n), e = (function(Tt) {
1349
- for (var Nt = []; Tt-- > 0; ) Nt.push(0);
1350
- return Nt;
1351
- })(this.m), s = !0, i = !0, p = Math.min(this.m - 1, this.n), r = Math.max(0, Math.min(this.n - 2, this.m)), n = 0; n < Math.max(p, r); n++) {
1352
- if (n < p) {
1353
- this.s[n] = 0;
1354
- for (var g = n; g < this.m; g++) this.s[n] = f.hypot(this.s[n], a[g][n]);
1355
- if (this.s[n] !== 0) {
1356
- a[n][n] < 0 && (this.s[n] = -this.s[n]);
1357
- for (var l = n; l < this.m; l++) a[l][n] /= this.s[n];
1358
- a[n][n] += 1;
1359
- }
1360
- this.s[n] = -this.s[n];
1361
- }
1362
- for (var c = n + 1; c < this.n; c++) {
1363
- if (/* @__PURE__ */ (function(Tt, Nt) {
1364
- return Tt && Nt;
1365
- })(n < p, this.s[n] !== 0)) {
1366
- for (var d = 0, m = n; m < this.m; m++) d += a[m][n] * a[m][c];
1367
- d = -d / a[n][n];
1368
- for (var E = n; E < this.m; E++) a[E][c] += d * a[E][n];
1369
- }
1370
- t[c] = a[n][c];
1371
- }
1372
- if (/* @__PURE__ */ (function(Tt, Nt) {
1373
- return Tt && Nt;
1374
- })(s, n < p)) for (var C = n; C < this.m; C++) this.U[C][n] = a[C][n];
1375
- if (n < r) {
1376
- t[n] = 0;
1377
- for (var R = n + 1; R < this.n; R++) t[n] = f.hypot(t[n], t[R]);
1378
- if (t[n] !== 0) {
1379
- t[n + 1] < 0 && (t[n] = -t[n]);
1380
- for (var S = n + 1; S < this.n; S++) t[S] /= t[n];
1381
- t[n + 1] += 1;
1382
- }
1383
- if (t[n] = -t[n], /* @__PURE__ */ (function(Tt, Nt) {
1384
- return Tt && Nt;
1385
- })(n + 1 < this.m, t[n] !== 0)) {
1386
- for (var G = n + 1; G < this.m; G++) e[G] = 0;
1387
- for (var X = n + 1; X < this.n; X++) for (var $ = n + 1; $ < this.m; $++) e[$] += t[X] * a[$][X];
1388
- for (var _ = n + 1; _ < this.n; _++) for (var Z = -t[_] / t[n + 1], h = n + 1; h < this.m; h++) a[h][_] += Z * e[h];
1389
- }
1390
- if (i) for (var T = n + 1; T < this.n; T++) this.V[T][n] = t[T];
1391
- }
1392
- }
1393
- var u = Math.min(this.n, this.m + 1);
1394
- if (p < this.n && (this.s[p] = a[p][p]), this.m < u && (this.s[u - 1] = 0), r + 1 < u && (t[r] = a[r][u - 1]), t[u - 1] = 0, s) {
1395
- for (var v = p; v < o; v++) {
1396
- for (var y = 0; y < this.m; y++) this.U[y][v] = 0;
1397
- this.U[v][v] = 1;
1398
- }
1399
- for (var w = p - 1; w >= 0; w--) if (this.s[w] !== 0) {
1400
- for (var I = w + 1; I < o; I++) {
1401
- for (var F = 0, P = w; P < this.m; P++) F += this.U[P][w] * this.U[P][I];
1402
- F = -F / this.U[w][w];
1403
- for (var b = w; b < this.m; b++) this.U[b][I] += F * this.U[b][w];
1404
- }
1405
- for (var H = w; H < this.m; H++) this.U[H][w] = -this.U[H][w];
1406
- this.U[w][w] = 1 + this.U[w][w];
1407
- for (var W = 0; W < w - 1; W++) this.U[W][w] = 0;
1408
- } else {
1409
- for (var J = 0; J < this.m; J++) this.U[J][w] = 0;
1410
- this.U[w][w] = 1;
1411
- }
1412
- }
1413
- if (i) for (var k = this.n - 1; k >= 0; k--) {
1414
- if (/* @__PURE__ */ (function(Tt, Nt) {
1415
- return Tt && Nt;
1416
- })(k < r, t[k] !== 0)) for (var z = k + 1; z < o; z++) {
1417
- for (var D = 0, B = k + 1; B < this.n; B++) D += this.V[B][k] * this.V[B][z];
1418
- D = -D / this.V[k + 1][k];
1419
- for (var et = k + 1; et < this.n; et++) this.V[et][z] += D * this.V[et][k];
1420
- }
1421
- for (var U = 0; U < this.n; U++) this.V[U][k] = 0;
1422
- this.V[k][k] = 1;
1423
- }
1424
- for (var V = u - 1, dt = 0, st = 2 ** -52, wt = 2 ** -966; u > 0; ) {
1425
- var j = void 0, pt = void 0;
1426
- for (j = u - 2; j >= -1 && j !== -1; j--) if (Math.abs(t[j]) <= wt + st * (Math.abs(this.s[j]) + Math.abs(this.s[j + 1]))) {
1427
- t[j] = 0;
1428
- break;
1429
- }
1430
- if (j === u - 2) pt = 4;
1431
- else {
1432
- var yt = void 0;
1433
- for (yt = u - 1; yt >= j && yt !== j; yt--) {
1434
- var Bt = (yt === u ? 0 : Math.abs(t[yt])) + (yt === j + 1 ? 0 : Math.abs(t[yt - 1]));
1435
- if (Math.abs(this.s[yt]) <= wt + st * Bt) {
1436
- this.s[yt] = 0;
1437
- break;
1438
- }
1439
- }
1440
- yt === j ? pt = 3 : yt === u - 1 ? pt = 1 : (pt = 2, j = yt);
1441
- }
1442
- switch (j++, pt) {
1443
- case 1:
1444
- var Yt = t[u - 2];
1445
- t[u - 2] = 0;
1446
- for (var Mt = u - 2; Mt >= j; Mt--) {
1447
- var xt = f.hypot(this.s[Mt], Yt), Ht = this.s[Mt] / xt, Xt = Yt / xt;
1448
- if (this.s[Mt] = xt, Mt !== j && (Yt = -Xt * t[Mt - 1], t[Mt - 1] = Ht * t[Mt - 1]), i) for (var Rt = 0; Rt < this.n; Rt++) xt = Ht * this.V[Rt][Mt] + Xt * this.V[Rt][u - 1], this.V[Rt][u - 1] = -Xt * this.V[Rt][Mt] + Ht * this.V[Rt][u - 1], this.V[Rt][Mt] = xt;
1449
- }
1450
- break;
1451
- case 2:
1452
- var Vt = t[j - 1];
1453
- t[j - 1] = 0;
1454
- for (var Pt = j; Pt < u; Pt++) {
1455
- var ht = f.hypot(this.s[Pt], Vt), ot = this.s[Pt] / ht, ct = Vt / ht;
1456
- if (this.s[Pt] = ht, Vt = -ct * t[Pt], t[Pt] = ot * t[Pt], s) for (var M = 0; M < this.m; M++) ht = ot * this.U[M][Pt] + ct * this.U[M][j - 1], this.U[M][j - 1] = -ct * this.U[M][Pt] + ot * this.U[M][j - 1], this.U[M][Pt] = ht;
1457
- }
1458
- break;
1459
- case 3:
1460
- var Y = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[u - 1]), Math.abs(this.s[u - 2])), Math.abs(t[u - 2])), Math.abs(this.s[j])), Math.abs(t[j])), K = this.s[u - 1] / Y, q = this.s[u - 2] / Y, tt = t[u - 2] / Y, Et = this.s[j] / Y, vt = t[j] / Y, it = ((q + K) * (q - K) + tt * tt) / 2, ft = K * tt * (K * tt), It = 0;
1461
- /* @__PURE__ */ (function(Tt, Nt) {
1462
- return Tt || Nt;
1463
- })(it !== 0, ft !== 0) && (It = Math.sqrt(it * it + ft), it < 0 && (It = -It), It = ft / (it + It));
1464
- for (var Ct = (Et + K) * (Et - K) + It, mt = Et * vt, lt = j; lt < u - 1; lt++) {
1465
- var gt = f.hypot(Ct, mt), Q = Ct / gt, ut = mt / gt;
1466
- if (lt !== j && (t[lt - 1] = gt), Ct = Q * this.s[lt] + ut * t[lt], t[lt] = Q * t[lt] - ut * this.s[lt], mt = ut * this.s[lt + 1], this.s[lt + 1] = Q * this.s[lt + 1], i) for (var Lt = 0; Lt < this.n; Lt++) gt = Q * this.V[Lt][lt] + ut * this.V[Lt][lt + 1], this.V[Lt][lt + 1] = -ut * this.V[Lt][lt] + Q * this.V[Lt][lt + 1], this.V[Lt][lt] = gt;
1467
- if (gt = f.hypot(Ct, mt), Q = Ct / gt, ut = mt / gt, this.s[lt] = gt, Ct = Q * t[lt] + ut * this.s[lt + 1], this.s[lt + 1] = -ut * t[lt] + Q * this.s[lt + 1], mt = ut * t[lt + 1], t[lt + 1] = Q * t[lt + 1], s && lt < this.m - 1) for (var rt = 0; rt < this.m; rt++) gt = Q * this.U[rt][lt] + ut * this.U[rt][lt + 1], this.U[rt][lt + 1] = -ut * this.U[rt][lt] + Q * this.U[rt][lt + 1], this.U[rt][lt] = gt;
1468
- }
1469
- t[u - 2] = Ct, dt += 1;
1470
- break;
1471
- case 4:
1472
- if (this.s[j] <= 0 && (this.s[j] = this.s[j] < 0 ? -this.s[j] : 0, i)) for (var bt = 0; bt <= V; bt++) this.V[bt][j] = -this.V[bt][j];
1473
- for (; j < V && !(this.s[j] >= this.s[j + 1]); ) {
1474
- var Ot = this.s[j];
1475
- if (this.s[j] = this.s[j + 1], this.s[j + 1] = Ot, i && j < this.n - 1) for (var Dt = 0; Dt < this.n; Dt++) Ot = this.V[Dt][j + 1], this.V[Dt][j + 1] = this.V[Dt][j], this.V[Dt][j] = Ot;
1476
- if (s && j < this.m - 1) for (var Ft = 0; Ft < this.m; Ft++) Ot = this.U[Ft][j + 1], this.U[Ft][j + 1] = this.U[Ft][j], this.U[Ft][j] = Ot;
1477
- j++;
1478
- }
1479
- dt = 0, u--;
1480
- }
1481
- }
1482
- return {
1483
- U: this.U,
1484
- V: this.V,
1485
- S: this.s
1486
- };
1487
- }, f.hypot = function(a, o) {
1488
- var t = void 0;
1489
- return Math.abs(a) > Math.abs(o) ? (t = o / a, t = Math.abs(a) * Math.sqrt(1 + t * t)) : o == 0 ? t = 0 : (t = a / o, t = Math.abs(o) * Math.sqrt(1 + t * t)), t;
1490
- }, A.exports = f;
1491
- }),
1492
- (function(A, O, N) {
1493
- var f = /* @__PURE__ */ (function() {
1494
- function o(t, e) {
1495
- for (var s = 0; s < e.length; s++) {
1496
- var i = e[s];
1497
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
1498
- }
1499
- }
1500
- return function(t, e, s) {
1501
- return e && o(t.prototype, e), s && o(t, s), t;
1502
- };
1503
- })();
1504
- function a(o, t) {
1505
- if (!(o instanceof t)) throw TypeError("Cannot call a class as a function");
1506
- }
1507
- A.exports = (function() {
1508
- function o(t, e) {
1509
- var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, p = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1510
- a(this, o), this.sequence1 = t, this.sequence2 = e, this.match_score = s, this.mismatch_penalty = i, this.gap_penalty = p, this.iMax = t.length + 1, this.jMax = e.length + 1, this.grid = Array(this.iMax);
1511
- for (var r = 0; r < this.iMax; r++) {
1512
- this.grid[r] = Array(this.jMax);
1513
- for (var n = 0; n < this.jMax; n++) this.grid[r][n] = 0;
1514
- }
1515
- this.tracebackGrid = Array(this.iMax);
1516
- for (var g = 0; g < this.iMax; g++) {
1517
- this.tracebackGrid[g] = Array(this.jMax);
1518
- for (var l = 0; l < this.jMax; l++) this.tracebackGrid[g][l] = [
1519
- null,
1520
- null,
1521
- null
1522
- ];
1523
- }
1524
- this.alignments = [], this.score = -1, this.computeGrids();
1525
- }
1526
- return f(o, [
1527
- {
1528
- key: "getScore",
1529
- value: function() {
1530
- return this.score;
1531
- }
1532
- },
1533
- {
1534
- key: "getAlignments",
1535
- value: function() {
1536
- return this.alignments;
1537
- }
1538
- },
1539
- {
1540
- key: "computeGrids",
1541
- value: function() {
1542
- for (var t = 1; t < this.jMax; t++) this.grid[0][t] = this.grid[0][t - 1] + this.gap_penalty, this.tracebackGrid[0][t] = [
1543
- !1,
1544
- !1,
1545
- !0
1546
- ];
1547
- for (var e = 1; e < this.iMax; e++) this.grid[e][0] = this.grid[e - 1][0] + this.gap_penalty, this.tracebackGrid[e][0] = [
1548
- !1,
1549
- !0,
1550
- !1
1551
- ];
1552
- for (var s = 1; s < this.iMax; s++) for (var i = 1; i < this.jMax; i++) {
1553
- var p = void 0;
1554
- p = this.sequence1[s - 1] === this.sequence2[i - 1] ? this.grid[s - 1][i - 1] + this.match_score : this.grid[s - 1][i - 1] + this.mismatch_penalty;
1555
- var r = this.grid[s - 1][i] + this.gap_penalty, n = this.grid[s][i - 1] + this.gap_penalty, g = [
1556
- p,
1557
- r,
1558
- n
1559
- ], l = this.arrayAllMaxIndexes(g);
1560
- this.grid[s][i] = g[l[0]], this.tracebackGrid[s][i] = [
1561
- l.includes(0),
1562
- l.includes(1),
1563
- l.includes(2)
1564
- ];
1565
- }
1566
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1567
- }
1568
- },
1569
- {
1570
- key: "alignmentTraceback",
1571
- value: function() {
1572
- var t = [];
1573
- for (t.push({
1574
- pos: [this.sequence1.length, this.sequence2.length],
1575
- seq1: "",
1576
- seq2: ""
1577
- }); t[0]; ) {
1578
- var e = t[0], s = this.tracebackGrid[e.pos[0]][e.pos[1]];
1579
- s[0] && t.push({
1580
- pos: [e.pos[0] - 1, e.pos[1] - 1],
1581
- seq1: this.sequence1[e.pos[0] - 1] + e.seq1,
1582
- seq2: this.sequence2[e.pos[1] - 1] + e.seq2
1583
- }), s[1] && t.push({
1584
- pos: [e.pos[0] - 1, e.pos[1]],
1585
- seq1: this.sequence1[e.pos[0] - 1] + e.seq1,
1586
- seq2: "-" + e.seq2
1587
- }), s[2] && t.push({
1588
- pos: [e.pos[0], e.pos[1] - 1],
1589
- seq1: "-" + e.seq1,
1590
- seq2: this.sequence2[e.pos[1] - 1] + e.seq2
1591
- }), e.pos[0] === 0 && e.pos[1] === 0 && this.alignments.push({
1592
- sequence1: e.seq1,
1593
- sequence2: e.seq2
1594
- }), t.shift();
1595
- }
1596
- return this.alignments;
1597
- }
1598
- },
1599
- {
1600
- key: "getAllIndexes",
1601
- value: function(t, e) {
1602
- for (var s = [], i = -1; (i = t.indexOf(e, i + 1)) !== -1; ) s.push(i);
1603
- return s;
1604
- }
1605
- },
1606
- {
1607
- key: "arrayAllMaxIndexes",
1608
- value: function(t) {
1609
- return this.getAllIndexes(t, Math.max.apply(null, t));
1610
- }
1611
- }
1612
- ]), o;
1613
- })();
1614
- }),
1615
- (function(A, O, N) {
1616
- var f = function() {
1617
- };
1618
- f.FDLayout = N(18), f.FDLayoutConstants = N(4), f.FDLayoutEdge = N(19), f.FDLayoutNode = N(20), f.DimensionD = N(21), f.HashMap = N(22), f.HashSet = N(23), f.IGeometry = N(8), f.IMath = N(9), f.Integer = N(10), f.Point = N(12), f.PointD = N(5), f.RandomSeed = N(16), f.RectangleD = N(13), f.Transform = N(17), f.UniqueIDGeneretor = N(14), f.Quicksort = N(25), f.LinkedList = N(11), f.LGraphObject = N(2), f.LGraph = N(6), f.LEdge = N(1), f.LGraphManager = N(7), f.LNode = N(3), f.Layout = N(15), f.LayoutConstants = N(0), f.NeedlemanWunsch = N(27), f.Matrix = N(24), f.SVD = N(26), A.exports = f;
1619
- }),
1620
- (function(A, O, N) {
1621
- function f() {
1622
- this.listeners = [];
1623
- }
1624
- var a = f.prototype;
1625
- a.addListener = function(o, t) {
1626
- this.listeners.push({
1627
- event: o,
1628
- callback: t
1629
- });
1630
- }, a.removeListener = function(o, t) {
1631
- for (var e = this.listeners.length; e >= 0; e--) {
1632
- var s = this.listeners[e];
1633
- s.event === o && s.callback === t && this.listeners.splice(e, 1);
1634
- }
1635
- }, a.emit = function(o, t) {
1636
- for (var e = 0; e < this.listeners.length; e++) {
1637
- var s = this.listeners[e];
1638
- o === s.event && s.callback(t);
1639
- }
1640
- }, A.exports = f;
1641
- })
1642
- ]);
1643
- });
1644
- })), Ce = /* @__PURE__ */ pe(((x, L) => {
1645
- (function(A, O) {
1646
- typeof x == "object" && typeof L == "object" ? L.exports = O(we()) : typeof define == "function" && define.amd ? define(["layout-base"], O) : typeof x == "object" ? x.coseBase = O(we()) : A.coseBase = O(A.layoutBase);
1647
- })(x, function(A) {
1648
- return (() => {
1649
- var O = {
1650
- 45: ((a, o, t) => {
1651
- var e = {};
1652
- e.layoutBase = t(551), e.CoSEConstants = t(806), e.CoSEEdge = t(767), e.CoSEGraph = t(880), e.CoSEGraphManager = t(578), e.CoSELayout = t(765), e.CoSENode = t(991), e.ConstraintHandler = t(902), a.exports = e;
1653
- }),
1654
- 806: ((a, o, t) => {
1655
- var e = t(551).FDLayoutConstants;
1656
- function s() {
1657
- }
1658
- for (var i in e) s[i] = e[i];
1659
- s.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, s.DEFAULT_RADIAL_SEPARATION = e.DEFAULT_EDGE_LENGTH, s.DEFAULT_COMPONENT_SEPERATION = 60, s.TILE = !0, s.TILING_PADDING_VERTICAL = 10, s.TILING_PADDING_HORIZONTAL = 10, s.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, s.ENFORCE_CONSTRAINTS = !0, s.APPLY_LAYOUT = !0, s.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, s.TREE_REDUCTION_ON_INCREMENTAL = !0, s.PURE_INCREMENTAL = s.DEFAULT_INCREMENTAL, a.exports = s;
1660
- }),
1661
- 767: ((a, o, t) => {
1662
- var e = t(551).FDLayoutEdge;
1663
- function s(p, r, n) {
1664
- e.call(this, p, r, n);
1665
- }
1666
- for (var i in s.prototype = Object.create(e.prototype), e) s[i] = e[i];
1667
- a.exports = s;
1668
- }),
1669
- 880: ((a, o, t) => {
1670
- var e = t(551).LGraph;
1671
- function s(p, r, n) {
1672
- e.call(this, p, r, n);
1673
- }
1674
- for (var i in s.prototype = Object.create(e.prototype), e) s[i] = e[i];
1675
- a.exports = s;
1676
- }),
1677
- 578: ((a, o, t) => {
1678
- var e = t(551).LGraphManager;
1679
- function s(p) {
1680
- e.call(this, p);
1681
- }
1682
- for (var i in s.prototype = Object.create(e.prototype), e) s[i] = e[i];
1683
- a.exports = s;
1684
- }),
1685
- 765: ((a, o, t) => {
1686
- var e = t(551).FDLayout, s = t(578), i = t(880), p = t(991), r = t(767), n = t(806), g = t(902), l = t(551).FDLayoutConstants, c = t(551).LayoutConstants, d = t(551).Point, m = t(551).PointD, E = t(551).DimensionD, C = t(551).Layout, R = t(551).Integer, S = t(551).IGeometry, G = t(551).LGraph, X = t(551).Transform, $ = t(551).LinkedList;
1687
- function _() {
1688
- e.call(this), this.toBeTiled = {}, this.constraints = {};
1689
- }
1690
- for (var Z in _.prototype = Object.create(e.prototype), e) _[Z] = e[Z];
1691
- _.prototype.newGraphManager = function() {
1692
- var h = new s(this);
1693
- return this.graphManager = h, h;
1694
- }, _.prototype.newGraph = function(h) {
1695
- return new i(null, this.graphManager, h);
1696
- }, _.prototype.newNode = function(h) {
1697
- return new p(this.graphManager, h);
1698
- }, _.prototype.newEdge = function(h) {
1699
- return new r(null, null, h);
1700
- }, _.prototype.initParameters = function() {
1701
- e.prototype.initParameters.call(this, arguments), this.isSubLayout || (this.idealEdgeLength = n.DEFAULT_EDGE_LENGTH < 10 ? 10 : 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);
1702
- }, _.prototype.initSpringEmbedder = function() {
1703
- e.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
1704
- }, _.prototype.layout = function() {
1705
- return c.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1706
- }, _.prototype.classicLayout = function() {
1707
- 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) {
1708
- var h = this.getFlatForest();
1709
- if (h.length > 0) this.positionNodesRadially(h);
1710
- else {
1711
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1712
- var T = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(v) {
1713
- return T.has(v);
1714
- });
1715
- this.graphManager.setAllNodesToApplyGravitation(u), this.positionNodesRandomly();
1716
- }
1717
- } else if (n.TREE_REDUCTION_ON_INCREMENTAL) {
1718
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1719
- var T = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(w) {
1720
- return T.has(w);
1721
- });
1722
- this.graphManager.setAllNodesToApplyGravitation(u);
1723
- }
1724
- return Object.keys(this.constraints).length > 0 && (g.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), n.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
1725
- }, _.prototype.tick = function() {
1726
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
1727
- if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1728
- else return !0;
1729
- if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1730
- if (this.isConverged())
1731
- if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1732
- else return !0;
1733
- this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - 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));
1734
- }
1735
- if (this.isTreeGrowing) {
1736
- if (this.growTreeIterations % 10 == 0)
1737
- if (this.prunedNodesAll.length > 0) {
1738
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1739
- var h = new Set(this.getAllNodes()), T = this.nodesWithGravity.filter(function(y) {
1740
- return h.has(y);
1741
- });
1742
- this.graphManager.setAllNodesToApplyGravitation(T), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = n.PURE_INCREMENTAL ? l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1743
- } else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1744
- this.growTreeIterations++;
1745
- }
1746
- if (this.isGrowthFinished) {
1747
- if (this.isConverged()) return !0;
1748
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = n.PURE_INCREMENTAL ? l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1749
- }
1750
- var u = !this.isTreeGrowing && !this.isGrowthFinished, v = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1751
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(u, v), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1752
- }, _.prototype.getPositionsData = function() {
1753
- for (var h = this.graphManager.getAllNodes(), T = {}, u = 0; u < h.length; u++) {
1754
- var v = h[u].rect, y = h[u].id;
1755
- T[y] = {
1756
- id: y,
1757
- x: v.getCenterX(),
1758
- y: v.getCenterY(),
1759
- w: v.width,
1760
- h: v.height
1761
- };
1762
- }
1763
- return T;
1764
- }, _.prototype.runSpringEmbedder = function() {
1765
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1766
- var h = !1;
1767
- if (l.ANIMATE === "during") this.emit("layoutstarted");
1768
- else {
1769
- for (; !h; ) h = this.tick();
1770
- this.graphManager.updateBounds();
1771
- }
1772
- }, _.prototype.moveNodes = function() {
1773
- for (var h = this.getAllNodes(), T, u = 0; u < h.length; u++) T = h[u], T.calculateDisplacement();
1774
- Object.keys(this.constraints).length > 0 && this.updateDisplacements();
1775
- for (var u = 0; u < h.length; u++) T = h[u], T.move();
1776
- }, _.prototype.initConstraintVariables = function() {
1777
- var h = this;
1778
- this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
1779
- for (var T = this.graphManager.getAllNodes(), u = 0; u < T.length; u++) {
1780
- var v = T[u];
1781
- this.idToNodeMap.set(v.id, v);
1782
- }
1783
- var y = function D(B) {
1784
- for (var et = B.getChild().getNodes(), U, V = 0, dt = 0; dt < et.length; dt++) U = et[dt], U.getChild() == null ? h.fixedNodeSet.has(U.id) && (V += 100) : V += D(U);
1785
- return V;
1786
- };
1787
- if (this.constraints.fixedNodeConstraint) {
1788
- this.constraints.fixedNodeConstraint.forEach(function(D) {
1789
- h.fixedNodeSet.add(D.nodeId);
1790
- });
1791
- for (var T = this.graphManager.getAllNodes(), v, u = 0; u < T.length; u++) if (v = T[u], v.getChild() != null) {
1792
- var w = y(v);
1793
- w > 0 && (v.fixedNodeWeight = w);
1794
- }
1795
- }
1796
- if (this.constraints.relativePlacementConstraint) {
1797
- var I = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
1798
- 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) {
1799
- h.fixedNodesOnHorizontal.add(D), h.fixedNodesOnVertical.add(D);
1800
- }), this.constraints.alignmentConstraint) {
1801
- if (this.constraints.alignmentConstraint.vertical) for (var P = this.constraints.alignmentConstraint.vertical, u = 0; u < P.length; u++) this.dummyToNodeForVerticalAlignment.set("dummy" + u, []), P[u].forEach(function(B) {
1802
- I.set(B, "dummy" + u), h.dummyToNodeForVerticalAlignment.get("dummy" + u).push(B), h.fixedNodeSet.has(B) && h.fixedNodesOnHorizontal.add("dummy" + u);
1803
- });
1804
- if (this.constraints.alignmentConstraint.horizontal) for (var b = this.constraints.alignmentConstraint.horizontal, u = 0; u < b.length; u++) this.dummyToNodeForHorizontalAlignment.set("dummy" + u, []), b[u].forEach(function(B) {
1805
- F.set(B, "dummy" + u), h.dummyToNodeForHorizontalAlignment.get("dummy" + u).push(B), h.fixedNodeSet.has(B) && h.fixedNodesOnVertical.add("dummy" + u);
1806
- });
1807
- }
1808
- if (n.RELAX_MOVEMENT_ON_CONSTRAINTS) this.shuffle = function(D) {
1809
- for (var B, et, U = D.length - 1; U >= 2 * D.length / 3; U--) B = Math.floor(Math.random() * (U + 1)), et = D[U], D[U] = D[B], D[B] = et;
1810
- return D;
1811
- }, 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) {
1812
- if (D.left) {
1813
- var B = I.has(D.left) ? I.get(D.left) : D.left, et = I.has(D.right) ? I.get(D.right) : D.right;
1814
- h.nodesInRelativeHorizontal.includes(B) || (h.nodesInRelativeHorizontal.push(B), h.nodeToRelativeConstraintMapHorizontal.set(B, []), h.dummyToNodeForVerticalAlignment.has(B) ? h.nodeToTempPositionMapHorizontal.set(B, h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()) : h.nodeToTempPositionMapHorizontal.set(B, h.idToNodeMap.get(B).getCenterX())), h.nodesInRelativeHorizontal.includes(et) || (h.nodesInRelativeHorizontal.push(et), h.nodeToRelativeConstraintMapHorizontal.set(et, []), h.dummyToNodeForVerticalAlignment.has(et) ? h.nodeToTempPositionMapHorizontal.set(et, h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX()) : h.nodeToTempPositionMapHorizontal.set(et, h.idToNodeMap.get(et).getCenterX())), h.nodeToRelativeConstraintMapHorizontal.get(B).push({
1815
- right: et,
1816
- gap: D.gap
1817
- }), h.nodeToRelativeConstraintMapHorizontal.get(et).push({
1818
- left: B,
1819
- gap: D.gap
1820
- });
1821
- } else {
1822
- var U = F.has(D.top) ? F.get(D.top) : D.top, V = F.has(D.bottom) ? F.get(D.bottom) : D.bottom;
1823
- h.nodesInRelativeVertical.includes(U) || (h.nodesInRelativeVertical.push(U), h.nodeToRelativeConstraintMapVertical.set(U, []), h.dummyToNodeForHorizontalAlignment.has(U) ? h.nodeToTempPositionMapVertical.set(U, h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY()) : h.nodeToTempPositionMapVertical.set(U, h.idToNodeMap.get(U).getCenterY())), h.nodesInRelativeVertical.includes(V) || (h.nodesInRelativeVertical.push(V), h.nodeToRelativeConstraintMapVertical.set(V, []), h.dummyToNodeForHorizontalAlignment.has(V) ? h.nodeToTempPositionMapVertical.set(V, h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(V)[0]).getCenterY()) : h.nodeToTempPositionMapVertical.set(V, h.idToNodeMap.get(V).getCenterY())), h.nodeToRelativeConstraintMapVertical.get(U).push({
1824
- bottom: V,
1825
- gap: D.gap
1826
- }), h.nodeToRelativeConstraintMapVertical.get(V).push({
1827
- top: U,
1828
- gap: D.gap
1829
- });
1830
- }
1831
- });
1832
- else {
1833
- var H = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map();
1834
- this.constraints.relativePlacementConstraint.forEach(function(D) {
1835
- if (D.left) {
1836
- var B = I.has(D.left) ? I.get(D.left) : D.left, et = I.has(D.right) ? I.get(D.right) : D.right;
1837
- H.has(B) ? H.get(B).push(et) : H.set(B, [et]), H.has(et) ? H.get(et).push(B) : H.set(et, [B]);
1838
- } else {
1839
- var U = F.has(D.top) ? F.get(D.top) : D.top, V = F.has(D.bottom) ? F.get(D.bottom) : D.bottom;
1840
- W.has(U) ? W.get(U).push(V) : W.set(U, [V]), W.has(V) ? W.get(V).push(U) : W.set(V, [U]);
1841
- }
1842
- });
1843
- var J = function(D, B) {
1844
- var et = [], U = [], V = new $(), dt = /* @__PURE__ */ new Set(), st = 0;
1845
- return D.forEach(function(wt, j) {
1846
- if (!dt.has(j)) {
1847
- et[st] = [], U[st] = !1;
1848
- var pt = j;
1849
- for (V.push(pt), dt.add(pt), et[st].push(pt); V.length != 0; ) pt = V.shift(), B.has(pt) && (U[st] = !0), D.get(pt).forEach(function(yt) {
1850
- dt.has(yt) || (V.push(yt), dt.add(yt), et[st].push(yt));
1851
- });
1852
- st++;
1853
- }
1854
- }), {
1855
- components: et,
1856
- isFixed: U
1857
- };
1858
- }, k = J(H, h.fixedNodesOnHorizontal);
1859
- this.componentsOnHorizontal = k.components, this.fixedComponentsOnHorizontal = k.isFixed;
1860
- var z = J(W, h.fixedNodesOnVertical);
1861
- this.componentsOnVertical = z.components, this.fixedComponentsOnVertical = z.isFixed;
1862
- }
1863
- }
1864
- }, _.prototype.updateDisplacements = function() {
1865
- var h = this;
1866
- if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(z) {
1867
- var D = h.idToNodeMap.get(z.nodeId);
1868
- D.displacementX = 0, D.displacementY = 0;
1869
- }), this.constraints.alignmentConstraint) {
1870
- if (this.constraints.alignmentConstraint.vertical) for (var T = this.constraints.alignmentConstraint.vertical, u = 0; u < T.length; u++) {
1871
- for (var v = 0, y = 0; y < T[u].length; y++) {
1872
- if (this.fixedNodeSet.has(T[u][y])) {
1873
- v = 0;
1874
- break;
1875
- }
1876
- v += this.idToNodeMap.get(T[u][y]).displacementX;
1877
- }
1878
- for (var w = v / T[u].length, y = 0; y < T[u].length; y++) this.idToNodeMap.get(T[u][y]).displacementX = w;
1879
- }
1880
- if (this.constraints.alignmentConstraint.horizontal) for (var I = this.constraints.alignmentConstraint.horizontal, u = 0; u < I.length; u++) {
1881
- for (var F = 0, y = 0; y < I[u].length; y++) {
1882
- if (this.fixedNodeSet.has(I[u][y])) {
1883
- F = 0;
1884
- break;
1885
- }
1886
- F += this.idToNodeMap.get(I[u][y]).displacementY;
1887
- }
1888
- for (var P = F / I[u].length, y = 0; y < I[u].length; y++) this.idToNodeMap.get(I[u][y]).displacementY = P;
1889
- }
1890
- }
1891
- if (this.constraints.relativePlacementConstraint)
1892
- if (n.RELAX_MOVEMENT_ON_CONSTRAINTS) this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(z) {
1893
- if (!h.fixedNodesOnHorizontal.has(z)) {
1894
- var D = 0;
1895
- D = h.dummyToNodeForVerticalAlignment.has(z) ? h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(z)[0]).displacementX : h.idToNodeMap.get(z).displacementX, h.nodeToRelativeConstraintMapHorizontal.get(z).forEach(function(B) {
1896
- if (B.right) {
1897
- var et = h.nodeToTempPositionMapHorizontal.get(B.right) - h.nodeToTempPositionMapHorizontal.get(z) - D;
1898
- et < B.gap && (D -= B.gap - et);
1899
- } else {
1900
- var et = h.nodeToTempPositionMapHorizontal.get(z) - h.nodeToTempPositionMapHorizontal.get(B.left) + D;
1901
- et < B.gap && (D += B.gap - et);
1902
- }
1903
- }), h.nodeToTempPositionMapHorizontal.set(z, h.nodeToTempPositionMapHorizontal.get(z) + D), h.dummyToNodeForVerticalAlignment.has(z) ? h.dummyToNodeForVerticalAlignment.get(z).forEach(function(B) {
1904
- h.idToNodeMap.get(B).displacementX = D;
1905
- }) : h.idToNodeMap.get(z).displacementX = D;
1906
- }
1907
- }), this.nodesInRelativeVertical.forEach(function(z) {
1908
- if (!h.fixedNodesOnHorizontal.has(z)) {
1909
- var D = 0;
1910
- D = h.dummyToNodeForHorizontalAlignment.has(z) ? h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(z)[0]).displacementY : h.idToNodeMap.get(z).displacementY, h.nodeToRelativeConstraintMapVertical.get(z).forEach(function(B) {
1911
- if (B.bottom) {
1912
- var et = h.nodeToTempPositionMapVertical.get(B.bottom) - h.nodeToTempPositionMapVertical.get(z) - D;
1913
- et < B.gap && (D -= B.gap - et);
1914
- } else {
1915
- var et = h.nodeToTempPositionMapVertical.get(z) - h.nodeToTempPositionMapVertical.get(B.top) + D;
1916
- et < B.gap && (D += B.gap - et);
1917
- }
1918
- }), h.nodeToTempPositionMapVertical.set(z, h.nodeToTempPositionMapVertical.get(z) + D), h.dummyToNodeForHorizontalAlignment.has(z) ? h.dummyToNodeForHorizontalAlignment.get(z).forEach(function(B) {
1919
- h.idToNodeMap.get(B).displacementY = D;
1920
- }) : h.idToNodeMap.get(z).displacementY = D;
1921
- }
1922
- });
1923
- else {
1924
- for (var u = 0; u < this.componentsOnHorizontal.length; u++) {
1925
- var b = this.componentsOnHorizontal[u];
1926
- if (this.fixedComponentsOnHorizontal[u]) for (var y = 0; y < b.length; y++) this.dummyToNodeForVerticalAlignment.has(b[y]) ? this.dummyToNodeForVerticalAlignment.get(b[y]).forEach(function(B) {
1927
- h.idToNodeMap.get(B).displacementX = 0;
1928
- }) : this.idToNodeMap.get(b[y]).displacementX = 0;
1929
- else {
1930
- for (var H = 0, W = 0, y = 0; y < b.length; y++) if (this.dummyToNodeForVerticalAlignment.has(b[y])) {
1931
- var J = this.dummyToNodeForVerticalAlignment.get(b[y]);
1932
- H += J.length * this.idToNodeMap.get(J[0]).displacementX, W += J.length;
1933
- } else H += this.idToNodeMap.get(b[y]).displacementX, W++;
1934
- for (var k = H / W, y = 0; y < b.length; y++) this.dummyToNodeForVerticalAlignment.has(b[y]) ? this.dummyToNodeForVerticalAlignment.get(b[y]).forEach(function(B) {
1935
- h.idToNodeMap.get(B).displacementX = k;
1936
- }) : this.idToNodeMap.get(b[y]).displacementX = k;
1937
- }
1938
- }
1939
- for (var u = 0; u < this.componentsOnVertical.length; u++) {
1940
- var b = this.componentsOnVertical[u];
1941
- if (this.fixedComponentsOnVertical[u]) for (var y = 0; y < b.length; y++) this.dummyToNodeForHorizontalAlignment.has(b[y]) ? this.dummyToNodeForHorizontalAlignment.get(b[y]).forEach(function(et) {
1942
- h.idToNodeMap.get(et).displacementY = 0;
1943
- }) : this.idToNodeMap.get(b[y]).displacementY = 0;
1944
- else {
1945
- for (var H = 0, W = 0, y = 0; y < b.length; y++) if (this.dummyToNodeForHorizontalAlignment.has(b[y])) {
1946
- var J = this.dummyToNodeForHorizontalAlignment.get(b[y]);
1947
- H += J.length * this.idToNodeMap.get(J[0]).displacementY, W += J.length;
1948
- } else H += this.idToNodeMap.get(b[y]).displacementY, W++;
1949
- for (var k = H / W, y = 0; y < b.length; y++) this.dummyToNodeForHorizontalAlignment.has(b[y]) ? this.dummyToNodeForHorizontalAlignment.get(b[y]).forEach(function(U) {
1950
- h.idToNodeMap.get(U).displacementY = k;
1951
- }) : this.idToNodeMap.get(b[y]).displacementY = k;
1952
- }
1953
- }
1954
- }
1955
- }, _.prototype.calculateNodesToApplyGravitationTo = function() {
1956
- for (var h = [], T, u = this.graphManager.getGraphs(), v = u.length, y = 0; y < v; y++) T = u[y], T.updateConnected(), T.isConnected || (h = h.concat(T.getNodes()));
1957
- return h;
1958
- }, _.prototype.createBendpoints = function() {
1959
- var h = [];
1960
- h = h.concat(this.graphManager.getAllEdges());
1961
- for (var T = /* @__PURE__ */ new Set(), u = 0; u < h.length; u++) {
1962
- var v = h[u];
1963
- if (!T.has(v)) {
1964
- var y = v.getSource(), w = v.getTarget();
1965
- if (y == w) v.getBendpoints().push(new m()), v.getBendpoints().push(new m()), this.createDummyNodesForBendpoints(v), T.add(v);
1966
- else {
1967
- var I = [];
1968
- if (I = I.concat(y.getEdgeListToNode(w)), I = I.concat(w.getEdgeListToNode(y)), !T.has(I[0])) {
1969
- if (I.length > 1) for (var F = 0; F < I.length; F++) {
1970
- var P = I[F];
1971
- P.getBendpoints().push(new m()), this.createDummyNodesForBendpoints(P);
1972
- }
1973
- I.forEach(function(b) {
1974
- T.add(b);
1975
- });
1976
- }
1977
- }
1978
- }
1979
- if (T.size == h.length) break;
1980
- }
1981
- }, _.prototype.positionNodesRadially = function(h) {
1982
- for (var T = new d(0, 0), u = Math.ceil(Math.sqrt(h.length)), v = 0, y = 0, w = 0, I = new m(0, 0), F = 0; F < h.length; F++) {
1983
- F % u == 0 && (w = 0, y = v, F != 0 && (y += n.DEFAULT_COMPONENT_SEPERATION), v = 0);
1984
- var P = h[F], b = C.findCenterOfTree(P);
1985
- T.x = w, T.y = y, I = _.radialLayout(P, b, T), I.y > v && (v = Math.floor(I.y)), w = Math.floor(I.x + n.DEFAULT_COMPONENT_SEPERATION);
1986
- }
1987
- this.transform(new m(c.WORLD_CENTER_X - I.x / 2, c.WORLD_CENTER_Y - I.y / 2));
1988
- }, _.radialLayout = function(h, T, u) {
1989
- var v = Math.max(this.maxDiagonalInTree(h), n.DEFAULT_RADIAL_SEPARATION);
1990
- _.branchRadialLayout(T, null, 0, 359, 0, v);
1991
- var y = G.calculateBounds(h), w = new X();
1992
- w.setDeviceOrgX(y.getMinX()), w.setDeviceOrgY(y.getMinY()), w.setWorldOrgX(u.x), w.setWorldOrgY(u.y);
1993
- for (var I = 0; I < h.length; I++) h[I].transform(w);
1994
- var F = new m(y.getMaxX(), y.getMaxY());
1995
- return w.inverseTransformPoint(F);
1996
- }, _.branchRadialLayout = function(h, T, u, v, y, w) {
1997
- var I = (v - u + 1) / 2;
1998
- I < 0 && (I += 180);
1999
- var F = (I + u) % 360 * S.TWO_PI / 360, P = y * Math.cos(F), b = y * Math.sin(F);
2000
- h.setCenter(P, b);
2001
- var H = [];
2002
- H = H.concat(h.getEdges());
2003
- var W = H.length;
2004
- T != null && W--;
2005
- for (var J = 0, k = H.length, z, D = h.getEdgesBetween(T); D.length > 1; ) {
2006
- var B = D[0];
2007
- D.splice(0, 1);
2008
- var et = H.indexOf(B);
2009
- et >= 0 && H.splice(et, 1), k--, W--;
2010
- }
2011
- z = T == null ? 0 : (H.indexOf(D[0]) + 1) % k;
2012
- for (var U = Math.abs(v - u) / W, V = z; J != W; V = ++V % k) {
2013
- var dt = H[V].getOtherEnd(h);
2014
- if (dt != T) {
2015
- var st = (u + J * U) % 360, wt = (st + U) % 360;
2016
- _.branchRadialLayout(dt, h, st, wt, y + w, w), J++;
2017
- }
2018
- }
2019
- }, _.maxDiagonalInTree = function(h) {
2020
- for (var T = R.MIN_VALUE, u = 0; u < h.length; u++) {
2021
- var v = h[u].getDiagonal();
2022
- v > T && (T = v);
2023
- }
2024
- return T;
2025
- }, _.prototype.calcRepulsionRange = function() {
2026
- return 2 * (this.level + 1) * this.idealEdgeLength;
2027
- }, _.prototype.groupZeroDegreeMembers = function() {
2028
- var h = this, T = {};
2029
- this.memberGroups = {}, this.idToDummyNode = {};
2030
- for (var u = [], v = this.graphManager.getAllNodes(), y = 0; y < v.length; y++) {
2031
- var w = v[y], I = w.getParent();
2032
- this.getNodeDegreeWithChildren(w) === 0 && (I.id == null || !this.getToBeTiled(I)) && u.push(w);
2033
- }
2034
- for (var y = 0; y < u.length; y++) {
2035
- var w = u[y], F = w.getParent().id;
2036
- T[F] === void 0 && (T[F] = []), T[F] = T[F].concat(w);
2037
- }
2038
- Object.keys(T).forEach(function(P) {
2039
- if (T[P].length > 1) {
2040
- var b = "DummyCompound_" + P;
2041
- h.memberGroups[b] = T[P];
2042
- var H = T[P][0].getParent(), W = new p(h.graphManager);
2043
- W.id = b, W.paddingLeft = H.paddingLeft || 0, W.paddingRight = H.paddingRight || 0, W.paddingBottom = H.paddingBottom || 0, W.paddingTop = H.paddingTop || 0, h.idToDummyNode[b] = W;
2044
- var J = h.getGraphManager().add(h.newGraph(), W), k = H.getChild();
2045
- k.add(W);
2046
- for (var z = 0; z < T[P].length; z++) {
2047
- var D = T[P][z];
2048
- k.remove(D), J.add(D);
2049
- }
2050
- }
2051
- });
2052
- }, _.prototype.clearCompounds = function() {
2053
- var h = {}, T = {};
2054
- this.performDFSOnCompounds();
2055
- for (var u = 0; u < this.compoundOrder.length; u++) T[this.compoundOrder[u].id] = this.compoundOrder[u], h[this.compoundOrder[u].id] = [].concat(this.compoundOrder[u].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[u].getChild()), this.compoundOrder[u].child = null;
2056
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(h, T);
2057
- }, _.prototype.clearZeroDegreeMembers = function() {
2058
- var h = this, T = this.tiledZeroDegreePack = [];
2059
- Object.keys(this.memberGroups).forEach(function(u) {
2060
- var v = h.idToDummyNode[u];
2061
- if (T[u] = h.tileNodes(h.memberGroups[u], v.paddingLeft + v.paddingRight), v.rect.width = T[u].width, v.rect.height = T[u].height, v.setCenter(T[u].centerX, T[u].centerY), v.labelMarginLeft = 0, v.labelMarginTop = 0, n.NODE_DIMENSIONS_INCLUDE_LABELS) {
2062
- var y = v.rect.width, w = v.rect.height;
2063
- v.labelWidth && (v.labelPosHorizontal == "left" ? (v.rect.x -= v.labelWidth, v.setWidth(y + v.labelWidth), v.labelMarginLeft = v.labelWidth) : v.labelPosHorizontal == "center" && v.labelWidth > y ? (v.rect.x -= (v.labelWidth - y) / 2, v.setWidth(v.labelWidth), v.labelMarginLeft = (v.labelWidth - y) / 2) : v.labelPosHorizontal == "right" && v.setWidth(y + v.labelWidth)), v.labelHeight && (v.labelPosVertical == "top" ? (v.rect.y -= v.labelHeight, v.setHeight(w + v.labelHeight), v.labelMarginTop = v.labelHeight) : v.labelPosVertical == "center" && v.labelHeight > w ? (v.rect.y -= (v.labelHeight - w) / 2, v.setHeight(v.labelHeight), v.labelMarginTop = (v.labelHeight - w) / 2) : v.labelPosVertical == "bottom" && v.setHeight(w + v.labelHeight));
2064
- }
2065
- });
2066
- }, _.prototype.repopulateCompounds = function() {
2067
- for (var h = this.compoundOrder.length - 1; h >= 0; h--) {
2068
- var T = this.compoundOrder[h], u = T.id, v = T.paddingLeft, y = T.paddingTop, w = T.labelMarginLeft, I = T.labelMarginTop;
2069
- this.adjustLocations(this.tiledMemberPack[u], T.rect.x, T.rect.y, v, y, w, I);
2070
- }
2071
- }, _.prototype.repopulateZeroDegreeMembers = function() {
2072
- var h = this, T = this.tiledZeroDegreePack;
2073
- Object.keys(T).forEach(function(u) {
2074
- var v = h.idToDummyNode[u], y = v.paddingLeft, w = v.paddingTop, I = v.labelMarginLeft, F = v.labelMarginTop;
2075
- h.adjustLocations(T[u], v.rect.x, v.rect.y, y, w, I, F);
2076
- });
2077
- }, _.prototype.getToBeTiled = function(h) {
2078
- var T = h.id;
2079
- if (this.toBeTiled[T] != null) return this.toBeTiled[T];
2080
- var u = h.getChild();
2081
- if (u == null) return this.toBeTiled[T] = !1, !1;
2082
- for (var v = u.getNodes(), y = 0; y < v.length; y++) {
2083
- var w = v[y];
2084
- if (this.getNodeDegree(w) > 0) return this.toBeTiled[T] = !1, !1;
2085
- if (w.getChild() == null) {
2086
- this.toBeTiled[w.id] = !1;
2087
- continue;
2088
- }
2089
- if (!this.getToBeTiled(w)) return this.toBeTiled[T] = !1, !1;
2090
- }
2091
- return this.toBeTiled[T] = !0, !0;
2092
- }, _.prototype.getNodeDegree = function(h) {
2093
- h.id;
2094
- for (var T = h.getEdges(), u = 0, v = 0; v < T.length; v++) {
2095
- var y = T[v];
2096
- y.getSource().id !== y.getTarget().id && (u += 1);
2097
- }
2098
- return u;
2099
- }, _.prototype.getNodeDegreeWithChildren = function(h) {
2100
- var T = this.getNodeDegree(h);
2101
- if (h.getChild() == null) return T;
2102
- for (var u = h.getChild().getNodes(), v = 0; v < u.length; v++) {
2103
- var y = u[v];
2104
- T += this.getNodeDegreeWithChildren(y);
2105
- }
2106
- return T;
2107
- }, _.prototype.performDFSOnCompounds = function() {
2108
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2109
- }, _.prototype.fillCompexOrderByDFS = function(h) {
2110
- for (var T = 0; T < h.length; T++) {
2111
- var u = h[T];
2112
- u.getChild() != null && this.fillCompexOrderByDFS(u.getChild().getNodes()), this.getToBeTiled(u) && this.compoundOrder.push(u);
2113
- }
2114
- }, _.prototype.adjustLocations = function(h, T, u, v, y, w, I) {
2115
- T += v + w, u += y + I;
2116
- for (var F = T, P = 0; P < h.rows.length; P++) {
2117
- var b = h.rows[P];
2118
- T = F;
2119
- for (var H = 0, W = 0; W < b.length; W++) {
2120
- var J = b[W];
2121
- J.rect.x = T, J.rect.y = u, T += J.rect.width + h.horizontalPadding, J.rect.height > H && (H = J.rect.height);
2122
- }
2123
- u += H + h.verticalPadding;
2124
- }
2125
- }, _.prototype.tileCompoundMembers = function(h, T) {
2126
- var u = this;
2127
- this.tiledMemberPack = [], Object.keys(h).forEach(function(v) {
2128
- var y = T[v];
2129
- if (u.tiledMemberPack[v] = u.tileNodes(h[v], y.paddingLeft + y.paddingRight), y.rect.width = u.tiledMemberPack[v].width, y.rect.height = u.tiledMemberPack[v].height, y.setCenter(u.tiledMemberPack[v].centerX, u.tiledMemberPack[v].centerY), y.labelMarginLeft = 0, y.labelMarginTop = 0, n.NODE_DIMENSIONS_INCLUDE_LABELS) {
2130
- var w = y.rect.width, I = y.rect.height;
2131
- y.labelWidth && (y.labelPosHorizontal == "left" ? (y.rect.x -= y.labelWidth, y.setWidth(w + y.labelWidth), y.labelMarginLeft = y.labelWidth) : y.labelPosHorizontal == "center" && y.labelWidth > w ? (y.rect.x -= (y.labelWidth - w) / 2, y.setWidth(y.labelWidth), y.labelMarginLeft = (y.labelWidth - w) / 2) : y.labelPosHorizontal == "right" && y.setWidth(w + y.labelWidth)), y.labelHeight && (y.labelPosVertical == "top" ? (y.rect.y -= y.labelHeight, y.setHeight(I + y.labelHeight), y.labelMarginTop = y.labelHeight) : y.labelPosVertical == "center" && y.labelHeight > I ? (y.rect.y -= (y.labelHeight - I) / 2, y.setHeight(y.labelHeight), y.labelMarginTop = (y.labelHeight - I) / 2) : y.labelPosVertical == "bottom" && y.setHeight(I + y.labelHeight));
2132
- }
2133
- });
2134
- }, _.prototype.tileNodes = function(h, T) {
2135
- var u = this.tileNodesByFavoringDim(h, T, !0), v = this.tileNodesByFavoringDim(h, T, !1), y = this.getOrgRatio(u);
2136
- return this.getOrgRatio(v) < y ? v : u;
2137
- }, _.prototype.getOrgRatio = function(h) {
2138
- var T = h.width / h.height;
2139
- return T < 1 && (T = 1 / T), T;
2140
- }, _.prototype.calcIdealRowWidth = function(h, T) {
2141
- var u = n.TILING_PADDING_VERTICAL, v = n.TILING_PADDING_HORIZONTAL, y = h.length, w = 0, I = 0, F = 0;
2142
- h.forEach(function(z) {
2143
- w += z.getWidth(), I += z.getHeight(), z.getWidth() > F && (F = z.getWidth());
2144
- });
2145
- var P = w / y, b = I / y, H = (u - v) ** 2 + 4 * (P + v) * (b + u) * y, W = (v - u + Math.sqrt(H)) / (2 * (P + v)), J;
2146
- T ? (J = Math.ceil(W), J == W && J++) : J = Math.floor(W);
2147
- var k = J * (P + v) - v;
2148
- return F > k && (k = F), k += v * 2, k;
2149
- }, _.prototype.tileNodesByFavoringDim = function(h, T, u) {
2150
- var v = n.TILING_PADDING_VERTICAL, y = n.TILING_PADDING_HORIZONTAL, w = n.TILING_COMPARE_BY, I = {
2151
- rows: [],
2152
- rowWidth: [],
2153
- rowHeight: [],
2154
- width: 0,
2155
- height: T,
2156
- verticalPadding: v,
2157
- horizontalPadding: y,
2158
- centerX: 0,
2159
- centerY: 0
2160
- };
2161
- w && (I.idealRowWidth = this.calcIdealRowWidth(h, u));
2162
- var F = function(z) {
2163
- return z.rect.width * z.rect.height;
2164
- }, P = function(z, D) {
2165
- return F(D) - F(z);
2166
- };
2167
- h.sort(function(z, D) {
2168
- var B = P;
2169
- return I.idealRowWidth ? (B = w, B(z.id, D.id)) : B(z, D);
2170
- });
2171
- for (var b = 0, H = 0, W = 0; W < h.length; W++) {
2172
- var J = h[W];
2173
- b += J.getCenterX(), H += J.getCenterY();
2174
- }
2175
- I.centerX = b / h.length, I.centerY = H / h.length;
2176
- for (var W = 0; W < h.length; W++) {
2177
- var J = h[W];
2178
- if (I.rows.length == 0) this.insertNodeToRow(I, J, 0, T);
2179
- else if (this.canAddHorizontal(I, J.rect.width, J.rect.height)) {
2180
- var k = I.rows.length - 1;
2181
- I.idealRowWidth || (k = this.getShortestRowIndex(I)), this.insertNodeToRow(I, J, k, T);
2182
- } else this.insertNodeToRow(I, J, I.rows.length, T);
2183
- this.shiftToLastRow(I);
2184
- }
2185
- return I;
2186
- }, _.prototype.insertNodeToRow = function(h, T, u, v) {
2187
- var y = v;
2188
- u == h.rows.length && (h.rows.push([]), h.rowWidth.push(y), h.rowHeight.push(0));
2189
- var w = h.rowWidth[u] + T.rect.width;
2190
- h.rows[u].length > 0 && (w += h.horizontalPadding), h.rowWidth[u] = w, h.width < w && (h.width = w);
2191
- var I = T.rect.height;
2192
- u > 0 && (I += h.verticalPadding);
2193
- var F = 0;
2194
- I > h.rowHeight[u] && (F = h.rowHeight[u], h.rowHeight[u] = I, F = h.rowHeight[u] - F), h.height += F, h.rows[u].push(T);
2195
- }, _.prototype.getShortestRowIndex = function(h) {
2196
- for (var T = -1, u = Number.MAX_VALUE, v = 0; v < h.rows.length; v++) h.rowWidth[v] < u && (T = v, u = h.rowWidth[v]);
2197
- return T;
2198
- }, _.prototype.getLongestRowIndex = function(h) {
2199
- for (var T = -1, u = Number.MIN_VALUE, v = 0; v < h.rows.length; v++) h.rowWidth[v] > u && (T = v, u = h.rowWidth[v]);
2200
- return T;
2201
- }, _.prototype.canAddHorizontal = function(h, T, u) {
2202
- if (h.idealRowWidth) {
2203
- var v = h.rows.length - 1;
2204
- return h.rowWidth[v] + T + h.horizontalPadding <= h.idealRowWidth;
2205
- }
2206
- var y = this.getShortestRowIndex(h);
2207
- if (y < 0) return !0;
2208
- var w = h.rowWidth[y];
2209
- if (w + h.horizontalPadding + T <= h.width) return !0;
2210
- var I = 0;
2211
- h.rowHeight[y] < u && y > 0 && (I = u + h.verticalPadding - h.rowHeight[y]);
2212
- var F = h.width - w >= T + h.horizontalPadding ? (h.height + I) / (w + T + h.horizontalPadding) : (h.height + I) / h.width;
2213
- I = u + h.verticalPadding;
2214
- var P = h.width < T ? (h.height + I) / T : (h.height + I) / h.width;
2215
- return P < 1 && (P = 1 / P), F < 1 && (F = 1 / F), F < P;
2216
- }, _.prototype.shiftToLastRow = function(h) {
2217
- var T = this.getLongestRowIndex(h), u = h.rowWidth.length - 1, v = h.rows[T], y = v[v.length - 1], w = y.width + h.horizontalPadding;
2218
- if (h.width - h.rowWidth[u] > w && T != u) {
2219
- v.splice(-1, 1), h.rows[u].push(y), h.rowWidth[T] = h.rowWidth[T] - w, h.rowWidth[u] = h.rowWidth[u] + w, h.width = h.rowWidth[instance.getLongestRowIndex(h)];
2220
- for (var I = Number.MIN_VALUE, F = 0; F < v.length; F++) v[F].height > I && (I = v[F].height);
2221
- T > 0 && (I += h.verticalPadding);
2222
- var P = h.rowHeight[T] + h.rowHeight[u];
2223
- h.rowHeight[T] = I, h.rowHeight[u] < y.height + h.verticalPadding && (h.rowHeight[u] = y.height + h.verticalPadding);
2224
- var b = h.rowHeight[T] + h.rowHeight[u];
2225
- h.height += b - P, this.shiftToLastRow(h);
2226
- }
2227
- }, _.prototype.tilingPreLayout = function() {
2228
- n.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2229
- }, _.prototype.tilingPostLayout = function() {
2230
- n.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2231
- }, _.prototype.reduceTrees = function() {
2232
- for (var h = [], T = !0, u; T; ) {
2233
- var v = this.graphManager.getAllNodes(), y = [];
2234
- T = !1;
2235
- for (var w = 0; w < v.length; w++) if (u = v[w], u.getEdges().length == 1 && !u.getEdges()[0].isInterGraph && u.getChild() == null) {
2236
- if (n.PURE_INCREMENTAL) {
2237
- var I = u.getEdges()[0].getOtherEnd(u), F = new E(u.getCenterX() - I.getCenterX(), u.getCenterY() - I.getCenterY());
2238
- y.push([
2239
- u,
2240
- u.getEdges()[0],
2241
- u.getOwner(),
2242
- F
2243
- ]);
2244
- } else y.push([
2245
- u,
2246
- u.getEdges()[0],
2247
- u.getOwner()
2248
- ]);
2249
- T = !0;
2250
- }
2251
- if (T == 1) {
2252
- for (var P = [], b = 0; b < y.length; b++) y[b][0].getEdges().length == 1 && (P.push(y[b]), y[b][0].getOwner().remove(y[b][0]));
2253
- h.push(P), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2254
- }
2255
- }
2256
- this.prunedNodesAll = h;
2257
- }, _.prototype.growTree = function(h) {
2258
- for (var T = h[h.length - 1], u, v = 0; v < T.length; v++) u = T[v], this.findPlaceforPrunedNode(u), u[2].add(u[0]), u[2].add(u[1], u[1].source, u[1].target);
2259
- h.splice(h.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2260
- }, _.prototype.findPlaceforPrunedNode = function(h) {
2261
- var T, u, v = h[0];
2262
- if (u = v == h[1].source ? h[1].target : h[1].source, n.PURE_INCREMENTAL) v.setCenter(u.getCenterX() + h[3].getWidth(), u.getCenterY() + h[3].getHeight());
2263
- else {
2264
- var y = u.startX, w = u.finishX, I = u.startY, F = u.finishY, P = [
2265
- 0,
2266
- 0,
2267
- 0,
2268
- 0
2269
- ];
2270
- if (I > 0) for (var b = y; b <= w; b++) P[0] += this.grid[b][I - 1].length + this.grid[b][I].length - 1;
2271
- if (w < this.grid.length - 1) for (var b = I; b <= F; b++) P[1] += this.grid[w + 1][b].length + this.grid[w][b].length - 1;
2272
- if (F < this.grid[0].length - 1) for (var b = y; b <= w; b++) P[2] += this.grid[b][F + 1].length + this.grid[b][F].length - 1;
2273
- if (y > 0) for (var b = I; b <= F; b++) P[3] += this.grid[y - 1][b].length + this.grid[y][b].length - 1;
2274
- for (var H = R.MAX_VALUE, W, J, k = 0; k < P.length; k++) P[k] < H ? (H = P[k], W = 1, J = k) : P[k] == H && W++;
2275
- if (W == 3 && H == 0) P[0] == 0 && P[1] == 0 && P[2] == 0 ? T = 1 : P[0] == 0 && P[1] == 0 && P[3] == 0 ? T = 0 : P[0] == 0 && P[2] == 0 && P[3] == 0 ? T = 3 : P[1] == 0 && P[2] == 0 && P[3] == 0 && (T = 2);
2276
- else if (W == 2 && H == 0) {
2277
- var z = Math.floor(Math.random() * 2);
2278
- T = P[0] == 0 && P[1] == 0 ? z == 0 ? 0 : 1 : P[0] == 0 && P[2] == 0 ? z == 0 ? 0 : 2 : P[0] == 0 && P[3] == 0 ? z == 0 ? 0 : 3 : P[1] == 0 && P[2] == 0 ? z == 0 ? 1 : 2 : P[1] == 0 && P[3] == 0 ? z == 0 ? 1 : 3 : z == 0 ? 2 : 3;
2279
- } else if (W == 4 && H == 0) {
2280
- var z = Math.floor(Math.random() * 4);
2281
- T = z;
2282
- } else T = J;
2283
- T == 0 ? v.setCenter(u.getCenterX(), u.getCenterY() - u.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - v.getHeight() / 2) : T == 1 ? v.setCenter(u.getCenterX() + u.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + v.getWidth() / 2, u.getCenterY()) : T == 2 ? v.setCenter(u.getCenterX(), u.getCenterY() + u.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + v.getHeight() / 2) : v.setCenter(u.getCenterX() - u.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - v.getWidth() / 2, u.getCenterY());
2284
- }
2285
- }, a.exports = _;
2286
- }),
2287
- 991: ((a, o, t) => {
2288
- var e = t(551).FDLayoutNode, s = t(551).IMath;
2289
- function i(r, n, g, l) {
2290
- e.call(this, r, n, g, l);
2291
- }
2292
- for (var p in i.prototype = Object.create(e.prototype), e) i[p] = e[p];
2293
- i.prototype.calculateDisplacement = function() {
2294
- var r = this.graphManager.getLayout();
2295
- this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += r.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += r.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += r.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += r.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > r.coolingFactor * r.maxNodeDisplacement && (this.displacementX = r.coolingFactor * r.maxNodeDisplacement * s.sign(this.displacementX)), Math.abs(this.displacementY) > r.coolingFactor * r.maxNodeDisplacement && (this.displacementY = r.coolingFactor * r.maxNodeDisplacement * s.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
2296
- }, i.prototype.propogateDisplacementToChildren = function(r, n) {
2297
- for (var g = this.getChild().getNodes(), l, c = 0; c < g.length; c++) l = g[c], l.getChild() == null ? (l.displacementX += r, l.displacementY += n) : l.propogateDisplacementToChildren(r, n);
2298
- }, i.prototype.move = function() {
2299
- var r = this.graphManager.getLayout();
2300
- (this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), r.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;
2301
- }, i.prototype.setPred1 = function(r) {
2302
- this.pred1 = r;
2303
- }, i.prototype.getPred1 = function() {
2304
- return pred1;
2305
- }, i.prototype.getPred2 = function() {
2306
- return pred2;
2307
- }, i.prototype.setNext = function(r) {
2308
- this.next = r;
2309
- }, i.prototype.getNext = function() {
2310
- return next;
2311
- }, i.prototype.setProcessed = function(r) {
2312
- this.processed = r;
2313
- }, i.prototype.isProcessed = function() {
2314
- return processed;
2315
- }, a.exports = i;
2316
- }),
2317
- 902: ((a, o, t) => {
2318
- function e(g) {
2319
- if (Array.isArray(g)) {
2320
- for (var l = 0, c = Array(g.length); l < g.length; l++) c[l] = g[l];
2321
- return c;
2322
- }
2323
- return Array.from(g);
2324
- }
2325
- var s = t(806), i = t(551).LinkedList, p = t(551).Matrix, r = t(551).SVD;
2326
- function n() {
2327
- }
2328
- n.handleConstraints = function(g) {
2329
- var l = {};
2330
- l.fixedNodeConstraint = g.constraints.fixedNodeConstraint, l.alignmentConstraint = g.constraints.alignmentConstraint, l.relativePlacementConstraint = g.constraints.relativePlacementConstraint;
2331
- for (var c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), m = [], E = [], C = g.getAllNodes(), R = 0, S = 0; S < C.length; S++) {
2332
- var G = C[S];
2333
- G.getChild() ?? (d.set(G.id, R++), m.push(G.getCenterX()), E.push(G.getCenterY()), c.set(G.id, G));
2334
- }
2335
- l.relativePlacementConstraint && l.relativePlacementConstraint.forEach(function(M) {
2336
- !M.gap && M.gap != 0 && (M.gap = M.left ? s.DEFAULT_EDGE_LENGTH + c.get(M.left).getWidth() / 2 + c.get(M.right).getWidth() / 2 : s.DEFAULT_EDGE_LENGTH + c.get(M.top).getHeight() / 2 + c.get(M.bottom).getHeight() / 2);
2337
- });
2338
- var X = function(M, Y) {
2339
- return {
2340
- x: M.x - Y.x,
2341
- y: M.y - Y.y
2342
- };
2343
- }, $ = function(M) {
2344
- var Y = 0, K = 0;
2345
- return M.forEach(function(q) {
2346
- Y += m[d.get(q)], K += E[d.get(q)];
2347
- }), {
2348
- x: Y / M.size,
2349
- y: K / M.size
2350
- };
2351
- }, _ = function(M, Y, K, q, tt) {
2352
- function Et(gt, Q) {
2353
- var ut = new Set(gt), Lt = !0, rt = !1, bt = void 0;
2354
- try {
2355
- for (var Ot = Q[Symbol.iterator](), Dt; !(Lt = (Dt = Ot.next()).done); Lt = !0) {
2356
- var Ft = Dt.value;
2357
- ut.add(Ft);
2358
- }
2359
- } catch (Tt) {
2360
- rt = !0, bt = Tt;
2361
- } finally {
2362
- try {
2363
- !Lt && Ot.return && Ot.return();
2364
- } finally {
2365
- if (rt) throw bt;
2366
- }
2367
- }
2368
- return ut;
2369
- }
2370
- var vt = /* @__PURE__ */ new Map();
2371
- M.forEach(function(gt, Q) {
2372
- vt.set(Q, 0);
2373
- }), M.forEach(function(gt, Q) {
2374
- gt.forEach(function(ut) {
2375
- vt.set(ut.id, vt.get(ut.id) + 1);
2376
- });
2377
- });
2378
- var it = /* @__PURE__ */ new Map(), ft = /* @__PURE__ */ new Map(), It = new i();
2379
- vt.forEach(function(gt, Q) {
2380
- gt == 0 ? (It.push(Q), K || (Y == "horizontal" ? it.set(Q, d.has(Q) ? m[d.get(Q)] : q.get(Q)) : it.set(Q, d.has(Q) ? E[d.get(Q)] : q.get(Q)))) : it.set(Q, -1 / 0), K && ft.set(Q, /* @__PURE__ */ new Set([Q]));
2381
- }), K && tt.forEach(function(gt) {
2382
- var Q = [];
2383
- if (gt.forEach(function(rt) {
2384
- K.has(rt) && Q.push(rt);
2385
- }), Q.length > 0) {
2386
- var ut = 0;
2387
- Q.forEach(function(rt) {
2388
- Y == "horizontal" ? (it.set(rt, d.has(rt) ? m[d.get(rt)] : q.get(rt)), ut += it.get(rt)) : (it.set(rt, d.has(rt) ? E[d.get(rt)] : q.get(rt)), ut += it.get(rt));
2389
- }), ut /= Q.length, gt.forEach(function(rt) {
2390
- K.has(rt) || it.set(rt, ut);
2391
- });
2392
- } else {
2393
- var Lt = 0;
2394
- gt.forEach(function(rt) {
2395
- Lt += Y == "horizontal" ? d.has(rt) ? m[d.get(rt)] : q.get(rt) : d.has(rt) ? E[d.get(rt)] : q.get(rt);
2396
- }), Lt /= gt.length, gt.forEach(function(rt) {
2397
- it.set(rt, Lt);
2398
- });
2399
- }
2400
- });
2401
- for (var Ct = function() {
2402
- var gt = It.shift();
2403
- M.get(gt).forEach(function(Q) {
2404
- if (it.get(Q.id) < it.get(gt) + Q.gap)
2405
- if (K && K.has(Q.id)) {
2406
- var ut = void 0;
2407
- if (ut = Y == "horizontal" ? d.has(Q.id) ? m[d.get(Q.id)] : q.get(Q.id) : d.has(Q.id) ? E[d.get(Q.id)] : q.get(Q.id), it.set(Q.id, ut), ut < it.get(gt) + Q.gap) {
2408
- var Lt = it.get(gt) + Q.gap - ut;
2409
- ft.get(gt).forEach(function(rt) {
2410
- it.set(rt, it.get(rt) - Lt);
2411
- });
2412
- }
2413
- } else it.set(Q.id, it.get(gt) + Q.gap);
2414
- vt.set(Q.id, vt.get(Q.id) - 1), vt.get(Q.id) == 0 && It.push(Q.id), K && ft.set(Q.id, Et(ft.get(gt), ft.get(Q.id)));
2415
- });
2416
- }; It.length != 0; ) Ct();
2417
- if (K) {
2418
- var mt = /* @__PURE__ */ new Set();
2419
- M.forEach(function(gt, Q) {
2420
- gt.length == 0 && mt.add(Q);
2421
- });
2422
- var lt = [];
2423
- ft.forEach(function(gt, Q) {
2424
- if (mt.has(Q)) {
2425
- var ut = !1, Lt = !0, rt = !1, bt = void 0;
2426
- try {
2427
- for (var Ot = gt[Symbol.iterator](), Dt; !(Lt = (Dt = Ot.next()).done); Lt = !0) {
2428
- var Ft = Dt.value;
2429
- K.has(Ft) && (ut = !0);
2430
- }
2431
- } catch (_t) {
2432
- rt = !0, bt = _t;
2433
- } finally {
2434
- try {
2435
- !Lt && Ot.return && Ot.return();
2436
- } finally {
2437
- if (rt) throw bt;
2438
- }
2439
- }
2440
- if (!ut) {
2441
- var Tt = !1, Nt = void 0;
2442
- lt.forEach(function(_t, St) {
2443
- _t.has([].concat(e(gt))[0]) && (Tt = !0, Nt = St);
2444
- }), Tt ? gt.forEach(function(_t) {
2445
- lt[Nt].add(_t);
2446
- }) : lt.push(new Set(gt));
2447
- }
2448
- }
2449
- }), lt.forEach(function(gt, Q) {
2450
- var ut = 1 / 0, Lt = 1 / 0, rt = -1 / 0, bt = -1 / 0, Ot = !0, Dt = !1, Ft = void 0;
2451
- try {
2452
- for (var Tt = gt[Symbol.iterator](), Nt; !(Ot = (Nt = Tt.next()).done); Ot = !0) {
2453
- var _t = Nt.value, St = void 0;
2454
- St = Y == "horizontal" ? d.has(_t) ? m[d.get(_t)] : q.get(_t) : d.has(_t) ? E[d.get(_t)] : q.get(_t);
2455
- var Ut = it.get(_t);
2456
- St < ut && (ut = St), St > rt && (rt = St), Ut < Lt && (Lt = Ut), Ut > bt && (bt = Ut);
2457
- }
2458
- } catch (jt) {
2459
- Dt = !0, Ft = jt;
2460
- } finally {
2461
- try {
2462
- !Ot && Tt.return && Tt.return();
2463
- } finally {
2464
- if (Dt) throw Ft;
2465
- }
2466
- }
2467
- var ne = (ut + rt) / 2 - (Lt + bt) / 2, ee = !0, qt = !1, Zt = void 0;
2468
- try {
2469
- for (var $t = gt[Symbol.iterator](), Kt; !(ee = (Kt = $t.next()).done); ee = !0) {
2470
- var re = Kt.value;
2471
- it.set(re, it.get(re) + ne);
2472
- }
2473
- } catch (jt) {
2474
- qt = !0, Zt = jt;
2475
- } finally {
2476
- try {
2477
- !ee && $t.return && $t.return();
2478
- } finally {
2479
- if (qt) throw Zt;
2480
- }
2481
- }
2482
- });
2483
- }
2484
- return it;
2485
- }, Z = function(M) {
2486
- var Y = 0, K = 0, q = 0, tt = 0;
2487
- if (M.forEach(function(ft) {
2488
- ft.left ? m[d.get(ft.left)] - m[d.get(ft.right)] >= 0 ? Y++ : K++ : E[d.get(ft.top)] - E[d.get(ft.bottom)] >= 0 ? q++ : tt++;
2489
- }), Y > K && q > tt) for (var Et = 0; Et < d.size; Et++) m[Et] = -1 * m[Et], E[Et] = -1 * E[Et];
2490
- else if (Y > K) for (var vt = 0; vt < d.size; vt++) m[vt] = -1 * m[vt];
2491
- else if (q > tt) for (var it = 0; it < d.size; it++) E[it] = -1 * E[it];
2492
- }, h = function(M) {
2493
- var Y = [], K = new i(), q = /* @__PURE__ */ new Set(), tt = 0;
2494
- return M.forEach(function(Et, vt) {
2495
- if (!q.has(vt)) {
2496
- Y[tt] = [];
2497
- var it = vt;
2498
- for (K.push(it), q.add(it), Y[tt].push(it); K.length != 0; ) it = K.shift(), M.get(it).forEach(function(ft) {
2499
- q.has(ft.id) || (K.push(ft.id), q.add(ft.id), Y[tt].push(ft.id));
2500
- });
2501
- tt++;
2502
- }
2503
- }), Y;
2504
- }, T = function(M) {
2505
- var Y = /* @__PURE__ */ new Map();
2506
- return M.forEach(function(K, q) {
2507
- Y.set(q, []);
2508
- }), M.forEach(function(K, q) {
2509
- K.forEach(function(tt) {
2510
- Y.get(q).push(tt), Y.get(tt.id).push({
2511
- id: q,
2512
- gap: tt.gap,
2513
- direction: tt.direction
2514
- });
2515
- });
2516
- }), Y;
2517
- }, u = function(M) {
2518
- var Y = /* @__PURE__ */ new Map();
2519
- return M.forEach(function(K, q) {
2520
- Y.set(q, []);
2521
- }), M.forEach(function(K, q) {
2522
- K.forEach(function(tt) {
2523
- Y.get(tt.id).push({
2524
- id: q,
2525
- gap: tt.gap,
2526
- direction: tt.direction
2527
- });
2528
- });
2529
- }), Y;
2530
- }, v = [], y = [], w = !1, I = !1, F = /* @__PURE__ */ new Set(), P = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), H = [];
2531
- if (l.fixedNodeConstraint && l.fixedNodeConstraint.forEach(function(M) {
2532
- F.add(M.nodeId);
2533
- }), l.relativePlacementConstraint && (l.relativePlacementConstraint.forEach(function(M) {
2534
- M.left ? (P.has(M.left) ? P.get(M.left).push({
2535
- id: M.right,
2536
- gap: M.gap,
2537
- direction: "horizontal"
2538
- }) : P.set(M.left, [{
2539
- id: M.right,
2540
- gap: M.gap,
2541
- direction: "horizontal"
2542
- }]), P.has(M.right) || P.set(M.right, [])) : (P.has(M.top) ? P.get(M.top).push({
2543
- id: M.bottom,
2544
- gap: M.gap,
2545
- direction: "vertical"
2546
- }) : P.set(M.top, [{
2547
- id: M.bottom,
2548
- gap: M.gap,
2549
- direction: "vertical"
2550
- }]), P.has(M.bottom) || P.set(M.bottom, []));
2551
- }), b = T(P), H = h(b)), s.TRANSFORM_ON_CONSTRAINT_HANDLING) {
2552
- if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 1) l.fixedNodeConstraint.forEach(function(M, Y) {
2553
- v[Y] = [M.position.x, M.position.y], y[Y] = [m[d.get(M.nodeId)], E[d.get(M.nodeId)]];
2554
- }), w = !0;
2555
- else if (l.alignmentConstraint) (function() {
2556
- var M = 0;
2557
- if (l.alignmentConstraint.vertical) {
2558
- for (var Y = l.alignmentConstraint.vertical, K = function(it) {
2559
- var ft = /* @__PURE__ */ new Set();
2560
- Y[it].forEach(function(mt) {
2561
- ft.add(mt);
2562
- });
2563
- var It = new Set([].concat(e(ft)).filter(function(mt) {
2564
- return F.has(mt);
2565
- })), Ct = void 0;
2566
- Ct = It.size > 0 ? m[d.get(It.values().next().value)] : $(ft).x, Y[it].forEach(function(mt) {
2567
- v[M] = [Ct, E[d.get(mt)]], y[M] = [m[d.get(mt)], E[d.get(mt)]], M++;
2568
- });
2569
- }, q = 0; q < Y.length; q++) K(q);
2570
- w = !0;
2571
- }
2572
- if (l.alignmentConstraint.horizontal) {
2573
- for (var tt = l.alignmentConstraint.horizontal, Et = function(it) {
2574
- var ft = /* @__PURE__ */ new Set();
2575
- tt[it].forEach(function(mt) {
2576
- ft.add(mt);
2577
- });
2578
- var It = new Set([].concat(e(ft)).filter(function(mt) {
2579
- return F.has(mt);
2580
- })), Ct = void 0;
2581
- Ct = It.size > 0 ? m[d.get(It.values().next().value)] : $(ft).y, tt[it].forEach(function(mt) {
2582
- v[M] = [m[d.get(mt)], Ct], y[M] = [m[d.get(mt)], E[d.get(mt)]], M++;
2583
- });
2584
- }, vt = 0; vt < tt.length; vt++) Et(vt);
2585
- w = !0;
2586
- }
2587
- l.relativePlacementConstraint && (I = !0);
2588
- })();
2589
- else if (l.relativePlacementConstraint) {
2590
- for (var W = 0, J = 0, k = 0; k < H.length; k++) H[k].length > W && (W = H[k].length, J = k);
2591
- if (W < b.size / 2) Z(l.relativePlacementConstraint), w = !1, I = !1;
2592
- else {
2593
- var z = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), B = [];
2594
- H[J].forEach(function(M) {
2595
- P.get(M).forEach(function(Y) {
2596
- Y.direction == "horizontal" ? (z.has(M) ? z.get(M).push(Y) : z.set(M, [Y]), z.has(Y.id) || z.set(Y.id, []), B.push({
2597
- left: M,
2598
- right: Y.id
2599
- })) : (D.has(M) ? D.get(M).push(Y) : D.set(M, [Y]), D.has(Y.id) || D.set(Y.id, []), B.push({
2600
- top: M,
2601
- bottom: Y.id
2602
- }));
2603
- });
2604
- }), Z(B), I = !1;
2605
- var et = _(z, "horizontal"), U = _(D, "vertical");
2606
- H[J].forEach(function(M, Y) {
2607
- y[Y] = [m[d.get(M)], E[d.get(M)]], v[Y] = [], et.has(M) ? v[Y][0] = et.get(M) : v[Y][0] = m[d.get(M)], U.has(M) ? v[Y][1] = U.get(M) : v[Y][1] = E[d.get(M)];
2608
- }), w = !0;
2609
- }
2610
- }
2611
- if (w) {
2612
- for (var V = void 0, dt = p.transpose(v), st = p.transpose(y), wt = 0; wt < dt.length; wt++) dt[wt] = p.multGamma(dt[wt]), st[wt] = p.multGamma(st[wt]);
2613
- var j = p.multMat(dt, p.transpose(st)), pt = r.svd(j);
2614
- V = p.multMat(pt.V, p.transpose(pt.U));
2615
- for (var yt = 0; yt < d.size; yt++) {
2616
- var Bt = [m[yt], E[yt]], Yt = [V[0][0], V[1][0]], Mt = [V[0][1], V[1][1]];
2617
- m[yt] = p.dotProduct(Bt, Yt), E[yt] = p.dotProduct(Bt, Mt);
2618
- }
2619
- I && Z(l.relativePlacementConstraint);
2620
- }
2621
- }
2622
- if (s.ENFORCE_CONSTRAINTS) {
2623
- if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 0) {
2624
- var xt = {
2625
- x: 0,
2626
- y: 0
2627
- };
2628
- l.fixedNodeConstraint.forEach(function(M, Y) {
2629
- var K = {
2630
- x: m[d.get(M.nodeId)],
2631
- y: E[d.get(M.nodeId)]
2632
- }, q = M.position, tt = X(q, K);
2633
- xt.x += tt.x, xt.y += tt.y;
2634
- }), xt.x /= l.fixedNodeConstraint.length, xt.y /= l.fixedNodeConstraint.length, m.forEach(function(M, Y) {
2635
- m[Y] += xt.x;
2636
- }), E.forEach(function(M, Y) {
2637
- E[Y] += xt.y;
2638
- }), l.fixedNodeConstraint.forEach(function(M) {
2639
- m[d.get(M.nodeId)] = M.position.x, E[d.get(M.nodeId)] = M.position.y;
2640
- });
2641
- }
2642
- if (l.alignmentConstraint) {
2643
- if (l.alignmentConstraint.vertical) for (var Ht = l.alignmentConstraint.vertical, Xt = function(M) {
2644
- var Y = /* @__PURE__ */ new Set();
2645
- Ht[M].forEach(function(tt) {
2646
- Y.add(tt);
2647
- });
2648
- var K = new Set([].concat(e(Y)).filter(function(tt) {
2649
- return F.has(tt);
2650
- })), q = void 0;
2651
- q = K.size > 0 ? m[d.get(K.values().next().value)] : $(Y).x, Y.forEach(function(tt) {
2652
- F.has(tt) || (m[d.get(tt)] = q);
2653
- });
2654
- }, Rt = 0; Rt < Ht.length; Rt++) Xt(Rt);
2655
- if (l.alignmentConstraint.horizontal) for (var Vt = l.alignmentConstraint.horizontal, Pt = function(M) {
2656
- var Y = /* @__PURE__ */ new Set();
2657
- Vt[M].forEach(function(tt) {
2658
- Y.add(tt);
2659
- });
2660
- var K = new Set([].concat(e(Y)).filter(function(tt) {
2661
- return F.has(tt);
2662
- })), q = void 0;
2663
- q = K.size > 0 ? E[d.get(K.values().next().value)] : $(Y).y, Y.forEach(function(tt) {
2664
- F.has(tt) || (E[d.get(tt)] = q);
2665
- });
2666
- }, ht = 0; ht < Vt.length; ht++) Pt(ht);
2667
- }
2668
- l.relativePlacementConstraint && (function() {
2669
- var M = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), Et = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Set(), it = /* @__PURE__ */ new Set();
2670
- if (F.forEach(function(at) {
2671
- vt.add(at), it.add(at);
2672
- }), l.alignmentConstraint) {
2673
- if (l.alignmentConstraint.vertical) for (var ft = l.alignmentConstraint.vertical, It = function(at) {
2674
- K.set("dummy" + at, []), ft[at].forEach(function(At) {
2675
- M.set(At, "dummy" + at), K.get("dummy" + at).push(At), F.has(At) && vt.add("dummy" + at);
2676
- }), tt.set("dummy" + at, m[d.get(ft[at][0])]);
2677
- }, Ct = 0; Ct < ft.length; Ct++) It(Ct);
2678
- if (l.alignmentConstraint.horizontal) for (var mt = l.alignmentConstraint.horizontal, lt = function(at) {
2679
- q.set("dummy" + at, []), mt[at].forEach(function(At) {
2680
- Y.set(At, "dummy" + at), q.get("dummy" + at).push(At), F.has(At) && it.add("dummy" + at);
2681
- }), Et.set("dummy" + at, E[d.get(mt[at][0])]);
2682
- }, gt = 0; gt < mt.length; gt++) lt(gt);
2683
- }
2684
- var Q = /* @__PURE__ */ new Map(), ut = /* @__PURE__ */ new Map(), Lt = function(at) {
2685
- P.get(at).forEach(function(At) {
2686
- var kt = void 0, zt = void 0;
2687
- At.direction == "horizontal" ? (kt = M.get(at) ? M.get(at) : at, zt = M.get(At.id) ? {
2688
- id: M.get(At.id),
2689
- gap: At.gap,
2690
- direction: At.direction
2691
- } : At, Q.has(kt) ? Q.get(kt).push(zt) : Q.set(kt, [zt]), Q.has(zt.id) || Q.set(zt.id, [])) : (kt = Y.get(at) ? Y.get(at) : at, zt = Y.get(At.id) ? {
2692
- id: Y.get(At.id),
2693
- gap: At.gap,
2694
- direction: At.direction
2695
- } : At, ut.has(kt) ? ut.get(kt).push(zt) : ut.set(kt, [zt]), ut.has(zt.id) || ut.set(zt.id, []));
2696
- });
2697
- }, rt = !0, bt = !1, Ot = void 0;
2698
- try {
2699
- for (var Dt = P.keys()[Symbol.iterator](), Ft; !(rt = (Ft = Dt.next()).done); rt = !0) {
2700
- var Tt = Ft.value;
2701
- Lt(Tt);
2702
- }
2703
- } catch (at) {
2704
- bt = !0, Ot = at;
2705
- } finally {
2706
- try {
2707
- !rt && Dt.return && Dt.return();
2708
- } finally {
2709
- if (bt) throw Ot;
2710
- }
2711
- }
2712
- var Nt = T(Q), _t = T(ut), St = h(Nt), Ut = h(_t), ne = u(Q), ee = u(ut), qt = [], Zt = [];
2713
- St.forEach(function(at, At) {
2714
- qt[At] = [], at.forEach(function(kt) {
2715
- ne.get(kt).length == 0 && qt[At].push(kt);
2716
- });
2717
- }), Ut.forEach(function(at, At) {
2718
- Zt[At] = [], at.forEach(function(kt) {
2719
- ee.get(kt).length == 0 && Zt[At].push(kt);
2720
- });
2721
- });
2722
- var $t = _(Q, "horizontal", vt, tt, qt), Kt = _(ut, "vertical", it, Et, Zt), re = function(at) {
2723
- K.get(at) ? K.get(at).forEach(function(At) {
2724
- m[d.get(At)] = $t.get(at);
2725
- }) : m[d.get(at)] = $t.get(at);
2726
- }, jt = !0, ye = !1, ve = void 0;
2727
- try {
2728
- for (var ae = $t.keys()[Symbol.iterator](), Ee; !(jt = (Ee = ae.next()).done); jt = !0) {
2729
- var se = Ee.value;
2730
- re(se);
2731
- }
2732
- } catch (at) {
2733
- ye = !0, ve = at;
2734
- } finally {
2735
- try {
2736
- !jt && ae.return && ae.return();
2737
- } finally {
2738
- if (ye) throw ve;
2739
- }
2740
- }
2741
- var Ue = function(at) {
2742
- q.get(at) ? q.get(at).forEach(function(At) {
2743
- E[d.get(At)] = Kt.get(at);
2744
- }) : E[d.get(at)] = Kt.get(at);
2745
- }, he = !0, Te = !1, Ne = void 0;
2746
- try {
2747
- for (var le = Kt.keys()[Symbol.iterator](), Ae; !(he = (Ae = le.next()).done); he = !0) {
2748
- var se = Ae.value;
2749
- Ue(se);
2750
- }
2751
- } catch (at) {
2752
- Te = !0, Ne = at;
2753
- } finally {
2754
- try {
2755
- !he && le.return && le.return();
2756
- } finally {
2757
- if (Te) throw Ne;
2758
- }
2759
- }
2760
- })();
2761
- }
2762
- for (var ot = 0; ot < C.length; ot++) {
2763
- var ct = C[ot];
2764
- ct.getChild() ?? ct.setCenter(m[d.get(ct.id)], E[d.get(ct.id)]);
2765
- }
2766
- }, a.exports = n;
2767
- }),
2768
- 551: ((a) => {
2769
- a.exports = A;
2770
- })
2771
- }, N = {};
2772
- function f(a) {
2773
- var o = N[a];
2774
- if (o !== void 0) return o.exports;
2775
- var t = N[a] = { exports: {} };
2776
- return O[a](t, t.exports, f), t.exports;
2777
- }
2778
- return f(45);
2779
- })();
2780
- });
2781
- })), li = /* @__PURE__ */ oi((/* @__PURE__ */ pe(((x, L) => {
2782
- (function(A, O) {
2783
- typeof x == "object" && typeof L == "object" ? L.exports = O(Ce()) : typeof define == "function" && define.amd ? define(["cose-base"], O) : typeof x == "object" ? x.cytoscapeFcose = O(Ce()) : A.cytoscapeFcose = O(A.coseBase);
2784
- })(x, function(A) {
2785
- return (() => {
2786
- var O = {
2787
- 658: ((a) => {
2788
- a.exports = Object.assign == null ? function(o) {
2789
- return [...arguments].slice(1).forEach(function(t) {
2790
- Object.keys(t).forEach(function(e) {
2791
- return o[e] = t[e];
2792
- });
2793
- }), o;
2794
- } : Object.assign.bind(Object);
2795
- }),
2796
- 548: ((a, o, t) => {
2797
- var e = /* @__PURE__ */ (function() {
2798
- function p(r, n) {
2799
- var g = [], l = !0, c = !1, d = void 0;
2800
- try {
2801
- for (var m = r[Symbol.iterator](), E; !(l = (E = m.next()).done) && (g.push(E.value), !(n && g.length === n)); l = !0) ;
2802
- } catch (C) {
2803
- c = !0, d = C;
2804
- } finally {
2805
- try {
2806
- !l && m.return && m.return();
2807
- } finally {
2808
- if (c) throw d;
2809
- }
2810
- }
2811
- return g;
2812
- }
2813
- return function(r, n) {
2814
- if (Array.isArray(r)) return r;
2815
- if (Symbol.iterator in Object(r)) return p(r, n);
2816
- throw TypeError("Invalid attempt to destructure non-iterable instance");
2817
- };
2818
- })(), s = t(140).layoutBase.LinkedList, i = {};
2819
- i.getTopMostNodes = function(p) {
2820
- for (var r = {}, n = 0; n < p.length; n++) r[p[n].id()] = !0;
2821
- return p.filter(function(g, l) {
2822
- typeof g == "number" && (g = l);
2823
- for (var c = g.parent()[0]; c != null; ) {
2824
- if (r[c.id()]) return !1;
2825
- c = c.parent()[0];
2826
- }
2827
- return !0;
2828
- });
2829
- }, i.connectComponents = function(p, r, n, g) {
2830
- var l = new s(), c = /* @__PURE__ */ new Set(), d = [], m = void 0, E = void 0, C = void 0, R = !1, S = 1, G = [], X = [], $ = function() {
2831
- var _ = p.collection();
2832
- X.push(_);
2833
- var Z = n[0], h = p.collection();
2834
- h.merge(Z).merge(Z.descendants().intersection(r)), d.push(Z), h.forEach(function(v) {
2835
- l.push(v), c.add(v), _.merge(v);
2836
- });
2837
- for (var T = function() {
2838
- Z = l.shift();
2839
- var v = p.collection();
2840
- Z.neighborhood().nodes().forEach(function(I) {
2841
- r.intersection(Z.edgesWith(I)).length > 0 && v.merge(I);
2842
- });
2843
- for (var y = 0; y < v.length; y++) {
2844
- var w = v[y];
2845
- m = n.intersection(w.union(w.ancestors())), m != null && !c.has(m[0]) && m.union(m.descendants()).forEach(function(I) {
2846
- l.push(I), c.add(I), _.merge(I), n.has(I) && d.push(I);
2847
- });
2848
- }
2849
- }; l.length != 0; ) T();
2850
- if (_.forEach(function(v) {
2851
- r.intersection(v.connectedEdges()).forEach(function(y) {
2852
- _.has(y.source()) && _.has(y.target()) && _.merge(y);
2853
- });
2854
- }), d.length == n.length && (R = !0), !R || R && S > 1) {
2855
- E = d[0], C = E.connectedEdges().length, d.forEach(function(v) {
2856
- v.connectedEdges().length < C && (C = v.connectedEdges().length, E = v);
2857
- }), G.push(E.id());
2858
- var u = p.collection();
2859
- u.merge(d[0]), d.forEach(function(v) {
2860
- u.merge(v);
2861
- }), d = [], n = n.difference(u), S++;
2862
- }
2863
- };
2864
- do
2865
- $();
2866
- while (!R);
2867
- return g && G.length > 0 && g.set("dummy" + (g.size + 1), G), X;
2868
- }, i.relocateComponent = function(p, r, n) {
2869
- if (!n.fixedNodeConstraint) {
2870
- var g = 1 / 0, l = -1 / 0, c = 1 / 0, d = -1 / 0;
2871
- if (n.quality == "draft") {
2872
- var m = !0, E = !1, C = void 0;
2873
- try {
2874
- for (var R = r.nodeIndexes[Symbol.iterator](), S; !(m = (S = R.next()).done); m = !0) {
2875
- var G = S.value, X = e(G, 2), $ = X[0], _ = X[1], Z = n.cy.getElementById($);
2876
- if (Z) {
2877
- var h = Z.boundingBox(), T = r.xCoords[_] - h.w / 2, u = r.xCoords[_] + h.w / 2, v = r.yCoords[_] - h.h / 2, y = r.yCoords[_] + h.h / 2;
2878
- T < g && (g = T), u > l && (l = u), v < c && (c = v), y > d && (d = y);
2879
- }
2880
- }
2881
- } catch (b) {
2882
- E = !0, C = b;
2883
- } finally {
2884
- try {
2885
- !m && R.return && R.return();
2886
- } finally {
2887
- if (E) throw C;
2888
- }
2889
- }
2890
- var w = p.x - (l + g) / 2, I = p.y - (d + c) / 2;
2891
- r.xCoords = r.xCoords.map(function(b) {
2892
- return b + w;
2893
- }), r.yCoords = r.yCoords.map(function(b) {
2894
- return b + I;
2895
- });
2896
- } else {
2897
- Object.keys(r).forEach(function(b) {
2898
- var H = r[b], W = H.getRect().x, J = H.getRect().x + H.getRect().width, k = H.getRect().y, z = H.getRect().y + H.getRect().height;
2899
- W < g && (g = W), J > l && (l = J), k < c && (c = k), z > d && (d = z);
2900
- });
2901
- var F = p.x - (l + g) / 2, P = p.y - (d + c) / 2;
2902
- Object.keys(r).forEach(function(b) {
2903
- var H = r[b];
2904
- H.setCenter(H.getCenterX() + F, H.getCenterY() + P);
2905
- });
2906
- }
2907
- }
2908
- }, i.calcBoundingBox = function(p, r, n, g) {
2909
- for (var l = 9007199254740991, c = -9007199254740991, d = 9007199254740991, m = -9007199254740991, E = void 0, C = void 0, R = void 0, S = void 0, G = p.descendants().not(":parent"), X = G.length, $ = 0; $ < X; $++) {
2910
- var _ = G[$];
2911
- E = r[g.get(_.id())] - _.width() / 2, C = r[g.get(_.id())] + _.width() / 2, R = n[g.get(_.id())] - _.height() / 2, S = n[g.get(_.id())] + _.height() / 2, l > E && (l = E), c < C && (c = C), d > R && (d = R), m < S && (m = S);
2912
- }
2913
- var Z = {};
2914
- return Z.topLeftX = l, Z.topLeftY = d, Z.width = c - l, Z.height = m - d, Z;
2915
- }, i.calcParentsWithoutChildren = function(p, r) {
2916
- var n = p.collection();
2917
- return r.nodes(":parent").forEach(function(g) {
2918
- var l = !1;
2919
- g.children().forEach(function(c) {
2920
- c.css("display") != "none" && (l = !0);
2921
- }), l || n.merge(g);
2922
- }), n;
2923
- }, a.exports = i;
2924
- }),
2925
- 816: ((a, o, t) => {
2926
- var e = t(548), s = t(140).CoSELayout, i = t(140).CoSENode, p = t(140).layoutBase.PointD, r = t(140).layoutBase.DimensionD, n = t(140).layoutBase.LayoutConstants, g = t(140).layoutBase.FDLayoutConstants, l = t(140).CoSEConstants;
2927
- a.exports = { coseLayout: function(c, d) {
2928
- var m = c.cy, E = c.eles, C = E.nodes(), R = E.edges(), S = void 0, G = void 0, X = void 0, $ = {};
2929
- c.randomize && (S = d.nodeIndexes, G = d.xCoords, X = d.yCoords);
2930
- var _ = function(I) {
2931
- return typeof I == "function";
2932
- }, Z = function(I, F) {
2933
- return _(I) ? I(F) : I;
2934
- }, h = e.calcParentsWithoutChildren(m, E), T = function I(F, P, b, H) {
2935
- for (var W = P.length, J = 0; J < W; J++) {
2936
- var k = P[J], z = null;
2937
- k.intersection(h).length == 0 && (z = k.children());
2938
- var D = void 0, B = k.layoutDimensions({ nodeDimensionsIncludeLabels: H.nodeDimensionsIncludeLabels });
2939
- if (k.outerWidth() != null && k.outerHeight() != null)
2940
- if (H.randomize)
2941
- if (!k.isParent()) D = F.add(new i(b.graphManager, new p(G[S.get(k.id())] - B.w / 2, X[S.get(k.id())] - B.h / 2), new r(parseFloat(B.w), parseFloat(B.h))));
2942
- else {
2943
- var et = e.calcBoundingBox(k, G, X, S);
2944
- D = k.intersection(h).length == 0 ? F.add(new i(b.graphManager, new p(et.topLeftX, et.topLeftY), new r(et.width, et.height))) : F.add(new i(b.graphManager, new p(et.topLeftX, et.topLeftY), new r(parseFloat(B.w), parseFloat(B.h))));
2945
- }
2946
- else D = F.add(new i(b.graphManager, new p(k.position("x") - B.w / 2, k.position("y") - B.h / 2), new r(parseFloat(B.w), parseFloat(B.h))));
2947
- else D = F.add(new i(this.graphManager));
2948
- if (D.id = k.data("id"), D.nodeRepulsion = Z(H.nodeRepulsion, k), D.paddingLeft = parseInt(k.css("padding")), D.paddingTop = parseInt(k.css("padding")), D.paddingRight = parseInt(k.css("padding")), D.paddingBottom = parseInt(k.css("padding")), H.nodeDimensionsIncludeLabels && (D.labelWidth = k.boundingBox({
2949
- includeLabels: !0,
2950
- includeNodes: !1,
2951
- includeOverlays: !1
2952
- }).w, D.labelHeight = k.boundingBox({
2953
- includeLabels: !0,
2954
- includeNodes: !1,
2955
- includeOverlays: !1
2956
- }).h, D.labelPosVertical = k.css("text-valign"), D.labelPosHorizontal = k.css("text-halign")), $[k.data("id")] = D, isNaN(D.rect.x) && (D.rect.x = 0), isNaN(D.rect.y) && (D.rect.y = 0), z != null && z.length > 0) {
2957
- var U = void 0;
2958
- U = b.getGraphManager().add(b.newGraph(), D), I(U, z, b, H);
2959
- }
2960
- }
2961
- }, u = function(I, F, P) {
2962
- for (var b = 0, H = 0, W = 0; W < P.length; W++) {
2963
- var J = P[W], k = $[J.data("source")], z = $[J.data("target")];
2964
- if (k && z && k !== z && k.getEdgesBetween(z).length == 0) {
2965
- var D = F.add(I.newEdge(), k, z);
2966
- D.id = J.id(), D.idealLength = Z(c.idealEdgeLength, J), D.edgeElasticity = Z(c.edgeElasticity, J), b += D.idealLength, H++;
2967
- }
2968
- }
2969
- c.idealEdgeLength != null && (l.DEFAULT_EDGE_LENGTH = g.DEFAULT_EDGE_LENGTH = H > 0 ? b / H : _(c.idealEdgeLength) ? 50 : c.idealEdgeLength, l.MIN_REPULSION_DIST = g.MIN_REPULSION_DIST = g.DEFAULT_EDGE_LENGTH / 10, l.DEFAULT_RADIAL_SEPARATION = g.DEFAULT_EDGE_LENGTH);
2970
- }, v = function(I, F) {
2971
- F.fixedNodeConstraint && (I.constraints.fixedNodeConstraint = F.fixedNodeConstraint), F.alignmentConstraint && (I.constraints.alignmentConstraint = F.alignmentConstraint), F.relativePlacementConstraint && (I.constraints.relativePlacementConstraint = F.relativePlacementConstraint);
2972
- };
2973
- c.nestingFactor != null && (l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = c.nestingFactor), c.gravity != null && (l.DEFAULT_GRAVITY_STRENGTH = g.DEFAULT_GRAVITY_STRENGTH = c.gravity), c.numIter != null && (l.MAX_ITERATIONS = g.MAX_ITERATIONS = c.numIter), c.gravityRange != null && (l.DEFAULT_GRAVITY_RANGE_FACTOR = g.DEFAULT_GRAVITY_RANGE_FACTOR = c.gravityRange), c.gravityCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_STRENGTH = g.DEFAULT_COMPOUND_GRAVITY_STRENGTH = c.gravityCompound), c.gravityRangeCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = c.gravityRangeCompound), c.initialEnergyOnIncremental != null && (l.DEFAULT_COOLING_FACTOR_INCREMENTAL = g.DEFAULT_COOLING_FACTOR_INCREMENTAL = c.initialEnergyOnIncremental), c.tilingCompareBy != null && (l.TILING_COMPARE_BY = c.tilingCompareBy), n.QUALITY = c.quality == "proof" ? 2 : 0, l.NODE_DIMENSIONS_INCLUDE_LABELS = g.NODE_DIMENSIONS_INCLUDE_LABELS = n.NODE_DIMENSIONS_INCLUDE_LABELS = c.nodeDimensionsIncludeLabels, l.DEFAULT_INCREMENTAL = g.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = !c.randomize, l.ANIMATE = g.ANIMATE = n.ANIMATE = c.animate, l.TILE = c.tile, l.TILING_PADDING_VERTICAL = typeof c.tilingPaddingVertical == "function" ? c.tilingPaddingVertical.call() : c.tilingPaddingVertical, l.TILING_PADDING_HORIZONTAL = typeof c.tilingPaddingHorizontal == "function" ? c.tilingPaddingHorizontal.call() : c.tilingPaddingHorizontal, l.DEFAULT_INCREMENTAL = g.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = !0, l.PURE_INCREMENTAL = !c.randomize, n.DEFAULT_UNIFORM_LEAF_NODE_SIZES = c.uniformNodeDimensions, c.step == "transformed" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !1), c.step == "enforced" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !1), c.step == "cose" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !0), c.step == "all" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !!c.randomize, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !0), l.TREE_REDUCTION_ON_INCREMENTAL = !(c.fixedNodeConstraint || c.alignmentConstraint || c.relativePlacementConstraint);
2974
- var y = new s(), w = y.newGraphManager();
2975
- return T(w.addRoot(), e.getTopMostNodes(C), y, c), u(y, w, R), v(y, c), y.runLayout(), $;
2976
- } };
2977
- }),
2978
- 212: ((a, o, t) => {
2979
- var e = /* @__PURE__ */ (function() {
2980
- function l(c, d) {
2981
- for (var m = 0; m < d.length; m++) {
2982
- var E = d[m];
2983
- E.enumerable = E.enumerable || !1, E.configurable = !0, "value" in E && (E.writable = !0), Object.defineProperty(c, E.key, E);
2984
- }
2985
- }
2986
- return function(c, d, m) {
2987
- return d && l(c.prototype, d), m && l(c, m), c;
2988
- };
2989
- })();
2990
- function s(l, c) {
2991
- if (!(l instanceof c)) throw TypeError("Cannot call a class as a function");
2992
- }
2993
- var i = t(658), p = t(548), r = t(657).spectralLayout, n = t(816).coseLayout, g = Object.freeze({
2994
- quality: "default",
2995
- randomize: !0,
2996
- animate: !0,
2997
- animationDuration: 1e3,
2998
- animationEasing: void 0,
2999
- fit: !0,
3000
- padding: 30,
3001
- nodeDimensionsIncludeLabels: !1,
3002
- uniformNodeDimensions: !1,
3003
- packComponents: !0,
3004
- step: "all",
3005
- samplingType: !0,
3006
- sampleSize: 25,
3007
- nodeSeparation: 75,
3008
- piTol: 1e-7,
3009
- nodeRepulsion: function(l) {
3010
- return 4500;
3011
- },
3012
- idealEdgeLength: function(l) {
3013
- return 50;
3014
- },
3015
- edgeElasticity: function(l) {
3016
- return 0.45;
3017
- },
3018
- nestingFactor: 0.1,
3019
- gravity: 0.25,
3020
- numIter: 2500,
3021
- tile: !0,
3022
- tilingCompareBy: void 0,
3023
- tilingPaddingVertical: 10,
3024
- tilingPaddingHorizontal: 10,
3025
- gravityRangeCompound: 1.5,
3026
- gravityCompound: 1,
3027
- gravityRange: 3.8,
3028
- initialEnergyOnIncremental: 0.3,
3029
- fixedNodeConstraint: void 0,
3030
- alignmentConstraint: void 0,
3031
- relativePlacementConstraint: void 0,
3032
- ready: function() {
3033
- },
3034
- stop: function() {
3035
- }
3036
- });
3037
- a.exports = (function() {
3038
- function l(c) {
3039
- s(this, l), this.options = i({}, g, c);
3040
- }
3041
- return e(l, [{
3042
- key: "run",
3043
- value: function() {
3044
- var c = this, d = this.options, m = d.cy, E = d.eles, C = [], R = [], S = void 0, G = [];
3045
- d.fixedNodeConstraint && (!Array.isArray(d.fixedNodeConstraint) || d.fixedNodeConstraint.length == 0) && (d.fixedNodeConstraint = void 0), d.alignmentConstraint && (d.alignmentConstraint.vertical && (!Array.isArray(d.alignmentConstraint.vertical) || d.alignmentConstraint.vertical.length == 0) && (d.alignmentConstraint.vertical = void 0), d.alignmentConstraint.horizontal && (!Array.isArray(d.alignmentConstraint.horizontal) || d.alignmentConstraint.horizontal.length == 0) && (d.alignmentConstraint.horizontal = void 0)), d.relativePlacementConstraint && (!Array.isArray(d.relativePlacementConstraint) || d.relativePlacementConstraint.length == 0) && (d.relativePlacementConstraint = void 0), (d.fixedNodeConstraint || d.alignmentConstraint || d.relativePlacementConstraint) && (d.tile = !1, d.packComponents = !1);
3046
- var X = void 0, $ = !1;
3047
- if (m.layoutUtilities && d.packComponents && (X = m.layoutUtilities("get"), X ||= m.layoutUtilities(), $ = !0), E.nodes().length > 0)
3048
- if ($) {
3049
- var _ = p.getTopMostNodes(d.eles.nodes());
3050
- if (S = p.connectComponents(m, d.eles, _), S.forEach(function(U) {
3051
- var V = U.boundingBox();
3052
- G.push({
3053
- x: V.x1 + V.w / 2,
3054
- y: V.y1 + V.h / 2
3055
- });
3056
- }), d.randomize && S.forEach(function(U) {
3057
- d.eles = U, C.push(r(d));
3058
- }), d.quality == "default" || d.quality == "proof") {
3059
- var Z = m.collection();
3060
- if (d.tile) {
3061
- var h = /* @__PURE__ */ new Map(), T = [], u = [], v = 0, y = {
3062
- nodeIndexes: h,
3063
- xCoords: T,
3064
- yCoords: u
3065
- }, w = [];
3066
- if (S.forEach(function(U, V) {
3067
- U.edges().length == 0 && (U.nodes().forEach(function(dt, st) {
3068
- Z.merge(U.nodes()[st]), dt.isParent() || (y.nodeIndexes.set(U.nodes()[st].id(), v++), y.xCoords.push(U.nodes()[0].position().x), y.yCoords.push(U.nodes()[0].position().y));
3069
- }), w.push(V));
3070
- }), Z.length > 1) {
3071
- var I = Z.boundingBox();
3072
- G.push({
3073
- x: I.x1 + I.w / 2,
3074
- y: I.y1 + I.h / 2
3075
- }), S.push(Z), C.push(y);
3076
- for (var F = w.length - 1; F >= 0; F--) S.splice(w[F], 1), C.splice(w[F], 1), G.splice(w[F], 1);
3077
- }
3078
- }
3079
- S.forEach(function(U, V) {
3080
- d.eles = U, R.push(n(d, C[V])), p.relocateComponent(G[V], R[V], d);
3081
- });
3082
- } else S.forEach(function(U, V) {
3083
- p.relocateComponent(G[V], C[V], d);
3084
- });
3085
- var P = /* @__PURE__ */ new Set();
3086
- if (S.length > 1) {
3087
- var b = [], H = E.filter(function(U) {
3088
- return U.css("display") == "none";
3089
- });
3090
- S.forEach(function(U, V) {
3091
- var dt = void 0;
3092
- if (d.quality == "draft" && (dt = C[V].nodeIndexes), U.nodes().not(H).length > 0) {
3093
- var st = {};
3094
- st.edges = [], st.nodes = [];
3095
- var wt = void 0;
3096
- U.nodes().not(H).forEach(function(j) {
3097
- if (d.quality == "draft")
3098
- if (!j.isParent()) wt = dt.get(j.id()), st.nodes.push({
3099
- x: C[V].xCoords[wt] - j.boundingbox().w / 2,
3100
- y: C[V].yCoords[wt] - j.boundingbox().h / 2,
3101
- width: j.boundingbox().w,
3102
- height: j.boundingbox().h
3103
- });
3104
- else {
3105
- var pt = p.calcBoundingBox(j, C[V].xCoords, C[V].yCoords, dt);
3106
- st.nodes.push({
3107
- x: pt.topLeftX,
3108
- y: pt.topLeftY,
3109
- width: pt.width,
3110
- height: pt.height
3111
- });
3112
- }
3113
- else R[V][j.id()] && st.nodes.push({
3114
- x: R[V][j.id()].getLeft(),
3115
- y: R[V][j.id()].getTop(),
3116
- width: R[V][j.id()].getWidth(),
3117
- height: R[V][j.id()].getHeight()
3118
- });
3119
- }), U.edges().forEach(function(j) {
3120
- var pt = j.source(), yt = j.target();
3121
- if (pt.css("display") != "none" && yt.css("display") != "none")
3122
- if (d.quality == "draft") {
3123
- var Bt = dt.get(pt.id()), Yt = dt.get(yt.id()), Mt = [], xt = [];
3124
- if (pt.isParent()) {
3125
- var Ht = p.calcBoundingBox(pt, C[V].xCoords, C[V].yCoords, dt);
3126
- Mt.push(Ht.topLeftX + Ht.width / 2), Mt.push(Ht.topLeftY + Ht.height / 2);
3127
- } else Mt.push(C[V].xCoords[Bt]), Mt.push(C[V].yCoords[Bt]);
3128
- if (yt.isParent()) {
3129
- var Xt = p.calcBoundingBox(yt, C[V].xCoords, C[V].yCoords, dt);
3130
- xt.push(Xt.topLeftX + Xt.width / 2), xt.push(Xt.topLeftY + Xt.height / 2);
3131
- } else xt.push(C[V].xCoords[Yt]), xt.push(C[V].yCoords[Yt]);
3132
- st.edges.push({
3133
- startX: Mt[0],
3134
- startY: Mt[1],
3135
- endX: xt[0],
3136
- endY: xt[1]
3137
- });
3138
- } else R[V][pt.id()] && R[V][yt.id()] && st.edges.push({
3139
- startX: R[V][pt.id()].getCenterX(),
3140
- startY: R[V][pt.id()].getCenterY(),
3141
- endX: R[V][yt.id()].getCenterX(),
3142
- endY: R[V][yt.id()].getCenterY()
3143
- });
3144
- }), st.nodes.length > 0 && (b.push(st), P.add(V));
3145
- }
3146
- });
3147
- var W = X.packComponents(b, d.randomize).shifts;
3148
- if (d.quality == "draft") C.forEach(function(U, V) {
3149
- var dt = U.xCoords.map(function(wt) {
3150
- return wt + W[V].dx;
3151
- }), st = U.yCoords.map(function(wt) {
3152
- return wt + W[V].dy;
3153
- });
3154
- U.xCoords = dt, U.yCoords = st;
3155
- });
3156
- else {
3157
- var J = 0;
3158
- P.forEach(function(U) {
3159
- Object.keys(R[U]).forEach(function(V) {
3160
- var dt = R[U][V];
3161
- dt.setCenter(dt.getCenterX() + W[J].dx, dt.getCenterY() + W[J].dy);
3162
- }), J++;
3163
- });
3164
- }
3165
- }
3166
- } else {
3167
- var k = d.eles.boundingBox();
3168
- if (G.push({
3169
- x: k.x1 + k.w / 2,
3170
- y: k.y1 + k.h / 2
3171
- }), d.randomize) {
3172
- var z = r(d);
3173
- C.push(z);
3174
- }
3175
- d.quality == "default" || d.quality == "proof" ? (R.push(n(d, C[0])), p.relocateComponent(G[0], R[0], d)) : p.relocateComponent(G[0], C[0], d);
3176
- }
3177
- var D = function(U, V) {
3178
- if (d.quality == "default" || d.quality == "proof") {
3179
- typeof U == "number" && (U = V);
3180
- var dt = void 0, st = void 0, wt = U.data("id");
3181
- return R.forEach(function(pt) {
3182
- wt in pt && (dt = {
3183
- x: pt[wt].getRect().getCenterX(),
3184
- y: pt[wt].getRect().getCenterY()
3185
- }, st = pt[wt]);
3186
- }), d.nodeDimensionsIncludeLabels && (st.labelWidth && (st.labelPosHorizontal == "left" ? dt.x += st.labelWidth / 2 : st.labelPosHorizontal == "right" && (dt.x -= st.labelWidth / 2)), st.labelHeight && (st.labelPosVertical == "top" ? dt.y += st.labelHeight / 2 : st.labelPosVertical == "bottom" && (dt.y -= st.labelHeight / 2))), dt ??= {
3187
- x: U.position("x"),
3188
- y: U.position("y")
3189
- }, {
3190
- x: dt.x,
3191
- y: dt.y
3192
- };
3193
- }
3194
- var j = void 0;
3195
- return C.forEach(function(pt) {
3196
- var yt = pt.nodeIndexes.get(U.id());
3197
- yt != null && (j = {
3198
- x: pt.xCoords[yt],
3199
- y: pt.yCoords[yt]
3200
- });
3201
- }), j ??= {
3202
- x: U.position("x"),
3203
- y: U.position("y")
3204
- }, {
3205
- x: j.x,
3206
- y: j.y
3207
- };
3208
- };
3209
- if (d.quality == "default" || d.quality == "proof" || d.randomize) {
3210
- var B = p.calcParentsWithoutChildren(m, E), et = E.filter(function(U) {
3211
- return U.css("display") == "none";
3212
- });
3213
- d.eles = E.not(et), E.nodes().not(":parent").not(et).layoutPositions(c, d, D), B.length > 0 && B.forEach(function(U) {
3214
- U.position(D(U));
3215
- });
3216
- } else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
3217
- }
3218
- }]), l;
3219
- })();
3220
- }),
3221
- 657: ((a, o, t) => {
3222
- var e = t(548), s = t(140).layoutBase.Matrix, i = t(140).layoutBase.SVD;
3223
- a.exports = { spectralLayout: function(p) {
3224
- var r = p.cy, n = p.eles, g = n.nodes(), l = n.nodes(":parent"), c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), E = [], C = [], R = [], S = [], G = [], X = [], $ = [], _ = [], Z = void 0, h = 1e8, T = 1e-9, u = p.piTol, v = p.samplingType, y = p.nodeSeparation, w = void 0, I = function() {
3225
- for (var ht = 0, ot = 0, ct = !1; ot < w; ) {
3226
- ht = Math.floor(Math.random() * Z), ct = !1;
3227
- for (var M = 0; M < ot; M++) if (S[M] == ht) {
3228
- ct = !0;
3229
- break;
3230
- }
3231
- if (!ct) S[ot] = ht, ot++;
3232
- else continue;
3233
- }
3234
- }, F = function(ht, ot, ct) {
3235
- for (var M = [], Y = 0, K = 0, q = 0, tt = void 0, Et = [], vt = 0, it = 1, ft = 0; ft < Z; ft++) Et[ft] = h;
3236
- for (M[K] = ht, Et[ht] = 0; K >= Y; ) {
3237
- q = M[Y++];
3238
- for (var It = E[q], Ct = 0; Ct < It.length; Ct++) tt = d.get(It[Ct]), Et[tt] == h && (Et[tt] = Et[q] + 1, M[++K] = tt);
3239
- X[q][ot] = Et[q] * y;
3240
- }
3241
- if (ct) {
3242
- for (var mt = 0; mt < Z; mt++) X[mt][ot] < G[mt] && (G[mt] = X[mt][ot]);
3243
- for (var lt = 0; lt < Z; lt++) G[lt] > vt && (vt = G[lt], it = lt);
3244
- }
3245
- return it;
3246
- }, P = function(ht) {
3247
- var ot = void 0;
3248
- if (ht) {
3249
- ot = Math.floor(Math.random() * Z);
3250
- for (var ct = 0; ct < Z; ct++) G[ct] = h;
3251
- for (var M = 0; M < w; M++) S[M] = ot, ot = F(ot, M, ht);
3252
- } else {
3253
- I();
3254
- for (var Y = 0; Y < w; Y++) F(S[Y], Y, ht);
3255
- }
3256
- for (var K = 0; K < Z; K++) for (var q = 0; q < w; q++) X[K][q] *= X[K][q];
3257
- for (var tt = 0; tt < w; tt++) $[tt] = [];
3258
- for (var Et = 0; Et < w; Et++) for (var vt = 0; vt < w; vt++) $[Et][vt] = X[S[vt]][Et];
3259
- }, b = function() {
3260
- for (var ht = i.svd($), ot = ht.S, ct = ht.U, M = ht.V, Y = ot[0] * ot[0] * ot[0], K = [], q = 0; q < w; q++) {
3261
- K[q] = [];
3262
- for (var tt = 0; tt < w; tt++) K[q][tt] = 0, q == tt && (K[q][tt] = ot[q] / (ot[q] * ot[q] + Y / (ot[q] * ot[q])));
3263
- }
3264
- _ = s.multMat(s.multMat(M, K), s.transpose(ct));
3265
- }, H = function() {
3266
- for (var ht = void 0, ot = void 0, ct = [], M = [], Y = [], K = [], q = 0; q < Z; q++) ct[q] = Math.random(), M[q] = Math.random();
3267
- ct = s.normalize(ct), M = s.normalize(M);
3268
- for (var tt = 0, Et = T, vt = T, it = void 0; ; ) {
3269
- tt++;
3270
- for (var ft = 0; ft < Z; ft++) Y[ft] = ct[ft];
3271
- if (ct = s.multGamma(s.multL(s.multGamma(Y), X, _)), ht = s.dotProduct(Y, ct), ct = s.normalize(ct), Et = s.dotProduct(Y, ct), it = Math.abs(Et / vt), it <= 1 + u && it >= 1) break;
3272
- vt = Et;
3273
- }
3274
- for (var It = 0; It < Z; It++) Y[It] = ct[It];
3275
- for (tt = 0, vt = T; ; ) {
3276
- tt++;
3277
- for (var Ct = 0; Ct < Z; Ct++) K[Ct] = M[Ct];
3278
- if (K = s.minusOp(K, s.multCons(Y, s.dotProduct(Y, K))), M = s.multGamma(s.multL(s.multGamma(K), X, _)), ot = s.dotProduct(K, M), M = s.normalize(M), Et = s.dotProduct(K, M), it = Math.abs(Et / vt), it <= 1 + u && it >= 1) break;
3279
- vt = Et;
3280
- }
3281
- for (var mt = 0; mt < Z; mt++) K[mt] = M[mt];
3282
- C = s.multCons(Y, Math.sqrt(Math.abs(ht))), R = s.multCons(K, Math.sqrt(Math.abs(ot)));
3283
- };
3284
- e.connectComponents(r, n, e.getTopMostNodes(g), c), l.forEach(function(ht) {
3285
- e.connectComponents(r, n, e.getTopMostNodes(ht.descendants().intersection(n)), c);
3286
- });
3287
- for (var W = 0, J = 0; J < g.length; J++) g[J].isParent() || d.set(g[J].id(), W++);
3288
- var k = !0, z = !1, D = void 0;
3289
- try {
3290
- for (var B = c.keys()[Symbol.iterator](), et; !(k = (et = B.next()).done); k = !0) {
3291
- var U = et.value;
3292
- d.set(U, W++);
3293
- }
3294
- } catch (ht) {
3295
- z = !0, D = ht;
3296
- } finally {
3297
- try {
3298
- !k && B.return && B.return();
3299
- } finally {
3300
- if (z) throw D;
3301
- }
3302
- }
3303
- for (var V = 0; V < d.size; V++) E[V] = [];
3304
- l.forEach(function(ht) {
3305
- for (var ot = ht.children().intersection(n); ot.nodes(":childless").length == 0; ) ot = ot.nodes()[0].children().intersection(n);
3306
- var ct = 0, M = ot.nodes(":childless")[0].connectedEdges().length;
3307
- ot.nodes(":childless").forEach(function(Y, K) {
3308
- Y.connectedEdges().length < M && (M = Y.connectedEdges().length, ct = K);
3309
- }), m.set(ht.id(), ot.nodes(":childless")[ct].id());
3310
- }), g.forEach(function(ht) {
3311
- var ot = void 0;
3312
- ot = ht.isParent() ? d.get(m.get(ht.id())) : d.get(ht.id()), ht.neighborhood().nodes().forEach(function(ct) {
3313
- n.intersection(ht.edgesWith(ct)).length > 0 && (ct.isParent() ? E[ot].push(m.get(ct.id())) : E[ot].push(ct.id()));
3314
- });
3315
- });
3316
- var dt = function(ht) {
3317
- var ot = d.get(ht), ct = void 0;
3318
- c.get(ht).forEach(function(M) {
3319
- ct = r.getElementById(M).isParent() ? m.get(M) : M, E[ot].push(ct), E[d.get(ct)].push(ht);
3320
- });
3321
- }, st = !0, wt = !1, j = void 0;
3322
- try {
3323
- for (var pt = c.keys()[Symbol.iterator](), yt; !(st = (yt = pt.next()).done); st = !0) {
3324
- var Bt = yt.value;
3325
- dt(Bt);
3326
- }
3327
- } catch (ht) {
3328
- wt = !0, j = ht;
3329
- } finally {
3330
- try {
3331
- !st && pt.return && pt.return();
3332
- } finally {
3333
- if (wt) throw j;
3334
- }
3335
- }
3336
- Z = d.size;
3337
- var Yt = void 0;
3338
- if (Z > 2) {
3339
- w = Z < p.sampleSize ? Z : p.sampleSize;
3340
- for (var Mt = 0; Mt < Z; Mt++) X[Mt] = [];
3341
- for (var xt = 0; xt < w; xt++) _[xt] = [];
3342
- return p.quality == "draft" || p.step == "all" ? (P(v), b(), H(), Yt = {
3343
- nodeIndexes: d,
3344
- xCoords: C,
3345
- yCoords: R
3346
- }) : (d.forEach(function(ht, ot) {
3347
- C.push(r.getElementById(ot).position("x")), R.push(r.getElementById(ot).position("y"));
3348
- }), Yt = {
3349
- nodeIndexes: d,
3350
- xCoords: C,
3351
- yCoords: R
3352
- }), Yt;
3353
- }
3354
- var Ht = d.keys(), Xt = r.getElementById(Ht.next().value), Rt = Xt.position(), Vt = Xt.outerWidth();
3355
- if (C.push(Rt.x), R.push(Rt.y), Z == 2) {
3356
- var Pt = r.getElementById(Ht.next().value).outerWidth();
3357
- C.push(Rt.x + Vt / 2 + Pt / 2 + p.idealEdgeLength), R.push(Rt.y);
3358
- }
3359
- return Yt = {
3360
- nodeIndexes: d,
3361
- xCoords: C,
3362
- yCoords: R
3363
- }, Yt;
3364
- } };
3365
- }),
3366
- 579: ((a, o, t) => {
3367
- var e = t(212), s = function(i) {
3368
- i && i("layout", "fcose", e);
3369
- };
3370
- typeof cytoscape < "u" && s(cytoscape), a.exports = s;
3371
- }),
3372
- 140: ((a) => {
3373
- a.exports = A;
3374
- })
3375
- }, N = {};
3376
- function f(a) {
3377
- var o = N[a];
3378
- if (o !== void 0) return o.exports;
3379
- var t = N[a] = { exports: {} };
3380
- return O[a](t, t.exports, f), t.exports;
3381
- }
3382
- return f(579);
3383
- })();
3384
- });
3385
- })))()), Le = {
3386
- L: "left",
3387
- R: "right",
3388
- T: "top",
3389
- B: "bottom"
3390
- }, Ie = {
3391
- L: /* @__PURE__ */ nt((x) => `${x},${x / 2} 0,${x} 0,0`, "L"),
3392
- R: /* @__PURE__ */ nt((x) => `0,${x / 2} ${x},0 ${x},${x}`, "R"),
3393
- T: /* @__PURE__ */ nt((x) => `0,0 ${x},0 ${x / 2},${x}`, "T"),
3394
- B: /* @__PURE__ */ nt((x) => `${x / 2},0 ${x},${x} 0,${x}`, "B")
3395
- }, oe = {
3396
- L: /* @__PURE__ */ nt((x, L) => x - L + 2, "L"),
3397
- R: /* @__PURE__ */ nt((x, L) => x - 2, "R"),
3398
- T: /* @__PURE__ */ nt((x, L) => x - L + 2, "T"),
3399
- B: /* @__PURE__ */ nt((x, L) => x - 2, "B")
3400
- }, di = /* @__PURE__ */ nt(function(x) {
3401
- return Gt(x) ? x === "L" ? "R" : "L" : x === "T" ? "B" : "T";
3402
- }, "getOppositeArchitectureDirection"), Me = /* @__PURE__ */ nt(function(x) {
3403
- let L = x;
3404
- return L === "L" || L === "R" || L === "T" || L === "B";
3405
- }, "isArchitectureDirection"), Gt = /* @__PURE__ */ nt(function(x) {
3406
- let L = x;
3407
- return L === "L" || L === "R";
3408
- }, "isArchitectureDirectionX"), Wt = /* @__PURE__ */ nt(function(x) {
3409
- let L = x;
3410
- return L === "T" || L === "B";
3411
- }, "isArchitectureDirectionY"), me = /* @__PURE__ */ nt(function(x, L) {
3412
- let A = Gt(x) && Wt(L), O = Wt(x) && Gt(L);
3413
- return A || O;
3414
- }, "isArchitectureDirectionXY"), gi = /* @__PURE__ */ nt(function(x) {
3415
- let L = x[0], A = x[1], O = Gt(L) && Wt(A), N = Wt(L) && Gt(A);
3416
- return O || N;
3417
- }, "isArchitecturePairXY"), ci = /* @__PURE__ */ nt(function(x) {
3418
- return x !== "LL" && x !== "RR" && x !== "TT" && x !== "BB";
3419
- }, "isValidArchitectureDirectionPair"), ge = /* @__PURE__ */ nt(function(x, L) {
3420
- let A = `${x}${L}`;
3421
- return ci(A) ? A : void 0;
3422
- }, "getArchitectureDirectionPair"), ui = /* @__PURE__ */ nt(function([x, L], A) {
3423
- let O = A[0], N = A[1];
3424
- return Gt(O) ? Wt(N) ? [x + (O === "L" ? -1 : 1), L + (N === "T" ? 1 : -1)] : [x + (O === "L" ? -1 : 1), L] : Gt(N) ? [x + (N === "L" ? 1 : -1), L + (O === "T" ? 1 : -1)] : [x, L + (O === "T" ? 1 : -1)];
3425
- }, "shiftPositionByArchitectureDirectionPair"), fi = /* @__PURE__ */ nt(function(x) {
3426
- return x === "LT" || x === "TL" ? [1, 1] : x === "BL" || x === "LB" ? [1, -1] : x === "BR" || x === "RB" ? [-1, -1] : [-1, 1];
3427
- }, "getArchitectureDirectionXYFactors"), pi = /* @__PURE__ */ nt(function(x, L) {
3428
- return me(x, L) ? "bend" : Gt(x) ? "horizontal" : "vertical";
3429
- }, "getArchitectureDirectionAlignment"), mi = /* @__PURE__ */ nt(function(x) {
3430
- return x.type === "service";
3431
- }, "isArchitectureService"), yi = /* @__PURE__ */ nt(function(x) {
3432
- return x.type === "junction";
3433
- }, "isArchitectureJunction"), Oe = /* @__PURE__ */ nt((x, L) => {
3434
- let [A, O] = [x, L].sort();
3435
- return `${JSON.stringify(A)}-${JSON.stringify(O)}`;
3436
- }, "architectureGroupAlignmentKey"), De = /* @__PURE__ */ nt((x) => x.data(), "edgeData"), Qt = /* @__PURE__ */ nt((x) => x.data(), "nodeData"), vi = ri.architecture, te, Re = (te = class {
3437
- constructor() {
3438
- this.nodes = /* @__PURE__ */ new Map(), this.groups = /* @__PURE__ */ new Map(), this.edges = [], this.layoutHints = [], this.registeredIds = /* @__PURE__ */ new Map(), this.elements = /* @__PURE__ */ new Map(), this.diagramId = "", this.setAccTitle = je, this.getAccTitle = qe, this.setDiagramTitle = Ze, this.getDiagramTitle = Ke, this.getAccDescription = Je, this.setAccDescription = Qe, this.clear();
3439
- }
3440
- setDiagramId(L) {
3441
- this.diagramId = L;
3442
- }
3443
- getDiagramId() {
3444
- return this.diagramId;
3445
- }
3446
- clear() {
3447
- this.nodes = /* @__PURE__ */ new Map(), this.groups = /* @__PURE__ */ new Map(), this.edges = [], this.layoutHints = [], this.registeredIds = /* @__PURE__ */ new Map(), this.dataStructures = void 0, this.elements = /* @__PURE__ */ new Map(), this.diagramId = "", ti();
3448
- }
3449
- addService({ id: L, icon: A, in: O, title: N, iconText: f }) {
3450
- if (this.registeredIds.has(L)) throw Error(`The service id [${L}] is already in use by another ${this.registeredIds.get(L)}`);
3451
- if (O !== void 0) {
3452
- if (L === O) throw Error(`The service [${L}] cannot be placed within itself`);
3453
- if (!this.registeredIds.has(O)) throw Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);
3454
- if (this.registeredIds.get(O) === "node") throw Error(`The service [${L}]'s parent is not a group`);
3455
- }
3456
- this.registeredIds.set(L, "node"), this.nodes.set(L, {
3457
- id: L,
3458
- type: "service",
3459
- icon: A,
3460
- iconText: f,
3461
- title: N,
3462
- edges: [],
3463
- in: O
3464
- });
3465
- }
3466
- getServices() {
3467
- return [...this.nodes.values()].filter(mi);
3468
- }
3469
- addJunction({ id: L, in: A }) {
3470
- if (this.registeredIds.has(L)) throw Error(`The junction id [${L}] is already in use by another ${this.registeredIds.get(L)}`);
3471
- if (A !== void 0) {
3472
- if (L === A) throw Error(`The junction [${L}] cannot be placed within itself`);
3473
- if (!this.registeredIds.has(A)) throw Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);
3474
- if (this.registeredIds.get(A) === "node") throw Error(`The junction [${L}]'s parent is not a group`);
3475
- }
3476
- this.registeredIds.set(L, "node"), this.nodes.set(L, {
3477
- id: L,
3478
- type: "junction",
3479
- edges: [],
3480
- in: A
3481
- });
3482
- }
3483
- getJunctions() {
3484
- return [...this.nodes.values()].filter(yi);
3485
- }
3486
- getNodes() {
3487
- return [...this.nodes.values()];
3488
- }
3489
- getNode(L) {
3490
- return this.nodes.get(L) ?? null;
3491
- }
3492
- addGroup({ id: L, icon: A, in: O, title: N }) {
3493
- if (this.registeredIds.has(L)) throw Error(`The group id [${L}] is already in use by another ${this.registeredIds.get(L)}`);
3494
- if (O !== void 0) {
3495
- if (L === O) throw Error(`The group [${L}] cannot be placed within itself`);
3496
- if (!this.registeredIds.has(O)) throw Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);
3497
- if (this.registeredIds.get(O) === "node") throw Error(`The group [${L}]'s parent is not a group`);
3498
- }
3499
- this.registeredIds.set(L, "group"), this.groups.set(L, {
3500
- id: L,
3501
- icon: A,
3502
- title: N,
3503
- in: O
3504
- });
3505
- }
3506
- getGroups() {
3507
- return [...this.groups.values()];
3508
- }
3509
- addEdge({ lhsId: L, rhsId: A, lhsDir: O, rhsDir: N, lhsInto: f, rhsInto: a, lhsGroup: o, rhsGroup: t, title: e }) {
3510
- if (!Me(O)) throw Error(`Invalid direction given for left hand side of edge ${L}--${A}. Expected (L,R,T,B) got ${String(O)}`);
3511
- if (!Me(N)) throw Error(`Invalid direction given for right hand side of edge ${L}--${A}. Expected (L,R,T,B) got ${String(N)}`);
3512
- if (!this.nodes.has(L) && !this.groups.has(L)) throw Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);
3513
- if (!this.nodes.has(A) && !this.groups.has(A)) throw Error(`The right-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`);
3514
- let s = this.nodes.get(L).in, i = this.nodes.get(A).in;
3515
- if (o && s && i && s == i) throw Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
3516
- if (t && s && i && s == i) throw Error(`The right-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
3517
- let p = {
3518
- lhsId: L,
3519
- lhsDir: O,
3520
- lhsInto: f,
3521
- lhsGroup: o,
3522
- rhsId: A,
3523
- rhsDir: N,
3524
- rhsInto: a,
3525
- rhsGroup: t,
3526
- title: e
3527
- };
3528
- this.edges.push(p);
3529
- let r = this.nodes.get(L), n = this.nodes.get(A);
3530
- r && n && (r.edges.push(this.edges[this.edges.length - 1]), n.edges.push(this.edges[this.edges.length - 1]));
3531
- }
3532
- getEdges() {
3533
- return this.edges;
3534
- }
3535
- addLayoutHint(L) {
3536
- if (L.members.length < 2) throw Error(`An align directive requires at least two members; got ${L.members.length}`);
3537
- let A = /* @__PURE__ */ new Set();
3538
- L.members.forEach((O) => {
3539
- if (this.registeredIds.get(O) !== "node") throw Error(`align ${L.direction} references [${O}], which is not a service or junction`);
3540
- if (A.has(O)) throw Error(`align ${L.direction} lists [${O}] more than once`);
3541
- A.add(O);
3542
- }), this.layoutHints.push(L);
3543
- }
3544
- getLayoutHints() {
3545
- return this.layoutHints;
3546
- }
3547
- getDataStructures() {
3548
- if (this.dataStructures === void 0) {
3549
- let L = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
3550
- for (let [o, t] of this.nodes.entries()) {
3551
- let e = /* @__PURE__ */ new Map();
3552
- for (let s of t.edges) {
3553
- let i = this.getNode(s.lhsId)?.in, p = this.getNode(s.rhsId)?.in;
3554
- if (i && p && i !== p) {
3555
- let r = pi(s.lhsDir, s.rhsDir);
3556
- r !== "bend" && L.set(Oe(i, p), r);
3557
- }
3558
- if (s.lhsId === o) {
3559
- let r = ge(s.lhsDir, s.rhsDir);
3560
- r && e.set(r, s.rhsId);
3561
- } else {
3562
- let r = ge(s.rhsDir, s.lhsDir);
3563
- r && e.set(r, s.lhsId);
3564
- }
3565
- }
3566
- A.set(o, e);
3567
- }
3568
- let O = /* @__PURE__ */ new Set(), N = new Set(A.keys()), f = /* @__PURE__ */ nt((o) => {
3569
- let t = /* @__PURE__ */ new Map([[o, [0, 0]]]), e = [o];
3570
- for (; e.length > 0; ) {
3571
- let s = e.shift();
3572
- if (s) {
3573
- O.add(s), N.delete(s);
3574
- let i = A.get(s);
3575
- if (!i) throw Error(`BFS error: adjacency list for id ${s} not found. Please report this as a bug.`);
3576
- let p = t.get(s);
3577
- if (!p) throw Error(`BFS error: position for id ${s} not found in spatial map. Please report this as a bug.`);
3578
- let [r, n] = p;
3579
- i.forEach((g, l) => {
3580
- O.has(g) || (t.set(g, ui([r, n], l)), e.push(g));
3581
- });
3582
- }
3583
- }
3584
- return t;
3585
- }, "BFS"), a = [];
3586
- for (; N.size > 0; ) {
3587
- let o = N.values().next().value;
3588
- a.push(f(o));
3589
- }
3590
- this.dataStructures = {
3591
- adjList: A,
3592
- spatialMaps: a,
3593
- groupAlignments: L
3594
- };
3595
- }
3596
- return this.dataStructures;
3597
- }
3598
- setElementForId(L, A) {
3599
- this.elements.set(L, A);
3600
- }
3601
- getElementById(L) {
3602
- return this.elements.get(L);
3603
- }
3604
- getConfig() {
3605
- return ei({
3606
- ...vi,
3607
- ...ii().architecture
3608
- });
3609
- }
3610
- getConfigField(L) {
3611
- return this.getConfig()[L];
3612
- }
3613
- }, nt(te, "ArchitectureDB"), te), Ei = /* @__PURE__ */ nt((x, L) => {
3614
- hi(x, L), x.groups.map((A) => L.addGroup(A)), x.services.map((A) => L.addService({
3615
- ...A,
3616
- type: "service"
3617
- })), x.junctions.map((A) => L.addJunction({
3618
- ...A,
3619
- type: "junction"
3620
- })), x.edges.map((A) => L.addEdge(A)), x.alignments?.map((A) => L.addLayoutHint({
3621
- direction: A.direction,
3622
- members: [...A.members]
3623
- }));
3624
- }, "populateDb"), be = {
3625
- parser: { yy: void 0 },
3626
- parse: /* @__PURE__ */ nt(async (x) => {
3627
- let L = await si("architecture", x);
3628
- xe.debug(L);
3629
- let A = be.parser?.yy;
3630
- if (!(A instanceof Re)) throw Error("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.");
3631
- Ei(L, A);
3632
- }, "parse")
3633
- }, Ti = /* @__PURE__ */ nt((x) => `
3634
- .edge {
3635
- stroke-width: ${x.archEdgeWidth};
3636
- stroke: ${x.archEdgeColor};
3637
- fill: none;
3638
- }
3639
-
3640
- .arrow {
3641
- fill: ${x.archEdgeArrowColor};
3642
- }
3643
-
3644
- .node-bkg {
3645
- fill: none;
3646
- stroke: ${x.archGroupBorderColor};
3647
- stroke-width: ${x.archGroupBorderWidth};
3648
- stroke-dasharray: 8;
3649
- }
3650
- .node-icon-text {
3651
- display: flex;
3652
- align-items: center;
3653
- }
3654
-
3655
- .node-icon-text > div {
3656
- color: #fff;
3657
- margin: 1px;
3658
- height: fit-content;
3659
- text-align: center;
3660
- overflow: hidden;
3661
- display: -webkit-box;
3662
- -webkit-box-orient: vertical;
3663
- }
3664
- `, "getStyles");
3665
- function ce(x, L) {
3666
- if (x === 0) return L();
3667
- let A = Math.random, O = x >>> 0;
3668
- Math.random = function() {
3669
- O = O + 1831565813 >>> 0;
3670
- let N = O;
3671
- return N = Math.imul(N ^ N >>> 15, N | 1), N ^= N + Math.imul(N ^ N >>> 7, N | 61), ((N ^ N >>> 14) >>> 0) / 4294967296;
3672
- };
3673
- try {
3674
- return L();
3675
- } finally {
3676
- Math.random = A;
3677
- }
3678
- }
3679
- nt(ce, "withSeededRandom");
3680
- var Jt = /* @__PURE__ */ nt((x) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${x}</g>`, "wrapIcon"), ie = {
3681
- prefix: "mermaid-architecture",
3682
- height: 80,
3683
- width: 80,
3684
- icons: {
3685
- database: { body: Jt('<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;"/>') },
3686
- server: { body: Jt('<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>') },
3687
- disk: { body: Jt('<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;"/>') },
3688
- internet: { body: Jt('<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;"/>') },
3689
- cloud: { body: Jt('<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;"/>') },
3690
- unknown: ai,
3691
- blank: { body: Jt("") }
3692
- }
3693
- }, Ni = /* @__PURE__ */ nt(async function(x, L, A, O) {
3694
- let N = A.getConfigField("padding"), f = A.getConfigField("iconSize"), a = f / 2, o = f / 6, t = o / 2;
3695
- await Promise.all(L.edges().map(async (e) => {
3696
- let { source: s, sourceDir: i, sourceArrow: p, sourceGroup: r, target: n, targetDir: g, targetArrow: l, targetGroup: c, label: d } = De(e), { x: m, y: E } = e[0].sourceEndpoint(), { x: C, y: R } = e[0].midpoint(), { x: S, y: G } = e[0].targetEndpoint(), X = N + 4;
3697
- if (r && (Gt(i) ? m += i === "L" ? -X : X : E += i === "T" ? -X : X + 18), c && (Gt(g) ? S += g === "L" ? -X : X : G += g === "T" ? -X : X + 18), !r && A.getNode(s)?.type === "junction" && (Gt(i) ? m += i === "L" ? a : -a : E += i === "T" ? a : -a), !c && A.getNode(n)?.type === "junction" && (Gt(g) ? S += g === "L" ? a : -a : G += g === "T" ? a : -a), e[0]._private.rscratch) {
3698
- let $ = x.insert("g");
3699
- if ($.insert("path").attr("d", `M ${m},${E} L ${C},${R} L${S},${G} `).attr("class", "edge").attr("id", `${O}-${$e(s, n, { prefix: "L" })}`), p) {
3700
- let _ = Gt(i) ? oe[i](m, o) : m - t, Z = Wt(i) ? oe[i](E, o) : E - t;
3701
- $.insert("polygon").attr("points", Ie[i](o)).attr("transform", `translate(${_},${Z})`).attr("class", "arrow");
3702
- }
3703
- if (l) {
3704
- let _ = Gt(g) ? oe[g](S, o) : S - t, Z = Wt(g) ? oe[g](G, o) : G - t;
3705
- $.insert("polygon").attr("points", Ie[g](o)).attr("transform", `translate(${_},${Z})`).attr("class", "arrow");
3706
- }
3707
- if (d) {
3708
- let _ = me(i, g) ? "XY" : Gt(i) ? "X" : "Y", Z = 0;
3709
- Z = _ === "X" ? Math.abs(m - S) : _ === "Y" ? Math.abs(E - G) / 1.5 : Math.abs(m - S) / 2;
3710
- let h = $.append("g");
3711
- if (await fe(h, d, {
3712
- useHtmlLabels: !1,
3713
- width: Z,
3714
- classes: "architecture-service-label"
3715
- }, ue()), h.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), _ === "X") h.attr("transform", "translate(" + C + ", " + R + ")");
3716
- else if (_ === "Y") h.attr("transform", "translate(" + C + ", " + R + ") rotate(-90)");
3717
- else if (_ === "XY") {
3718
- let T = ge(i, g);
3719
- if (T && gi(T)) {
3720
- let u = h.node().getBoundingClientRect(), [v, y] = fi(T);
3721
- h.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * v * y * 45})`);
3722
- let w = h.node().getBoundingClientRect();
3723
- h.attr("transform", `
3724
- translate(${C}, ${R - u.height / 2})
3725
- translate(${v * w.width / 2}, ${y * w.height / 2})
3726
- rotate(${-1 * v * y * 45}, 0, ${u.height / 2})
3727
- `);
3728
- }
3729
- }
3730
- }
3731
- }
3732
- }));
3733
- }, "drawEdges"), Ai = /* @__PURE__ */ nt(async function(x, L, A, O) {
3734
- let N = A.getConfigField("padding") * 0.75, f = A.getConfigField("fontSize"), a = A.getConfigField("iconSize") / 2;
3735
- await Promise.all(L.nodes().map(async (o) => {
3736
- let t = Qt(o);
3737
- if (t.type === "group") {
3738
- let { h: e, w: s, x1: i, y1: p } = o.boundingBox(), r = x.append("rect");
3739
- r.attr("id", `${O}-group-${t.id}`).attr("x", i + a).attr("y", p + a).attr("width", s).attr("height", e).attr("class", "node-bkg");
3740
- let n = x.append("g"), g = i, l = p;
3741
- if (t.icon) {
3742
- let c = n.append("g");
3743
- c.html(`<g>${await de(t.icon, {
3744
- height: N,
3745
- width: N,
3746
- fallbackPrefix: ie.prefix
3747
- })}</g>`), c.attr("transform", "translate(" + (g + a + 1) + ", " + (l + a + 1) + ")"), g += N, l += f / 2 - 1 - 2;
3748
- }
3749
- if (t.label) {
3750
- let c = n.append("g");
3751
- await fe(c, t.label, {
3752
- useHtmlLabels: !1,
3753
- width: s,
3754
- classes: "architecture-service-label"
3755
- }, ue()), c.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), c.attr("transform", "translate(" + (g + a + 4) + ", " + (l + a + 2) + ")");
3756
- }
3757
- A.setElementForId(t.id, r);
3758
- }
3759
- }));
3760
- }, "drawGroups"), wi = /* @__PURE__ */ nt(async function(x, L, A, O) {
3761
- let N = ue();
3762
- for (let f of A) {
3763
- let a = L.append("g"), o = x.getConfigField("iconSize");
3764
- if (f.title) {
3765
- let i = a.append("g");
3766
- await fe(i, f.title, {
3767
- useHtmlLabels: !1,
3768
- width: o * 1.5,
3769
- classes: "architecture-service-label"
3770
- }, N), i.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), i.attr("transform", "translate(" + o / 2 + ", " + o + ")");
3771
- }
3772
- let t = a.append("g");
3773
- if (f.icon) t.html(`<g>${await de(f.icon, {
3774
- height: o,
3775
- width: o,
3776
- fallbackPrefix: ie.prefix
3777
- })}</g>`);
3778
- else if (f.iconText) {
3779
- t.html(`<g>${await de("blank", {
3780
- height: o,
3781
- width: o,
3782
- fallbackPrefix: ie.prefix
3783
- })}</g>`);
3784
- let i = t.append("g").append("foreignObject").attr("width", o).attr("height", o).append("div").attr("class", "node-icon-text").attr("style", `height: ${o}px;`).append("div").html(Ve(f.iconText, N)), p = parseInt(window.getComputedStyle(i.node(), null).getPropertyValue("font-size").replace(/\D/g, "")) ?? 16;
3785
- i.attr("style", `-webkit-line-clamp: ${Math.floor((o - 2) / p)};`);
3786
- } else t.append("path").attr("class", "node-bkg").attr("id", `${O}-node-${f.id}`).attr("d", `M0,${o} V5 Q0,0 5,0 H${o - 5} Q${o},0 ${o},5 V${o} Z`);
3787
- a.attr("id", `${O}-service-${f.id}`).attr("class", "architecture-service");
3788
- let { width: e, height: s } = a.node().getBBox();
3789
- f.width = e, f.height = s, x.setElementForId(f.id, a);
3790
- }
3791
- return 0;
3792
- }, "drawServices"), Ci = /* @__PURE__ */ nt(function(x, L, A, O) {
3793
- A.forEach((N) => {
3794
- let f = L.append("g"), a = x.getConfigField("iconSize");
3795
- f.append("g").append("rect").attr("id", `${O}-node-${N.id}`).attr("fill-opacity", "0").attr("width", a).attr("height", a), f.attr("class", "architecture-junction");
3796
- let { width: o, height: t } = f._groups[0][0].getBBox();
3797
- f.width = o, f.height = t, x.setElementForId(N.id, f);
3798
- });
3799
- }, "drawJunctions");
3800
- ni([{
3801
- name: ie.prefix,
3802
- icons: ie
3803
- }]), _e.use(li.default);
3804
- function Fe(x, L, A) {
3805
- x.forEach((O) => {
3806
- L.add({
3807
- group: "nodes",
3808
- data: {
3809
- type: "service",
3810
- id: O.id,
3811
- icon: O.icon,
3812
- label: O.title,
3813
- parent: O.in,
3814
- width: A.getConfigField("iconSize"),
3815
- height: A.getConfigField("iconSize")
3816
- },
3817
- classes: "node-service"
3818
- });
3819
- });
3820
- }
3821
- nt(Fe, "addServices");
3822
- function Pe(x, L, A) {
3823
- x.forEach((O) => {
3824
- L.add({
3825
- group: "nodes",
3826
- data: {
3827
- type: "junction",
3828
- id: O.id,
3829
- parent: O.in,
3830
- width: A.getConfigField("iconSize"),
3831
- height: A.getConfigField("iconSize")
3832
- },
3833
- classes: "node-junction"
3834
- });
3835
- });
3836
- }
3837
- nt(Pe, "addJunctions");
3838
- function Se(x, L) {
3839
- L.nodes().map((A) => {
3840
- let O = Qt(A);
3841
- O.type !== "group" && (O.x = A.position().x, O.y = A.position().y, x.getElementById(O.id).attr("transform", "translate(" + (O.x || 0) + "," + (O.y || 0) + ")"));
3842
- });
3843
- }
3844
- nt(Se, "positionNodes");
3845
- function Ge(x, L) {
3846
- x.forEach((A) => {
3847
- L.add({
3848
- group: "nodes",
3849
- data: {
3850
- type: "group",
3851
- id: A.id,
3852
- icon: A.icon,
3853
- label: A.title,
3854
- parent: A.in
3855
- },
3856
- classes: "node-group"
3857
- });
3858
- });
3859
- }
3860
- nt(Ge, "addGroups");
3861
- function Ye(x, L) {
3862
- x.forEach((A) => {
3863
- let { lhsId: O, rhsId: N, lhsInto: f, lhsGroup: a, rhsInto: o, lhsDir: t, rhsDir: e, rhsGroup: s, title: i } = A, p = me(A.lhsDir, A.rhsDir) ? "segments" : "straight", r = {
3864
- id: `${O}-${N}`,
3865
- label: i,
3866
- source: O,
3867
- sourceDir: t,
3868
- sourceArrow: f,
3869
- sourceGroup: a,
3870
- sourceEndpoint: t === "L" ? "0 50%" : t === "R" ? "100% 50%" : t === "T" ? "50% 0" : "50% 100%",
3871
- target: N,
3872
- targetDir: e,
3873
- targetArrow: o,
3874
- targetGroup: s,
3875
- targetEndpoint: e === "L" ? "0 50%" : e === "R" ? "100% 50%" : e === "T" ? "50% 0" : "50% 100%"
3876
- };
3877
- L.add({
3878
- group: "edges",
3879
- data: r,
3880
- classes: p
3881
- });
3882
- });
3883
- }
3884
- nt(Ye, "addEdges");
3885
- function He(x, L, A, O = []) {
3886
- let N = /* @__PURE__ */ nt((i, p) => {
3887
- let r = /* @__PURE__ */ new Map();
3888
- for (let [n, g] of i.entries()) {
3889
- let l = `${n}`, c = 0, d = [...g.entries()];
3890
- if (d.length === 1) {
3891
- r.set(l, d[0][1]);
3892
- continue;
3893
- }
3894
- for (let m = 0; m < d.length - 1; m++) for (let E = m + 1; E < d.length; E++) {
3895
- let [C, R] = d[m], [S, G] = d[E];
3896
- if (A.get(Oe(C, S)) === p) r.set(l, [
3897
- ...r.get(l) ?? [],
3898
- ...R,
3899
- ...G
3900
- ]);
3901
- else if (C === "default" || S === "default") r.set(l, [
3902
- ...r.get(l) ?? [],
3903
- ...R,
3904
- ...G
3905
- ]);
3906
- else {
3907
- let X = `${l}-${c++}`;
3908
- r.set(X, R);
3909
- let $ = `${l}-${c++}`;
3910
- r.set($, G);
3911
- }
3912
- }
3913
- }
3914
- return r;
3915
- }, "flattenAlignments"), [f, a] = L.map((i) => {
3916
- let p = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
3917
- return i.forEach(([n, g], l) => {
3918
- let c = x.getNode(l)?.in ?? "default", d = p.get(g) ?? /* @__PURE__ */ new Map();
3919
- p.has(g) || p.set(g, d);
3920
- let m = r.get(n) ?? /* @__PURE__ */ new Map();
3921
- r.has(n) || r.set(n, m);
3922
- for (let E of [d, m]) {
3923
- let C = E.get(c) ?? [];
3924
- E.has(c) || E.set(c, C), C.push(l);
3925
- }
3926
- }), {
3927
- horiz: [...N(p, "horizontal").values()].filter((n) => n.length > 1),
3928
- vert: [...N(r, "vertical").values()].filter((n) => n.length > 1)
3929
- };
3930
- }).reduce(([i, p], { horiz: r, vert: n }) => [[...i, ...r], [...p, ...n]], [[], []]), o = /* @__PURE__ */ new Set();
3931
- O.forEach((i) => i.members.forEach((p) => o.add(p)));
3932
- let t = /* @__PURE__ */ nt((i) => i.filter((p) => !p.some((r) => o.has(r))), "dropOverlapping"), e = t(f), s = t(a);
3933
- return O.forEach((i) => {
3934
- i.members.length < 2 || (i.direction === "row" ? e.push([...i.members]) : s.push([...i.members]));
3935
- }), {
3936
- horizontal: e,
3937
- vertical: s
3938
- };
3939
- }
3940
- nt(He, "getAlignments");
3941
- function ke(x, L, A = []) {
3942
- let O = [], N = L.getConfigField("iconSize"), f = L.getConfigField("idealEdgeLengthMultiplier"), a = f * N, o = /* @__PURE__ */ new Set();
3943
- A.forEach((s) => {
3944
- for (let i = 0; i < s.members.length - 1; i++) {
3945
- let p = s.members[i], r = s.members[i + 1];
3946
- o.add(`${p}|${r}`), o.add(`${r}|${p}`), s.direction === "row" ? O.push({
3947
- left: p,
3948
- right: r,
3949
- gap: a
3950
- }) : O.push({
3951
- top: p,
3952
- bottom: r,
3953
- gap: a
3954
- });
3955
- }
3956
- });
3957
- let t = /* @__PURE__ */ nt((s) => `${s[0]},${s[1]}`, "posToStr"), e = /* @__PURE__ */ nt((s) => s.split(",").map((i) => parseInt(i)), "strToPos");
3958
- return x.forEach((s) => {
3959
- let i = new Map([...s.entries()].map(([g, l]) => [t(l), g])), p = [t([0, 0])], r = {}, n = {
3960
- L: [-1, 0],
3961
- R: [1, 0],
3962
- T: [0, 1],
3963
- B: [0, -1]
3964
- };
3965
- for (; p.length > 0; ) {
3966
- let g = p.shift();
3967
- if (g) {
3968
- r[g] = 1;
3969
- let l = i.get(g);
3970
- if (l) {
3971
- let c = e(g);
3972
- Object.entries(n).forEach(([d, m]) => {
3973
- let E = t([c[0] + m[0], c[1] + m[1]]), C = i.get(E);
3974
- if (C && !r[E]) {
3975
- if (p.push(E), o.has(`${l}|${C}`)) return;
3976
- O.push({
3977
- [Le[d]]: C,
3978
- [Le[di(d)]]: l,
3979
- gap: f * N
3980
- });
3981
- }
3982
- });
3983
- }
3984
- }
3985
- }
3986
- }), O;
3987
- }
3988
- nt(ke, "getRelativeConstraints");
3989
- function Xe(x, L, A, O, N, { spatialMaps: f, groupAlignments: a }) {
3990
- return new Promise((o) => {
3991
- let t = We("body").append("div").attr("id", "cy").attr("style", "display:none"), e = _e({
3992
- container: document.getElementById("cy"),
3993
- style: [
3994
- {
3995
- selector: "edge",
3996
- style: {
3997
- "curve-style": "straight",
3998
- "source-endpoint": "data(sourceEndpoint)",
3999
- "target-endpoint": "data(targetEndpoint)"
4000
- }
4001
- },
4002
- {
4003
- selector: "edge[label]",
4004
- style: { label: "data(label)" }
4005
- },
4006
- {
4007
- selector: "edge.segments",
4008
- style: {
4009
- "curve-style": "segments",
4010
- "segment-weights": "0",
4011
- "segment-distances": [0.5],
4012
- "edge-distances": "endpoints",
4013
- "source-endpoint": "data(sourceEndpoint)",
4014
- "target-endpoint": "data(targetEndpoint)"
4015
- }
4016
- },
4017
- {
4018
- selector: "node",
4019
- style: { "compound-sizing-wrt-labels": "include" }
4020
- },
4021
- {
4022
- selector: "node[label]",
4023
- style: {
4024
- "text-valign": "bottom",
4025
- "text-halign": "center",
4026
- "font-size": `${N.getConfigField("fontSize")}px`
4027
- }
4028
- },
4029
- {
4030
- selector: ".node-service",
4031
- style: {
4032
- label: "data(label)",
4033
- width: "data(width)",
4034
- height: "data(height)"
4035
- }
4036
- },
4037
- {
4038
- selector: ".node-junction",
4039
- style: {
4040
- width: "data(width)",
4041
- height: "data(height)"
4042
- }
4043
- },
4044
- {
4045
- selector: ".node-group",
4046
- style: { padding: `${N.getConfigField("padding")}px` }
4047
- }
4048
- ],
4049
- layout: {
4050
- name: "grid",
4051
- boundingBox: {
4052
- x1: 0,
4053
- x2: 100,
4054
- y1: 0,
4055
- y2: 100
4056
- }
4057
- }
4058
- });
4059
- t.remove(), Ge(A, e), Fe(x, e, N), Pe(L, e, N), Ye(O, e);
4060
- let s = N.getLayoutHints(), i = He(N, f, a, s), p = ke(f, N, s), r = N.getConfigField("iconSize"), n = N.getConfigField("idealEdgeLengthMultiplier") * r, g = 0.5 * r, l = N.getConfigField("edgeElasticity"), c = N.getConfigField("seed"), d = e.layout({
4061
- name: "fcose",
4062
- quality: "proof",
4063
- randomize: N.getConfigField("randomize"),
4064
- nodeSeparation: N.getConfigField("nodeSeparation"),
4065
- numIter: N.getConfigField("numIter"),
4066
- styleEnabled: !1,
4067
- animate: !1,
4068
- nodeDimensionsIncludeLabels: !1,
4069
- idealEdgeLength(m) {
4070
- let [E, C] = m.connectedNodes(), { parent: R } = Qt(E), { parent: S } = Qt(C);
4071
- return R === S ? n : g;
4072
- },
4073
- edgeElasticity(m) {
4074
- let [E, C] = m.connectedNodes(), { parent: R } = Qt(E), { parent: S } = Qt(C);
4075
- return R === S ? l : 1e-3;
4076
- },
4077
- alignmentConstraint: i,
4078
- relativePlacementConstraint: p
4079
- });
4080
- d.one("layoutstop", () => {
4081
- function m(E, C, R, S) {
4082
- let G, X, { x: $, y: _ } = E, { x: Z, y: h } = C;
4083
- X = (S - _ + ($ - R) * (_ - h) / ($ - Z)) / Math.sqrt(1 + ((_ - h) / ($ - Z)) ** 2), G = Math.sqrt((S - _) ** 2 + (R - $) ** 2 - X ** 2);
4084
- let T = Math.sqrt((Z - $) ** 2 + (h - _) ** 2);
4085
- G /= T;
4086
- let u = (Z - $) * (S - _) - (h - _) * (R - $);
4087
- switch (!0) {
4088
- case u >= 0:
4089
- u = 1;
4090
- break;
4091
- case u < 0:
4092
- u = -1;
4093
- }
4094
- let v = (Z - $) * (R - $) + (h - _) * (S - _);
4095
- switch (!0) {
4096
- case v >= 0:
4097
- v = 1;
4098
- break;
4099
- case v < 0:
4100
- v = -1;
4101
- }
4102
- return X = Math.abs(X) * u, G *= v, {
4103
- distances: X,
4104
- weights: G
4105
- };
4106
- }
4107
- nt(m, "getSegmentWeights"), e.startBatch();
4108
- for (let E of Object.values(e.edges())) if (E.data?.()) {
4109
- let { x: C, y: R } = E.source().position(), { x: S, y: G } = E.target().position();
4110
- if (C !== S && R !== G) {
4111
- let X = E.sourceEndpoint(), $ = E.targetEndpoint(), { sourceDir: _ } = De(E), [Z, h] = Wt(_) ? [X.x, $.y] : [$.x, X.y], { weights: T, distances: u } = m(X, $, Z, h);
4112
- E.style("segment-distances", u), E.style("segment-weights", T);
4113
- }
4114
- }
4115
- e.endBatch(), ce(c, () => d.run());
4116
- });
4117
- try {
4118
- ce(c, () => d.run());
4119
- } catch (m) {
4120
- throw m instanceof RangeError && m.message.includes("Invalid array length") ? Error("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.") : m;
4121
- }
4122
- e.ready((m) => {
4123
- xe.info("Ready", m), o(e);
4124
- });
4125
- });
4126
- }
4127
- nt(Xe, "layoutArchitecture");
4128
- var _i = {
4129
- parser: be,
4130
- get db() {
4131
- return new Re();
4132
- },
4133
- renderer: { draw: /* @__PURE__ */ nt(async (x, L, A, O) => {
4134
- let N = O.db;
4135
- N.setDiagramId(L);
4136
- let f = N.getServices(), a = N.getJunctions(), o = N.getGroups(), t = N.getEdges(), e = N.getDataStructures(), s = ze(L), i = s.append("g");
4137
- i.attr("class", "architecture-edges");
4138
- let p = s.append("g");
4139
- p.attr("class", "architecture-services");
4140
- let r = s.append("g");
4141
- r.attr("class", "architecture-groups"), await wi(N, p, f, L), Ci(N, p, a, L);
4142
- let n = await Xe(f, a, o, t, N, e);
4143
- await Ni(i, n, N, L), await Ai(r, n, N, L), Se(N, n), Be(void 0, s, N.getConfigField("padding"), N.getConfigField("useMaxWidth"));
4144
- }, "draw") },
4145
- styles: Ti
4146
- };
4147
- export {
4148
- _i as diagram
4149
- };