@marimo-team/islands 0.15.2 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/dist/{ConnectedDataExplorerComponent-C39nQwtD.js → ConnectedDataExplorerComponent-DfvW3rBn.js} +323 -328
  2. package/dist/{ImageComparisonComponent-BhkiyswP.js → ImageComparisonComponent-XaJshw7d.js} +13 -13
  3. package/dist/{_baseUniq-DdHL34FO.js → _baseUniq-dN9WKF9m.js} +67 -67
  4. package/dist/any-language-editor-CpFniVi-.js +27 -0
  5. package/dist/{arc-BXrety1g.js → arc-BOhn-m2C.js} +1 -1
  6. package/dist/{architectureDiagram-KFL7JDKH-BMy6ywCF.js → architectureDiagram-W76B3OCA-Bpg85ZKv.js} +144 -144
  7. package/dist/assets/{worker-COGufAQn.js → worker-Y-Q4G-N2.js} +30 -26
  8. package/dist/asterisk-DS281yxp.js +271 -0
  9. package/dist/{blockDiagram-ZYB65J3Q-DYT2-nlI.js → blockDiagram-QIGZ2CNN-DS1kOHlW.js} +10 -10
  10. package/dist/{c4Diagram-AAMF2YG6-ZiQzioe6.js → c4Diagram-FPNF74CW-CyRVKssw.js} +8 -8
  11. package/dist/{channel-CeuXqUAU.js → channel-BilGXox7.js} +1 -1
  12. package/dist/{chunk-ANTBXLJU-BvYnIrdq.js → chunk-4BX2VUAB-CZR39zCO.js} +1 -1
  13. package/dist/{chunk-WVR4S24B-DXj8yaUk.js → chunk-55IACEB6-BIH-MYov.js} +1 -1
  14. package/dist/{chunk-GLLZNHP4-CyFsosAe.js → chunk-FMBD7UC4-4PZXFZE8.js} +1 -1
  15. package/dist/{chunk-JBRWN2VN-DA_EEhy2.js → chunk-K7UQS3LO-CEvWKznk.js} +117 -117
  16. package/dist/{chunk-NRVI72HA-BYx2jMlI.js → chunk-QN33PNHL-D5LO5Jq_.js} +1 -1
  17. package/dist/{chunk-FHKO5MBM-DfCztBk8.js → chunk-QZHKN3VN-6gwUonWI.js} +1 -1
  18. package/dist/{chunk-LXBSTHXV-Se7vdY6J.js → chunk-TVAH2DTR-3gm06QdU.js} +7 -7
  19. package/dist/{chunk-OMD6QJNC-CqgcPMgL.js → chunk-TZMSLE5B-Cm8Iy9bO.js} +1 -1
  20. package/dist/{classDiagram-v2-QTMF73CY-B19A3G1l.js → classDiagram-KNZD7YFC-DC529O_z.js} +2 -2
  21. package/dist/{classDiagram-3BZAVTQC-B19A3G1l.js → classDiagram-v2-RKCZMP56-DC529O_z.js} +2 -2
  22. package/dist/{clone-78au0tn1.js → clone-CLoRX3j6.js} +1 -1
  23. package/dist/cose-bilkent-S5V4N54A-qf5DlS6Y.js +2609 -0
  24. package/dist/{cytoscape.esm-BYnVVhJX.js → cytoscape.esm-DfdJODL8.js} +34 -34
  25. package/dist/{dagre-2BBEFEWP-BfEn3ZUV.js → dagre-5GWH7T2D-Ceocls0m.js} +6 -6
  26. package/dist/{data-grid-overlay-editor-CH_qLkV2.js → data-grid-overlay-editor-AqDS_UKe.js} +11 -11
  27. package/dist/{diagram-4IRLE6MV-CL8xidnG.js → diagram-N5W7TBWH-CP66oSiv.js} +59 -60
  28. package/dist/{diagram-RP2FKANI-B1BPcUew.js → diagram-QEK2KX5R-_YD4kxxi.js} +15 -15
  29. package/dist/{diagram-GUPCWM2R-CZ5cfqlq.js → diagram-S2PKOQOG-Cnj8T-OP.js} +10 -10
  30. package/dist/dockerfile-Cm8cRYCN.js +194 -0
  31. package/dist/ebnf-DUPDuY4r.js +78 -0
  32. package/dist/{erDiagram-HZWUO2LU-BEAIww50.js → erDiagram-AWTI2OKA-CGnvoHx6.js} +8 -8
  33. package/dist/fcl-CPC2WYrI.js +103 -0
  34. package/dist/{flowDiagram-THRYKUMA-Czs2UAI2.js → flowDiagram-PVAE7QVJ-DG-pr9R9.js} +9 -9
  35. package/dist/{ganttDiagram-WV7ZQ7D5-ByYIAVFO.js → ganttDiagram-OWAHRB6G-JmChtxvn.js} +34 -34
  36. package/dist/{gitGraphDiagram-OJR772UL-BcpDsiyB.js → gitGraphDiagram-NY62KEGX-D8wLfOPd.js} +4 -4
  37. package/dist/{glide-data-editor-CmN6FVyi.js → glide-data-editor-9nC3iCIZ.js} +33 -33
  38. package/dist/{graph-77W6heli.js → graph-CoRe7vAN.js} +3 -3
  39. package/dist/http-D9LttvKF.js +44 -0
  40. package/dist/{index-Bfk9dnyS.js → index-6qYeHHjQ.js} +33090 -32892
  41. package/dist/{index-BOojn38D.js → index-BpzLh4Qe.js} +7711 -7711
  42. package/dist/{index-CmozKMxx.js → index-BthgsgYX.js} +6 -6
  43. package/dist/{index-pBmAzQJl.js → index-MCx5v1x0.js} +2 -2
  44. package/dist/index-jkm77Jrz.js +98 -0
  45. package/dist/{infoDiagram-6WOFNB3A-CfzLHHVP.js → infoDiagram-STP46IZ2-BlXxvOrR.js} +2 -2
  46. package/dist/{journeyDiagram-FFXJYRFH-ndAcpkGn.js → journeyDiagram-BIP6EPQ6-CNRYs_Fc.js} +24 -26
  47. package/dist/{kanban-definition-KOZQBZVT-DcQYzNvc.js → kanban-definition-6OIFK2YF-B9HeMAuP.js} +14 -14
  48. package/dist/{layout-XySVHJgD.js → layout-m2vOUiW1.js} +81 -81
  49. package/dist/{linear-PbooOqg7.js → linear-DU6Q5CX3.js} +35 -35
  50. package/dist/{main-B5yML0bw.js → main-BD2KGFpU.js} +74594 -68034
  51. package/dist/main.js +1 -1
  52. package/dist/{mermaid-Cg5IX6Nv.js → mermaid-HVCtvbyx.js} +6160 -7493
  53. package/dist/min-DcGMA4e_.js +80 -0
  54. package/dist/mindmap-definition-Q6HEUPPD-BW8UmIDQ.js +785 -0
  55. package/dist/nginx-zDPm3Z74.js +89 -0
  56. package/dist/{number-overlay-editor-DUhfZqtP.js → number-overlay-editor-D8Hl0Syo.js} +19 -19
  57. package/dist/{pieDiagram-DBDJKBY4-DTOlNsja.js → pieDiagram-ADFJNKIX-Bg-3zg5U.js} +17 -17
  58. package/dist/{quadrantDiagram-YPSRARAO-BX2d8VS-.js → quadrantDiagram-LMRXKWRM-BO4IG6Yz.js} +6 -6
  59. package/dist/{react-plotly-Dcyw-3Sa.js → react-plotly-dkvHVuRb.js} +3577 -3577
  60. package/dist/{requirementDiagram-EGVEC5DT-D1T5u-wG.js → requirementDiagram-4UW4RH46-5sdTguSM.js} +7 -7
  61. package/dist/{sankeyDiagram-HRAUVNP4-G6xDfnp-.js → sankeyDiagram-GR3RE2ED-Buhlv9OI.js} +5 -5
  62. package/dist/sequenceDiagram-C3RYC4MD-C3qsM2UP.js +2519 -0
  63. package/dist/{slides-component-BJLlPJSr.js → slides-component-D209A0-s.js} +66 -66
  64. package/dist/solr-BNlsLglM.js +41 -0
  65. package/dist/spreadsheet-C-cy4P5N.js +49 -0
  66. package/dist/{stateDiagram-UUKSUZ4H-CYXbjaom.js → stateDiagram-KXAO66HF-CopJ7G6P.js} +5 -5
  67. package/dist/{stateDiagram-v2-EYPG3UTE-Br1HYKT6.js → stateDiagram-v2-UMBNRL4Z-CejL8AKf.js} +2 -2
  68. package/dist/style.css +1 -1
  69. package/dist/tiddlywiki-5wqsXtSk.js +155 -0
  70. package/dist/tiki-__Kn3CeS.js +181 -0
  71. package/dist/{time-B9SZnSen.js → time-BwSBitlN.js} +58 -58
  72. package/dist/{timeline-definition-3HZDQTIS-DeK_ZRD0.js → timeline-definition-XQNQX7LJ-DzMNTX-C.js} +10 -12
  73. package/dist/{timer-BYwnU4DF.js → timer-B0-z63CM.js} +16 -16
  74. package/dist/{treemap-75Q7IDZK-CKP4vV_0.js → treemap-75Q7IDZK-zeJG07dk.js} +14 -14
  75. package/dist/{vega-component-CpgdqX2d.js → vega-component-CUkiTayd.js} +30 -30
  76. package/dist/{xychartDiagram-FDP5SA34-AMEPsx_R.js → xychartDiagram-6GGTOJPD-DiENNXMS.js} +7 -7
  77. package/package.json +39 -39
  78. package/src/__mocks__/notebook.ts +3 -0
  79. package/src/__mocks__/requests.ts +3 -0
  80. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  81. package/src/__tests__/chat-utils.test.ts +26 -211
  82. package/src/components/ai/ai-model-dropdown.tsx +25 -9
  83. package/src/components/app-config/ai-config.tsx +7 -0
  84. package/src/components/chat/chat-components.tsx +71 -0
  85. package/src/components/chat/chat-panel.tsx +481 -291
  86. package/src/components/chat/chat-utils.ts +50 -0
  87. package/src/components/chat/markdown-renderer.tsx +3 -7
  88. package/src/components/chat/tool-call-accordion.tsx +5 -5
  89. package/src/components/datasources/__tests__/utils.test.ts +6 -0
  90. package/src/components/datasources/column-preview.tsx +1 -3
  91. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  92. package/src/components/editor/ai/add-cell-with-ai.tsx +20 -15
  93. package/src/components/editor/ai/ai-completion-editor.tsx +22 -3
  94. package/src/components/editor/ai/completion-handlers.tsx +2 -4
  95. package/src/components/editor/ai/completion-utils.ts +85 -11
  96. package/src/components/editor/alerts/startup-logs-alert.tsx +72 -0
  97. package/src/components/editor/chrome/panels/datasources-panel.tsx +3 -1
  98. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +3 -1
  99. package/src/components/editor/chrome/panels/documentation-panel.tsx +3 -1
  100. package/src/components/editor/chrome/panels/error-panel.tsx +3 -1
  101. package/src/components/editor/chrome/panels/file-explorer-panel.tsx +3 -1
  102. package/src/components/editor/chrome/panels/logs-panel.tsx +3 -1
  103. package/src/components/editor/chrome/panels/outline-panel.tsx +3 -1
  104. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -2
  105. package/src/components/editor/chrome/panels/scratchpad-panel.tsx +3 -1
  106. package/src/components/editor/chrome/panels/secrets-panel.tsx +3 -1
  107. package/src/components/editor/chrome/panels/snippets-panel.tsx +3 -1
  108. package/src/components/editor/chrome/panels/tracing-panel.tsx +3 -1
  109. package/src/components/editor/chrome/panels/variable-panel.tsx +3 -1
  110. package/src/components/editor/chrome/wrapper/app-chrome.tsx +38 -28
  111. package/src/components/editor/controls/command-palette-button.tsx +1 -1
  112. package/src/components/editor/controls/command-palette.tsx +5 -4
  113. package/src/components/editor/controls/state.ts +4 -0
  114. package/src/components/editor/package-alert.tsx +108 -58
  115. package/src/components/editor/renderers/CellArray.tsx +2 -0
  116. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +0 -1
  117. package/src/components/pages/edit-page.tsx +7 -3
  118. package/src/core/ai/chat-utils.ts +26 -43
  119. package/src/core/ai/config.ts +1 -1
  120. package/src/core/ai/context/__tests__/registry.test.ts +277 -3
  121. package/src/core/ai/context/context.ts +11 -1
  122. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +378 -0
  123. package/src/core/ai/context/providers/__tests__/error.test.ts +3 -2
  124. package/src/core/ai/context/providers/__tests__/file.test.ts +119 -0
  125. package/src/core/ai/context/providers/cell-output.ts +349 -0
  126. package/src/core/ai/context/providers/common.ts +5 -1
  127. package/src/core/ai/context/providers/file.ts +287 -0
  128. package/src/core/ai/context/registry.ts +79 -0
  129. package/src/core/ai/state.ts +22 -5
  130. package/src/core/alerts/state.ts +71 -3
  131. package/src/core/cells/cell.ts +2 -2
  132. package/src/core/cells/cells.ts +1 -1
  133. package/src/core/cells/logs.ts +1 -1
  134. package/src/core/cells/runs.ts +6 -5
  135. package/src/core/codemirror/ai/resources.ts +47 -5
  136. package/src/core/codemirror/ai/state.ts +12 -0
  137. package/src/core/codemirror/language/__tests__/sql.test.ts +45 -0
  138. package/src/core/codemirror/markdown/__tests__/commands.test.ts +1 -0
  139. package/src/core/codemirror/theme/dark.ts +1 -1
  140. package/src/core/config/capabilities.ts +1 -1
  141. package/src/core/datasets/__tests__/data-source.test.ts +24 -0
  142. package/src/core/errors/__tests__/errors.test.ts +2 -0
  143. package/src/core/islands/bridge.ts +1 -0
  144. package/src/core/islands/main.ts +1 -0
  145. package/src/core/kernel/messages.ts +12 -6
  146. package/src/core/layout/layout.ts +3 -3
  147. package/src/core/network/requests-network.ts +8 -0
  148. package/src/core/network/requests-static.ts +1 -0
  149. package/src/core/network/requests-toasting.ts +1 -0
  150. package/src/core/network/types.ts +4 -1
  151. package/src/core/wasm/bridge.ts +18 -2
  152. package/src/core/wasm/worker/bootstrap.ts +3 -1
  153. package/src/core/wasm/worker/getMarimoWheel.ts +3 -8
  154. package/src/core/wasm/worker/types.ts +3 -0
  155. package/src/core/websocket/useMarimoWebSocket.tsx +7 -1
  156. package/src/css/app/Cell.css +42 -21
  157. package/src/css/app/codemirror.css +5 -1
  158. package/src/css/globals.css +3 -0
  159. package/src/css/md.css +1 -1
  160. package/src/plugins/impl/MicrophonePlugin.tsx +2 -2
  161. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -9
  162. package/src/plugins/impl/chat/chat-ui.tsx +129 -110
  163. package/src/plugins/impl/chat/types.ts +5 -8
  164. package/src/plugins/impl/code/__tests__/language.test.ts +15 -0
  165. package/src/plugins/impl/code/any-language-editor.tsx +11 -8
  166. package/src/plugins/layout/MimeRenderPlugin.tsx +3 -6
  167. package/src/stories/cell.stories.tsx +6 -0
  168. package/src/stories/layout/vertical/one-column.stories.tsx +215 -0
  169. package/src/theme/useTheme.ts +11 -6
  170. package/src/utils/__tests__/blob.test.ts +37 -0
  171. package/src/utils/arrays.ts +13 -0
  172. package/src/utils/fileToBase64.ts +21 -6
  173. package/src/utils/json/base64.ts +5 -2
  174. package/src/utils/numbers.ts +9 -7
  175. package/dist/any-language-editor-DC5170DQ.js +0 -45
  176. package/dist/asn1-jKiBa2Ya.js +0 -95
  177. package/dist/clojure-CCKyeQKf.js +0 -800
  178. package/dist/css-BkF-NPzE.js +0 -1553
  179. package/dist/index-5ZH_qS8j.js +0 -288
  180. package/dist/index-U4yn89qO.js +0 -341
  181. package/dist/javascript-C2yteZeJ.js +0 -691
  182. package/dist/min-DS5Jz-hg.js +0 -80
  183. package/dist/mindmap-definition-LNHGMQRG-0aOVaMR8.js +0 -3234
  184. package/dist/mllike-BSnXJBGA.js +0 -272
  185. package/dist/pug-CwAQJzGR.js +0 -248
  186. package/dist/python-BkR3uSy8.js +0 -313
  187. package/dist/rpm-IznJm2Xc.js +0 -57
  188. package/dist/sequenceDiagram-WFGC7UMF-DMhHzllb.js +0 -2284
  189. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
@@ -1,3234 +0,0 @@
1
- var _a;
2
- import { _, l as Q, c as nt, K as yt, V as Et, H as rt, i as q, W as Lt, X as Tt, Y as Nt, d as mt, a5 as Dt, P as Ot } from "./mermaid-Cg5IX6Nv.js";
3
- import { c as ut } from "./cytoscape.esm-BYnVVhJX.js";
4
- import { M as At } from "./main-B5yML0bw.js";
5
- var J = { exports: {} }, tt = { exports: {} }, et = { exports: {} }, It = et.exports, lt;
6
- function Ct() {
7
- return lt || (lt = 1, function(I, w) {
8
- (function(D, v) {
9
- I.exports = v();
10
- })(It, function() {
11
- return (
12
- /******/
13
- function(f) {
14
- var D = {};
15
- function v(r) {
16
- if (D[r])
17
- return D[r].exports;
18
- var t = D[r] = {
19
- /******/
20
- i: r,
21
- /******/
22
- l: false,
23
- /******/
24
- exports: {}
25
- /******/
26
- };
27
- return f[r].call(t.exports, t, t.exports, v), t.l = true, t.exports;
28
- }
29
- return v.m = f, v.c = D, v.i = function(r) {
30
- return r;
31
- }, v.d = function(r, t, e) {
32
- v.o(r, t) || Object.defineProperty(r, t, {
33
- /******/
34
- configurable: false,
35
- /******/
36
- enumerable: true,
37
- /******/
38
- get: e
39
- /******/
40
- });
41
- }, v.n = function(r) {
42
- var t = r && r.__esModule ? (
43
- /******/
44
- function() {
45
- return r.default;
46
- }
47
- ) : (
48
- /******/
49
- function() {
50
- return r;
51
- }
52
- );
53
- return v.d(t, "a", t), t;
54
- }, v.o = function(r, t) {
55
- return Object.prototype.hasOwnProperty.call(r, t);
56
- }, v.p = "", v(v.s = 26);
57
- }([
58
- /* 0 */
59
- /***/
60
- function(f, D, v) {
61
- function r() {
62
- }
63
- r.QUALITY = 1, r.DEFAULT_CREATE_BENDS_AS_NEEDED = false, r.DEFAULT_INCREMENTAL = false, r.DEFAULT_ANIMATION_ON_LAYOUT = true, r.DEFAULT_ANIMATION_DURING_LAYOUT = false, r.DEFAULT_ANIMATION_PERIOD = 50, r.DEFAULT_UNIFORM_LEAF_NODE_SIZES = false, r.DEFAULT_GRAPH_MARGIN = 15, r.NODE_DIMENSIONS_INCLUDE_LABELS = false, r.SIMPLE_NODE_SIZE = 40, r.SIMPLE_NODE_HALF_SIZE = r.SIMPLE_NODE_SIZE / 2, r.EMPTY_COMPOUND_NODE_SIZE = 40, r.MIN_EDGE_LENGTH = 1, r.WORLD_BOUNDARY = 1e6, r.INITIAL_WORLD_BOUNDARY = r.WORLD_BOUNDARY / 1e3, r.WORLD_CENTER_X = 1200, r.WORLD_CENTER_Y = 900, f.exports = r;
64
- },
65
- /* 1 */
66
- /***/
67
- function(f, D, v) {
68
- var r = v(2), t = v(8), e = v(9);
69
- function i(g, a, y) {
70
- r.call(this, y), this.isOverlapingSourceAndTarget = false, this.vGraphObject = y, this.bendpoints = [], this.source = g, this.target = a;
71
- }
72
- i.prototype = Object.create(r.prototype);
73
- for (var o in r)
74
- i[o] = r[o];
75
- i.prototype.getSource = function() {
76
- return this.source;
77
- }, i.prototype.getTarget = function() {
78
- return this.target;
79
- }, i.prototype.isInterGraph = function() {
80
- return this.isInterGraph;
81
- }, i.prototype.getLength = function() {
82
- return this.length;
83
- }, i.prototype.isOverlapingSourceAndTarget = function() {
84
- return this.isOverlapingSourceAndTarget;
85
- }, i.prototype.getBendpoints = function() {
86
- return this.bendpoints;
87
- }, i.prototype.getLca = function() {
88
- return this.lca;
89
- }, i.prototype.getSourceInLca = function() {
90
- return this.sourceInLca;
91
- }, i.prototype.getTargetInLca = function() {
92
- return this.targetInLca;
93
- }, i.prototype.getOtherEnd = function(g) {
94
- if (this.source === g)
95
- return this.target;
96
- if (this.target === g)
97
- return this.source;
98
- throw "Node is not incident with this edge";
99
- }, i.prototype.getOtherEndInGraph = function(g, a) {
100
- for (var y = this.getOtherEnd(g), n = a.getGraphManager().getRoot(); ; ) {
101
- if (y.getOwner() == a)
102
- return y;
103
- if (y.getOwner() == n)
104
- break;
105
- y = y.getOwner().getParent();
106
- }
107
- return null;
108
- }, i.prototype.updateLength = function() {
109
- var g = new Array(4);
110
- this.isOverlapingSourceAndTarget = t.getIntersection(this.target.getRect(), this.source.getRect(), g), this.isOverlapingSourceAndTarget || (this.lengthX = g[0] - g[2], this.lengthY = g[1] - g[3], Math.abs(this.lengthX) < 1 && (this.lengthX = e.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = e.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
111
- }, i.prototype.updateLengthSimple = function() {
112
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = e.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = e.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
113
- }, f.exports = i;
114
- },
115
- /* 2 */
116
- /***/
117
- function(f, D, v) {
118
- function r(t) {
119
- this.vGraphObject = t;
120
- }
121
- f.exports = r;
122
- },
123
- /* 3 */
124
- /***/
125
- function(f, D, v) {
126
- var r = v(2), t = v(10), e = v(13), i = v(0), o = v(16), g = v(4);
127
- function a(n, c, l, E) {
128
- l == null && E == null && (E = c), r.call(this, E), n.graphManager != null && (n = n.graphManager), this.estimatedSize = t.MIN_VALUE, this.inclusionTreeDepth = t.MAX_VALUE, this.vGraphObject = E, this.edges = [], this.graphManager = n, l != null && c != null ? this.rect = new e(c.x, c.y, l.width, l.height) : this.rect = new e();
129
- }
130
- a.prototype = Object.create(r.prototype);
131
- for (var y in r)
132
- a[y] = r[y];
133
- a.prototype.getEdges = function() {
134
- return this.edges;
135
- }, a.prototype.getChild = function() {
136
- return this.child;
137
- }, a.prototype.getOwner = function() {
138
- return this.owner;
139
- }, a.prototype.getWidth = function() {
140
- return this.rect.width;
141
- }, a.prototype.setWidth = function(n) {
142
- this.rect.width = n;
143
- }, a.prototype.getHeight = function() {
144
- return this.rect.height;
145
- }, a.prototype.setHeight = function(n) {
146
- this.rect.height = n;
147
- }, a.prototype.getCenterX = function() {
148
- return this.rect.x + this.rect.width / 2;
149
- }, a.prototype.getCenterY = function() {
150
- return this.rect.y + this.rect.height / 2;
151
- }, a.prototype.getCenter = function() {
152
- return new g(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
153
- }, a.prototype.getLocation = function() {
154
- return new g(this.rect.x, this.rect.y);
155
- }, a.prototype.getRect = function() {
156
- return this.rect;
157
- }, a.prototype.getDiagonal = function() {
158
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
159
- }, a.prototype.getHalfTheDiagonal = function() {
160
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
161
- }, a.prototype.setRect = function(n, c) {
162
- this.rect.x = n.x, this.rect.y = n.y, this.rect.width = c.width, this.rect.height = c.height;
163
- }, a.prototype.setCenter = function(n, c) {
164
- this.rect.x = n - this.rect.width / 2, this.rect.y = c - this.rect.height / 2;
165
- }, a.prototype.setLocation = function(n, c) {
166
- this.rect.x = n, this.rect.y = c;
167
- }, a.prototype.moveBy = function(n, c) {
168
- this.rect.x += n, this.rect.y += c;
169
- }, a.prototype.getEdgeListToNode = function(n) {
170
- var c = [], l = this;
171
- return l.edges.forEach(function(E) {
172
- if (E.target == n) {
173
- if (E.source != l) throw "Incorrect edge source!";
174
- c.push(E);
175
- }
176
- }), c;
177
- }, a.prototype.getEdgesBetween = function(n) {
178
- var c = [], l = this;
179
- return l.edges.forEach(function(E) {
180
- if (!(E.source == l || E.target == l)) throw "Incorrect edge source and/or target";
181
- (E.target == n || E.source == n) && c.push(E);
182
- }), c;
183
- }, a.prototype.getNeighborsList = function() {
184
- var n = /* @__PURE__ */ new Set(), c = this;
185
- return c.edges.forEach(function(l) {
186
- if (l.source == c)
187
- n.add(l.target);
188
- else {
189
- if (l.target != c)
190
- throw "Incorrect incidency!";
191
- n.add(l.source);
192
- }
193
- }), n;
194
- }, a.prototype.withChildren = function() {
195
- var n = /* @__PURE__ */ new Set(), c, l;
196
- if (n.add(this), this.child != null)
197
- for (var E = this.child.getNodes(), T = 0; T < E.length; T++)
198
- c = E[T], l = c.withChildren(), l.forEach(function(m) {
199
- n.add(m);
200
- });
201
- return n;
202
- }, a.prototype.getNoOfChildren = function() {
203
- var n = 0, c;
204
- if (this.child == null)
205
- n = 1;
206
- else
207
- for (var l = this.child.getNodes(), E = 0; E < l.length; E++)
208
- c = l[E], n += c.getNoOfChildren();
209
- return n == 0 && (n = 1), n;
210
- }, a.prototype.getEstimatedSize = function() {
211
- if (this.estimatedSize == t.MIN_VALUE)
212
- throw "assert failed";
213
- return this.estimatedSize;
214
- }, a.prototype.calcEstimatedSize = function() {
215
- 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);
216
- }, a.prototype.scatter = function() {
217
- var n, c, l = -i.INITIAL_WORLD_BOUNDARY, E = i.INITIAL_WORLD_BOUNDARY;
218
- n = i.WORLD_CENTER_X + o.nextDouble() * (E - l) + l;
219
- var T = -i.INITIAL_WORLD_BOUNDARY, m = i.INITIAL_WORLD_BOUNDARY;
220
- c = i.WORLD_CENTER_Y + o.nextDouble() * (m - T) + T, this.rect.x = n, this.rect.y = c;
221
- }, a.prototype.updateBounds = function() {
222
- if (this.getChild() == null)
223
- throw "assert failed";
224
- if (this.getChild().getNodes().length != 0) {
225
- var n = this.getChild();
226
- if (n.updateBounds(true), this.rect.x = n.getLeft(), this.rect.y = n.getTop(), this.setWidth(n.getRight() - n.getLeft()), this.setHeight(n.getBottom() - n.getTop()), i.NODE_DIMENSIONS_INCLUDE_LABELS) {
227
- var c = n.getRight() - n.getLeft(), l = n.getBottom() - n.getTop();
228
- this.labelWidth > c && (this.rect.x -= (this.labelWidth - c) / 2, this.setWidth(this.labelWidth)), this.labelHeight > l && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - l) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - l), this.setHeight(this.labelHeight));
229
- }
230
- }
231
- }, a.prototype.getInclusionTreeDepth = function() {
232
- if (this.inclusionTreeDepth == t.MAX_VALUE)
233
- throw "assert failed";
234
- return this.inclusionTreeDepth;
235
- }, a.prototype.transform = function(n) {
236
- var c = this.rect.x;
237
- c > i.WORLD_BOUNDARY ? c = i.WORLD_BOUNDARY : c < -i.WORLD_BOUNDARY && (c = -i.WORLD_BOUNDARY);
238
- var l = this.rect.y;
239
- l > i.WORLD_BOUNDARY ? l = i.WORLD_BOUNDARY : l < -i.WORLD_BOUNDARY && (l = -i.WORLD_BOUNDARY);
240
- var E = new g(c, l), T = n.inverseTransformPoint(E);
241
- this.setLocation(T.x, T.y);
242
- }, a.prototype.getLeft = function() {
243
- return this.rect.x;
244
- }, a.prototype.getRight = function() {
245
- return this.rect.x + this.rect.width;
246
- }, a.prototype.getTop = function() {
247
- return this.rect.y;
248
- }, a.prototype.getBottom = function() {
249
- return this.rect.y + this.rect.height;
250
- }, a.prototype.getParent = function() {
251
- return this.owner == null ? null : this.owner.getParent();
252
- }, f.exports = a;
253
- },
254
- /* 4 */
255
- /***/
256
- function(f, D, v) {
257
- function r(t, e) {
258
- t == null && e == null ? (this.x = 0, this.y = 0) : (this.x = t, this.y = e);
259
- }
260
- r.prototype.getX = function() {
261
- return this.x;
262
- }, r.prototype.getY = function() {
263
- return this.y;
264
- }, r.prototype.setX = function(t) {
265
- this.x = t;
266
- }, r.prototype.setY = function(t) {
267
- this.y = t;
268
- }, r.prototype.getDifference = function(t) {
269
- return new DimensionD(this.x - t.x, this.y - t.y);
270
- }, r.prototype.getCopy = function() {
271
- return new r(this.x, this.y);
272
- }, r.prototype.translate = function(t) {
273
- return this.x += t.width, this.y += t.height, this;
274
- }, f.exports = r;
275
- },
276
- /* 5 */
277
- /***/
278
- function(f, D, v) {
279
- var r = v(2), t = v(10), e = v(0), i = v(6), o = v(3), g = v(1), a = v(13), y = v(12), n = v(11);
280
- function c(E, T, m) {
281
- r.call(this, m), this.estimatedSize = t.MIN_VALUE, this.margin = e.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = false, this.parent = E, T != null && T instanceof i ? this.graphManager = T : T != null && T instanceof Layout && (this.graphManager = T.graphManager);
282
- }
283
- c.prototype = Object.create(r.prototype);
284
- for (var l in r)
285
- c[l] = r[l];
286
- c.prototype.getNodes = function() {
287
- return this.nodes;
288
- }, c.prototype.getEdges = function() {
289
- return this.edges;
290
- }, c.prototype.getGraphManager = function() {
291
- return this.graphManager;
292
- }, c.prototype.getParent = function() {
293
- return this.parent;
294
- }, c.prototype.getLeft = function() {
295
- return this.left;
296
- }, c.prototype.getRight = function() {
297
- return this.right;
298
- }, c.prototype.getTop = function() {
299
- return this.top;
300
- }, c.prototype.getBottom = function() {
301
- return this.bottom;
302
- }, c.prototype.isConnected = function() {
303
- return this.isConnected;
304
- }, c.prototype.add = function(E, T, m) {
305
- if (T == null && m == null) {
306
- var L = E;
307
- if (this.graphManager == null)
308
- throw "Graph has no graph mgr!";
309
- if (this.getNodes().indexOf(L) > -1)
310
- throw "Node already in graph!";
311
- return L.owner = this, this.getNodes().push(L), L;
312
- } else {
313
- var O = E;
314
- if (!(this.getNodes().indexOf(T) > -1 && this.getNodes().indexOf(m) > -1))
315
- throw "Source or target not in graph!";
316
- if (!(T.owner == m.owner && T.owner == this))
317
- throw "Both owners must be this graph!";
318
- return T.owner != m.owner ? null : (O.source = T, O.target = m, O.isInterGraph = false, this.getEdges().push(O), T.edges.push(O), m != T && m.edges.push(O), O);
319
- }
320
- }, c.prototype.remove = function(E) {
321
- var T = E;
322
- if (E instanceof o) {
323
- if (T == null)
324
- throw "Node is null!";
325
- if (!(T.owner != null && T.owner == this))
326
- throw "Owner graph is invalid!";
327
- if (this.graphManager == null)
328
- throw "Owner graph manager is invalid!";
329
- for (var m = T.edges.slice(), L, O = m.length, d = 0; d < O; d++)
330
- L = m[d], L.isInterGraph ? this.graphManager.remove(L) : L.source.owner.remove(L);
331
- var N = this.nodes.indexOf(T);
332
- if (N == -1)
333
- throw "Node not in owner node list!";
334
- this.nodes.splice(N, 1);
335
- } else if (E instanceof g) {
336
- var L = E;
337
- if (L == null)
338
- throw "Edge is null!";
339
- if (!(L.source != null && L.target != null))
340
- throw "Source and/or target is null!";
341
- if (!(L.source.owner != null && L.target.owner != null && L.source.owner == this && L.target.owner == this))
342
- throw "Source and/or target owner is invalid!";
343
- var s = L.source.edges.indexOf(L), h = L.target.edges.indexOf(L);
344
- if (!(s > -1 && h > -1))
345
- throw "Source and/or target doesn't know this edge!";
346
- L.source.edges.splice(s, 1), L.target != L.source && L.target.edges.splice(h, 1);
347
- var N = L.source.owner.getEdges().indexOf(L);
348
- if (N == -1)
349
- throw "Not in owner's edge list!";
350
- L.source.owner.getEdges().splice(N, 1);
351
- }
352
- }, c.prototype.updateLeftTop = function() {
353
- for (var E = t.MAX_VALUE, T = t.MAX_VALUE, m, L, O, d = this.getNodes(), N = d.length, s = 0; s < N; s++) {
354
- var h = d[s];
355
- m = h.getTop(), L = h.getLeft(), E > m && (E = m), T > L && (T = L);
356
- }
357
- return E == t.MAX_VALUE ? null : (d[0].getParent().paddingLeft != null ? O = d[0].getParent().paddingLeft : O = this.margin, this.left = T - O, this.top = E - O, new y(this.left, this.top));
358
- }, c.prototype.updateBounds = function(E) {
359
- for (var T = t.MAX_VALUE, m = -t.MAX_VALUE, L = t.MAX_VALUE, O = -t.MAX_VALUE, d, N, s, h, u, p = this.nodes, A = p.length, C = 0; C < A; C++) {
360
- var R = p[C];
361
- E && R.child != null && R.updateBounds(), d = R.getLeft(), N = R.getRight(), s = R.getTop(), h = R.getBottom(), T > d && (T = d), m < N && (m = N), L > s && (L = s), O < h && (O = h);
362
- }
363
- var x = new a(T, L, m - T, O - L);
364
- T == t.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), p[0].getParent().paddingLeft != null ? u = p[0].getParent().paddingLeft : u = this.margin, this.left = x.x - u, this.right = x.x + x.width + u, this.top = x.y - u, this.bottom = x.y + x.height + u;
365
- }, c.calculateBounds = function(E) {
366
- for (var T = t.MAX_VALUE, m = -t.MAX_VALUE, L = t.MAX_VALUE, O = -t.MAX_VALUE, d, N, s, h, u = E.length, p = 0; p < u; p++) {
367
- var A = E[p];
368
- d = A.getLeft(), N = A.getRight(), s = A.getTop(), h = A.getBottom(), T > d && (T = d), m < N && (m = N), L > s && (L = s), O < h && (O = h);
369
- }
370
- var C = new a(T, L, m - T, O - L);
371
- return C;
372
- }, c.prototype.getInclusionTreeDepth = function() {
373
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
374
- }, c.prototype.getEstimatedSize = function() {
375
- if (this.estimatedSize == t.MIN_VALUE)
376
- throw "assert failed";
377
- return this.estimatedSize;
378
- }, c.prototype.calcEstimatedSize = function() {
379
- for (var E = 0, T = this.nodes, m = T.length, L = 0; L < m; L++) {
380
- var O = T[L];
381
- E += O.calcEstimatedSize();
382
- }
383
- return E == 0 ? this.estimatedSize = e.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = E / Math.sqrt(this.nodes.length), this.estimatedSize;
384
- }, c.prototype.updateConnected = function() {
385
- var E = this;
386
- if (this.nodes.length == 0) {
387
- this.isConnected = true;
388
- return;
389
- }
390
- var T = new n(), m = /* @__PURE__ */ new Set(), L = this.nodes[0], O, d, N = L.withChildren();
391
- for (N.forEach(function(C) {
392
- T.push(C), m.add(C);
393
- }); T.length !== 0; ) {
394
- L = T.shift(), O = L.getEdges();
395
- for (var s = O.length, h = 0; h < s; h++) {
396
- var u = O[h];
397
- if (d = u.getOtherEndInGraph(L, this), d != null && !m.has(d)) {
398
- var p = d.withChildren();
399
- p.forEach(function(C) {
400
- T.push(C), m.add(C);
401
- });
402
- }
403
- }
404
- }
405
- if (this.isConnected = false, m.size >= this.nodes.length) {
406
- var A = 0;
407
- m.forEach(function(C) {
408
- C.owner == E && A++;
409
- }), A == this.nodes.length && (this.isConnected = true);
410
- }
411
- }, f.exports = c;
412
- },
413
- /* 6 */
414
- /***/
415
- function(f, D, v) {
416
- var r, t = v(1);
417
- function e(i) {
418
- r = v(5), this.layout = i, this.graphs = [], this.edges = [];
419
- }
420
- e.prototype.addRoot = function() {
421
- var i = this.layout.newGraph(), o = this.layout.newNode(null), g = this.add(i, o);
422
- return this.setRootGraph(g), this.rootGraph;
423
- }, e.prototype.add = function(i, o, g, a, y) {
424
- if (g == null && a == null && y == null) {
425
- if (i == null)
426
- throw "Graph is null!";
427
- if (o == null)
428
- throw "Parent node is null!";
429
- if (this.graphs.indexOf(i) > -1)
430
- throw "Graph already in this graph mgr!";
431
- if (this.graphs.push(i), i.parent != null)
432
- throw "Already has a parent!";
433
- if (o.child != null)
434
- throw "Already has a child!";
435
- return i.parent = o, o.child = i, i;
436
- } else {
437
- y = g, a = o, g = i;
438
- var n = a.getOwner(), c = y.getOwner();
439
- if (!(n != null && n.getGraphManager() == this))
440
- throw "Source not in this graph mgr!";
441
- if (!(c != null && c.getGraphManager() == this))
442
- throw "Target not in this graph mgr!";
443
- if (n == c)
444
- return g.isInterGraph = false, n.add(g, a, y);
445
- if (g.isInterGraph = true, g.source = a, g.target = y, this.edges.indexOf(g) > -1)
446
- throw "Edge already in inter-graph edge list!";
447
- if (this.edges.push(g), !(g.source != null && g.target != null))
448
- throw "Edge source and/or target is null!";
449
- if (!(g.source.edges.indexOf(g) == -1 && g.target.edges.indexOf(g) == -1))
450
- throw "Edge already in source and/or target incidency list!";
451
- return g.source.edges.push(g), g.target.edges.push(g), g;
452
- }
453
- }, e.prototype.remove = function(i) {
454
- if (i instanceof r) {
455
- var o = i;
456
- if (o.getGraphManager() != this)
457
- throw "Graph not in this graph mgr";
458
- if (!(o == this.rootGraph || o.parent != null && o.parent.graphManager == this))
459
- throw "Invalid parent node!";
460
- var g = [];
461
- g = g.concat(o.getEdges());
462
- for (var a, y = g.length, n = 0; n < y; n++)
463
- a = g[n], o.remove(a);
464
- var c = [];
465
- c = c.concat(o.getNodes());
466
- var l;
467
- y = c.length;
468
- for (var n = 0; n < y; n++)
469
- l = c[n], o.remove(l);
470
- o == this.rootGraph && this.setRootGraph(null);
471
- var E = this.graphs.indexOf(o);
472
- this.graphs.splice(E, 1), o.parent = null;
473
- } else if (i instanceof t) {
474
- if (a = i, a == null)
475
- throw "Edge is null!";
476
- if (!a.isInterGraph)
477
- throw "Not an inter-graph edge!";
478
- if (!(a.source != null && a.target != null))
479
- throw "Source and/or target is null!";
480
- if (!(a.source.edges.indexOf(a) != -1 && a.target.edges.indexOf(a) != -1))
481
- throw "Source and/or target doesn't know this edge!";
482
- var E = a.source.edges.indexOf(a);
483
- if (a.source.edges.splice(E, 1), E = a.target.edges.indexOf(a), a.target.edges.splice(E, 1), !(a.source.owner != null && a.source.owner.getGraphManager() != null))
484
- throw "Edge owner graph or owner graph manager is null!";
485
- if (a.source.owner.getGraphManager().edges.indexOf(a) == -1)
486
- throw "Not in owner graph manager's edge list!";
487
- var E = a.source.owner.getGraphManager().edges.indexOf(a);
488
- a.source.owner.getGraphManager().edges.splice(E, 1);
489
- }
490
- }, e.prototype.updateBounds = function() {
491
- this.rootGraph.updateBounds(true);
492
- }, e.prototype.getGraphs = function() {
493
- return this.graphs;
494
- }, e.prototype.getAllNodes = function() {
495
- if (this.allNodes == null) {
496
- for (var i = [], o = this.getGraphs(), g = o.length, a = 0; a < g; a++)
497
- i = i.concat(o[a].getNodes());
498
- this.allNodes = i;
499
- }
500
- return this.allNodes;
501
- }, e.prototype.resetAllNodes = function() {
502
- this.allNodes = null;
503
- }, e.prototype.resetAllEdges = function() {
504
- this.allEdges = null;
505
- }, e.prototype.resetAllNodesToApplyGravitation = function() {
506
- this.allNodesToApplyGravitation = null;
507
- }, e.prototype.getAllEdges = function() {
508
- if (this.allEdges == null) {
509
- var i = [], o = this.getGraphs();
510
- o.length;
511
- for (var g = 0; g < o.length; g++)
512
- i = i.concat(o[g].getEdges());
513
- i = i.concat(this.edges), this.allEdges = i;
514
- }
515
- return this.allEdges;
516
- }, e.prototype.getAllNodesToApplyGravitation = function() {
517
- return this.allNodesToApplyGravitation;
518
- }, e.prototype.setAllNodesToApplyGravitation = function(i) {
519
- if (this.allNodesToApplyGravitation != null)
520
- throw "assert failed";
521
- this.allNodesToApplyGravitation = i;
522
- }, e.prototype.getRoot = function() {
523
- return this.rootGraph;
524
- }, e.prototype.setRootGraph = function(i) {
525
- if (i.getGraphManager() != this)
526
- throw "Root not in this graph mgr!";
527
- this.rootGraph = i, i.parent == null && (i.parent = this.layout.newNode("Root node"));
528
- }, e.prototype.getLayout = function() {
529
- return this.layout;
530
- }, e.prototype.isOneAncestorOfOther = function(i, o) {
531
- if (!(i != null && o != null))
532
- throw "assert failed";
533
- if (i == o)
534
- return true;
535
- var g = i.getOwner(), a;
536
- do {
537
- if (a = g.getParent(), a == null)
538
- break;
539
- if (a == o)
540
- return true;
541
- if (g = a.getOwner(), g == null)
542
- break;
543
- } while (true);
544
- g = o.getOwner();
545
- do {
546
- if (a = g.getParent(), a == null)
547
- break;
548
- if (a == i)
549
- return true;
550
- if (g = a.getOwner(), g == null)
551
- break;
552
- } while (true);
553
- return false;
554
- }, e.prototype.calcLowestCommonAncestors = function() {
555
- for (var i, o, g, a, y, n = this.getAllEdges(), c = n.length, l = 0; l < c; l++) {
556
- if (i = n[l], o = i.source, g = i.target, i.lca = null, i.sourceInLca = o, i.targetInLca = g, o == g) {
557
- i.lca = o.getOwner();
558
- continue;
559
- }
560
- for (a = o.getOwner(); i.lca == null; ) {
561
- for (i.targetInLca = g, y = g.getOwner(); i.lca == null; ) {
562
- if (y == a) {
563
- i.lca = y;
564
- break;
565
- }
566
- if (y == this.rootGraph)
567
- break;
568
- if (i.lca != null)
569
- throw "assert failed";
570
- i.targetInLca = y.getParent(), y = i.targetInLca.getOwner();
571
- }
572
- if (a == this.rootGraph)
573
- break;
574
- i.lca == null && (i.sourceInLca = a.getParent(), a = i.sourceInLca.getOwner());
575
- }
576
- if (i.lca == null)
577
- throw "assert failed";
578
- }
579
- }, e.prototype.calcLowestCommonAncestor = function(i, o) {
580
- if (i == o)
581
- return i.getOwner();
582
- var g = i.getOwner();
583
- do {
584
- if (g == null)
585
- break;
586
- var a = o.getOwner();
587
- do {
588
- if (a == null)
589
- break;
590
- if (a == g)
591
- return a;
592
- a = a.getParent().getOwner();
593
- } while (true);
594
- g = g.getParent().getOwner();
595
- } while (true);
596
- return g;
597
- }, e.prototype.calcInclusionTreeDepths = function(i, o) {
598
- i == null && o == null && (i = this.rootGraph, o = 1);
599
- for (var g, a = i.getNodes(), y = a.length, n = 0; n < y; n++)
600
- g = a[n], g.inclusionTreeDepth = o, g.child != null && this.calcInclusionTreeDepths(g.child, o + 1);
601
- }, e.prototype.includesInvalidEdge = function() {
602
- for (var i, o = this.edges.length, g = 0; g < o; g++)
603
- if (i = this.edges[g], this.isOneAncestorOfOther(i.source, i.target))
604
- return true;
605
- return false;
606
- }, f.exports = e;
607
- },
608
- /* 7 */
609
- /***/
610
- function(f, D, v) {
611
- var r = v(0);
612
- function t() {
613
- }
614
- for (var e in r)
615
- t[e] = r[e];
616
- t.MAX_ITERATIONS = 2500, t.DEFAULT_EDGE_LENGTH = 50, t.DEFAULT_SPRING_STRENGTH = 0.45, t.DEFAULT_REPULSION_STRENGTH = 4500, t.DEFAULT_GRAVITY_STRENGTH = 0.4, t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, t.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true, t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true, t.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, t.COOLING_ADAPTATION_FACTOR = 0.33, t.ADAPTATION_LOWER_NODE_LIMIT = 1e3, t.ADAPTATION_UPPER_NODE_LIMIT = 5e3, t.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, t.MAX_NODE_DISPLACEMENT = t.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, t.MIN_REPULSION_DIST = t.DEFAULT_EDGE_LENGTH / 10, t.CONVERGENCE_CHECK_PERIOD = 100, t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, t.MIN_EDGE_LENGTH = 1, t.GRID_CALCULATION_CHECK_PERIOD = 10, f.exports = t;
617
- },
618
- /* 8 */
619
- /***/
620
- function(f, D, v) {
621
- var r = v(12);
622
- function t() {
623
- }
624
- t.calcSeparationAmount = function(e, i, o, g) {
625
- if (!e.intersects(i))
626
- throw "assert failed";
627
- var a = new Array(2);
628
- this.decideDirectionsForOverlappingNodes(e, i, a), o[0] = Math.min(e.getRight(), i.getRight()) - Math.max(e.x, i.x), o[1] = Math.min(e.getBottom(), i.getBottom()) - Math.max(e.y, i.y), e.getX() <= i.getX() && e.getRight() >= i.getRight() ? o[0] += Math.min(i.getX() - e.getX(), e.getRight() - i.getRight()) : i.getX() <= e.getX() && i.getRight() >= e.getRight() && (o[0] += Math.min(e.getX() - i.getX(), i.getRight() - e.getRight())), e.getY() <= i.getY() && e.getBottom() >= i.getBottom() ? o[1] += Math.min(i.getY() - e.getY(), e.getBottom() - i.getBottom()) : i.getY() <= e.getY() && i.getBottom() >= e.getBottom() && (o[1] += Math.min(e.getY() - i.getY(), i.getBottom() - e.getBottom()));
629
- var y = Math.abs((i.getCenterY() - e.getCenterY()) / (i.getCenterX() - e.getCenterX()));
630
- i.getCenterY() === e.getCenterY() && i.getCenterX() === e.getCenterX() && (y = 1);
631
- var n = y * o[0], c = o[1] / y;
632
- o[0] < c ? c = o[0] : n = o[1], o[0] = -1 * a[0] * (c / 2 + g), o[1] = -1 * a[1] * (n / 2 + g);
633
- }, t.decideDirectionsForOverlappingNodes = function(e, i, o) {
634
- e.getCenterX() < i.getCenterX() ? o[0] = -1 : o[0] = 1, e.getCenterY() < i.getCenterY() ? o[1] = -1 : o[1] = 1;
635
- }, t.getIntersection2 = function(e, i, o) {
636
- var g = e.getCenterX(), a = e.getCenterY(), y = i.getCenterX(), n = i.getCenterY();
637
- if (e.intersects(i))
638
- return o[0] = g, o[1] = a, o[2] = y, o[3] = n, true;
639
- var c = e.getX(), l = e.getY(), E = e.getRight(), T = e.getX(), m = e.getBottom(), L = e.getRight(), O = e.getWidthHalf(), d = e.getHeightHalf(), N = i.getX(), s = i.getY(), h = i.getRight(), u = i.getX(), p = i.getBottom(), A = i.getRight(), C = i.getWidthHalf(), R = i.getHeightHalf(), x = false, G = false;
640
- if (g === y) {
641
- if (a > n)
642
- return o[0] = g, o[1] = l, o[2] = y, o[3] = p, false;
643
- if (a < n)
644
- return o[0] = g, o[1] = m, o[2] = y, o[3] = s, false;
645
- } else if (a === n) {
646
- if (g > y)
647
- return o[0] = c, o[1] = a, o[2] = h, o[3] = n, false;
648
- if (g < y)
649
- return o[0] = E, o[1] = a, o[2] = N, o[3] = n, false;
650
- } else {
651
- var U = e.height / e.width, X = i.height / i.width, M = (n - a) / (y - g), S = void 0, F = void 0, b = void 0, Y = void 0, k = void 0, H = void 0;
652
- if (-U === M ? g > y ? (o[0] = T, o[1] = m, x = true) : (o[0] = E, o[1] = l, x = true) : U === M && (g > y ? (o[0] = c, o[1] = l, x = true) : (o[0] = L, o[1] = m, x = true)), -X === M ? y > g ? (o[2] = u, o[3] = p, G = true) : (o[2] = h, o[3] = s, G = true) : X === M && (y > g ? (o[2] = N, o[3] = s, G = true) : (o[2] = A, o[3] = p, G = true)), x && G)
653
- return false;
654
- if (g > y ? a > n ? (S = this.getCardinalDirection(U, M, 4), F = this.getCardinalDirection(X, M, 2)) : (S = this.getCardinalDirection(-U, M, 3), F = this.getCardinalDirection(-X, M, 1)) : a > n ? (S = this.getCardinalDirection(-U, M, 1), F = this.getCardinalDirection(-X, M, 3)) : (S = this.getCardinalDirection(U, M, 2), F = this.getCardinalDirection(X, M, 4)), !x)
655
- switch (S) {
656
- case 1:
657
- Y = l, b = g + -d / M, o[0] = b, o[1] = Y;
658
- break;
659
- case 2:
660
- b = L, Y = a + O * M, o[0] = b, o[1] = Y;
661
- break;
662
- case 3:
663
- Y = m, b = g + d / M, o[0] = b, o[1] = Y;
664
- break;
665
- case 4:
666
- b = T, Y = a + -O * M, o[0] = b, o[1] = Y;
667
- break;
668
- }
669
- if (!G)
670
- switch (F) {
671
- case 1:
672
- H = s, k = y + -R / M, o[2] = k, o[3] = H;
673
- break;
674
- case 2:
675
- k = A, H = n + C * M, o[2] = k, o[3] = H;
676
- break;
677
- case 3:
678
- H = p, k = y + R / M, o[2] = k, o[3] = H;
679
- break;
680
- case 4:
681
- k = u, H = n + -C * M, o[2] = k, o[3] = H;
682
- break;
683
- }
684
- }
685
- return false;
686
- }, t.getCardinalDirection = function(e, i, o) {
687
- return e > i ? o : 1 + o % 4;
688
- }, t.getIntersection = function(e, i, o, g) {
689
- if (g == null)
690
- return this.getIntersection2(e, i, o);
691
- var a = e.x, y = e.y, n = i.x, c = i.y, l = o.x, E = o.y, T = g.x, m = g.y, L = void 0, O = void 0, d = void 0, N = void 0, s = void 0, h = void 0, u = void 0, p = void 0, A = void 0;
692
- return d = c - y, s = a - n, u = n * y - a * c, N = m - E, h = l - T, p = T * E - l * m, A = d * h - N * s, A === 0 ? null : (L = (s * p - h * u) / A, O = (N * u - d * p) / A, new r(L, O));
693
- }, t.angleOfVector = function(e, i, o, g) {
694
- var a = void 0;
695
- return e !== o ? (a = Math.atan((g - i) / (o - e)), o < e ? a += Math.PI : g < i && (a += this.TWO_PI)) : g < i ? a = this.ONE_AND_HALF_PI : a = this.HALF_PI, a;
696
- }, t.doIntersect = function(e, i, o, g) {
697
- var a = e.x, y = e.y, n = i.x, c = i.y, l = o.x, E = o.y, T = g.x, m = g.y, L = (n - a) * (m - E) - (T - l) * (c - y);
698
- if (L === 0)
699
- return false;
700
- var O = ((m - E) * (T - a) + (l - T) * (m - y)) / L, d = ((y - c) * (T - a) + (n - a) * (m - y)) / L;
701
- return 0 < O && O < 1 && 0 < d && d < 1;
702
- }, t.HALF_PI = 0.5 * Math.PI, t.ONE_AND_HALF_PI = 1.5 * Math.PI, t.TWO_PI = 2 * Math.PI, t.THREE_PI = 3 * Math.PI, f.exports = t;
703
- },
704
- /* 9 */
705
- /***/
706
- function(f, D, v) {
707
- function r() {
708
- }
709
- r.sign = function(t) {
710
- return t > 0 ? 1 : t < 0 ? -1 : 0;
711
- }, r.floor = function(t) {
712
- return t < 0 ? Math.ceil(t) : Math.floor(t);
713
- }, r.ceil = function(t) {
714
- return t < 0 ? Math.floor(t) : Math.ceil(t);
715
- }, f.exports = r;
716
- },
717
- /* 10 */
718
- /***/
719
- function(f, D, v) {
720
- function r() {
721
- }
722
- r.MAX_VALUE = 2147483647, r.MIN_VALUE = -2147483648, f.exports = r;
723
- },
724
- /* 11 */
725
- /***/
726
- function(f, D, v) {
727
- var r = /* @__PURE__ */ function() {
728
- function a(y, n) {
729
- for (var c = 0; c < n.length; c++) {
730
- var l = n[c];
731
- l.enumerable = l.enumerable || false, l.configurable = true, "value" in l && (l.writable = true), Object.defineProperty(y, l.key, l);
732
- }
733
- }
734
- return function(y, n, c) {
735
- return n && a(y.prototype, n), c && a(y, c), y;
736
- };
737
- }();
738
- function t(a, y) {
739
- if (!(a instanceof y))
740
- throw new TypeError("Cannot call a class as a function");
741
- }
742
- var e = function(y) {
743
- return { value: y, next: null, prev: null };
744
- }, i = function(y, n, c, l) {
745
- return y !== null ? y.next = n : l.head = n, c !== null ? c.prev = n : l.tail = n, n.prev = y, n.next = c, l.length++, n;
746
- }, o = function(y, n) {
747
- var c = y.prev, l = y.next;
748
- return c !== null ? c.next = l : n.head = l, l !== null ? l.prev = c : n.tail = c, y.prev = y.next = null, n.length--, y;
749
- }, g = function() {
750
- function a(y) {
751
- var n = this;
752
- t(this, a), this.length = 0, this.head = null, this.tail = null, y == null ? void 0 : y.forEach(function(c) {
753
- return n.push(c);
754
- });
755
- }
756
- return r(a, [{
757
- key: "size",
758
- value: function() {
759
- return this.length;
760
- }
761
- }, {
762
- key: "insertBefore",
763
- value: function(n, c) {
764
- return i(c.prev, e(n), c, this);
765
- }
766
- }, {
767
- key: "insertAfter",
768
- value: function(n, c) {
769
- return i(c, e(n), c.next, this);
770
- }
771
- }, {
772
- key: "insertNodeBefore",
773
- value: function(n, c) {
774
- return i(c.prev, n, c, this);
775
- }
776
- }, {
777
- key: "insertNodeAfter",
778
- value: function(n, c) {
779
- return i(c, n, c.next, this);
780
- }
781
- }, {
782
- key: "push",
783
- value: function(n) {
784
- return i(this.tail, e(n), null, this);
785
- }
786
- }, {
787
- key: "unshift",
788
- value: function(n) {
789
- return i(null, e(n), this.head, this);
790
- }
791
- }, {
792
- key: "remove",
793
- value: function(n) {
794
- return o(n, this);
795
- }
796
- }, {
797
- key: "pop",
798
- value: function() {
799
- return o(this.tail, this).value;
800
- }
801
- }, {
802
- key: "popNode",
803
- value: function() {
804
- return o(this.tail, this);
805
- }
806
- }, {
807
- key: "shift",
808
- value: function() {
809
- return o(this.head, this).value;
810
- }
811
- }, {
812
- key: "shiftNode",
813
- value: function() {
814
- return o(this.head, this);
815
- }
816
- }, {
817
- key: "get_object_at",
818
- value: function(n) {
819
- if (n <= this.length()) {
820
- for (var c = 1, l = this.head; c < n; )
821
- l = l.next, c++;
822
- return l.value;
823
- }
824
- }
825
- }, {
826
- key: "set_object_at",
827
- value: function(n, c) {
828
- if (n <= this.length()) {
829
- for (var l = 1, E = this.head; l < n; )
830
- E = E.next, l++;
831
- E.value = c;
832
- }
833
- }
834
- }]), a;
835
- }();
836
- f.exports = g;
837
- },
838
- /* 12 */
839
- /***/
840
- function(f, D, v) {
841
- function r(t, e, i) {
842
- this.x = null, this.y = null, t == null && e == null && i == null ? (this.x = 0, this.y = 0) : typeof t == "number" && typeof e == "number" && i == null ? (this.x = t, this.y = e) : t.constructor.name == "Point" && e == null && i == null && (i = t, this.x = i.x, this.y = i.y);
843
- }
844
- r.prototype.getX = function() {
845
- return this.x;
846
- }, r.prototype.getY = function() {
847
- return this.y;
848
- }, r.prototype.getLocation = function() {
849
- return new r(this.x, this.y);
850
- }, r.prototype.setLocation = function(t, e, i) {
851
- t.constructor.name == "Point" && e == null && i == null ? (i = t, this.setLocation(i.x, i.y)) : typeof t == "number" && typeof e == "number" && i == null && (parseInt(t) == t && parseInt(e) == e ? this.move(t, e) : (this.x = Math.floor(t + 0.5), this.y = Math.floor(e + 0.5)));
852
- }, r.prototype.move = function(t, e) {
853
- this.x = t, this.y = e;
854
- }, r.prototype.translate = function(t, e) {
855
- this.x += t, this.y += e;
856
- }, r.prototype.equals = function(t) {
857
- if (t.constructor.name == "Point") {
858
- var e = t;
859
- return this.x == e.x && this.y == e.y;
860
- }
861
- return this == t;
862
- }, r.prototype.toString = function() {
863
- return new r().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
864
- }, f.exports = r;
865
- },
866
- /* 13 */
867
- /***/
868
- function(f, D, v) {
869
- function r(t, e, i, o) {
870
- this.x = 0, this.y = 0, this.width = 0, this.height = 0, t != null && e != null && i != null && o != null && (this.x = t, this.y = e, this.width = i, this.height = o);
871
- }
872
- r.prototype.getX = function() {
873
- return this.x;
874
- }, r.prototype.setX = function(t) {
875
- this.x = t;
876
- }, r.prototype.getY = function() {
877
- return this.y;
878
- }, r.prototype.setY = function(t) {
879
- this.y = t;
880
- }, r.prototype.getWidth = function() {
881
- return this.width;
882
- }, r.prototype.setWidth = function(t) {
883
- this.width = t;
884
- }, r.prototype.getHeight = function() {
885
- return this.height;
886
- }, r.prototype.setHeight = function(t) {
887
- this.height = t;
888
- }, r.prototype.getRight = function() {
889
- return this.x + this.width;
890
- }, r.prototype.getBottom = function() {
891
- return this.y + this.height;
892
- }, r.prototype.intersects = function(t) {
893
- return !(this.getRight() < t.x || this.getBottom() < t.y || t.getRight() < this.x || t.getBottom() < this.y);
894
- }, r.prototype.getCenterX = function() {
895
- return this.x + this.width / 2;
896
- }, r.prototype.getMinX = function() {
897
- return this.getX();
898
- }, r.prototype.getMaxX = function() {
899
- return this.getX() + this.width;
900
- }, r.prototype.getCenterY = function() {
901
- return this.y + this.height / 2;
902
- }, r.prototype.getMinY = function() {
903
- return this.getY();
904
- }, r.prototype.getMaxY = function() {
905
- return this.getY() + this.height;
906
- }, r.prototype.getWidthHalf = function() {
907
- return this.width / 2;
908
- }, r.prototype.getHeightHalf = function() {
909
- return this.height / 2;
910
- }, f.exports = r;
911
- },
912
- /* 14 */
913
- /***/
914
- function(f, D, v) {
915
- var r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
916
- return typeof e;
917
- } : function(e) {
918
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
919
- };
920
- function t() {
921
- }
922
- t.lastID = 0, t.createID = function(e) {
923
- return t.isPrimitive(e) ? e : (e.uniqueID != null || (e.uniqueID = t.getString(), t.lastID++), e.uniqueID);
924
- }, t.getString = function(e) {
925
- return e == null && (e = t.lastID), "Object#" + e;
926
- }, t.isPrimitive = function(e) {
927
- var i = typeof e > "u" ? "undefined" : r(e);
928
- return e == null || i != "object" && i != "function";
929
- }, f.exports = t;
930
- },
931
- /* 15 */
932
- /***/
933
- function(f, D, v) {
934
- function r(l) {
935
- if (Array.isArray(l)) {
936
- for (var E = 0, T = Array(l.length); E < l.length; E++)
937
- T[E] = l[E];
938
- return T;
939
- } else
940
- return Array.from(l);
941
- }
942
- var t = v(0), e = v(6), i = v(3), o = v(1), g = v(5), a = v(4), y = v(17), n = v(27);
943
- function c(l) {
944
- n.call(this), this.layoutQuality = t.QUALITY, this.createBendsAsNeeded = t.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = t.DEFAULT_INCREMENTAL, this.animationOnLayout = t.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = t.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = t.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = t.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new e(this), this.isLayoutFinished = false, this.isSubLayout = false, this.isRemoteUse = false, l != null && (this.isRemoteUse = l);
945
- }
946
- c.RANDOM_SEED = 1, c.prototype = Object.create(n.prototype), c.prototype.getGraphManager = function() {
947
- return this.graphManager;
948
- }, c.prototype.getAllNodes = function() {
949
- return this.graphManager.getAllNodes();
950
- }, c.prototype.getAllEdges = function() {
951
- return this.graphManager.getAllEdges();
952
- }, c.prototype.getAllNodesToApplyGravitation = function() {
953
- return this.graphManager.getAllNodesToApplyGravitation();
954
- }, c.prototype.newGraphManager = function() {
955
- var l = new e(this);
956
- return this.graphManager = l, l;
957
- }, c.prototype.newGraph = function(l) {
958
- return new g(null, this.graphManager, l);
959
- }, c.prototype.newNode = function(l) {
960
- return new i(this.graphManager, l);
961
- }, c.prototype.newEdge = function(l) {
962
- return new o(null, null, l);
963
- }, c.prototype.checkLayoutSuccess = function() {
964
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
965
- }, c.prototype.runLayout = function() {
966
- this.isLayoutFinished = false, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
967
- var l;
968
- return this.checkLayoutSuccess() ? l = false : l = this.layout(), t.ANIMATE === "during" ? false : (l && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = true, l);
969
- }, c.prototype.doPostLayout = function() {
970
- this.incremental || this.transform(), this.update();
971
- }, c.prototype.update2 = function() {
972
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
973
- for (var l = this.graphManager.getAllEdges(), E = 0; E < l.length; E++)
974
- l[E];
975
- for (var T = this.graphManager.getRoot().getNodes(), E = 0; E < T.length; E++)
976
- T[E];
977
- this.update(this.graphManager.getRoot());
978
- }
979
- }, c.prototype.update = function(l) {
980
- if (l == null)
981
- this.update2();
982
- else if (l instanceof i) {
983
- var E = l;
984
- if (E.getChild() != null)
985
- for (var T = E.getChild().getNodes(), m = 0; m < T.length; m++)
986
- update(T[m]);
987
- if (E.vGraphObject != null) {
988
- var L = E.vGraphObject;
989
- L.update(E);
990
- }
991
- } else if (l instanceof o) {
992
- var O = l;
993
- if (O.vGraphObject != null) {
994
- var d = O.vGraphObject;
995
- d.update(O);
996
- }
997
- } else if (l instanceof g) {
998
- var N = l;
999
- if (N.vGraphObject != null) {
1000
- var s = N.vGraphObject;
1001
- s.update(N);
1002
- }
1003
- }
1004
- }, c.prototype.initParameters = function() {
1005
- this.isSubLayout || (this.layoutQuality = t.QUALITY, this.animationDuringLayout = t.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = t.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = t.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = t.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = t.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = t.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = false);
1006
- }, c.prototype.transform = function(l) {
1007
- if (l == null)
1008
- this.transform(new a(0, 0));
1009
- else {
1010
- var E = new y(), T = this.graphManager.getRoot().updateLeftTop();
1011
- if (T != null) {
1012
- E.setWorldOrgX(l.x), E.setWorldOrgY(l.y), E.setDeviceOrgX(T.x), E.setDeviceOrgY(T.y);
1013
- for (var m = this.getAllNodes(), L, O = 0; O < m.length; O++)
1014
- L = m[O], L.transform(E);
1015
- }
1016
- }
1017
- }, c.prototype.positionNodesRandomly = function(l) {
1018
- if (l == null)
1019
- this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(true);
1020
- else
1021
- for (var E, T, m = l.getNodes(), L = 0; L < m.length; L++)
1022
- E = m[L], T = E.getChild(), T == null || T.getNodes().length == 0 ? E.scatter() : (this.positionNodesRandomly(T), E.updateBounds());
1023
- }, c.prototype.getFlatForest = function() {
1024
- for (var l = [], E = true, T = this.graphManager.getRoot().getNodes(), m = true, L = 0; L < T.length; L++)
1025
- T[L].getChild() != null && (m = false);
1026
- if (!m)
1027
- return l;
1028
- var O = /* @__PURE__ */ new Set(), d = [], N = /* @__PURE__ */ new Map(), s = [];
1029
- for (s = s.concat(T); s.length > 0 && E; ) {
1030
- for (d.push(s[0]); d.length > 0 && E; ) {
1031
- var h = d[0];
1032
- d.splice(0, 1), O.add(h);
1033
- for (var u = h.getEdges(), L = 0; L < u.length; L++) {
1034
- var p = u[L].getOtherEnd(h);
1035
- if (N.get(h) != p)
1036
- if (!O.has(p))
1037
- d.push(p), N.set(p, h);
1038
- else {
1039
- E = false;
1040
- break;
1041
- }
1042
- }
1043
- }
1044
- if (!E)
1045
- l = [];
1046
- else {
1047
- var A = [].concat(r(O));
1048
- l.push(A);
1049
- for (var L = 0; L < A.length; L++) {
1050
- var C = A[L], R = s.indexOf(C);
1051
- R > -1 && s.splice(R, 1);
1052
- }
1053
- O = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Map();
1054
- }
1055
- }
1056
- return l;
1057
- }, c.prototype.createDummyNodesForBendpoints = function(l) {
1058
- for (var E = [], T = l.source, m = this.graphManager.calcLowestCommonAncestor(l.source, l.target), L = 0; L < l.bendpoints.length; L++) {
1059
- var O = this.newNode(null);
1060
- O.setRect(new Point(0, 0), new Dimension(1, 1)), m.add(O);
1061
- var d = this.newEdge(null);
1062
- this.graphManager.add(d, T, O), E.add(O), T = O;
1063
- }
1064
- var d = this.newEdge(null);
1065
- return this.graphManager.add(d, T, l.target), this.edgeToDummyNodes.set(l, E), l.isInterGraph() ? this.graphManager.remove(l) : m.remove(l), E;
1066
- }, c.prototype.createBendpointsFromDummyNodes = function() {
1067
- var l = [];
1068
- l = l.concat(this.graphManager.getAllEdges()), l = [].concat(r(this.edgeToDummyNodes.keys())).concat(l);
1069
- for (var E = 0; E < l.length; E++) {
1070
- var T = l[E];
1071
- if (T.bendpoints.length > 0) {
1072
- for (var m = this.edgeToDummyNodes.get(T), L = 0; L < m.length; L++) {
1073
- var O = m[L], d = new a(O.getCenterX(), O.getCenterY()), N = T.bendpoints.get(L);
1074
- N.x = d.x, N.y = d.y, O.getOwner().remove(O);
1075
- }
1076
- this.graphManager.add(T, T.source, T.target);
1077
- }
1078
- }
1079
- }, c.transform = function(l, E, T, m) {
1080
- if (T != null && m != null) {
1081
- var L = E;
1082
- if (l <= 50) {
1083
- var O = E / T;
1084
- L -= (E - O) / 50 * (50 - l);
1085
- } else {
1086
- var d = E * m;
1087
- L += (d - E) / 50 * (l - 50);
1088
- }
1089
- return L;
1090
- } else {
1091
- var N, s;
1092
- return l <= 50 ? (N = 9 * E / 500, s = E / 10) : (N = 9 * E / 50, s = -8 * E), N * l + s;
1093
- }
1094
- }, c.findCenterOfTree = function(l) {
1095
- var E = [];
1096
- E = E.concat(l);
1097
- var T = [], m = /* @__PURE__ */ new Map(), L = false, O = null;
1098
- (E.length == 1 || E.length == 2) && (L = true, O = E[0]);
1099
- for (var d = 0; d < E.length; d++) {
1100
- var N = E[d], s = N.getNeighborsList().size;
1101
- m.set(N, N.getNeighborsList().size), s == 1 && T.push(N);
1102
- }
1103
- var h = [];
1104
- for (h = h.concat(T); !L; ) {
1105
- var u = [];
1106
- u = u.concat(h), h = [];
1107
- for (var d = 0; d < E.length; d++) {
1108
- var N = E[d], p = E.indexOf(N);
1109
- p >= 0 && E.splice(p, 1);
1110
- var A = N.getNeighborsList();
1111
- A.forEach(function(x) {
1112
- if (T.indexOf(x) < 0) {
1113
- var G = m.get(x), U = G - 1;
1114
- U == 1 && h.push(x), m.set(x, U);
1115
- }
1116
- });
1117
- }
1118
- T = T.concat(h), (E.length == 1 || E.length == 2) && (L = true, O = E[0]);
1119
- }
1120
- return O;
1121
- }, c.prototype.setGraphManager = function(l) {
1122
- this.graphManager = l;
1123
- }, f.exports = c;
1124
- },
1125
- /* 16 */
1126
- /***/
1127
- function(f, D, v) {
1128
- function r() {
1129
- }
1130
- r.seed = 1, r.x = 0, r.nextDouble = function() {
1131
- return r.x = Math.sin(r.seed++) * 1e4, r.x - Math.floor(r.x);
1132
- }, f.exports = r;
1133
- },
1134
- /* 17 */
1135
- /***/
1136
- function(f, D, v) {
1137
- var r = v(4);
1138
- function t(e, i) {
1139
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1140
- }
1141
- t.prototype.getWorldOrgX = function() {
1142
- return this.lworldOrgX;
1143
- }, t.prototype.setWorldOrgX = function(e) {
1144
- this.lworldOrgX = e;
1145
- }, t.prototype.getWorldOrgY = function() {
1146
- return this.lworldOrgY;
1147
- }, t.prototype.setWorldOrgY = function(e) {
1148
- this.lworldOrgY = e;
1149
- }, t.prototype.getWorldExtX = function() {
1150
- return this.lworldExtX;
1151
- }, t.prototype.setWorldExtX = function(e) {
1152
- this.lworldExtX = e;
1153
- }, t.prototype.getWorldExtY = function() {
1154
- return this.lworldExtY;
1155
- }, t.prototype.setWorldExtY = function(e) {
1156
- this.lworldExtY = e;
1157
- }, t.prototype.getDeviceOrgX = function() {
1158
- return this.ldeviceOrgX;
1159
- }, t.prototype.setDeviceOrgX = function(e) {
1160
- this.ldeviceOrgX = e;
1161
- }, t.prototype.getDeviceOrgY = function() {
1162
- return this.ldeviceOrgY;
1163
- }, t.prototype.setDeviceOrgY = function(e) {
1164
- this.ldeviceOrgY = e;
1165
- }, t.prototype.getDeviceExtX = function() {
1166
- return this.ldeviceExtX;
1167
- }, t.prototype.setDeviceExtX = function(e) {
1168
- this.ldeviceExtX = e;
1169
- }, t.prototype.getDeviceExtY = function() {
1170
- return this.ldeviceExtY;
1171
- }, t.prototype.setDeviceExtY = function(e) {
1172
- this.ldeviceExtY = e;
1173
- }, t.prototype.transformX = function(e) {
1174
- var i = 0, o = this.lworldExtX;
1175
- return o != 0 && (i = this.ldeviceOrgX + (e - this.lworldOrgX) * this.ldeviceExtX / o), i;
1176
- }, t.prototype.transformY = function(e) {
1177
- var i = 0, o = this.lworldExtY;
1178
- return o != 0 && (i = this.ldeviceOrgY + (e - this.lworldOrgY) * this.ldeviceExtY / o), i;
1179
- }, t.prototype.inverseTransformX = function(e) {
1180
- var i = 0, o = this.ldeviceExtX;
1181
- return o != 0 && (i = this.lworldOrgX + (e - this.ldeviceOrgX) * this.lworldExtX / o), i;
1182
- }, t.prototype.inverseTransformY = function(e) {
1183
- var i = 0, o = this.ldeviceExtY;
1184
- return o != 0 && (i = this.lworldOrgY + (e - this.ldeviceOrgY) * this.lworldExtY / o), i;
1185
- }, t.prototype.inverseTransformPoint = function(e) {
1186
- var i = new r(this.inverseTransformX(e.x), this.inverseTransformY(e.y));
1187
- return i;
1188
- }, f.exports = t;
1189
- },
1190
- /* 18 */
1191
- /***/
1192
- function(f, D, v) {
1193
- function r(n) {
1194
- if (Array.isArray(n)) {
1195
- for (var c = 0, l = Array(n.length); c < n.length; c++)
1196
- l[c] = n[c];
1197
- return l;
1198
- } else
1199
- return Array.from(n);
1200
- }
1201
- var t = v(15), e = v(7), i = v(0), o = v(8), g = v(9);
1202
- function a() {
1203
- t.call(this), this.useSmartIdealEdgeLengthCalculation = e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = e.DEFAULT_EDGE_LENGTH, this.springConstant = e.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = e.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = e.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = e.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = e.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * e.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = e.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = e.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = e.MAX_ITERATIONS;
1204
- }
1205
- a.prototype = Object.create(t.prototype);
1206
- for (var y in t)
1207
- a[y] = t[y];
1208
- a.prototype.initParameters = function() {
1209
- t.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1210
- }, a.prototype.calcIdealEdgeLengths = function() {
1211
- for (var n, c, l, E, T, m, L = this.getGraphManager().getAllEdges(), O = 0; O < L.length; O++)
1212
- n = L[O], n.idealLength = this.idealEdgeLength, n.isInterGraph && (l = n.getSource(), E = n.getTarget(), T = n.getSourceInLca().getEstimatedSize(), m = n.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (n.idealLength += T + m - 2 * i.SIMPLE_NODE_SIZE), c = n.getLca().getInclusionTreeDepth(), n.idealLength += e.DEFAULT_EDGE_LENGTH * e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (l.getInclusionTreeDepth() + E.getInclusionTreeDepth() - 2 * c));
1213
- }, a.prototype.initSpringEmbedder = function() {
1214
- var n = this.getAllNodes().length;
1215
- this.incremental ? (n > e.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * e.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (n - e.ADAPTATION_LOWER_NODE_LIMIT) / (e.ADAPTATION_UPPER_NODE_LIMIT - e.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - e.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = e.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (n > e.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(e.COOLING_ADAPTATION_FACTOR, 1 - (n - e.ADAPTATION_LOWER_NODE_LIMIT) / (e.ADAPTATION_UPPER_NODE_LIMIT - e.ADAPTATION_LOWER_NODE_LIMIT) * (1 - e.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = e.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1216
- }, a.prototype.calcSpringForces = function() {
1217
- for (var n = this.getAllEdges(), c, l = 0; l < n.length; l++)
1218
- c = n[l], this.calcSpringForce(c, c.idealLength);
1219
- }, a.prototype.calcRepulsionForces = function() {
1220
- var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, l, E, T, m, L = this.getAllNodes(), O;
1221
- if (this.useFRGridVariant)
1222
- for (this.totalIterations % e.GRID_CALCULATION_CHECK_PERIOD == 1 && n && this.updateGrid(), O = /* @__PURE__ */ new Set(), l = 0; l < L.length; l++)
1223
- T = L[l], this.calculateRepulsionForceOfANode(T, O, n, c), O.add(T);
1224
- else
1225
- for (l = 0; l < L.length; l++)
1226
- for (T = L[l], E = l + 1; E < L.length; E++)
1227
- m = L[E], T.getOwner() == m.getOwner() && this.calcRepulsionForce(T, m);
1228
- }, a.prototype.calcGravitationalForces = function() {
1229
- for (var n, c = this.getAllNodesToApplyGravitation(), l = 0; l < c.length; l++)
1230
- n = c[l], this.calcGravitationalForce(n);
1231
- }, a.prototype.moveNodes = function() {
1232
- for (var n = this.getAllNodes(), c, l = 0; l < n.length; l++)
1233
- c = n[l], c.move();
1234
- }, a.prototype.calcSpringForce = function(n, c) {
1235
- var l = n.getSource(), E = n.getTarget(), T, m, L, O;
1236
- if (this.uniformLeafNodeSizes && l.getChild() == null && E.getChild() == null)
1237
- n.updateLengthSimple();
1238
- else if (n.updateLength(), n.isOverlapingSourceAndTarget)
1239
- return;
1240
- T = n.getLength(), T != 0 && (m = this.springConstant * (T - c), L = m * (n.lengthX / T), O = m * (n.lengthY / T), l.springForceX += L, l.springForceY += O, E.springForceX -= L, E.springForceY -= O);
1241
- }, a.prototype.calcRepulsionForce = function(n, c) {
1242
- var l = n.getRect(), E = c.getRect(), T = new Array(2), m = new Array(4), L, O, d, N, s, h, u;
1243
- if (l.intersects(E)) {
1244
- o.calcSeparationAmount(l, E, T, e.DEFAULT_EDGE_LENGTH / 2), h = 2 * T[0], u = 2 * T[1];
1245
- var p = n.noOfChildren * c.noOfChildren / (n.noOfChildren + c.noOfChildren);
1246
- n.repulsionForceX -= p * h, n.repulsionForceY -= p * u, c.repulsionForceX += p * h, c.repulsionForceY += p * u;
1247
- } else
1248
- this.uniformLeafNodeSizes && n.getChild() == null && c.getChild() == null ? (L = E.getCenterX() - l.getCenterX(), O = E.getCenterY() - l.getCenterY()) : (o.getIntersection(l, E, m), L = m[2] - m[0], O = m[3] - m[1]), Math.abs(L) < e.MIN_REPULSION_DIST && (L = g.sign(L) * e.MIN_REPULSION_DIST), Math.abs(O) < e.MIN_REPULSION_DIST && (O = g.sign(O) * e.MIN_REPULSION_DIST), d = L * L + O * O, N = Math.sqrt(d), s = this.repulsionConstant * n.noOfChildren * c.noOfChildren / d, h = s * L / N, u = s * O / N, n.repulsionForceX -= h, n.repulsionForceY -= u, c.repulsionForceX += h, c.repulsionForceY += u;
1249
- }, a.prototype.calcGravitationalForce = function(n) {
1250
- var c, l, E, T, m, L, O, d;
1251
- c = n.getOwner(), l = (c.getRight() + c.getLeft()) / 2, E = (c.getTop() + c.getBottom()) / 2, T = n.getCenterX() - l, m = n.getCenterY() - E, L = Math.abs(T) + n.getWidth() / 2, O = Math.abs(m) + n.getHeight() / 2, n.getOwner() == this.graphManager.getRoot() ? (d = c.getEstimatedSize() * this.gravityRangeFactor, (L > d || O > d) && (n.gravitationForceX = -this.gravityConstant * T, n.gravitationForceY = -this.gravityConstant * m)) : (d = c.getEstimatedSize() * this.compoundGravityRangeFactor, (L > d || O > d) && (n.gravitationForceX = -this.gravityConstant * T * this.compoundGravityConstant, n.gravitationForceY = -this.gravityConstant * m * this.compoundGravityConstant));
1252
- }, a.prototype.isConverged = function() {
1253
- var n, c = false;
1254
- return this.totalIterations > this.maxIterations / 3 && (c = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), n = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, n || c;
1255
- }, a.prototype.animate = function() {
1256
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1257
- }, a.prototype.calcNoOfChildrenForAllNodes = function() {
1258
- for (var n, c = this.graphManager.getAllNodes(), l = 0; l < c.length; l++)
1259
- n = c[l], n.noOfChildren = n.getNoOfChildren();
1260
- }, a.prototype.calcGrid = function(n) {
1261
- var c = 0, l = 0;
1262
- c = parseInt(Math.ceil((n.getRight() - n.getLeft()) / this.repulsionRange)), l = parseInt(Math.ceil((n.getBottom() - n.getTop()) / this.repulsionRange));
1263
- for (var E = new Array(c), T = 0; T < c; T++)
1264
- E[T] = new Array(l);
1265
- for (var T = 0; T < c; T++)
1266
- for (var m = 0; m < l; m++)
1267
- E[T][m] = new Array();
1268
- return E;
1269
- }, a.prototype.addNodeToGrid = function(n, c, l) {
1270
- var E = 0, T = 0, m = 0, L = 0;
1271
- E = parseInt(Math.floor((n.getRect().x - c) / this.repulsionRange)), T = parseInt(Math.floor((n.getRect().width + n.getRect().x - c) / this.repulsionRange)), m = parseInt(Math.floor((n.getRect().y - l) / this.repulsionRange)), L = parseInt(Math.floor((n.getRect().height + n.getRect().y - l) / this.repulsionRange));
1272
- for (var O = E; O <= T; O++)
1273
- for (var d = m; d <= L; d++)
1274
- this.grid[O][d].push(n), n.setGridCoordinates(E, T, m, L);
1275
- }, a.prototype.updateGrid = function() {
1276
- var n, c, l = this.getAllNodes();
1277
- for (this.grid = this.calcGrid(this.graphManager.getRoot()), n = 0; n < l.length; n++)
1278
- c = l[n], this.addNodeToGrid(c, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1279
- }, a.prototype.calculateRepulsionForceOfANode = function(n, c, l, E) {
1280
- if (this.totalIterations % e.GRID_CALCULATION_CHECK_PERIOD == 1 && l || E) {
1281
- var T = /* @__PURE__ */ new Set();
1282
- n.surrounding = new Array();
1283
- for (var m, L = this.grid, O = n.startX - 1; O < n.finishX + 2; O++)
1284
- for (var d = n.startY - 1; d < n.finishY + 2; d++)
1285
- if (!(O < 0 || d < 0 || O >= L.length || d >= L[0].length)) {
1286
- for (var N = 0; N < L[O][d].length; N++)
1287
- if (m = L[O][d][N], !(n.getOwner() != m.getOwner() || n == m) && !c.has(m) && !T.has(m)) {
1288
- var s = Math.abs(n.getCenterX() - m.getCenterX()) - (n.getWidth() / 2 + m.getWidth() / 2), h = Math.abs(n.getCenterY() - m.getCenterY()) - (n.getHeight() / 2 + m.getHeight() / 2);
1289
- s <= this.repulsionRange && h <= this.repulsionRange && T.add(m);
1290
- }
1291
- }
1292
- n.surrounding = [].concat(r(T));
1293
- }
1294
- for (O = 0; O < n.surrounding.length; O++)
1295
- this.calcRepulsionForce(n, n.surrounding[O]);
1296
- }, a.prototype.calcRepulsionRange = function() {
1297
- return 0;
1298
- }, f.exports = a;
1299
- },
1300
- /* 19 */
1301
- /***/
1302
- function(f, D, v) {
1303
- var r = v(1), t = v(7);
1304
- function e(o, g, a) {
1305
- r.call(this, o, g, a), this.idealLength = t.DEFAULT_EDGE_LENGTH;
1306
- }
1307
- e.prototype = Object.create(r.prototype);
1308
- for (var i in r)
1309
- e[i] = r[i];
1310
- f.exports = e;
1311
- },
1312
- /* 20 */
1313
- /***/
1314
- function(f, D, v) {
1315
- var r = v(3);
1316
- function t(i, o, g, a) {
1317
- r.call(this, i, o, g, a), 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 = [];
1318
- }
1319
- t.prototype = Object.create(r.prototype);
1320
- for (var e in r)
1321
- t[e] = r[e];
1322
- t.prototype.setGridCoordinates = function(i, o, g, a) {
1323
- this.startX = i, this.finishX = o, this.startY = g, this.finishY = a;
1324
- }, f.exports = t;
1325
- },
1326
- /* 21 */
1327
- /***/
1328
- function(f, D, v) {
1329
- function r(t, e) {
1330
- this.width = 0, this.height = 0, t !== null && e !== null && (this.height = e, this.width = t);
1331
- }
1332
- r.prototype.getWidth = function() {
1333
- return this.width;
1334
- }, r.prototype.setWidth = function(t) {
1335
- this.width = t;
1336
- }, r.prototype.getHeight = function() {
1337
- return this.height;
1338
- }, r.prototype.setHeight = function(t) {
1339
- this.height = t;
1340
- }, f.exports = r;
1341
- },
1342
- /* 22 */
1343
- /***/
1344
- function(f, D, v) {
1345
- var r = v(14);
1346
- function t() {
1347
- this.map = {}, this.keys = [];
1348
- }
1349
- t.prototype.put = function(e, i) {
1350
- var o = r.createID(e);
1351
- this.contains(o) || (this.map[o] = i, this.keys.push(e));
1352
- }, t.prototype.contains = function(e) {
1353
- return r.createID(e), this.map[e] != null;
1354
- }, t.prototype.get = function(e) {
1355
- var i = r.createID(e);
1356
- return this.map[i];
1357
- }, t.prototype.keySet = function() {
1358
- return this.keys;
1359
- }, f.exports = t;
1360
- },
1361
- /* 23 */
1362
- /***/
1363
- function(f, D, v) {
1364
- var r = v(14);
1365
- function t() {
1366
- this.set = {};
1367
- }
1368
- t.prototype.add = function(e) {
1369
- var i = r.createID(e);
1370
- this.contains(i) || (this.set[i] = e);
1371
- }, t.prototype.remove = function(e) {
1372
- delete this.set[r.createID(e)];
1373
- }, t.prototype.clear = function() {
1374
- this.set = {};
1375
- }, t.prototype.contains = function(e) {
1376
- return this.set[r.createID(e)] == e;
1377
- }, t.prototype.isEmpty = function() {
1378
- return this.size() === 0;
1379
- }, t.prototype.size = function() {
1380
- return Object.keys(this.set).length;
1381
- }, t.prototype.addAllTo = function(e) {
1382
- for (var i = Object.keys(this.set), o = i.length, g = 0; g < o; g++)
1383
- e.push(this.set[i[g]]);
1384
- }, t.prototype.size = function() {
1385
- return Object.keys(this.set).length;
1386
- }, t.prototype.addAll = function(e) {
1387
- for (var i = e.length, o = 0; o < i; o++) {
1388
- var g = e[o];
1389
- this.add(g);
1390
- }
1391
- }, f.exports = t;
1392
- },
1393
- /* 24 */
1394
- /***/
1395
- function(f, D, v) {
1396
- var r = /* @__PURE__ */ function() {
1397
- function o(g, a) {
1398
- for (var y = 0; y < a.length; y++) {
1399
- var n = a[y];
1400
- n.enumerable = n.enumerable || false, n.configurable = true, "value" in n && (n.writable = true), Object.defineProperty(g, n.key, n);
1401
- }
1402
- }
1403
- return function(g, a, y) {
1404
- return a && o(g.prototype, a), y && o(g, y), g;
1405
- };
1406
- }();
1407
- function t(o, g) {
1408
- if (!(o instanceof g))
1409
- throw new TypeError("Cannot call a class as a function");
1410
- }
1411
- var e = v(11), i = function() {
1412
- function o(g, a) {
1413
- t(this, o), (a !== null || a !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1414
- var y = void 0;
1415
- g instanceof e ? y = g.size() : y = g.length, this._quicksort(g, 0, y - 1);
1416
- }
1417
- return r(o, [{
1418
- key: "_quicksort",
1419
- value: function(a, y, n) {
1420
- if (y < n) {
1421
- var c = this._partition(a, y, n);
1422
- this._quicksort(a, y, c), this._quicksort(a, c + 1, n);
1423
- }
1424
- }
1425
- }, {
1426
- key: "_partition",
1427
- value: function(a, y, n) {
1428
- for (var c = this._get(a, y), l = y, E = n; ; ) {
1429
- for (; this.compareFunction(c, this._get(a, E)); )
1430
- E--;
1431
- for (; this.compareFunction(this._get(a, l), c); )
1432
- l++;
1433
- if (l < E)
1434
- this._swap(a, l, E), l++, E--;
1435
- else return E;
1436
- }
1437
- }
1438
- }, {
1439
- key: "_get",
1440
- value: function(a, y) {
1441
- return a instanceof e ? a.get_object_at(y) : a[y];
1442
- }
1443
- }, {
1444
- key: "_set",
1445
- value: function(a, y, n) {
1446
- a instanceof e ? a.set_object_at(y, n) : a[y] = n;
1447
- }
1448
- }, {
1449
- key: "_swap",
1450
- value: function(a, y, n) {
1451
- var c = this._get(a, y);
1452
- this._set(a, y, this._get(a, n)), this._set(a, n, c);
1453
- }
1454
- }, {
1455
- key: "_defaultCompareFunction",
1456
- value: function(a, y) {
1457
- return y > a;
1458
- }
1459
- }]), o;
1460
- }();
1461
- f.exports = i;
1462
- },
1463
- /* 25 */
1464
- /***/
1465
- function(f, D, v) {
1466
- var r = /* @__PURE__ */ function() {
1467
- function i(o, g) {
1468
- for (var a = 0; a < g.length; a++) {
1469
- var y = g[a];
1470
- y.enumerable = y.enumerable || false, y.configurable = true, "value" in y && (y.writable = true), Object.defineProperty(o, y.key, y);
1471
- }
1472
- }
1473
- return function(o, g, a) {
1474
- return g && i(o.prototype, g), a && i(o, a), o;
1475
- };
1476
- }();
1477
- function t(i, o) {
1478
- if (!(i instanceof o))
1479
- throw new TypeError("Cannot call a class as a function");
1480
- }
1481
- var e = function() {
1482
- function i(o, g) {
1483
- var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, y = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1484
- t(this, i), this.sequence1 = o, this.sequence2 = g, this.match_score = a, this.mismatch_penalty = y, this.gap_penalty = n, this.iMax = o.length + 1, this.jMax = g.length + 1, this.grid = new Array(this.iMax);
1485
- for (var c = 0; c < this.iMax; c++) {
1486
- this.grid[c] = new Array(this.jMax);
1487
- for (var l = 0; l < this.jMax; l++)
1488
- this.grid[c][l] = 0;
1489
- }
1490
- this.tracebackGrid = new Array(this.iMax);
1491
- for (var E = 0; E < this.iMax; E++) {
1492
- this.tracebackGrid[E] = new Array(this.jMax);
1493
- for (var T = 0; T < this.jMax; T++)
1494
- this.tracebackGrid[E][T] = [null, null, null];
1495
- }
1496
- this.alignments = [], this.score = -1, this.computeGrids();
1497
- }
1498
- return r(i, [{
1499
- key: "getScore",
1500
- value: function() {
1501
- return this.score;
1502
- }
1503
- }, {
1504
- key: "getAlignments",
1505
- value: function() {
1506
- return this.alignments;
1507
- }
1508
- // Main dynamic programming procedure
1509
- }, {
1510
- key: "computeGrids",
1511
- value: function() {
1512
- for (var g = 1; g < this.jMax; g++)
1513
- this.grid[0][g] = this.grid[0][g - 1] + this.gap_penalty, this.tracebackGrid[0][g] = [false, false, true];
1514
- for (var a = 1; a < this.iMax; a++)
1515
- this.grid[a][0] = this.grid[a - 1][0] + this.gap_penalty, this.tracebackGrid[a][0] = [false, true, false];
1516
- for (var y = 1; y < this.iMax; y++)
1517
- for (var n = 1; n < this.jMax; n++) {
1518
- var c = void 0;
1519
- this.sequence1[y - 1] === this.sequence2[n - 1] ? c = this.grid[y - 1][n - 1] + this.match_score : c = this.grid[y - 1][n - 1] + this.mismatch_penalty;
1520
- var l = this.grid[y - 1][n] + this.gap_penalty, E = this.grid[y][n - 1] + this.gap_penalty, T = [c, l, E], m = this.arrayAllMaxIndexes(T);
1521
- this.grid[y][n] = T[m[0]], this.tracebackGrid[y][n] = [m.includes(0), m.includes(1), m.includes(2)];
1522
- }
1523
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1524
- }
1525
- // Gets all possible valid sequence combinations
1526
- }, {
1527
- key: "alignmentTraceback",
1528
- value: function() {
1529
- var g = [];
1530
- for (g.push({
1531
- pos: [this.sequence1.length, this.sequence2.length],
1532
- seq1: "",
1533
- seq2: ""
1534
- }); g[0]; ) {
1535
- var a = g[0], y = this.tracebackGrid[a.pos[0]][a.pos[1]];
1536
- y[0] && g.push({
1537
- pos: [a.pos[0] - 1, a.pos[1] - 1],
1538
- seq1: this.sequence1[a.pos[0] - 1] + a.seq1,
1539
- seq2: this.sequence2[a.pos[1] - 1] + a.seq2
1540
- }), y[1] && g.push({
1541
- pos: [a.pos[0] - 1, a.pos[1]],
1542
- seq1: this.sequence1[a.pos[0] - 1] + a.seq1,
1543
- seq2: "-" + a.seq2
1544
- }), y[2] && g.push({
1545
- pos: [a.pos[0], a.pos[1] - 1],
1546
- seq1: "-" + a.seq1,
1547
- seq2: this.sequence2[a.pos[1] - 1] + a.seq2
1548
- }), a.pos[0] === 0 && a.pos[1] === 0 && this.alignments.push({
1549
- sequence1: a.seq1,
1550
- sequence2: a.seq2
1551
- }), g.shift();
1552
- }
1553
- return this.alignments;
1554
- }
1555
- // Helper Functions
1556
- }, {
1557
- key: "getAllIndexes",
1558
- value: function(g, a) {
1559
- for (var y = [], n = -1; (n = g.indexOf(a, n + 1)) !== -1; )
1560
- y.push(n);
1561
- return y;
1562
- }
1563
- }, {
1564
- key: "arrayAllMaxIndexes",
1565
- value: function(g) {
1566
- return this.getAllIndexes(g, Math.max.apply(null, g));
1567
- }
1568
- }]), i;
1569
- }();
1570
- f.exports = e;
1571
- },
1572
- /* 26 */
1573
- /***/
1574
- function(f, D, v) {
1575
- var r = function() {
1576
- };
1577
- r.FDLayout = v(18), r.FDLayoutConstants = v(7), r.FDLayoutEdge = v(19), r.FDLayoutNode = v(20), r.DimensionD = v(21), r.HashMap = v(22), r.HashSet = v(23), r.IGeometry = v(8), r.IMath = v(9), r.Integer = v(10), r.Point = v(12), r.PointD = v(4), r.RandomSeed = v(16), r.RectangleD = v(13), r.Transform = v(17), r.UniqueIDGeneretor = v(14), r.Quicksort = v(24), r.LinkedList = v(11), r.LGraphObject = v(2), r.LGraph = v(5), r.LEdge = v(1), r.LGraphManager = v(6), r.LNode = v(3), r.Layout = v(15), r.LayoutConstants = v(0), r.NeedlemanWunsch = v(25), f.exports = r;
1578
- },
1579
- /* 27 */
1580
- /***/
1581
- function(f, D, v) {
1582
- function r() {
1583
- this.listeners = [];
1584
- }
1585
- var t = r.prototype;
1586
- t.addListener = function(e, i) {
1587
- this.listeners.push({
1588
- event: e,
1589
- callback: i
1590
- });
1591
- }, t.removeListener = function(e, i) {
1592
- for (var o = this.listeners.length; o >= 0; o--) {
1593
- var g = this.listeners[o];
1594
- g.event === e && g.callback === i && this.listeners.splice(o, 1);
1595
- }
1596
- }, t.emit = function(e, i) {
1597
- for (var o = 0; o < this.listeners.length; o++) {
1598
- var g = this.listeners[o];
1599
- e === g.event && g.callback(i);
1600
- }
1601
- }, f.exports = r;
1602
- }
1603
- /******/
1604
- ])
1605
- );
1606
- });
1607
- }(et)), et.exports;
1608
- }
1609
- var Rt = tt.exports, ct;
1610
- function xt() {
1611
- return ct || (ct = 1, function(I, w) {
1612
- (function(D, v) {
1613
- I.exports = v(Ct());
1614
- })(Rt, function(f) {
1615
- return (
1616
- /******/
1617
- function(D) {
1618
- var v = {};
1619
- function r(t) {
1620
- if (v[t])
1621
- return v[t].exports;
1622
- var e = v[t] = {
1623
- /******/
1624
- i: t,
1625
- /******/
1626
- l: false,
1627
- /******/
1628
- exports: {}
1629
- /******/
1630
- };
1631
- return D[t].call(e.exports, e, e.exports, r), e.l = true, e.exports;
1632
- }
1633
- return r.m = D, r.c = v, r.i = function(t) {
1634
- return t;
1635
- }, r.d = function(t, e, i) {
1636
- r.o(t, e) || Object.defineProperty(t, e, {
1637
- /******/
1638
- configurable: false,
1639
- /******/
1640
- enumerable: true,
1641
- /******/
1642
- get: i
1643
- /******/
1644
- });
1645
- }, r.n = function(t) {
1646
- var e = t && t.__esModule ? (
1647
- /******/
1648
- function() {
1649
- return t.default;
1650
- }
1651
- ) : (
1652
- /******/
1653
- function() {
1654
- return t;
1655
- }
1656
- );
1657
- return r.d(e, "a", e), e;
1658
- }, r.o = function(t, e) {
1659
- return Object.prototype.hasOwnProperty.call(t, e);
1660
- }, r.p = "", r(r.s = 7);
1661
- }([
1662
- /* 0 */
1663
- /***/
1664
- function(D, v) {
1665
- D.exports = f;
1666
- },
1667
- /* 1 */
1668
- /***/
1669
- function(D, v, r) {
1670
- var t = r(0).FDLayoutConstants;
1671
- function e() {
1672
- }
1673
- for (var i in t)
1674
- e[i] = t[i];
1675
- e.DEFAULT_USE_MULTI_LEVEL_SCALING = false, e.DEFAULT_RADIAL_SEPARATION = t.DEFAULT_EDGE_LENGTH, e.DEFAULT_COMPONENT_SEPERATION = 60, e.TILE = true, e.TILING_PADDING_VERTICAL = 10, e.TILING_PADDING_HORIZONTAL = 10, e.TREE_REDUCTION_ON_INCREMENTAL = false, D.exports = e;
1676
- },
1677
- /* 2 */
1678
- /***/
1679
- function(D, v, r) {
1680
- var t = r(0).FDLayoutEdge;
1681
- function e(o, g, a) {
1682
- t.call(this, o, g, a);
1683
- }
1684
- e.prototype = Object.create(t.prototype);
1685
- for (var i in t)
1686
- e[i] = t[i];
1687
- D.exports = e;
1688
- },
1689
- /* 3 */
1690
- /***/
1691
- function(D, v, r) {
1692
- var t = r(0).LGraph;
1693
- function e(o, g, a) {
1694
- t.call(this, o, g, a);
1695
- }
1696
- e.prototype = Object.create(t.prototype);
1697
- for (var i in t)
1698
- e[i] = t[i];
1699
- D.exports = e;
1700
- },
1701
- /* 4 */
1702
- /***/
1703
- function(D, v, r) {
1704
- var t = r(0).LGraphManager;
1705
- function e(o) {
1706
- t.call(this, o);
1707
- }
1708
- e.prototype = Object.create(t.prototype);
1709
- for (var i in t)
1710
- e[i] = t[i];
1711
- D.exports = e;
1712
- },
1713
- /* 5 */
1714
- /***/
1715
- function(D, v, r) {
1716
- var t = r(0).FDLayoutNode, e = r(0).IMath;
1717
- function i(g, a, y, n) {
1718
- t.call(this, g, a, y, n);
1719
- }
1720
- i.prototype = Object.create(t.prototype);
1721
- for (var o in t)
1722
- i[o] = t[o];
1723
- i.prototype.move = function() {
1724
- var g = this.graphManager.getLayout();
1725
- this.displacementX = g.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = g.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementX = g.coolingFactor * g.maxNodeDisplacement * e.sign(this.displacementX)), Math.abs(this.displacementY) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementY = g.coolingFactor * g.maxNodeDisplacement * e.sign(this.displacementY)), this.child == null ? this.moveBy(this.displacementX, this.displacementY) : this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), g.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;
1726
- }, i.prototype.propogateDisplacementToChildren = function(g, a) {
1727
- for (var y = this.getChild().getNodes(), n, c = 0; c < y.length; c++)
1728
- n = y[c], n.getChild() == null ? (n.moveBy(g, a), n.displacementX += g, n.displacementY += a) : n.propogateDisplacementToChildren(g, a);
1729
- }, i.prototype.setPred1 = function(g) {
1730
- this.pred1 = g;
1731
- }, i.prototype.getPred1 = function() {
1732
- return pred1;
1733
- }, i.prototype.getPred2 = function() {
1734
- return pred2;
1735
- }, i.prototype.setNext = function(g) {
1736
- this.next = g;
1737
- }, i.prototype.getNext = function() {
1738
- return next;
1739
- }, i.prototype.setProcessed = function(g) {
1740
- this.processed = g;
1741
- }, i.prototype.isProcessed = function() {
1742
- return processed;
1743
- }, D.exports = i;
1744
- },
1745
- /* 6 */
1746
- /***/
1747
- function(D, v, r) {
1748
- var t = r(0).FDLayout, e = r(4), i = r(3), o = r(5), g = r(2), a = r(1), y = r(0).FDLayoutConstants, n = r(0).LayoutConstants, c = r(0).Point, l = r(0).PointD, E = r(0).Layout, T = r(0).Integer, m = r(0).IGeometry, L = r(0).LGraph, O = r(0).Transform;
1749
- function d() {
1750
- t.call(this), this.toBeTiled = {};
1751
- }
1752
- d.prototype = Object.create(t.prototype);
1753
- for (var N in t)
1754
- d[N] = t[N];
1755
- d.prototype.newGraphManager = function() {
1756
- var s = new e(this);
1757
- return this.graphManager = s, s;
1758
- }, d.prototype.newGraph = function(s) {
1759
- return new i(null, this.graphManager, s);
1760
- }, d.prototype.newNode = function(s) {
1761
- return new o(this.graphManager, s);
1762
- }, d.prototype.newEdge = function(s) {
1763
- return new g(null, null, s);
1764
- }, d.prototype.initParameters = function() {
1765
- t.prototype.initParameters.call(this, arguments), this.isSubLayout || (a.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = a.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = y.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = y.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = y.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = y.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = y.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = false, this.isGrowthFinished = false, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / y.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = y.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1766
- }, d.prototype.layout = function() {
1767
- var s = n.DEFAULT_CREATE_BENDS_AS_NEEDED;
1768
- return s && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1769
- }, d.prototype.classicLayout = function() {
1770
- 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) {
1771
- if (a.TREE_REDUCTION_ON_INCREMENTAL) {
1772
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1773
- var h = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(C) {
1774
- return h.has(C);
1775
- });
1776
- this.graphManager.setAllNodesToApplyGravitation(u);
1777
- }
1778
- } else {
1779
- var s = this.getFlatForest();
1780
- if (s.length > 0)
1781
- this.positionNodesRadially(s);
1782
- else {
1783
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1784
- var h = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(p) {
1785
- return h.has(p);
1786
- });
1787
- this.graphManager.setAllNodesToApplyGravitation(u), this.positionNodesRandomly();
1788
- }
1789
- }
1790
- return this.initSpringEmbedder(), this.runSpringEmbedder(), true;
1791
- }, d.prototype.tick = function() {
1792
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
1793
- if (this.prunedNodesAll.length > 0)
1794
- this.isTreeGrowing = true;
1795
- else
1796
- return true;
1797
- if (this.totalIterations % y.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1798
- if (this.isConverged())
1799
- if (this.prunedNodesAll.length > 0)
1800
- this.isTreeGrowing = true;
1801
- else
1802
- return true;
1803
- this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
1804
- }
1805
- if (this.isTreeGrowing) {
1806
- if (this.growTreeIterations % 10 == 0)
1807
- if (this.prunedNodesAll.length > 0) {
1808
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1809
- var s = new Set(this.getAllNodes()), h = this.nodesWithGravity.filter(function(A) {
1810
- return s.has(A);
1811
- });
1812
- this.graphManager.setAllNodesToApplyGravitation(h), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = y.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1813
- } else
1814
- this.isTreeGrowing = false, this.isGrowthFinished = true;
1815
- this.growTreeIterations++;
1816
- }
1817
- if (this.isGrowthFinished) {
1818
- if (this.isConverged())
1819
- return true;
1820
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = y.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1821
- }
1822
- var u = !this.isTreeGrowing && !this.isGrowthFinished, p = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1823
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(u, p), this.calcGravitationalForces(), this.moveNodes(), this.animate(), false;
1824
- }, d.prototype.getPositionsData = function() {
1825
- for (var s = this.graphManager.getAllNodes(), h = {}, u = 0; u < s.length; u++) {
1826
- var p = s[u].rect, A = s[u].id;
1827
- h[A] = {
1828
- id: A,
1829
- x: p.getCenterX(),
1830
- y: p.getCenterY(),
1831
- w: p.width,
1832
- h: p.height
1833
- };
1834
- }
1835
- return h;
1836
- }, d.prototype.runSpringEmbedder = function() {
1837
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1838
- var s = false;
1839
- if (y.ANIMATE === "during")
1840
- this.emit("layoutstarted");
1841
- else {
1842
- for (; !s; )
1843
- s = this.tick();
1844
- this.graphManager.updateBounds();
1845
- }
1846
- }, d.prototype.calculateNodesToApplyGravitationTo = function() {
1847
- var s = [], h, u = this.graphManager.getGraphs(), p = u.length, A;
1848
- for (A = 0; A < p; A++)
1849
- h = u[A], h.updateConnected(), h.isConnected || (s = s.concat(h.getNodes()));
1850
- return s;
1851
- }, d.prototype.createBendpoints = function() {
1852
- var s = [];
1853
- s = s.concat(this.graphManager.getAllEdges());
1854
- var h = /* @__PURE__ */ new Set(), u;
1855
- for (u = 0; u < s.length; u++) {
1856
- var p = s[u];
1857
- if (!h.has(p)) {
1858
- var A = p.getSource(), C = p.getTarget();
1859
- if (A == C)
1860
- p.getBendpoints().push(new l()), p.getBendpoints().push(new l()), this.createDummyNodesForBendpoints(p), h.add(p);
1861
- else {
1862
- var R = [];
1863
- if (R = R.concat(A.getEdgeListToNode(C)), R = R.concat(C.getEdgeListToNode(A)), !h.has(R[0])) {
1864
- if (R.length > 1) {
1865
- var x;
1866
- for (x = 0; x < R.length; x++) {
1867
- var G = R[x];
1868
- G.getBendpoints().push(new l()), this.createDummyNodesForBendpoints(G);
1869
- }
1870
- }
1871
- R.forEach(function(U) {
1872
- h.add(U);
1873
- });
1874
- }
1875
- }
1876
- }
1877
- if (h.size == s.length)
1878
- break;
1879
- }
1880
- }, d.prototype.positionNodesRadially = function(s) {
1881
- for (var h = new c(0, 0), u = Math.ceil(Math.sqrt(s.length)), p = 0, A = 0, C = 0, R = new l(0, 0), x = 0; x < s.length; x++) {
1882
- x % u == 0 && (C = 0, A = p, x != 0 && (A += a.DEFAULT_COMPONENT_SEPERATION), p = 0);
1883
- var G = s[x], U = E.findCenterOfTree(G);
1884
- h.x = C, h.y = A, R = d.radialLayout(G, U, h), R.y > p && (p = Math.floor(R.y)), C = Math.floor(R.x + a.DEFAULT_COMPONENT_SEPERATION);
1885
- }
1886
- this.transform(new l(n.WORLD_CENTER_X - R.x / 2, n.WORLD_CENTER_Y - R.y / 2));
1887
- }, d.radialLayout = function(s, h, u) {
1888
- var p = Math.max(this.maxDiagonalInTree(s), a.DEFAULT_RADIAL_SEPARATION);
1889
- d.branchRadialLayout(h, null, 0, 359, 0, p);
1890
- var A = L.calculateBounds(s), C = new O();
1891
- C.setDeviceOrgX(A.getMinX()), C.setDeviceOrgY(A.getMinY()), C.setWorldOrgX(u.x), C.setWorldOrgY(u.y);
1892
- for (var R = 0; R < s.length; R++) {
1893
- var x = s[R];
1894
- x.transform(C);
1895
- }
1896
- var G = new l(A.getMaxX(), A.getMaxY());
1897
- return C.inverseTransformPoint(G);
1898
- }, d.branchRadialLayout = function(s, h, u, p, A, C) {
1899
- var R = (p - u + 1) / 2;
1900
- R < 0 && (R += 180);
1901
- var x = (R + u) % 360, G = x * m.TWO_PI / 360, U = A * Math.cos(G), X = A * Math.sin(G);
1902
- s.setCenter(U, X);
1903
- var M = [];
1904
- M = M.concat(s.getEdges());
1905
- var S = M.length;
1906
- h != null && S--;
1907
- for (var F = 0, b = M.length, Y, k = s.getEdgesBetween(h); k.length > 1; ) {
1908
- var H = k[0];
1909
- k.splice(0, 1);
1910
- var P = M.indexOf(H);
1911
- P >= 0 && M.splice(P, 1), b--, S--;
1912
- }
1913
- h != null ? Y = (M.indexOf(k[0]) + 1) % b : Y = 0;
1914
- for (var W = Math.abs(p - u) / S, $ = Y; F != S; $ = ++$ % b) {
1915
- var j = M[$].getOtherEnd(s);
1916
- if (j != h) {
1917
- var V = (u + F * W) % 360, z = (V + W) % 360;
1918
- d.branchRadialLayout(j, s, V, z, A + C, C), F++;
1919
- }
1920
- }
1921
- }, d.maxDiagonalInTree = function(s) {
1922
- for (var h = T.MIN_VALUE, u = 0; u < s.length; u++) {
1923
- var p = s[u], A = p.getDiagonal();
1924
- A > h && (h = A);
1925
- }
1926
- return h;
1927
- }, d.prototype.calcRepulsionRange = function() {
1928
- return 2 * (this.level + 1) * this.idealEdgeLength;
1929
- }, d.prototype.groupZeroDegreeMembers = function() {
1930
- var s = this, h = {};
1931
- this.memberGroups = {}, this.idToDummyNode = {};
1932
- for (var u = [], p = this.graphManager.getAllNodes(), A = 0; A < p.length; A++) {
1933
- var C = p[A], R = C.getParent();
1934
- this.getNodeDegreeWithChildren(C) === 0 && (R.id == null || !this.getToBeTiled(R)) && u.push(C);
1935
- }
1936
- for (var A = 0; A < u.length; A++) {
1937
- var C = u[A], x = C.getParent().id;
1938
- typeof h[x] > "u" && (h[x] = []), h[x] = h[x].concat(C);
1939
- }
1940
- Object.keys(h).forEach(function(G) {
1941
- if (h[G].length > 1) {
1942
- var U = "DummyCompound_" + G;
1943
- s.memberGroups[U] = h[G];
1944
- var X = h[G][0].getParent(), M = new o(s.graphManager);
1945
- M.id = U, M.paddingLeft = X.paddingLeft || 0, M.paddingRight = X.paddingRight || 0, M.paddingBottom = X.paddingBottom || 0, M.paddingTop = X.paddingTop || 0, s.idToDummyNode[U] = M;
1946
- var S = s.getGraphManager().add(s.newGraph(), M), F = X.getChild();
1947
- F.add(M);
1948
- for (var b = 0; b < h[G].length; b++) {
1949
- var Y = h[G][b];
1950
- F.remove(Y), S.add(Y);
1951
- }
1952
- }
1953
- });
1954
- }, d.prototype.clearCompounds = function() {
1955
- var s = {}, h = {};
1956
- this.performDFSOnCompounds();
1957
- for (var u = 0; u < this.compoundOrder.length; u++)
1958
- h[this.compoundOrder[u].id] = this.compoundOrder[u], s[this.compoundOrder[u].id] = [].concat(this.compoundOrder[u].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[u].getChild()), this.compoundOrder[u].child = null;
1959
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(s, h);
1960
- }, d.prototype.clearZeroDegreeMembers = function() {
1961
- var s = this, h = this.tiledZeroDegreePack = [];
1962
- Object.keys(this.memberGroups).forEach(function(u) {
1963
- var p = s.idToDummyNode[u];
1964
- h[u] = s.tileNodes(s.memberGroups[u], p.paddingLeft + p.paddingRight), p.rect.width = h[u].width, p.rect.height = h[u].height;
1965
- });
1966
- }, d.prototype.repopulateCompounds = function() {
1967
- for (var s = this.compoundOrder.length - 1; s >= 0; s--) {
1968
- var h = this.compoundOrder[s], u = h.id, p = h.paddingLeft, A = h.paddingTop;
1969
- this.adjustLocations(this.tiledMemberPack[u], h.rect.x, h.rect.y, p, A);
1970
- }
1971
- }, d.prototype.repopulateZeroDegreeMembers = function() {
1972
- var s = this, h = this.tiledZeroDegreePack;
1973
- Object.keys(h).forEach(function(u) {
1974
- var p = s.idToDummyNode[u], A = p.paddingLeft, C = p.paddingTop;
1975
- s.adjustLocations(h[u], p.rect.x, p.rect.y, A, C);
1976
- });
1977
- }, d.prototype.getToBeTiled = function(s) {
1978
- var h = s.id;
1979
- if (this.toBeTiled[h] != null)
1980
- return this.toBeTiled[h];
1981
- var u = s.getChild();
1982
- if (u == null)
1983
- return this.toBeTiled[h] = false, false;
1984
- for (var p = u.getNodes(), A = 0; A < p.length; A++) {
1985
- var C = p[A];
1986
- if (this.getNodeDegree(C) > 0)
1987
- return this.toBeTiled[h] = false, false;
1988
- if (C.getChild() == null) {
1989
- this.toBeTiled[C.id] = false;
1990
- continue;
1991
- }
1992
- if (!this.getToBeTiled(C))
1993
- return this.toBeTiled[h] = false, false;
1994
- }
1995
- return this.toBeTiled[h] = true, true;
1996
- }, d.prototype.getNodeDegree = function(s) {
1997
- s.id;
1998
- for (var h = s.getEdges(), u = 0, p = 0; p < h.length; p++) {
1999
- var A = h[p];
2000
- A.getSource().id !== A.getTarget().id && (u = u + 1);
2001
- }
2002
- return u;
2003
- }, d.prototype.getNodeDegreeWithChildren = function(s) {
2004
- var h = this.getNodeDegree(s);
2005
- if (s.getChild() == null)
2006
- return h;
2007
- for (var u = s.getChild().getNodes(), p = 0; p < u.length; p++) {
2008
- var A = u[p];
2009
- h += this.getNodeDegreeWithChildren(A);
2010
- }
2011
- return h;
2012
- }, d.prototype.performDFSOnCompounds = function() {
2013
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2014
- }, d.prototype.fillCompexOrderByDFS = function(s) {
2015
- for (var h = 0; h < s.length; h++) {
2016
- var u = s[h];
2017
- u.getChild() != null && this.fillCompexOrderByDFS(u.getChild().getNodes()), this.getToBeTiled(u) && this.compoundOrder.push(u);
2018
- }
2019
- }, d.prototype.adjustLocations = function(s, h, u, p, A) {
2020
- h += p, u += A;
2021
- for (var C = h, R = 0; R < s.rows.length; R++) {
2022
- var x = s.rows[R];
2023
- h = C;
2024
- for (var G = 0, U = 0; U < x.length; U++) {
2025
- var X = x[U];
2026
- X.rect.x = h, X.rect.y = u, h += X.rect.width + s.horizontalPadding, X.rect.height > G && (G = X.rect.height);
2027
- }
2028
- u += G + s.verticalPadding;
2029
- }
2030
- }, d.prototype.tileCompoundMembers = function(s, h) {
2031
- var u = this;
2032
- this.tiledMemberPack = [], Object.keys(s).forEach(function(p) {
2033
- var A = h[p];
2034
- u.tiledMemberPack[p] = u.tileNodes(s[p], A.paddingLeft + A.paddingRight), A.rect.width = u.tiledMemberPack[p].width, A.rect.height = u.tiledMemberPack[p].height;
2035
- });
2036
- }, d.prototype.tileNodes = function(s, h) {
2037
- var u = a.TILING_PADDING_VERTICAL, p = a.TILING_PADDING_HORIZONTAL, A = {
2038
- rows: [],
2039
- rowWidth: [],
2040
- rowHeight: [],
2041
- width: 0,
2042
- height: h,
2043
- // assume minHeight equals to minWidth
2044
- verticalPadding: u,
2045
- horizontalPadding: p
2046
- };
2047
- s.sort(function(x, G) {
2048
- return x.rect.width * x.rect.height > G.rect.width * G.rect.height ? -1 : x.rect.width * x.rect.height < G.rect.width * G.rect.height ? 1 : 0;
2049
- });
2050
- for (var C = 0; C < s.length; C++) {
2051
- var R = s[C];
2052
- A.rows.length == 0 ? this.insertNodeToRow(A, R, 0, h) : this.canAddHorizontal(A, R.rect.width, R.rect.height) ? this.insertNodeToRow(A, R, this.getShortestRowIndex(A), h) : this.insertNodeToRow(A, R, A.rows.length, h), this.shiftToLastRow(A);
2053
- }
2054
- return A;
2055
- }, d.prototype.insertNodeToRow = function(s, h, u, p) {
2056
- var A = p;
2057
- if (u == s.rows.length) {
2058
- var C = [];
2059
- s.rows.push(C), s.rowWidth.push(A), s.rowHeight.push(0);
2060
- }
2061
- var R = s.rowWidth[u] + h.rect.width;
2062
- s.rows[u].length > 0 && (R += s.horizontalPadding), s.rowWidth[u] = R, s.width < R && (s.width = R);
2063
- var x = h.rect.height;
2064
- u > 0 && (x += s.verticalPadding);
2065
- var G = 0;
2066
- x > s.rowHeight[u] && (G = s.rowHeight[u], s.rowHeight[u] = x, G = s.rowHeight[u] - G), s.height += G, s.rows[u].push(h);
2067
- }, d.prototype.getShortestRowIndex = function(s) {
2068
- for (var h = -1, u = Number.MAX_VALUE, p = 0; p < s.rows.length; p++)
2069
- s.rowWidth[p] < u && (h = p, u = s.rowWidth[p]);
2070
- return h;
2071
- }, d.prototype.getLongestRowIndex = function(s) {
2072
- for (var h = -1, u = Number.MIN_VALUE, p = 0; p < s.rows.length; p++)
2073
- s.rowWidth[p] > u && (h = p, u = s.rowWidth[p]);
2074
- return h;
2075
- }, d.prototype.canAddHorizontal = function(s, h, u) {
2076
- var p = this.getShortestRowIndex(s);
2077
- if (p < 0)
2078
- return true;
2079
- var A = s.rowWidth[p];
2080
- if (A + s.horizontalPadding + h <= s.width) return true;
2081
- var C = 0;
2082
- s.rowHeight[p] < u && p > 0 && (C = u + s.verticalPadding - s.rowHeight[p]);
2083
- var R;
2084
- s.width - A >= h + s.horizontalPadding ? R = (s.height + C) / (A + h + s.horizontalPadding) : R = (s.height + C) / s.width, C = u + s.verticalPadding;
2085
- var x;
2086
- return s.width < h ? x = (s.height + C) / h : x = (s.height + C) / s.width, x < 1 && (x = 1 / x), R < 1 && (R = 1 / R), R < x;
2087
- }, d.prototype.shiftToLastRow = function(s) {
2088
- var h = this.getLongestRowIndex(s), u = s.rowWidth.length - 1, p = s.rows[h], A = p[p.length - 1], C = A.width + s.horizontalPadding;
2089
- if (s.width - s.rowWidth[u] > C && h != u) {
2090
- p.splice(-1, 1), s.rows[u].push(A), s.rowWidth[h] = s.rowWidth[h] - C, s.rowWidth[u] = s.rowWidth[u] + C, s.width = s.rowWidth[instance.getLongestRowIndex(s)];
2091
- for (var R = Number.MIN_VALUE, x = 0; x < p.length; x++)
2092
- p[x].height > R && (R = p[x].height);
2093
- h > 0 && (R += s.verticalPadding);
2094
- var G = s.rowHeight[h] + s.rowHeight[u];
2095
- s.rowHeight[h] = R, s.rowHeight[u] < A.height + s.verticalPadding && (s.rowHeight[u] = A.height + s.verticalPadding);
2096
- var U = s.rowHeight[h] + s.rowHeight[u];
2097
- s.height += U - G, this.shiftToLastRow(s);
2098
- }
2099
- }, d.prototype.tilingPreLayout = function() {
2100
- a.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2101
- }, d.prototype.tilingPostLayout = function() {
2102
- a.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2103
- }, d.prototype.reduceTrees = function() {
2104
- for (var s = [], h = true, u; h; ) {
2105
- var p = this.graphManager.getAllNodes(), A = [];
2106
- h = false;
2107
- for (var C = 0; C < p.length; C++)
2108
- u = p[C], u.getEdges().length == 1 && !u.getEdges()[0].isInterGraph && u.getChild() == null && (A.push([u, u.getEdges()[0], u.getOwner()]), h = true);
2109
- if (h == true) {
2110
- for (var R = [], x = 0; x < A.length; x++)
2111
- A[x][0].getEdges().length == 1 && (R.push(A[x]), A[x][0].getOwner().remove(A[x][0]));
2112
- s.push(R), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2113
- }
2114
- }
2115
- this.prunedNodesAll = s;
2116
- }, d.prototype.growTree = function(s) {
2117
- for (var h = s.length, u = s[h - 1], p, A = 0; A < u.length; A++)
2118
- p = u[A], this.findPlaceforPrunedNode(p), p[2].add(p[0]), p[2].add(p[1], p[1].source, p[1].target);
2119
- s.splice(s.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2120
- }, d.prototype.findPlaceforPrunedNode = function(s) {
2121
- var h, u, p = s[0];
2122
- p == s[1].source ? u = s[1].target : u = s[1].source;
2123
- var A = u.startX, C = u.finishX, R = u.startY, x = u.finishY, G = 0, U = 0, X = 0, M = 0, S = [G, X, U, M];
2124
- if (R > 0)
2125
- for (var F = A; F <= C; F++)
2126
- S[0] += this.grid[F][R - 1].length + this.grid[F][R].length - 1;
2127
- if (C < this.grid.length - 1)
2128
- for (var F = R; F <= x; F++)
2129
- S[1] += this.grid[C + 1][F].length + this.grid[C][F].length - 1;
2130
- if (x < this.grid[0].length - 1)
2131
- for (var F = A; F <= C; F++)
2132
- S[2] += this.grid[F][x + 1].length + this.grid[F][x].length - 1;
2133
- if (A > 0)
2134
- for (var F = R; F <= x; F++)
2135
- S[3] += this.grid[A - 1][F].length + this.grid[A][F].length - 1;
2136
- for (var b = T.MAX_VALUE, Y, k, H = 0; H < S.length; H++)
2137
- S[H] < b ? (b = S[H], Y = 1, k = H) : S[H] == b && Y++;
2138
- if (Y == 3 && b == 0)
2139
- S[0] == 0 && S[1] == 0 && S[2] == 0 ? h = 1 : S[0] == 0 && S[1] == 0 && S[3] == 0 ? h = 0 : S[0] == 0 && S[2] == 0 && S[3] == 0 ? h = 3 : S[1] == 0 && S[2] == 0 && S[3] == 0 && (h = 2);
2140
- else if (Y == 2 && b == 0) {
2141
- var P = Math.floor(Math.random() * 2);
2142
- S[0] == 0 && S[1] == 0 ? P == 0 ? h = 0 : h = 1 : S[0] == 0 && S[2] == 0 ? P == 0 ? h = 0 : h = 2 : S[0] == 0 && S[3] == 0 ? P == 0 ? h = 0 : h = 3 : S[1] == 0 && S[2] == 0 ? P == 0 ? h = 1 : h = 2 : S[1] == 0 && S[3] == 0 ? P == 0 ? h = 1 : h = 3 : P == 0 ? h = 2 : h = 3;
2143
- } else if (Y == 4 && b == 0) {
2144
- var P = Math.floor(Math.random() * 4);
2145
- h = P;
2146
- } else
2147
- h = k;
2148
- h == 0 ? p.setCenter(u.getCenterX(), u.getCenterY() - u.getHeight() / 2 - y.DEFAULT_EDGE_LENGTH - p.getHeight() / 2) : h == 1 ? p.setCenter(u.getCenterX() + u.getWidth() / 2 + y.DEFAULT_EDGE_LENGTH + p.getWidth() / 2, u.getCenterY()) : h == 2 ? p.setCenter(u.getCenterX(), u.getCenterY() + u.getHeight() / 2 + y.DEFAULT_EDGE_LENGTH + p.getHeight() / 2) : p.setCenter(u.getCenterX() - u.getWidth() / 2 - y.DEFAULT_EDGE_LENGTH - p.getWidth() / 2, u.getCenterY());
2149
- }, D.exports = d;
2150
- },
2151
- /* 7 */
2152
- /***/
2153
- function(D, v, r) {
2154
- var t = {};
2155
- t.layoutBase = r(0), t.CoSEConstants = r(1), t.CoSEEdge = r(2), t.CoSEGraph = r(3), t.CoSEGraphManager = r(4), t.CoSELayout = r(6), t.CoSENode = r(5), D.exports = t;
2156
- }
2157
- /******/
2158
- ])
2159
- );
2160
- });
2161
- }(tt)), tt.exports;
2162
- }
2163
- var Mt = J.exports, gt;
2164
- function wt() {
2165
- return gt || (gt = 1, function(I, w) {
2166
- (function(D, v) {
2167
- I.exports = v(xt());
2168
- })(Mt, function(f) {
2169
- return (
2170
- /******/
2171
- function(D) {
2172
- var v = {};
2173
- function r(t) {
2174
- if (v[t])
2175
- return v[t].exports;
2176
- var e = v[t] = {
2177
- /******/
2178
- i: t,
2179
- /******/
2180
- l: false,
2181
- /******/
2182
- exports: {}
2183
- /******/
2184
- };
2185
- return D[t].call(e.exports, e, e.exports, r), e.l = true, e.exports;
2186
- }
2187
- return r.m = D, r.c = v, r.i = function(t) {
2188
- return t;
2189
- }, r.d = function(t, e, i) {
2190
- r.o(t, e) || Object.defineProperty(t, e, {
2191
- /******/
2192
- configurable: false,
2193
- /******/
2194
- enumerable: true,
2195
- /******/
2196
- get: i
2197
- /******/
2198
- });
2199
- }, r.n = function(t) {
2200
- var e = t && t.__esModule ? (
2201
- /******/
2202
- function() {
2203
- return t.default;
2204
- }
2205
- ) : (
2206
- /******/
2207
- function() {
2208
- return t;
2209
- }
2210
- );
2211
- return r.d(e, "a", e), e;
2212
- }, r.o = function(t, e) {
2213
- return Object.prototype.hasOwnProperty.call(t, e);
2214
- }, r.p = "", r(r.s = 1);
2215
- }([
2216
- /* 0 */
2217
- /***/
2218
- function(D, v) {
2219
- D.exports = f;
2220
- },
2221
- /* 1 */
2222
- /***/
2223
- function(D, v, r) {
2224
- var t = r(0).layoutBase.LayoutConstants, e = r(0).layoutBase.FDLayoutConstants, i = r(0).CoSEConstants, o = r(0).CoSELayout, g = r(0).CoSENode, a = r(0).layoutBase.PointD, y = r(0).layoutBase.DimensionD, n = {
2225
- // Called on `layoutready`
2226
- ready: function() {
2227
- },
2228
- // Called on `layoutstop`
2229
- stop: function() {
2230
- },
2231
- // 'draft', 'default' or 'proof"
2232
- // - 'draft' fast cooling rate
2233
- // - 'default' moderate cooling rate
2234
- // - "proof" slow cooling rate
2235
- quality: "default",
2236
- // include labels in node dimensions
2237
- nodeDimensionsIncludeLabels: false,
2238
- // number of ticks per frame; higher is faster but more jerky
2239
- refresh: 30,
2240
- // Whether to fit the network view after when done
2241
- fit: true,
2242
- // Padding on fit
2243
- padding: 10,
2244
- // Whether to enable incremental mode
2245
- randomize: true,
2246
- // Node repulsion (non overlapping) multiplier
2247
- nodeRepulsion: 4500,
2248
- // Ideal edge (non nested) length
2249
- idealEdgeLength: 50,
2250
- // Divisor to compute edge forces
2251
- edgeElasticity: 0.45,
2252
- // Nesting factor (multiplier) to compute ideal edge length for nested edges
2253
- nestingFactor: 0.1,
2254
- // Gravity force (constant)
2255
- gravity: 0.25,
2256
- // Maximum number of iterations to perform
2257
- numIter: 2500,
2258
- // For enabling tiling
2259
- tile: true,
2260
- // Type of layout animation. The option set is {'during', 'end', false}
2261
- animate: "end",
2262
- // Duration for animate:end
2263
- animationDuration: 500,
2264
- // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
2265
- tilingPaddingVertical: 10,
2266
- // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
2267
- tilingPaddingHorizontal: 10,
2268
- // Gravity range (constant) for compounds
2269
- gravityRangeCompound: 1.5,
2270
- // Gravity force (constant) for compounds
2271
- gravityCompound: 1,
2272
- // Gravity range (constant)
2273
- gravityRange: 3.8,
2274
- // Initial cooling factor for incremental layout
2275
- initialEnergyOnIncremental: 0.5
2276
- };
2277
- function c(m, L) {
2278
- var O = {};
2279
- for (var d in m)
2280
- O[d] = m[d];
2281
- for (var d in L)
2282
- O[d] = L[d];
2283
- return O;
2284
- }
2285
- function l(m) {
2286
- this.options = c(n, m), E(this.options);
2287
- }
2288
- var E = function(L) {
2289
- L.nodeRepulsion != null && (i.DEFAULT_REPULSION_STRENGTH = e.DEFAULT_REPULSION_STRENGTH = L.nodeRepulsion), L.idealEdgeLength != null && (i.DEFAULT_EDGE_LENGTH = e.DEFAULT_EDGE_LENGTH = L.idealEdgeLength), L.edgeElasticity != null && (i.DEFAULT_SPRING_STRENGTH = e.DEFAULT_SPRING_STRENGTH = L.edgeElasticity), L.nestingFactor != null && (i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = L.nestingFactor), L.gravity != null && (i.DEFAULT_GRAVITY_STRENGTH = e.DEFAULT_GRAVITY_STRENGTH = L.gravity), L.numIter != null && (i.MAX_ITERATIONS = e.MAX_ITERATIONS = L.numIter), L.gravityRange != null && (i.DEFAULT_GRAVITY_RANGE_FACTOR = e.DEFAULT_GRAVITY_RANGE_FACTOR = L.gravityRange), L.gravityCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = e.DEFAULT_COMPOUND_GRAVITY_STRENGTH = L.gravityCompound), L.gravityRangeCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = L.gravityRangeCompound), L.initialEnergyOnIncremental != null && (i.DEFAULT_COOLING_FACTOR_INCREMENTAL = e.DEFAULT_COOLING_FACTOR_INCREMENTAL = L.initialEnergyOnIncremental), L.quality == "draft" ? t.QUALITY = 0 : L.quality == "proof" ? t.QUALITY = 2 : t.QUALITY = 1, i.NODE_DIMENSIONS_INCLUDE_LABELS = e.NODE_DIMENSIONS_INCLUDE_LABELS = t.NODE_DIMENSIONS_INCLUDE_LABELS = L.nodeDimensionsIncludeLabels, i.DEFAULT_INCREMENTAL = e.DEFAULT_INCREMENTAL = t.DEFAULT_INCREMENTAL = !L.randomize, i.ANIMATE = e.ANIMATE = t.ANIMATE = L.animate, i.TILE = L.tile, i.TILING_PADDING_VERTICAL = typeof L.tilingPaddingVertical == "function" ? L.tilingPaddingVertical.call() : L.tilingPaddingVertical, i.TILING_PADDING_HORIZONTAL = typeof L.tilingPaddingHorizontal == "function" ? L.tilingPaddingHorizontal.call() : L.tilingPaddingHorizontal;
2290
- };
2291
- l.prototype.run = function() {
2292
- var m, L, O = this.options;
2293
- this.idToLNode = {};
2294
- var d = this.layout = new o(), N = this;
2295
- N.stopped = false, this.cy = this.options.cy, this.cy.trigger({ type: "layoutstart", layout: this });
2296
- var s = d.newGraphManager();
2297
- this.gm = s;
2298
- var h = this.options.eles.nodes(), u = this.options.eles.edges();
2299
- this.root = s.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(h), d);
2300
- for (var p = 0; p < u.length; p++) {
2301
- var A = u[p], C = this.idToLNode[A.data("source")], R = this.idToLNode[A.data("target")];
2302
- if (C !== R && C.getEdgesBetween(R).length == 0) {
2303
- var x = s.add(d.newEdge(), C, R);
2304
- x.id = A.id();
2305
- }
2306
- }
2307
- var G = function(M, S) {
2308
- typeof M == "number" && (M = S);
2309
- var F = M.data("id"), b = N.idToLNode[F];
2310
- return {
2311
- x: b.getRect().getCenterX(),
2312
- y: b.getRect().getCenterY()
2313
- };
2314
- }, U = function X() {
2315
- for (var M = function() {
2316
- O.fit && O.cy.fit(O.eles, O.padding), m || (m = true, N.cy.one("layoutready", O.ready), N.cy.trigger({ type: "layoutready", layout: N }));
2317
- }, S = N.options.refresh, F, b = 0; b < S && !F; b++)
2318
- F = N.stopped || N.layout.tick();
2319
- if (F) {
2320
- d.checkLayoutSuccess() && !d.isSubLayout && d.doPostLayout(), d.tilingPostLayout && d.tilingPostLayout(), d.isLayoutFinished = true, N.options.eles.nodes().positions(G), M(), N.cy.one("layoutstop", N.options.stop), N.cy.trigger({ type: "layoutstop", layout: N }), L && cancelAnimationFrame(L), m = false;
2321
- return;
2322
- }
2323
- var Y = N.layout.getPositionsData();
2324
- O.eles.nodes().positions(function(k, H) {
2325
- if (typeof k == "number" && (k = H), !k.isParent()) {
2326
- for (var P = k.id(), W = Y[P], $ = k; W == null && (W = Y[$.data("parent")] || Y["DummyCompound_" + $.data("parent")], Y[P] = W, $ = $.parent()[0], $ != null); )
2327
- ;
2328
- return W != null ? {
2329
- x: W.x,
2330
- y: W.y
2331
- } : {
2332
- x: k.position("x"),
2333
- y: k.position("y")
2334
- };
2335
- }
2336
- }), M(), L = requestAnimationFrame(X);
2337
- };
2338
- return d.addListener("layoutstarted", function() {
2339
- N.options.animate === "during" && (L = requestAnimationFrame(U));
2340
- }), d.runLayout(), this.options.animate !== "during" && (N.options.eles.nodes().not(":parent").layoutPositions(N, N.options, G), m = false), this;
2341
- }, l.prototype.getTopMostNodes = function(m) {
2342
- for (var L = {}, O = 0; O < m.length; O++)
2343
- L[m[O].id()] = true;
2344
- var d = m.filter(function(N, s) {
2345
- typeof N == "number" && (N = s);
2346
- for (var h = N.parent()[0]; h != null; ) {
2347
- if (L[h.id()])
2348
- return false;
2349
- h = h.parent()[0];
2350
- }
2351
- return true;
2352
- });
2353
- return d;
2354
- }, l.prototype.processChildrenList = function(m, L, O) {
2355
- for (var d = L.length, N = 0; N < d; N++) {
2356
- var s = L[N], h = s.children(), u, p = s.layoutDimensions({
2357
- nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels
2358
- });
2359
- if (s.outerWidth() != null && s.outerHeight() != null ? u = m.add(new g(O.graphManager, new a(s.position("x") - p.w / 2, s.position("y") - p.h / 2), new y(parseFloat(p.w), parseFloat(p.h)))) : u = m.add(new g(this.graphManager)), u.id = s.data("id"), u.paddingLeft = parseInt(s.css("padding")), u.paddingTop = parseInt(s.css("padding")), u.paddingRight = parseInt(s.css("padding")), u.paddingBottom = parseInt(s.css("padding")), this.options.nodeDimensionsIncludeLabels && s.isParent()) {
2360
- var A = s.boundingBox({ includeLabels: true, includeNodes: false }).w, C = s.boundingBox({ includeLabels: true, includeNodes: false }).h, R = s.css("text-halign");
2361
- u.labelWidth = A, u.labelHeight = C, u.labelPos = R;
2362
- }
2363
- if (this.idToLNode[s.data("id")] = u, isNaN(u.rect.x) && (u.rect.x = 0), isNaN(u.rect.y) && (u.rect.y = 0), h != null && h.length > 0) {
2364
- var x;
2365
- x = O.getGraphManager().add(O.newGraph(), u), this.processChildrenList(x, h, O);
2366
- }
2367
- }
2368
- }, l.prototype.stop = function() {
2369
- return this.stopped = true, this;
2370
- };
2371
- var T = function(L) {
2372
- L("layout", "cose-bilkent", l);
2373
- };
2374
- typeof cytoscape < "u" && T(cytoscape), D.exports = T;
2375
- }
2376
- /******/
2377
- ])
2378
- );
2379
- });
2380
- }(J)), J.exports;
2381
- }
2382
- var St = wt();
2383
- const Gt = /* @__PURE__ */ At(St);
2384
- var st = function() {
2385
- var I = /* @__PURE__ */ _(function(O, d, N, s) {
2386
- for (N = N || {}, s = O.length; s--; N[O[s]] = d) ;
2387
- return N;
2388
- }, "o"), w = [1, 4], f = [1, 13], D = [1, 12], v = [1, 15], r = [1, 16], t = [1, 20], e = [1, 19], i = [6, 7, 8], o = [1, 26], g = [1, 24], a = [1, 25], y = [6, 7, 11], n = [1, 6, 13, 15, 16, 19, 22], c = [1, 33], l = [1, 34], E = [1, 6, 7, 11, 13, 15, 16, 19, 22], T = {
2389
- trace: /* @__PURE__ */ _(function() {
2390
- }, "trace"),
2391
- yy: {},
2392
- symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, MINDMAP: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, ICON: 15, CLASS: 16, nodeWithId: 17, nodeWithoutId: 18, NODE_DSTART: 19, NODE_DESCR: 20, NODE_DEND: 21, NODE_ID: 22, $accept: 0, $end: 1 },
2393
- terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" },
2394
- productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]],
2395
- performAction: /* @__PURE__ */ _(function(d, N, s, h, u, p, A) {
2396
- var C = p.length - 1;
2397
- switch (u) {
2398
- case 6:
2399
- case 7:
2400
- return h;
2401
- case 8:
2402
- h.getLogger().trace("Stop NL ");
2403
- break;
2404
- case 9:
2405
- h.getLogger().trace("Stop EOF ");
2406
- break;
2407
- case 11:
2408
- h.getLogger().trace("Stop NL2 ");
2409
- break;
2410
- case 12:
2411
- h.getLogger().trace("Stop EOF2 ");
2412
- break;
2413
- case 15:
2414
- h.getLogger().info("Node: ", p[C].id), h.addNode(p[C - 1].length, p[C].id, p[C].descr, p[C].type);
2415
- break;
2416
- case 16:
2417
- h.getLogger().trace("Icon: ", p[C]), h.decorateNode({ icon: p[C] });
2418
- break;
2419
- case 17:
2420
- case 21:
2421
- h.decorateNode({ class: p[C] });
2422
- break;
2423
- case 18:
2424
- h.getLogger().trace("SPACELIST");
2425
- break;
2426
- case 19:
2427
- h.getLogger().trace("Node: ", p[C].id), h.addNode(0, p[C].id, p[C].descr, p[C].type);
2428
- break;
2429
- case 20:
2430
- h.decorateNode({ icon: p[C] });
2431
- break;
2432
- case 25:
2433
- h.getLogger().trace("node found ..", p[C - 2]), this.$ = { id: p[C - 1], descr: p[C - 1], type: h.getType(p[C - 2], p[C]) };
2434
- break;
2435
- case 26:
2436
- this.$ = { id: p[C], descr: p[C], type: h.nodeType.DEFAULT };
2437
- break;
2438
- case 27:
2439
- h.getLogger().trace("node found ..", p[C - 3]), this.$ = { id: p[C - 3], descr: p[C - 1], type: h.getType(p[C - 2], p[C]) };
2440
- break;
2441
- }
2442
- }, "anonymous"),
2443
- table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: w }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: w }, { 6: f, 7: [1, 10], 9: 9, 12: 11, 13: D, 14: 14, 15: v, 16: r, 17: 17, 18: 18, 19: t, 22: e }, I(i, [2, 3]), { 1: [2, 2] }, I(i, [2, 4]), I(i, [2, 5]), { 1: [2, 6], 6: f, 12: 21, 13: D, 14: 14, 15: v, 16: r, 17: 17, 18: 18, 19: t, 22: e }, { 6: f, 9: 22, 12: 11, 13: D, 14: 14, 15: v, 16: r, 17: 17, 18: 18, 19: t, 22: e }, { 6: o, 7: g, 10: 23, 11: a }, I(y, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: t, 22: e }), I(y, [2, 18]), I(y, [2, 19]), I(y, [2, 20]), I(y, [2, 21]), I(y, [2, 23]), I(y, [2, 24]), I(y, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: o, 7: g, 10: 32, 11: a }, { 1: [2, 7], 6: f, 12: 21, 13: D, 14: 14, 15: v, 16: r, 17: 17, 18: 18, 19: t, 22: e }, I(n, [2, 14], { 7: c, 11: l }), I(E, [2, 8]), I(E, [2, 9]), I(E, [2, 10]), I(y, [2, 15]), I(y, [2, 16]), I(y, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, I(n, [2, 13], { 7: c, 11: l }), I(E, [2, 11]), I(E, [2, 12]), { 21: [1, 37] }, I(y, [2, 25]), I(y, [2, 27])],
2444
- defaultActions: { 2: [2, 1], 6: [2, 2] },
2445
- parseError: /* @__PURE__ */ _(function(d, N) {
2446
- if (N.recoverable)
2447
- this.trace(d);
2448
- else {
2449
- var s = new Error(d);
2450
- throw s.hash = N, s;
2451
- }
2452
- }, "parseError"),
2453
- parse: /* @__PURE__ */ _(function(d) {
2454
- var N = this, s = [0], h = [], u = [null], p = [], A = this.table, C = "", R = 0, x = 0, G = 2, U = 1, X = p.slice.call(arguments, 1), M = Object.create(this.lexer), S = { yy: {} };
2455
- for (var F in this.yy)
2456
- Object.prototype.hasOwnProperty.call(this.yy, F) && (S.yy[F] = this.yy[F]);
2457
- M.setInput(d, S.yy), S.yy.lexer = M, S.yy.parser = this, typeof M.yylloc > "u" && (M.yylloc = {});
2458
- var b = M.yylloc;
2459
- p.push(b);
2460
- var Y = M.options && M.options.ranges;
2461
- typeof S.yy.parseError == "function" ? this.parseError = S.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
2462
- function k(B) {
2463
- s.length = s.length - 2 * B, u.length = u.length - B, p.length = p.length - B;
2464
- }
2465
- _(k, "popStack");
2466
- function H() {
2467
- var B;
2468
- return B = h.pop() || M.lex() || U, typeof B != "number" && (B instanceof Array && (h = B, B = h.pop()), B = N.symbols_[B] || B), B;
2469
- }
2470
- _(H, "lex");
2471
- for (var P, W, $, j, V = {}, z, Z, ht, K; ; ) {
2472
- if (W = s[s.length - 1], this.defaultActions[W] ? $ = this.defaultActions[W] : ((P === null || typeof P > "u") && (P = H()), $ = A[W] && A[W][P]), typeof $ > "u" || !$.length || !$[0]) {
2473
- var it = "";
2474
- K = [];
2475
- for (z in A[W])
2476
- this.terminals_[z] && z > G && K.push("'" + this.terminals_[z] + "'");
2477
- M.showPosition ? it = "Parse error on line " + (R + 1) + `:
2478
- ` + M.showPosition() + `
2479
- Expecting ` + K.join(", ") + ", got '" + (this.terminals_[P] || P) + "'" : it = "Parse error on line " + (R + 1) + ": Unexpected " + (P == U ? "end of input" : "'" + (this.terminals_[P] || P) + "'"), this.parseError(it, {
2480
- text: M.match,
2481
- token: this.terminals_[P] || P,
2482
- line: M.yylineno,
2483
- loc: b,
2484
- expected: K
2485
- });
2486
- }
2487
- if ($[0] instanceof Array && $.length > 1)
2488
- throw new Error("Parse Error: multiple actions possible at state: " + W + ", token: " + P);
2489
- switch ($[0]) {
2490
- case 1:
2491
- s.push(P), u.push(M.yytext), p.push(M.yylloc), s.push($[1]), P = null, x = M.yyleng, C = M.yytext, R = M.yylineno, b = M.yylloc;
2492
- break;
2493
- case 2:
2494
- if (Z = this.productions_[$[1]][1], V.$ = u[u.length - Z], V._$ = {
2495
- first_line: p[p.length - (Z || 1)].first_line,
2496
- last_line: p[p.length - 1].last_line,
2497
- first_column: p[p.length - (Z || 1)].first_column,
2498
- last_column: p[p.length - 1].last_column
2499
- }, Y && (V._$.range = [
2500
- p[p.length - (Z || 1)].range[0],
2501
- p[p.length - 1].range[1]
2502
- ]), j = this.performAction.apply(V, [
2503
- C,
2504
- x,
2505
- R,
2506
- S.yy,
2507
- $[1],
2508
- u,
2509
- p
2510
- ].concat(X)), typeof j < "u")
2511
- return j;
2512
- Z && (s = s.slice(0, -1 * Z * 2), u = u.slice(0, -1 * Z), p = p.slice(0, -1 * Z)), s.push(this.productions_[$[1]][0]), u.push(V.$), p.push(V._$), ht = A[s[s.length - 2]][s[s.length - 1]], s.push(ht);
2513
- break;
2514
- case 3:
2515
- return true;
2516
- }
2517
- }
2518
- return true;
2519
- }, "parse")
2520
- }, m = /* @__PURE__ */ function() {
2521
- var O = {
2522
- EOF: 1,
2523
- parseError: /* @__PURE__ */ _(function(N, s) {
2524
- if (this.yy.parser)
2525
- this.yy.parser.parseError(N, s);
2526
- else
2527
- throw new Error(N);
2528
- }, "parseError"),
2529
- // resets the lexer, sets new input
2530
- setInput: /* @__PURE__ */ _(function(d, N) {
2531
- return this.yy = N || this.yy || {}, this._input = d, this._more = this._backtrack = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
2532
- first_line: 1,
2533
- first_column: 0,
2534
- last_line: 1,
2535
- last_column: 0
2536
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
2537
- }, "setInput"),
2538
- // consumes and returns one char from the input
2539
- input: /* @__PURE__ */ _(function() {
2540
- var d = this._input[0];
2541
- this.yytext += d, this.yyleng++, this.offset++, this.match += d, this.matched += d;
2542
- var N = d.match(/(?:\r\n?|\n).*/g);
2543
- return N ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), d;
2544
- }, "input"),
2545
- // unshifts one char (or a string) into the input
2546
- unput: /* @__PURE__ */ _(function(d) {
2547
- var N = d.length, s = d.split(/(?:\r\n?|\n)/g);
2548
- this._input = d + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - N), this.offset -= N;
2549
- var h = this.match.split(/(?:\r\n?|\n)/g);
2550
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), s.length - 1 && (this.yylineno -= s.length - 1);
2551
- var u = this.yylloc.range;
2552
- return this.yylloc = {
2553
- first_line: this.yylloc.first_line,
2554
- last_line: this.yylineno + 1,
2555
- first_column: this.yylloc.first_column,
2556
- last_column: s ? (s.length === h.length ? this.yylloc.first_column : 0) + h[h.length - s.length].length - s[0].length : this.yylloc.first_column - N
2557
- }, this.options.ranges && (this.yylloc.range = [u[0], u[0] + this.yyleng - N]), this.yyleng = this.yytext.length, this;
2558
- }, "unput"),
2559
- // When called from action, caches matched text and appends it on next action
2560
- more: /* @__PURE__ */ _(function() {
2561
- return this._more = true, this;
2562
- }, "more"),
2563
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
2564
- reject: /* @__PURE__ */ _(function() {
2565
- if (this.options.backtrack_lexer)
2566
- this._backtrack = true;
2567
- else
2568
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
2569
- ` + this.showPosition(), {
2570
- text: "",
2571
- token: null,
2572
- line: this.yylineno
2573
- });
2574
- return this;
2575
- }, "reject"),
2576
- // retain first n characters of the match
2577
- less: /* @__PURE__ */ _(function(d) {
2578
- this.unput(this.match.slice(d));
2579
- }, "less"),
2580
- // displays already matched input, i.e. for error messages
2581
- pastInput: /* @__PURE__ */ _(function() {
2582
- var d = this.matched.substr(0, this.matched.length - this.match.length);
2583
- return (d.length > 20 ? "..." : "") + d.substr(-20).replace(/\n/g, "");
2584
- }, "pastInput"),
2585
- // displays upcoming input, i.e. for error messages
2586
- upcomingInput: /* @__PURE__ */ _(function() {
2587
- var d = this.match;
2588
- return d.length < 20 && (d += this._input.substr(0, 20 - d.length)), (d.substr(0, 20) + (d.length > 20 ? "..." : "")).replace(/\n/g, "");
2589
- }, "upcomingInput"),
2590
- // displays the character position where the lexing error occurred, i.e. for error messages
2591
- showPosition: /* @__PURE__ */ _(function() {
2592
- var d = this.pastInput(), N = new Array(d.length + 1).join("-");
2593
- return d + this.upcomingInput() + `
2594
- ` + N + "^";
2595
- }, "showPosition"),
2596
- // test the lexed token: return FALSE when not a match, otherwise return token
2597
- test_match: /* @__PURE__ */ _(function(d, N) {
2598
- var s, h, u;
2599
- if (this.options.backtrack_lexer && (u = {
2600
- yylineno: this.yylineno,
2601
- yylloc: {
2602
- first_line: this.yylloc.first_line,
2603
- last_line: this.last_line,
2604
- first_column: this.yylloc.first_column,
2605
- last_column: this.yylloc.last_column
2606
- },
2607
- yytext: this.yytext,
2608
- match: this.match,
2609
- matches: this.matches,
2610
- matched: this.matched,
2611
- yyleng: this.yyleng,
2612
- offset: this.offset,
2613
- _more: this._more,
2614
- _input: this._input,
2615
- yy: this.yy,
2616
- conditionStack: this.conditionStack.slice(0),
2617
- done: this.done
2618
- }, this.options.ranges && (u.yylloc.range = this.yylloc.range.slice(0))), h = d[0].match(/(?:\r\n?|\n).*/g), h && (this.yylineno += h.length), this.yylloc = {
2619
- first_line: this.yylloc.last_line,
2620
- last_line: this.yylineno + 1,
2621
- first_column: this.yylloc.last_column,
2622
- last_column: h ? h[h.length - 1].length - h[h.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + d[0].length
2623
- }, this.yytext += d[0], this.match += d[0], this.matches = d, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = false, this._backtrack = false, this._input = this._input.slice(d[0].length), this.matched += d[0], s = this.performAction.call(this, this.yy, this, N, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), s)
2624
- return s;
2625
- if (this._backtrack) {
2626
- for (var p in u)
2627
- this[p] = u[p];
2628
- return false;
2629
- }
2630
- return false;
2631
- }, "test_match"),
2632
- // return next match in input
2633
- next: /* @__PURE__ */ _(function() {
2634
- if (this.done)
2635
- return this.EOF;
2636
- this._input || (this.done = true);
2637
- var d, N, s, h;
2638
- this._more || (this.yytext = "", this.match = "");
2639
- for (var u = this._currentRules(), p = 0; p < u.length; p++)
2640
- if (s = this._input.match(this.rules[u[p]]), s && (!N || s[0].length > N[0].length)) {
2641
- if (N = s, h = p, this.options.backtrack_lexer) {
2642
- if (d = this.test_match(s, u[p]), d !== false)
2643
- return d;
2644
- if (this._backtrack) {
2645
- N = false;
2646
- continue;
2647
- } else
2648
- return false;
2649
- } else if (!this.options.flex)
2650
- break;
2651
- }
2652
- return N ? (d = this.test_match(N, u[h]), d !== false ? d : false) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
2653
- ` + this.showPosition(), {
2654
- text: "",
2655
- token: null,
2656
- line: this.yylineno
2657
- });
2658
- }, "next"),
2659
- // return next match that has a token
2660
- lex: /* @__PURE__ */ _(function() {
2661
- var N = this.next();
2662
- return N || this.lex();
2663
- }, "lex"),
2664
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
2665
- begin: /* @__PURE__ */ _(function(N) {
2666
- this.conditionStack.push(N);
2667
- }, "begin"),
2668
- // pop the previously active lexer condition state off the condition stack
2669
- popState: /* @__PURE__ */ _(function() {
2670
- var N = this.conditionStack.length - 1;
2671
- return N > 0 ? this.conditionStack.pop() : this.conditionStack[0];
2672
- }, "popState"),
2673
- // produce the lexer rule set which is active for the currently active lexer condition state
2674
- _currentRules: /* @__PURE__ */ _(function() {
2675
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
2676
- }, "_currentRules"),
2677
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
2678
- topState: /* @__PURE__ */ _(function(N) {
2679
- return N = this.conditionStack.length - 1 - Math.abs(N || 0), N >= 0 ? this.conditionStack[N] : "INITIAL";
2680
- }, "topState"),
2681
- // alias for begin(condition)
2682
- pushState: /* @__PURE__ */ _(function(N) {
2683
- this.begin(N);
2684
- }, "pushState"),
2685
- // return the number of states currently on the stack
2686
- stateStackSize: /* @__PURE__ */ _(function() {
2687
- return this.conditionStack.length;
2688
- }, "stateStackSize"),
2689
- options: { "case-insensitive": true },
2690
- performAction: /* @__PURE__ */ _(function(N, s, h, u) {
2691
- switch (h) {
2692
- case 0:
2693
- return N.getLogger().trace("Found comment", s.yytext), 6;
2694
- case 1:
2695
- return 8;
2696
- case 2:
2697
- this.begin("CLASS");
2698
- break;
2699
- case 3:
2700
- return this.popState(), 16;
2701
- case 4:
2702
- this.popState();
2703
- break;
2704
- case 5:
2705
- N.getLogger().trace("Begin icon"), this.begin("ICON");
2706
- break;
2707
- case 6:
2708
- return N.getLogger().trace("SPACELINE"), 6;
2709
- case 7:
2710
- return 7;
2711
- case 8:
2712
- return 15;
2713
- case 9:
2714
- N.getLogger().trace("end icon"), this.popState();
2715
- break;
2716
- case 10:
2717
- return N.getLogger().trace("Exploding node"), this.begin("NODE"), 19;
2718
- case 11:
2719
- return N.getLogger().trace("Cloud"), this.begin("NODE"), 19;
2720
- case 12:
2721
- return N.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19;
2722
- case 13:
2723
- return N.getLogger().trace("Cloud Bang"), this.begin("NODE"), 19;
2724
- case 14:
2725
- return this.begin("NODE"), 19;
2726
- case 15:
2727
- return this.begin("NODE"), 19;
2728
- case 16:
2729
- return this.begin("NODE"), 19;
2730
- case 17:
2731
- return this.begin("NODE"), 19;
2732
- case 18:
2733
- return 13;
2734
- case 19:
2735
- return 22;
2736
- case 20:
2737
- return 11;
2738
- case 21:
2739
- this.begin("NSTR2");
2740
- break;
2741
- case 22:
2742
- return "NODE_DESCR";
2743
- case 23:
2744
- this.popState();
2745
- break;
2746
- case 24:
2747
- N.getLogger().trace("Starting NSTR"), this.begin("NSTR");
2748
- break;
2749
- case 25:
2750
- return N.getLogger().trace("description:", s.yytext), "NODE_DESCR";
2751
- case 26:
2752
- this.popState();
2753
- break;
2754
- case 27:
2755
- return this.popState(), N.getLogger().trace("node end ))"), "NODE_DEND";
2756
- case 28:
2757
- return this.popState(), N.getLogger().trace("node end )"), "NODE_DEND";
2758
- case 29:
2759
- return this.popState(), N.getLogger().trace("node end ...", s.yytext), "NODE_DEND";
2760
- case 30:
2761
- return this.popState(), N.getLogger().trace("node end (("), "NODE_DEND";
2762
- case 31:
2763
- return this.popState(), N.getLogger().trace("node end (-"), "NODE_DEND";
2764
- case 32:
2765
- return this.popState(), N.getLogger().trace("node end (-"), "NODE_DEND";
2766
- case 33:
2767
- return this.popState(), N.getLogger().trace("node end (("), "NODE_DEND";
2768
- case 34:
2769
- return this.popState(), N.getLogger().trace("node end (("), "NODE_DEND";
2770
- case 35:
2771
- return N.getLogger().trace("Long description:", s.yytext), 20;
2772
- case 36:
2773
- return N.getLogger().trace("Long description:", s.yytext), 20;
2774
- }
2775
- }, "anonymous"),
2776
- rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
2777
- conditions: { CLASS: { rules: [3, 4], inclusive: false }, ICON: { rules: [8, 9], inclusive: false }, NSTR2: { rules: [22, 23], inclusive: false }, NSTR: { rules: [25, 26], inclusive: false }, NODE: { rules: [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], inclusive: false }, INITIAL: { rules: [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], inclusive: true } }
2778
- };
2779
- return O;
2780
- }();
2781
- T.lexer = m;
2782
- function L() {
2783
- this.yy = {};
2784
- }
2785
- return _(L, "Parser"), L.prototype = T, T.Parser = L, new L();
2786
- }();
2787
- st.parser = st;
2788
- var _t = st, Ft = {
2789
- DEFAULT: 0,
2790
- NO_BORDER: 0,
2791
- ROUNDED_RECT: 1,
2792
- RECT: 2,
2793
- CIRCLE: 3,
2794
- CLOUD: 4,
2795
- BANG: 5,
2796
- HEXAGON: 6
2797
- }, bt = (_a = class {
2798
- constructor() {
2799
- this.nodes = [], this.count = 0, this.elements = {}, this.getLogger = this.getLogger.bind(this), this.nodeType = Ft, this.clear(), this.getType = this.getType.bind(this), this.getMindmap = this.getMindmap.bind(this), this.getElementById = this.getElementById.bind(this), this.getParent = this.getParent.bind(this), this.getMindmap = this.getMindmap.bind(this), this.addNode = this.addNode.bind(this), this.decorateNode = this.decorateNode.bind(this);
2800
- }
2801
- clear() {
2802
- this.nodes = [], this.count = 0, this.elements = {};
2803
- }
2804
- getParent(I) {
2805
- for (let w = this.nodes.length - 1; w >= 0; w--)
2806
- if (this.nodes[w].level < I)
2807
- return this.nodes[w];
2808
- return null;
2809
- }
2810
- getMindmap() {
2811
- return this.nodes.length > 0 ? this.nodes[0] : null;
2812
- }
2813
- addNode(I, w, f, D) {
2814
- var _a2, _b;
2815
- Q.info("addNode", I, w, f, D);
2816
- const v = nt();
2817
- let r = ((_a2 = v.mindmap) == null ? void 0 : _a2.padding) ?? rt.mindmap.padding;
2818
- switch (D) {
2819
- case this.nodeType.ROUNDED_RECT:
2820
- case this.nodeType.RECT:
2821
- case this.nodeType.HEXAGON:
2822
- r *= 2;
2823
- break;
2824
- }
2825
- const t = {
2826
- id: this.count++,
2827
- nodeId: q(w, v),
2828
- level: I,
2829
- descr: q(f, v),
2830
- type: D,
2831
- children: [],
2832
- width: ((_b = v.mindmap) == null ? void 0 : _b.maxNodeWidth) ?? rt.mindmap.maxNodeWidth,
2833
- padding: r
2834
- }, e = this.getParent(I);
2835
- if (e)
2836
- e.children.push(t), this.nodes.push(t);
2837
- else if (this.nodes.length === 0)
2838
- this.nodes.push(t);
2839
- else
2840
- throw new Error(
2841
- `There can be only one root. No parent could be found for ("${t.descr}")`
2842
- );
2843
- }
2844
- getType(I, w) {
2845
- switch (Q.debug("In get type", I, w), I) {
2846
- case "[":
2847
- return this.nodeType.RECT;
2848
- case "(":
2849
- return w === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
2850
- case "((":
2851
- return this.nodeType.CIRCLE;
2852
- case ")":
2853
- return this.nodeType.CLOUD;
2854
- case "))":
2855
- return this.nodeType.BANG;
2856
- case "{{":
2857
- return this.nodeType.HEXAGON;
2858
- default:
2859
- return this.nodeType.DEFAULT;
2860
- }
2861
- }
2862
- setElementForId(I, w) {
2863
- this.elements[I] = w;
2864
- }
2865
- getElementById(I) {
2866
- return this.elements[I];
2867
- }
2868
- decorateNode(I) {
2869
- if (!I)
2870
- return;
2871
- const w = nt(), f = this.nodes[this.nodes.length - 1];
2872
- I.icon && (f.icon = q(I.icon, w)), I.class && (f.class = q(I.class, w));
2873
- }
2874
- type2Str(I) {
2875
- switch (I) {
2876
- case this.nodeType.DEFAULT:
2877
- return "no-border";
2878
- case this.nodeType.RECT:
2879
- return "rect";
2880
- case this.nodeType.ROUNDED_RECT:
2881
- return "rounded-rect";
2882
- case this.nodeType.CIRCLE:
2883
- return "circle";
2884
- case this.nodeType.CLOUD:
2885
- return "cloud";
2886
- case this.nodeType.BANG:
2887
- return "bang";
2888
- case this.nodeType.HEXAGON:
2889
- return "hexgon";
2890
- // cspell: disable-line
2891
- default:
2892
- return "no-border";
2893
- }
2894
- }
2895
- getLogger() {
2896
- return Q;
2897
- }
2898
- }, _(_a, "MindmapDB"), _a), Ut = 12, Pt = /* @__PURE__ */ _(function(I, w, f, D) {
2899
- w.append("path").attr("id", "node-" + f.id).attr("class", "node-bkg node-" + I.type2Str(f.type)).attr(
2900
- "d",
2901
- `M0 ${f.height - 5} v${-f.height + 2 * 5} q0,-5 5,-5 h${f.width - 2 * 5} q5,0 5,5 v${f.height - 5} H0 Z`
2902
- ), w.append("line").attr("class", "node-line-" + D).attr("x1", 0).attr("y1", f.height).attr("x2", f.width).attr("y2", f.height);
2903
- }, "defaultBkg"), Yt = /* @__PURE__ */ _(function(I, w, f) {
2904
- w.append("rect").attr("id", "node-" + f.id).attr("class", "node-bkg node-" + I.type2Str(f.type)).attr("height", f.height).attr("width", f.width);
2905
- }, "rectBkg"), Xt = /* @__PURE__ */ _(function(I, w, f) {
2906
- const D = f.width, v = f.height, r = 0.15 * D, t = 0.25 * D, e = 0.35 * D, i = 0.2 * D;
2907
- w.append("path").attr("id", "node-" + f.id).attr("class", "node-bkg node-" + I.type2Str(f.type)).attr(
2908
- "d",
2909
- `M0 0 a${r},${r} 0 0,1 ${D * 0.25},${-1 * D * 0.1}
2910
- a${e},${e} 1 0,1 ${D * 0.4},${-1 * D * 0.1}
2911
- a${t},${t} 1 0,1 ${D * 0.35},${1 * D * 0.2}
2912
-
2913
- a${r},${r} 1 0,1 ${D * 0.15},${1 * v * 0.35}
2914
- a${i},${i} 1 0,1 ${-1 * D * 0.15},${1 * v * 0.65}
2915
-
2916
- a${t},${r} 1 0,1 ${-1 * D * 0.25},${D * 0.15}
2917
- a${e},${e} 1 0,1 ${-1 * D * 0.5},0
2918
- a${r},${r} 1 0,1 ${-1 * D * 0.25},${-1 * D * 0.15}
2919
-
2920
- a${r},${r} 1 0,1 ${-1 * D * 0.1},${-1 * v * 0.35}
2921
- a${i},${i} 1 0,1 ${D * 0.1},${-1 * v * 0.65}
2922
-
2923
- H0 V0 Z`
2924
- );
2925
- }, "cloudBkg"), kt = /* @__PURE__ */ _(function(I, w, f) {
2926
- const D = f.width, v = f.height, r = 0.15 * D;
2927
- w.append("path").attr("id", "node-" + f.id).attr("class", "node-bkg node-" + I.type2Str(f.type)).attr(
2928
- "d",
2929
- `M0 0 a${r},${r} 1 0,0 ${D * 0.25},${-1 * v * 0.1}
2930
- a${r},${r} 1 0,0 ${D * 0.25},0
2931
- a${r},${r} 1 0,0 ${D * 0.25},0
2932
- a${r},${r} 1 0,0 ${D * 0.25},${1 * v * 0.1}
2933
-
2934
- a${r},${r} 1 0,0 ${D * 0.15},${1 * v * 0.33}
2935
- a${r * 0.8},${r * 0.8} 1 0,0 0,${1 * v * 0.34}
2936
- a${r},${r} 1 0,0 ${-1 * D * 0.15},${1 * v * 0.33}
2937
-
2938
- a${r},${r} 1 0,0 ${-1 * D * 0.25},${v * 0.15}
2939
- a${r},${r} 1 0,0 ${-1 * D * 0.25},0
2940
- a${r},${r} 1 0,0 ${-1 * D * 0.25},0
2941
- a${r},${r} 1 0,0 ${-1 * D * 0.25},${-1 * v * 0.15}
2942
-
2943
- a${r},${r} 1 0,0 ${-1 * D * 0.1},${-1 * v * 0.33}
2944
- a${r * 0.8},${r * 0.8} 1 0,0 0,${-1 * v * 0.34}
2945
- a${r},${r} 1 0,0 ${D * 0.1},${-1 * v * 0.33}
2946
-
2947
- H0 V0 Z`
2948
- );
2949
- }, "bangBkg"), Ht = /* @__PURE__ */ _(function(I, w, f) {
2950
- w.append("circle").attr("id", "node-" + f.id).attr("class", "node-bkg node-" + I.type2Str(f.type)).attr("r", f.width / 2);
2951
- }, "circleBkg");
2952
- function ft(I, w, f, D, v) {
2953
- return I.insert("polygon", ":first-child").attr(
2954
- "points",
2955
- D.map(function(r) {
2956
- return r.x + "," + r.y;
2957
- }).join(" ")
2958
- ).attr("transform", "translate(" + (v.width - w) / 2 + ", " + f + ")");
2959
- }
2960
- _(ft, "insertPolygonShape");
2961
- var $t = /* @__PURE__ */ _(function(I, w, f) {
2962
- const D = f.height, r = D / 4, t = f.width - f.padding + 2 * r, e = [
2963
- { x: r, y: 0 },
2964
- { x: t - r, y: 0 },
2965
- { x: t, y: -D / 2 },
2966
- { x: t - r, y: -D },
2967
- { x: r, y: -D },
2968
- { x: 0, y: -D / 2 }
2969
- ];
2970
- ft(w, t, D, e, f);
2971
- }, "hexagonBkg"), Wt = /* @__PURE__ */ _(function(I, w, f) {
2972
- w.append("rect").attr("id", "node-" + f.id).attr("class", "node-bkg node-" + I.type2Str(f.type)).attr("height", f.height).attr("rx", f.padding).attr("ry", f.padding).attr("width", f.width);
2973
- }, "roundedRectBkg"), Bt = /* @__PURE__ */ _(async function(I, w, f, D, v) {
2974
- const r = v.htmlLabels, t = D % (Ut - 1), e = w.append("g");
2975
- f.section = t;
2976
- let i = "section-" + t;
2977
- t < 0 && (i += " section-root"), e.attr("class", (f.class ? f.class + " " : "") + "mindmap-node " + i);
2978
- const o = e.append("g"), g = e.append("g"), a = f.descr.replace(/(<br\/*>)/g, `
2979
- `);
2980
- await Dt(
2981
- g,
2982
- a,
2983
- {
2984
- useHtmlLabels: r,
2985
- width: f.width,
2986
- classes: "mindmap-node-label"
2987
- },
2988
- v
2989
- ), r || g.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle");
2990
- const y = g.node().getBBox(), [n] = Ot(v.fontSize);
2991
- if (f.height = y.height + n * 1.1 * 0.5 + f.padding, f.width = y.width + 2 * f.padding, f.icon)
2992
- if (f.type === I.nodeType.CIRCLE)
2993
- f.height += 50, f.width += 50, e.append("foreignObject").attr("height", "50px").attr("width", f.width).attr("style", "text-align: center;").append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + t + " " + f.icon), g.attr(
2994
- "transform",
2995
- "translate(" + f.width / 2 + ", " + (f.height / 2 - 1.5 * f.padding) + ")"
2996
- );
2997
- else {
2998
- f.width += 50;
2999
- const c = f.height;
3000
- f.height = Math.max(c, 60);
3001
- const l = Math.abs(f.height - c);
3002
- e.append("foreignObject").attr("width", "60px").attr("height", f.height).attr("style", "text-align: center;margin-top:" + l / 2 + "px;").append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + t + " " + f.icon), g.attr(
3003
- "transform",
3004
- "translate(" + (25 + f.width / 2) + ", " + (l / 2 + f.padding / 2) + ")"
3005
- );
3006
- }
3007
- else if (r) {
3008
- const c = (f.width - y.width) / 2, l = (f.height - y.height) / 2;
3009
- g.attr("transform", "translate(" + c + ", " + l + ")");
3010
- } else {
3011
- const c = f.width / 2, l = f.padding / 2;
3012
- g.attr("transform", "translate(" + c + ", " + l + ")");
3013
- }
3014
- switch (f.type) {
3015
- case I.nodeType.DEFAULT:
3016
- Pt(I, o, f, t);
3017
- break;
3018
- case I.nodeType.ROUNDED_RECT:
3019
- Wt(I, o, f, t);
3020
- break;
3021
- case I.nodeType.RECT:
3022
- Yt(I, o, f, t);
3023
- break;
3024
- case I.nodeType.CIRCLE:
3025
- o.attr("transform", "translate(" + f.width / 2 + ", " + +f.height / 2 + ")"), Ht(I, o, f, t);
3026
- break;
3027
- case I.nodeType.CLOUD:
3028
- Xt(I, o, f, t);
3029
- break;
3030
- case I.nodeType.BANG:
3031
- kt(I, o, f, t);
3032
- break;
3033
- case I.nodeType.HEXAGON:
3034
- $t(I, o, f, t);
3035
- break;
3036
- }
3037
- return I.setElementForId(f.id, e), f.height;
3038
- }, "drawNode"), Vt = /* @__PURE__ */ _(function(I, w) {
3039
- const f = I.getElementById(w.id), D = w.x || 0, v = w.y || 0;
3040
- f.attr("transform", "translate(" + D + "," + v + ")");
3041
- }, "positionNode");
3042
- ut.use(Gt);
3043
- async function at(I, w, f, D, v) {
3044
- await Bt(I, w, f, D, v), f.children && await Promise.all(
3045
- f.children.map(
3046
- (r, t) => at(I, w, r, D < 0 ? t : D, v)
3047
- )
3048
- );
3049
- }
3050
- _(at, "drawNodes");
3051
- function pt(I, w) {
3052
- w.edges().map((f, D) => {
3053
- const v = f.data();
3054
- if (f[0]._private.bodyBounds) {
3055
- const r = f[0]._private.rscratch;
3056
- Q.trace("Edge: ", D, v), I.insert("path").attr(
3057
- "d",
3058
- `M ${r.startX},${r.startY} L ${r.midX},${r.midY} L${r.endX},${r.endY} `
3059
- ).attr("class", "edge section-edge-" + v.section + " edge-depth-" + v.depth);
3060
- }
3061
- });
3062
- }
3063
- _(pt, "drawEdges");
3064
- function ot(I, w, f, D) {
3065
- w.add({
3066
- group: "nodes",
3067
- data: {
3068
- id: I.id.toString(),
3069
- labelText: I.descr,
3070
- height: I.height,
3071
- width: I.width,
3072
- level: D,
3073
- nodeId: I.id,
3074
- padding: I.padding,
3075
- type: I.type
3076
- },
3077
- position: {
3078
- x: I.x,
3079
- y: I.y
3080
- }
3081
- }), I.children && I.children.forEach((v) => {
3082
- ot(v, w, f, D + 1), w.add({
3083
- group: "edges",
3084
- data: {
3085
- id: `${I.id}_${v.id}`,
3086
- source: I.id,
3087
- target: v.id,
3088
- depth: D,
3089
- section: v.section
3090
- }
3091
- });
3092
- });
3093
- }
3094
- _(ot, "addNodes");
3095
- function dt(I, w) {
3096
- return new Promise((f) => {
3097
- const D = mt("body").append("div").attr("id", "cy").attr("style", "display:none"), v = ut({
3098
- container: document.getElementById("cy"),
3099
- // container to render in
3100
- style: [
3101
- {
3102
- selector: "edge",
3103
- style: {
3104
- "curve-style": "bezier"
3105
- }
3106
- }
3107
- ]
3108
- });
3109
- D.remove(), ot(I, v, w, 0), v.nodes().forEach(function(r) {
3110
- r.layoutDimensions = () => {
3111
- const t = r.data();
3112
- return { w: t.width, h: t.height };
3113
- };
3114
- }), v.layout({
3115
- name: "cose-bilkent",
3116
- // @ts-ignore Types for cose-bilkent are not correct?
3117
- quality: "proof",
3118
- styleEnabled: false,
3119
- animate: false
3120
- }).run(), v.ready((r) => {
3121
- Q.info("Ready", r), f(v);
3122
- });
3123
- });
3124
- }
3125
- _(dt, "layoutMindmap");
3126
- function vt(I, w) {
3127
- w.nodes().map((f, D) => {
3128
- const v = f.data();
3129
- v.x = f.position().x, v.y = f.position().y, Vt(I, v);
3130
- const r = I.getElementById(v.nodeId);
3131
- Q.info("id:", D, "Position: (", f.position().x, ", ", f.position().y, ")", v), r.attr(
3132
- "transform",
3133
- `translate(${f.position().x - v.width / 2}, ${f.position().y - v.height / 2})`
3134
- ), r.attr("attr", `apa-${D})`);
3135
- });
3136
- }
3137
- _(vt, "positionNodes");
3138
- var Zt = /* @__PURE__ */ _(async (I, w, f, D) => {
3139
- var _a2, _b;
3140
- Q.debug(`Rendering mindmap diagram
3141
- ` + I);
3142
- const v = D.db, r = v.getMindmap();
3143
- if (!r)
3144
- return;
3145
- const t = nt();
3146
- t.htmlLabels = false;
3147
- const e = yt(w), i = e.append("g");
3148
- i.attr("class", "mindmap-edges");
3149
- const o = e.append("g");
3150
- o.attr("class", "mindmap-nodes"), await at(v, o, r, -1, t);
3151
- const g = await dt(r, t);
3152
- pt(i, g), vt(v, g), Et(
3153
- void 0,
3154
- e,
3155
- ((_a2 = t.mindmap) == null ? void 0 : _a2.padding) ?? rt.mindmap.padding,
3156
- ((_b = t.mindmap) == null ? void 0 : _b.useMaxWidth) ?? rt.mindmap.useMaxWidth
3157
- );
3158
- }, "draw"), Qt = {
3159
- draw: Zt
3160
- }, jt = /* @__PURE__ */ _((I) => {
3161
- let w = "";
3162
- for (let f = 0; f < I.THEME_COLOR_LIMIT; f++)
3163
- I["lineColor" + f] = I["lineColor" + f] || I["cScaleInv" + f], Lt(I["lineColor" + f]) ? I["lineColor" + f] = Tt(I["lineColor" + f], 20) : I["lineColor" + f] = Nt(I["lineColor" + f], 20);
3164
- for (let f = 0; f < I.THEME_COLOR_LIMIT; f++) {
3165
- const D = "" + (17 - 3 * f);
3166
- w += `
3167
- .section-${f - 1} rect, .section-${f - 1} path, .section-${f - 1} circle, .section-${f - 1} polygon, .section-${f - 1} path {
3168
- fill: ${I["cScale" + f]};
3169
- }
3170
- .section-${f - 1} text {
3171
- fill: ${I["cScaleLabel" + f]};
3172
- }
3173
- .node-icon-${f - 1} {
3174
- font-size: 40px;
3175
- color: ${I["cScaleLabel" + f]};
3176
- }
3177
- .section-edge-${f - 1}{
3178
- stroke: ${I["cScale" + f]};
3179
- }
3180
- .edge-depth-${f - 1}{
3181
- stroke-width: ${D};
3182
- }
3183
- .section-${f - 1} line {
3184
- stroke: ${I["cScaleInv" + f]} ;
3185
- stroke-width: 3;
3186
- }
3187
-
3188
- .disabled, .disabled circle, .disabled text {
3189
- fill: lightgray;
3190
- }
3191
- .disabled text {
3192
- fill: #efefef;
3193
- }
3194
- `;
3195
- }
3196
- return w;
3197
- }, "genSections"), zt = /* @__PURE__ */ _((I) => `
3198
- .edge {
3199
- stroke-width: 3;
3200
- }
3201
- ${jt(I)}
3202
- .section-root rect, .section-root path, .section-root circle, .section-root polygon {
3203
- fill: ${I.git0};
3204
- }
3205
- .section-root text {
3206
- fill: ${I.gitBranchLabel0};
3207
- }
3208
- .icon-container {
3209
- height:100%;
3210
- display: flex;
3211
- justify-content: center;
3212
- align-items: center;
3213
- }
3214
- .edge {
3215
- fill: none;
3216
- }
3217
- .mindmap-node-label {
3218
- dy: 1em;
3219
- alignment-baseline: middle;
3220
- text-anchor: middle;
3221
- dominant-baseline: middle;
3222
- text-align: center;
3223
- }
3224
- `, "getStyles"), Kt = zt, ee = {
3225
- get db() {
3226
- return new bt();
3227
- },
3228
- renderer: Qt,
3229
- parser: _t,
3230
- styles: Kt
3231
- };
3232
- export {
3233
- ee as diagram
3234
- };