@marimo-team/frontend 0.15.5 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-Cn5-l2X1.js → ConnectedDataExplorerComponent-BErMbWvG.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-CEXMKKA4.js → ImageComparisonComponent-fTHv1Ih0.js} +1 -1
  3. package/dist/assets/{VegaLite-Bt14Ds9k.js → VegaLite-Bdi-TyfY.js} +6 -6
  4. package/dist/assets/_baseEach-CNBxBxvS.js +1 -0
  5. package/dist/assets/_baseMap-D1WHjKrd.js +1 -0
  6. package/dist/assets/_baseUniq-CCgDNtZb.js +1 -0
  7. package/dist/assets/_createAggregator-DcD0kTA5.js +1 -0
  8. package/dist/assets/agent-panel-Crv430aI.js +268 -0
  9. package/dist/assets/agent-panel-D92Mfy1i.css +1 -0
  10. package/dist/assets/{any-language-editor-DiwNT6zp.js → any-language-editor-CQh552Wu.js} +1 -1
  11. package/dist/assets/architectureDiagram-W76B3OCA-BAJeBxzt.js +36 -0
  12. package/dist/assets/{between-horizontal-start-FyewyCGn.js → between-horizontal-start-Boxgxbt_.js} +1 -1
  13. package/dist/assets/{blockDiagram-QIGZ2CNN-BrOkAf_c.js → blockDiagram-QIGZ2CNN-CL-1svEK.js} +1 -1
  14. package/dist/assets/{c4Diagram-FPNF74CW-BHPzDxE2.js → c4Diagram-FPNF74CW-BbEqbCTl.js} +5 -5
  15. package/dist/assets/channel-_2eNSz0n.js +1 -0
  16. package/dist/assets/chat-panel-CXh5Wl6C.js +3 -0
  17. package/dist/assets/{chunk-4BX2VUAB-DLxaCNYh.js → chunk-4BX2VUAB-C--8TXeE.js} +1 -1
  18. package/dist/assets/{chunk-55IACEB6-DdzvO3HR.js → chunk-55IACEB6-Bj00HDqq.js} +1 -1
  19. package/dist/assets/{chunk-FMBD7UC4-R5o-nSiG.js → chunk-FMBD7UC4-C-lhB6hN.js} +1 -1
  20. package/dist/assets/{chunk-K7UQS3LO-DxaMrGgG.js → chunk-K7UQS3LO-B-pGTXPt.js} +1 -1
  21. package/dist/assets/{chunk-QN33PNHL-DqS9-FYm.js → chunk-QN33PNHL-DqUzGhvm.js} +1 -1
  22. package/dist/assets/{chunk-QZHKN3VN-BZ-TzajS.js → chunk-QZHKN3VN-TntJHfSk.js} +1 -1
  23. package/dist/assets/{chunk-TVAH2DTR-BsgP2dyv.js → chunk-TVAH2DTR-HUJb1psV.js} +1 -1
  24. package/dist/assets/{chunk-TZMSLE5B-D-h3ahXI.js → chunk-TZMSLE5B-BK3C__t3.js} +1 -1
  25. package/dist/assets/{circle-play-CQtRZ-rT.js → circle-play-DBLOv1Yu.js} +1 -1
  26. package/dist/assets/classDiagram-KNZD7YFC-BGmh9POF.js +1 -0
  27. package/dist/assets/classDiagram-v2-RKCZMP56-BGmh9POF.js +1 -0
  28. package/dist/assets/{clear-button-BY6Z_ViL.js → clear-button-BeoFbEKH.js} +1 -1
  29. package/dist/assets/clone-BFDSPAj3.js +1 -0
  30. package/dist/assets/command-palette-CXZiSv0I.js +1 -0
  31. package/dist/assets/common-C7oJcmCT.js +1 -0
  32. package/dist/assets/{compile-Ct_jzdKr.js → compile-7L0MwhyI.js} +1 -1
  33. package/dist/assets/cose-bilkent-S5V4N54A-BMkGLcVC.js +1 -0
  34. package/dist/assets/dagre-5GWH7T2D-BJtRienS.js +4 -0
  35. package/dist/assets/{data-grid-overlay-editor-BN_wulc3.js → data-grid-overlay-editor-DBkmGtNs.js} +1 -1
  36. package/dist/assets/datasources-panel-B7FbYLiy.js +1 -0
  37. package/dist/assets/{dependency-graph-panel-BOmSCZf7.js → dependency-graph-panel-DEdOxp2X.js} +4 -4
  38. package/dist/assets/diagram-N5W7TBWH-CmECY3nb.js +24 -0
  39. package/dist/assets/diagram-QEK2KX5R-DMOVSNKD.js +43 -0
  40. package/dist/assets/diagram-S2PKOQOG-BiJ96PNQ.js +24 -0
  41. package/dist/assets/{documentation-panel-BxjJO_Gw.js → documentation-panel-xULhaEv3.js} +1 -1
  42. package/dist/assets/edit-page-BrYda9VE.js +129 -0
  43. package/dist/assets/{ellipsis-vertical-UHbmjI2n.js → ellipsis-vertical-BBqXIlc2.js} +1 -1
  44. package/dist/assets/{empty-state-BIBXzY_0.js → empty-state-B3dA3G5P.js} +1 -1
  45. package/dist/assets/{erDiagram-AWTI2OKA-E84mAle_.js → erDiagram-AWTI2OKA-MP1DiFRo.js} +1 -1
  46. package/dist/assets/{error-panel-MEvQ6K7h.js → error-panel-Cc1sv-Ag.js} +1 -1
  47. package/dist/assets/file-explorer-panel-Bw59Kva1.js +1 -0
  48. package/dist/assets/{flowDiagram-PVAE7QVJ-DfbIRSAW.js → flowDiagram-PVAE7QVJ-BX7caPp7.js} +1 -1
  49. package/dist/assets/{ganttDiagram-OWAHRB6G-DR4HZ1z_.js → ganttDiagram-OWAHRB6G-B462g4Yf.js} +3 -3
  50. package/dist/assets/gitGraphDiagram-NY62KEGX-CGgvZ9-9.js +65 -0
  51. package/dist/assets/{glide-data-editor-nNmo1lPq.js → glide-data-editor-C0gUFZON.js} +4 -4
  52. package/dist/assets/graph-CHRVBzY5.js +1 -0
  53. package/dist/assets/{home-page-9eW6qida.js → home-page-Fb2osjys.js} +3 -3
  54. package/dist/assets/{index-DMomwMcN.js → index-BVgAenPd.js} +1 -1
  55. package/dist/assets/{index-B8llrTSo.js → index-BY93Ejhl.js} +1 -1
  56. package/dist/assets/{index-BFSnz7iM.js → index-C-8WADat.js} +1 -1
  57. package/dist/assets/{index-CPN7TRA1.js → index-C-GhZ7ti.js} +1 -1
  58. package/dist/assets/{index-DyLSuOH1.js → index-C1v_Z9et.js} +1 -1
  59. package/dist/assets/{index-VPWqq2Pg.js → index-C4Tn5NvJ.js} +1 -1
  60. package/dist/assets/{index-BAH034Ue.js → index-C77h_TXN.js} +1 -1
  61. package/dist/assets/{index-Dt9UWeWn.js → index-CQDrxQ0j.js} +1 -1
  62. package/dist/assets/{index-DWOaniGT.js → index-CWMgowgL.js} +1 -1
  63. package/dist/assets/{index-B1_GXGaP.js → index-Clbi_Yaq.js} +1 -1
  64. package/dist/assets/{index-B7yXbrLa.js → index-CpTPJo4k.js} +1 -1
  65. package/dist/assets/{index-CknhX2Vy.css → index-Cx0bsY1w.css} +1 -1
  66. package/dist/assets/{index-DqzMPAC8.js → index-D1vmG6DS.js} +2 -2
  67. package/dist/assets/{index-c6If577Q.js → index-D9UKkrr2.js} +1 -1
  68. package/dist/assets/{index-CB2pnVQG.js → index-DEQvTChO.js} +1 -1
  69. package/dist/assets/{index-OC46250R.js → index-DKEudB02.js} +205 -197
  70. package/dist/assets/{index-CSgxTUzD.js → index-DRMm6SNo.js} +1 -1
  71. package/dist/assets/{index-Bq516OmX.js → index-DoRmcrKM.js} +1 -1
  72. package/dist/assets/{index-DSU75csX.js → index-lYa_leQE.js} +1 -1
  73. package/dist/assets/{index-BLu5CX6z.js → index-vmICa5KN.js} +1 -1
  74. package/dist/assets/{index-uacyUula.js → index-z9bohSQJ.js} +1 -1
  75. package/dist/assets/infoDiagram-STP46IZ2-CVyrdLc8.js +2 -0
  76. package/dist/assets/isEmpty-DU_ogP_D.js +1 -0
  77. package/dist/assets/{journeyDiagram-BIP6EPQ6-BBiFyygf.js → journeyDiagram-BIP6EPQ6-C6EgLP_Q.js} +1 -1
  78. package/dist/assets/{kanban-definition-6OIFK2YF-DhgA6Nt6.js → kanban-definition-6OIFK2YF-BXzYO1yj.js} +4 -4
  79. package/dist/assets/layout-jihVw5-i.js +1 -0
  80. package/dist/assets/linear-C4blANlC.js +1 -0
  81. package/dist/assets/{links-CbvGxbsJ.js → links-D59GIweI.js} +3 -3
  82. package/dist/assets/{logs-panel-B9SmTZAW.js → logs-panel-D401qzZh.js} +1 -1
  83. package/dist/assets/markdown-renderer-Cd9eYyaL.js +263 -0
  84. package/dist/assets/{agent-panel-DpQ6muj-.css → markdown-renderer-ClyzDMmG.css} +1 -1
  85. package/dist/assets/mermaid-BEVuRz_O.js +1 -0
  86. package/dist/assets/{mermaid.core-4nVOEVX3.js → mermaid.core-CaSnaLH0.js} +41 -41
  87. package/dist/assets/min-DUMu_zeK.js +1 -0
  88. package/dist/assets/{mindmap-definition-Q6HEUPPD-CVLQNn1q.js → mindmap-definition-Q6HEUPPD-BXUM5MT2.js} +2 -2
  89. package/dist/assets/{number-overlay-editor-CzRzXLcd.js → number-overlay-editor-4uWXGlPG.js} +1 -1
  90. package/dist/assets/{outline-panel-uvsS-YEQ.js → outline-panel-DIzkvm2I.js} +1 -1
  91. package/dist/assets/packages-panel-CJL0MVlj.js +1 -0
  92. package/dist/assets/{pieDiagram-ADFJNKIX-C5IQ5DBZ.js → pieDiagram-ADFJNKIX-Dxt5PVNo.js} +3 -3
  93. package/dist/assets/{quadrantDiagram-LMRXKWRM-CFXFnQxx.js → quadrantDiagram-LMRXKWRM-D4pUaA31.js} +1 -1
  94. package/dist/assets/{react-plotly-mzdv02_Y.js → react-plotly-cJZ0VWBq.js} +1 -1
  95. package/dist/assets/{requirementDiagram-4UW4RH46-D9bPC89T.js → requirementDiagram-4UW4RH46-DVRTjgas.js} +1 -1
  96. package/dist/assets/run-page-BUEnMC9w.js +1 -0
  97. package/dist/assets/sankeyDiagram-GR3RE2ED-CVFnD9C-.js +10 -0
  98. package/dist/assets/scratchpad-panel-BIgRENkI.js +1 -0
  99. package/dist/assets/secrets-panel-xY5-V_BD.js +1 -0
  100. package/dist/assets/{sequenceDiagram-C3RYC4MD-6N7_hY4k.js → sequenceDiagram-C3RYC4MD-_lY4ZN_S.js} +4 -4
  101. package/dist/assets/{slides-component-EcjC8sDK.js → slides-component-Xjymwj7X.js} +1 -1
  102. package/dist/assets/snippets-panel-CTPYW41n.js +1 -0
  103. package/dist/assets/sortBy-BNZKwiq_.js +1 -0
  104. package/dist/assets/state-C4NiC9tO.js +1 -0
  105. package/dist/assets/stateDiagram-KXAO66HF-Da0JQWCn.js +1 -0
  106. package/dist/assets/stateDiagram-v2-UMBNRL4Z-D5lYZOOt.js +1 -0
  107. package/dist/assets/storage-CMdLzB_c.js +26 -0
  108. package/dist/assets/terminal-BPwTkXae.js +10 -0
  109. package/dist/assets/time-Dv5_Ouz_.js +1 -0
  110. package/dist/assets/{timeline-definition-XQNQX7LJ-BEaynAiY.js → timeline-definition-XQNQX7LJ-Dxh5Zu2e.js} +1 -1
  111. package/dist/assets/tracing-BCIurUfa.js +2 -0
  112. package/dist/assets/{tracing-panel-BmuHLPrY.js → tracing-panel-DAzrzNmm.js} +2 -2
  113. package/dist/assets/{trash-UBqfK4mR.js → trash-Dc6DSjz_.js} +1 -1
  114. package/dist/assets/{tree-XiEycetl.js → tree-jheoerAX.js} +1 -1
  115. package/dist/assets/{treemap-75Q7IDZK-CnuVFbBG.js → treemap-75Q7IDZK-IgpxeGaf.js} +21 -21
  116. package/dist/assets/{ts-tags-CloPe9IY.js → ts-tags-DxCDHihD.js} +1 -1
  117. package/dist/assets/variable-panel-DYAiLBmF.js +1 -0
  118. package/dist/assets/{vega-component-DsTH4tuX.js → vega-component-BpfpiPKI.js} +1 -1
  119. package/dist/assets/{xychartDiagram-6GGTOJPD-Dcz3O-A3.js → xychartDiagram-6GGTOJPD-CmNigJ31.js} +1 -1
  120. package/dist/index.html +2 -2
  121. package/package.json +8 -4
  122. package/src/__tests__/mocks.ts +43 -0
  123. package/src/components/app-config/user-config-form.tsx +32 -0
  124. package/src/components/chat/acp/__tests__/__snapshots__/prompt.test.ts.snap +55 -23
  125. package/src/components/chat/acp/__tests__/context-utils.test.ts +222 -0
  126. package/src/components/chat/acp/__tests__/prompt.test.ts +1 -1
  127. package/src/components/chat/acp/__tests__/state.test.ts +2 -6
  128. package/src/components/chat/acp/agent-docs.tsx +33 -6
  129. package/src/components/chat/acp/agent-panel.css +0 -18
  130. package/src/components/chat/acp/agent-panel.tsx +397 -72
  131. package/src/components/chat/acp/agent-selector.tsx +7 -1
  132. package/src/components/chat/acp/blocks.tsx +40 -10
  133. package/src/components/chat/acp/common.tsx +10 -2
  134. package/src/components/chat/acp/context-utils.ts +127 -0
  135. package/src/components/chat/acp/prompt.ts +34 -10
  136. package/src/components/chat/acp/state.ts +1 -1
  137. package/src/components/chat/acp/types.ts +8 -0
  138. package/src/components/chat/chat-panel.tsx +23 -88
  139. package/src/components/chat/chat-utils.ts +127 -1
  140. package/src/components/chat/markdown-renderer.css +39 -0
  141. package/src/components/chat/markdown-renderer.tsx +7 -38
  142. package/src/components/chat/tool-call-accordion.tsx +113 -23
  143. package/src/components/editor/Cell.tsx +6 -0
  144. package/src/components/editor/actions/name-cell-input.tsx +6 -1
  145. package/src/components/editor/actions/useCellActionButton.tsx +3 -1
  146. package/src/components/editor/ai/__tests__/completion-utils.test.ts +178 -1
  147. package/src/components/editor/ai/add-cell-with-ai.tsx +68 -66
  148. package/src/components/editor/ai/ai-completion-editor.tsx +29 -26
  149. package/src/components/editor/ai/completion-handlers.tsx +44 -6
  150. package/src/components/editor/ai/completion-utils.ts +92 -0
  151. package/src/components/editor/ai/transport/chat-transport.tsx +36 -0
  152. package/src/components/editor/cell/StagedAICell.tsx +51 -0
  153. package/src/components/editor/cell/cell-actions.tsx +2 -1
  154. package/src/components/terminal/__tests__/state.test.ts +207 -0
  155. package/src/components/terminal/hooks.ts +41 -0
  156. package/src/components/terminal/state.ts +75 -0
  157. package/src/components/terminal/terminal.tsx +334 -13
  158. package/src/components/terminal/theme.tsx +56 -0
  159. package/src/core/ai/__tests__/staged-cells.test.ts +356 -0
  160. package/src/core/ai/staged-cells.ts +208 -0
  161. package/src/core/cells/cells.ts +1 -1
  162. package/src/core/codemirror/lsp/federated-lsp.ts +1 -1
  163. package/src/core/islands/main.ts +2 -2
  164. package/src/core/kernel/messages.ts +8 -12
  165. package/src/core/saving/__tests__/filename.test.ts +37 -0
  166. package/src/core/static/__tests__/download-html.test.ts +43 -1
  167. package/src/core/websocket/useMarimoWebSocket.tsx +2 -2
  168. package/src/css/app/Cell.css +11 -0
  169. package/src/plugins/core/RenderHTML.tsx +36 -2
  170. package/src/plugins/core/__test__/RenderHTML.test.ts +72 -0
  171. package/src/plugins/core/registerReactComponent.tsx +28 -0
  172. package/src/plugins/impl/FileBrowserPlugin.tsx +8 -2
  173. package/src/stories/cell.stories.tsx +1 -1
  174. package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
  175. package/src/utils/__tests__/cell-urls.test.ts +29 -0
  176. package/src/utils/__tests__/filenames.test.ts +18 -0
  177. package/src/utils/__tests__/path.test.ts +38 -0
  178. package/src/utils/__tests__/urls.test.ts +56 -1
  179. package/src/utils/errors.ts +9 -0
  180. package/dist/assets/_baseEach-C1FLm7WW.js +0 -1
  181. package/dist/assets/_baseMap-DBVArUYD.js +0 -1
  182. package/dist/assets/_baseUniq-Dk7ZPJ3N.js +0 -1
  183. package/dist/assets/_createAggregator-Bn38fDd3.js +0 -1
  184. package/dist/assets/agent-panel-COUYnuIK.js +0 -475
  185. package/dist/assets/architectureDiagram-W76B3OCA-DBzWQKKu.js +0 -36
  186. package/dist/assets/channel-CjhbjOv4.js +0 -1
  187. package/dist/assets/chat-panel-BPXKoTnZ.js +0 -7
  188. package/dist/assets/chat-panel-Brrs_eeH.css +0 -1
  189. package/dist/assets/classDiagram-KNZD7YFC-DHs5cFzy.js +0 -1
  190. package/dist/assets/classDiagram-v2-RKCZMP56-DHs5cFzy.js +0 -1
  191. package/dist/assets/clone-DM1YNjEn.js +0 -1
  192. package/dist/assets/command-palette-S0bzQp7v.js +0 -1
  193. package/dist/assets/common-B8U9k2Ly.js +0 -1
  194. package/dist/assets/cose-bilkent-S5V4N54A-wz1Sfx7j.js +0 -1
  195. package/dist/assets/dagre-5GWH7T2D-BfpcVBgq.js +0 -4
  196. package/dist/assets/datasources-panel-DfuURLJw.js +0 -1
  197. package/dist/assets/diagram-N5W7TBWH-Bf0oqqQh.js +0 -24
  198. package/dist/assets/diagram-QEK2KX5R-ZTc3qikh.js +0 -43
  199. package/dist/assets/diagram-S2PKOQOG-tLScBy7Z.js +0 -24
  200. package/dist/assets/edit-page-DJ8kJZ9w.js +0 -129
  201. package/dist/assets/file-explorer-panel-CzNUJ63G.js +0 -1
  202. package/dist/assets/gitGraphDiagram-NY62KEGX-C1t6QtVa.js +0 -65
  203. package/dist/assets/graph-CssCVWIq.js +0 -1
  204. package/dist/assets/index-DcCIe7np.js +0 -28
  205. package/dist/assets/infoDiagram-STP46IZ2-CwiAoz9f.js +0 -2
  206. package/dist/assets/layout-DpQrxGW-.js +0 -1
  207. package/dist/assets/linear-NsreOeBF.js +0 -1
  208. package/dist/assets/mermaid-DSt0r6IQ.js +0 -1
  209. package/dist/assets/min-D259kI3t.js +0 -1
  210. package/dist/assets/packages-panel-xMz9W2hW.js +0 -1
  211. package/dist/assets/run-page-Bb68qdhQ.js +0 -1
  212. package/dist/assets/sankeyDiagram-GR3RE2ED-BSJOau8E.js +0 -10
  213. package/dist/assets/scratchpad-panel-BF4BO-U4.js +0 -1
  214. package/dist/assets/secrets-panel-CdIX44dQ.js +0 -1
  215. package/dist/assets/snippets-panel-Dco9h0rb.js +0 -1
  216. package/dist/assets/sortBy-aLGA-PGK.js +0 -1
  217. package/dist/assets/stateDiagram-KXAO66HF-Bd68WT3b.js +0 -1
  218. package/dist/assets/stateDiagram-v2-UMBNRL4Z-BXz_GSwb.js +0 -1
  219. package/dist/assets/storage-CGlP4lCF.js +0 -26
  220. package/dist/assets/terminal-CxkHubcu.js +0 -9
  221. package/dist/assets/time-D2nr1UgQ.js +0 -1
  222. package/dist/assets/tracing-kTqHxa7q.js +0 -2
  223. package/dist/assets/variable-panel-noTnH-AQ.js +0 -1
@@ -1,36 +0,0 @@
1
- var Qt;import{_ as nt,K as ze,V as Ve,l as ye,b as We,a as Be,q as je,t as qe,g as $e,s as Ze,z as Qe,F as Ke,G as Je,H as tn,c as se,a5 as ae,ao as he,h as en,ap as nn,aq as rn}from"./mermaid.core-4nVOEVX3.js";import{p as on}from"./chunk-4BX2VUAB-DLxaCNYh.js";import{p as sn}from"./treemap-75Q7IDZK-CnuVFbBG.js";import{c as Ee}from"./cytoscape.esm-UcEO6FGL.js";import{a9 as an}from"./index-OC46250R.js";import{s as hn}from"./transform-D9VCJYws.js";import"./step-BwsUM5iJ.js";import"./_baseEach-C1FLm7WW.js";import"./_baseUniq-Dk7ZPJ3N.js";import"./min-D259kI3t.js";import"./_baseMap-DBVArUYD.js";import"./clone-DM1YNjEn.js";import"./_createAggregator-Bn38fDd3.js";import"./timer-Bqd5yn_a.js";var Ne,Te={exports:{}},Ae={exports:{}},we={exports:{}};function ln(){return Ne?we.exports:(Ne=1,C=function(){return(function(T){var L={};function E(d){if(L[d])return L[d].exports;var r=L[d]={i:d,l:!1,exports:{}};return T[d].call(r.exports,r,r.exports,E),r.l=!0,r.exports}return E.m=T,E.c=L,E.i=function(d){return d},E.d=function(d,r,a){E.o(d,r)||Object.defineProperty(d,r,{configurable:!1,enumerable:!0,get:a})},E.n=function(d){var r=d&&d.__esModule?function(){return d.default}:function(){return d};return E.d(r,"a",r),r},E.o=function(d,r){return Object.prototype.hasOwnProperty.call(d,r)},E.p="",E(E.s=28)})([function(T,L,E){function d(){}d.QUALITY=1,d.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,d.DEFAULT_INCREMENTAL=!1,d.DEFAULT_ANIMATION_ON_LAYOUT=!0,d.DEFAULT_ANIMATION_DURING_LAYOUT=!1,d.DEFAULT_ANIMATION_PERIOD=50,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,d.DEFAULT_GRAPH_MARGIN=15,d.NODE_DIMENSIONS_INCLUDE_LABELS=!1,d.SIMPLE_NODE_SIZE=40,d.SIMPLE_NODE_HALF_SIZE=d.SIMPLE_NODE_SIZE/2,d.EMPTY_COMPOUND_NODE_SIZE=40,d.MIN_EDGE_LENGTH=1,d.WORLD_BOUNDARY=1e6,d.INITIAL_WORLD_BOUNDARY=d.WORLD_BOUNDARY/1e3,d.WORLD_CENTER_X=1200,d.WORLD_CENTER_Y=900,T.exports=d},function(T,L,E){var d=E(2),r=E(8),a=E(9);function e(i,o,t){d.call(this,t),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=t,this.bendpoints=[],this.source=i,this.target=o}for(var n in e.prototype=Object.create(d.prototype),d)e[n]=d[n];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(i){if(this.source===i)return this.target;if(this.target===i)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(i,o){for(var t=this.getOtherEnd(i),h=o.getGraphManager().getRoot();;){if(t.getOwner()==o)return t;if(t.getOwner()==h)break;t=t.getOwner().getParent()}return null},e.prototype.updateLength=function(){var i=new Array(4);this.isOverlapingSourceAndTarget=r.getIntersection(this.target.getRect(),this.source.getRect(),i),this.isOverlapingSourceAndTarget||(this.lengthX=i[0]-i[2],this.lengthY=i[1]-i[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},T.exports=e},function(T,L,E){T.exports=function(d){this.vGraphObject=d}},function(T,L,E){var d=E(2),r=E(10),a=E(13),e=E(0),n=E(16),i=E(5);function o(h,g,c,l){c==null&&l==null&&(l=g),d.call(this,l),h.graphManager!=null&&(h=h.graphManager),this.estimatedSize=r.MIN_VALUE,this.inclusionTreeDepth=r.MAX_VALUE,this.vGraphObject=l,this.edges=[],this.graphManager=h,this.rect=c!=null&&g!=null?new a(g.x,g.y,c.width,c.height):new a}for(var t in o.prototype=Object.create(d.prototype),d)o[t]=d[t];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(h){this.rect.width=h},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(h){this.rect.height=h},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new i(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new i(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(h,g){this.rect.x=h.x,this.rect.y=h.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(h,g){this.rect.x=h-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(h,g){this.rect.x=h,this.rect.y=g},o.prototype.moveBy=function(h,g){this.rect.x+=h,this.rect.y+=g},o.prototype.getEdgeListToNode=function(h){var g=[],c=this;return c.edges.forEach(function(l){if(l.target==h){if(l.source!=c)throw"Incorrect edge source!";g.push(l)}}),g},o.prototype.getEdgesBetween=function(h){var g=[],c=this;return c.edges.forEach(function(l){if(l.source!=c&&l.target!=c)throw"Incorrect edge source and/or target";l.target!=h&&l.source!=h||g.push(l)}),g},o.prototype.getNeighborsList=function(){var h=new Set,g=this;return g.edges.forEach(function(c){if(c.source==g)h.add(c.target);else{if(c.target!=g)throw"Incorrect incidency!";h.add(c.source)}}),h},o.prototype.withChildren=function(){var h=new Set;if(h.add(this),this.child!=null)for(var g=this.child.getNodes(),c=0;c<g.length;c++)g[c].withChildren().forEach(function(l){h.add(l)});return h},o.prototype.getNoOfChildren=function(){var h=0;if(this.child==null)h=1;else for(var g=this.child.getNodes(),c=0;c<g.length;c++)h+=g[c].getNoOfChildren();return h==0&&(h=1),h},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.prototype.calcEstimatedSize=function(){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)},o.prototype.scatter=function(){var h,g,c=-e.INITIAL_WORLD_BOUNDARY,l=e.INITIAL_WORLD_BOUNDARY;h=e.WORLD_CENTER_X+n.nextDouble()*(l-c)+c;var y=-e.INITIAL_WORLD_BOUNDARY,v=e.INITIAL_WORLD_BOUNDARY;g=e.WORLD_CENTER_Y+n.nextDouble()*(v-y)+y,this.rect.x=h,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var h=this.getChild();if(h.updateBounds(!0),this.rect.x=h.getLeft(),this.rect.y=h.getTop(),this.setWidth(h.getRight()-h.getLeft()),this.setHeight(h.getBottom()-h.getTop()),e.NODE_DIMENSIONS_INCLUDE_LABELS){var g=h.getRight()-h.getLeft(),c=h.getBottom()-h.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(g+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>g?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>c?(this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(c+this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==r.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(h){var g=this.rect.x;g>e.WORLD_BOUNDARY?g=e.WORLD_BOUNDARY:g<-e.WORLD_BOUNDARY&&(g=-e.WORLD_BOUNDARY);var c=this.rect.y;c>e.WORLD_BOUNDARY?c=e.WORLD_BOUNDARY:c<-e.WORLD_BOUNDARY&&(c=-e.WORLD_BOUNDARY);var l=new i(g,c),y=h.inverseTransformPoint(l);this.setLocation(y.x,y.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},T.exports=o},function(T,L,E){var d=E(0);function r(){}for(var a in d)r[a]=d[a];r.MAX_ITERATIONS=2500,r.DEFAULT_EDGE_LENGTH=50,r.DEFAULT_SPRING_STRENGTH=.45,r.DEFAULT_REPULSION_STRENGTH=4500,r.DEFAULT_GRAVITY_STRENGTH=.4,r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,r.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,r.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,r.COOLING_ADAPTATION_FACTOR=.33,r.ADAPTATION_LOWER_NODE_LIMIT=1e3,r.ADAPTATION_UPPER_NODE_LIMIT=5e3,r.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,r.MAX_NODE_DISPLACEMENT=3*r.MAX_NODE_DISPLACEMENT_INCREMENTAL,r.MIN_REPULSION_DIST=r.DEFAULT_EDGE_LENGTH/10,r.CONVERGENCE_CHECK_PERIOD=100,r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,r.MIN_EDGE_LENGTH=1,r.GRID_CALCULATION_CHECK_PERIOD=10,T.exports=r},function(T,L,E){function d(r,a){r==null&&a==null?(this.x=0,this.y=0):(this.x=r,this.y=a)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(r){this.x=r},d.prototype.setY=function(r){this.y=r},d.prototype.getDifference=function(r){return new DimensionD(this.x-r.x,this.y-r.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(r){return this.x+=r.width,this.y+=r.height,this},T.exports=d},function(T,L,E){var d=E(2),r=E(10),a=E(0),e=E(7),n=E(3),i=E(1),o=E(13),t=E(12),h=E(11);function g(l,y,v){d.call(this,v),this.estimatedSize=r.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=l,y!=null&&y instanceof e?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}for(var c in g.prototype=Object.create(d.prototype),d)g[c]=d[c];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(l,y,v){if(y==null&&v==null){var N=l;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(N)>-1)throw"Node already in graph!";return N.owner=this,this.getNodes().push(N),N}var A=l;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(v)>-1))throw"Source or target not in graph!";if(y.owner!=v.owner||y.owner!=this)throw"Both owners must be this graph!";return y.owner!=v.owner?null:(A.source=y,A.target=v,A.isInterGraph=!1,this.getEdges().push(A),y.edges.push(A),v!=y&&v.edges.push(A),A)},g.prototype.remove=function(l){var y=l;if(l instanceof n){if(y==null)throw"Node is null!";if(y.owner==null||y.owner!=this)throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var v=y.edges.slice(),N=v.length,A=0;A<N;A++)(M=v[A]).isInterGraph?this.graphManager.remove(M):M.source.owner.remove(M);if((P=this.nodes.indexOf(y))==-1)throw"Node not in owner node list!";this.nodes.splice(P,1)}else if(l instanceof i){var M;if((M=l)==null)throw"Edge is null!";if(M.source==null||M.target==null)throw"Source and/or target is null!";if(M.source.owner==null||M.target.owner==null||M.source.owner!=this||M.target.owner!=this)throw"Source and/or target owner is invalid!";var P,b=M.source.edges.indexOf(M),Y=M.target.edges.indexOf(M);if(!(b>-1&&Y>-1))throw"Source and/or target doesn't know this edge!";if(M.source.edges.splice(b,1),M.target!=M.source&&M.target.edges.splice(Y,1),(P=M.source.owner.getEdges().indexOf(M))==-1)throw"Not in owner's edge list!";M.source.owner.getEdges().splice(P,1)}},g.prototype.updateLeftTop=function(){for(var l,y,v,N=r.MAX_VALUE,A=r.MAX_VALUE,M=this.getNodes(),P=M.length,b=0;b<P;b++){var Y=M[b];N>(l=Y.getTop())&&(N=l),A>(y=Y.getLeft())&&(A=y)}return N==r.MAX_VALUE?null:(v=M[0].getParent().paddingLeft!=null?M[0].getParent().paddingLeft:this.margin,this.left=A-v,this.top=N-v,new t(this.left,this.top))},g.prototype.updateBounds=function(l){for(var y,v,N,A,M,P=r.MAX_VALUE,b=-r.MAX_VALUE,Y=r.MAX_VALUE,H=-r.MAX_VALUE,q=this.nodes,_=q.length,B=0;B<_;B++){var s=q[B];l&&s.child!=null&&s.updateBounds(),P>(y=s.getLeft())&&(P=y),b<(v=s.getRight())&&(b=v),Y>(N=s.getTop())&&(Y=N),H<(A=s.getBottom())&&(H=A)}var m=new o(P,Y,b-P,H-Y);P==r.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),M=q[0].getParent().paddingLeft!=null?q[0].getParent().paddingLeft:this.margin,this.left=m.x-M,this.right=m.x+m.width+M,this.top=m.y-M,this.bottom=m.y+m.height+M},g.calculateBounds=function(l){for(var y,v,N,A,M=r.MAX_VALUE,P=-r.MAX_VALUE,b=r.MAX_VALUE,Y=-r.MAX_VALUE,H=l.length,q=0;q<H;q++){var _=l[q];M>(y=_.getLeft())&&(M=y),P<(v=_.getRight())&&(P=v),b>(N=_.getTop())&&(b=N),Y<(A=_.getBottom())&&(Y=A)}return new o(M,b,P-M,Y-b)},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var l=0,y=this.nodes,v=y.length,N=0;N<v;N++)l+=y[N].calcEstimatedSize();return this.estimatedSize=l==0?a.EMPTY_COMPOUND_NODE_SIZE:l/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var l=this;if(this.nodes.length!=0){var y,v,N=new h,A=new Set,M=this.nodes[0];for(M.withChildren().forEach(function(H){N.push(H),A.add(H)});N.length!==0;)for(var P=(y=(M=N.shift()).getEdges()).length,b=0;b<P;b++)(v=y[b].getOtherEndInGraph(M,this))==null||A.has(v)||v.withChildren().forEach(function(H){N.push(H),A.add(H)});if(this.isConnected=!1,A.size>=this.nodes.length){var Y=0;A.forEach(function(H){H.owner==l&&Y++}),Y==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},T.exports=g},function(T,L,E){var d,r=E(1);function a(e){d=E(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),n=this.layout.newNode(null),i=this.add(e,n);return this.setRootGraph(i),this.rootGraph},a.prototype.add=function(e,n,i,o,t){if(i==null&&o==null&&t==null){if(e==null)throw"Graph is null!";if(n==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(n.child!=null)throw"Already has a child!";return e.parent=n,n.child=e,e}t=i,i=e;var h=(o=n).getOwner(),g=t.getOwner();if(h==null||h.getGraphManager()!=this)throw"Source not in this graph mgr!";if(g==null||g.getGraphManager()!=this)throw"Target not in this graph mgr!";if(h==g)return i.isInterGraph=!1,h.add(i,o,t);if(i.isInterGraph=!0,i.source=o,i.target=t,this.edges.indexOf(i)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(i),i.source==null||i.target==null)throw"Edge source and/or target is null!";if(i.source.edges.indexOf(i)!=-1||i.target.edges.indexOf(i)!=-1)throw"Edge already in source and/or target incidency list!";return i.source.edges.push(i),i.target.edges.push(i),i},a.prototype.remove=function(e){if(e instanceof d){var n=e;if(n.getGraphManager()!=this)throw"Graph not in this graph mgr";if(n!=this.rootGraph&&(n.parent==null||n.parent.graphManager!=this))throw"Invalid parent node!";for(var i,o=[],t=(o=o.concat(n.getEdges())).length,h=0;h<t;h++)i=o[h],n.remove(i);var g,c=[];for(t=(c=c.concat(n.getNodes())).length,h=0;h<t;h++)g=c[h],n.remove(g);n==this.rootGraph&&this.setRootGraph(null);var l=this.graphs.indexOf(n);this.graphs.splice(l,1),n.parent=null}else if(e instanceof r){if((i=e)==null)throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(i.source==null||i.target==null)throw"Source and/or target is null!";if(i.source.edges.indexOf(i)==-1||i.target.edges.indexOf(i)==-1)throw"Source and/or target doesn't know this edge!";if(l=i.source.edges.indexOf(i),i.source.edges.splice(l,1),l=i.target.edges.indexOf(i),i.target.edges.splice(l,1),i.source.owner==null||i.source.owner.getGraphManager()==null)throw"Edge owner graph or owner graph manager is null!";if(i.source.owner.getGraphManager().edges.indexOf(i)==-1)throw"Not in owner graph manager's edge list!";l=i.source.owner.getGraphManager().edges.indexOf(i),i.source.owner.getGraphManager().edges.splice(l,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],n=this.getGraphs(),i=n.length,o=0;o<i;o++)e=e.concat(n[o].getNodes());this.allNodes=e}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){var e=[],n=this.getGraphs();n.length;for(var i=0;i<n.length;i++)e=e.concat(n[i].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,e.parent==null&&(e.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,n){if(e==null||n==null)throw"assert failed";if(e==n)return!0;for(var i,o=e.getOwner();(i=o.getParent())!=null;){if(i==n)return!0;if((o=i.getOwner())==null)break}for(o=n.getOwner();(i=o.getParent())!=null;){if(i==e)return!0;if((o=i.getOwner())==null)break}return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,n,i,o,t,h=this.getAllEdges(),g=h.length,c=0;c<g;c++)if(n=(e=h[c]).source,i=e.target,e.lca=null,e.sourceInLca=n,e.targetInLca=i,n!=i){for(o=n.getOwner();e.lca==null;){for(e.targetInLca=i,t=i.getOwner();e.lca==null;){if(t==o){e.lca=t;break}if(t==this.rootGraph)break;if(e.lca!=null)throw"assert failed";e.targetInLca=t.getParent(),t=e.targetInLca.getOwner()}if(o==this.rootGraph)break;e.lca==null&&(e.sourceInLca=o.getParent(),o=e.sourceInLca.getOwner())}if(e.lca==null)throw"assert failed"}else e.lca=n.getOwner()},a.prototype.calcLowestCommonAncestor=function(e,n){if(e==n)return e.getOwner();for(var i=e.getOwner();i!=null;){for(var o=n.getOwner();o!=null;){if(o==i)return o;o=o.getParent().getOwner()}i=i.getParent().getOwner()}return i},a.prototype.calcInclusionTreeDepths=function(e,n){var i;e==null&&n==null&&(e=this.rootGraph,n=1);for(var o=e.getNodes(),t=o.length,h=0;h<t;h++)(i=o[h]).inclusionTreeDepth=n,i.child!=null&&this.calcInclusionTreeDepths(i.child,n+1)},a.prototype.includesInvalidEdge=function(){for(var e,n=[],i=this.edges.length,o=0;o<i;o++)e=this.edges[o],this.isOneAncestorOfOther(e.source,e.target)&&n.push(e);for(o=0;o<n.length;o++)this.remove(n[o]);return!1},T.exports=a},function(T,L,E){var d=E(12);function r(){}r.calcSeparationAmount=function(a,e,n,i){if(!a.intersects(e))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(a,e,o),n[0]=Math.min(a.getRight(),e.getRight())-Math.max(a.x,e.x),n[1]=Math.min(a.getBottom(),e.getBottom())-Math.max(a.y,e.y),a.getX()<=e.getX()&&a.getRight()>=e.getRight()?n[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(n[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?n[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(n[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var t=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(t=1);var h=t*n[0],g=n[1]/t;n[0]<g?g=n[0]:h=n[1],n[0]=-1*o[0]*(g/2+i),n[1]=-1*o[1]*(h/2+i)},r.decideDirectionsForOverlappingNodes=function(a,e,n){a.getCenterX()<e.getCenterX()?n[0]=-1:n[0]=1,a.getCenterY()<e.getCenterY()?n[1]=-1:n[1]=1},r.getIntersection2=function(a,e,n){var i=a.getCenterX(),o=a.getCenterY(),t=e.getCenterX(),h=e.getCenterY();if(a.intersects(e))return n[0]=i,n[1]=o,n[2]=t,n[3]=h,!0;var g=a.getX(),c=a.getY(),l=a.getRight(),y=a.getX(),v=a.getBottom(),N=a.getRight(),A=a.getWidthHalf(),M=a.getHeightHalf(),P=e.getX(),b=e.getY(),Y=e.getRight(),H=e.getX(),q=e.getBottom(),_=e.getRight(),B=e.getWidthHalf(),s=e.getHeightHalf(),m=!1,u=!1;if(i===t){if(o>h)return n[0]=i,n[1]=c,n[2]=t,n[3]=q,!1;if(o<h)return n[0]=i,n[1]=v,n[2]=t,n[3]=b,!1}else if(o===h){if(i>t)return n[0]=g,n[1]=o,n[2]=Y,n[3]=h,!1;if(i<t)return n[0]=l,n[1]=o,n[2]=P,n[3]=h,!1}else{var p=a.height/a.width,f=e.height/e.width,w=(h-o)/(t-i),I=void 0,x=void 0,F=void 0,G=void 0,S=void 0,D=void 0;if(-p===w?i>t?(n[0]=y,n[1]=v,m=!0):(n[0]=l,n[1]=c,m=!0):p===w&&(i>t?(n[0]=g,n[1]=c,m=!0):(n[0]=N,n[1]=v,m=!0)),-f===w?t>i?(n[2]=H,n[3]=q,u=!0):(n[2]=Y,n[3]=b,u=!0):f===w&&(t>i?(n[2]=P,n[3]=b,u=!0):(n[2]=_,n[3]=q,u=!0)),m&&u)return!1;if(i>t?o>h?(I=this.getCardinalDirection(p,w,4),x=this.getCardinalDirection(f,w,2)):(I=this.getCardinalDirection(-p,w,3),x=this.getCardinalDirection(-f,w,1)):o>h?(I=this.getCardinalDirection(-p,w,1),x=this.getCardinalDirection(-f,w,3)):(I=this.getCardinalDirection(p,w,2),x=this.getCardinalDirection(f,w,4)),!m)switch(I){case 1:G=c,F=i+-M/w,n[0]=F,n[1]=G;break;case 2:F=N,G=o+A*w,n[0]=F,n[1]=G;break;case 3:G=v,F=i+M/w,n[0]=F,n[1]=G;break;case 4:F=y,G=o+-A*w,n[0]=F,n[1]=G}if(!u)switch(x){case 1:D=b,S=t+-s/w,n[2]=S,n[3]=D;break;case 2:S=_,D=h+B*w,n[2]=S,n[3]=D;break;case 3:D=q,S=t+s/w,n[2]=S,n[3]=D;break;case 4:S=H,D=h+-B*w,n[2]=S,n[3]=D}}return!1},r.getCardinalDirection=function(a,e,n){return a>e?n:1+n%4},r.getIntersection=function(a,e,n,i){if(i==null)return this.getIntersection2(a,e,n);var o,t,h,g,c,l,y,v=a.x,N=a.y,A=e.x,M=e.y,P=n.x,b=n.y,Y=i.x,H=i.y;return(y=(o=M-N)*(g=P-Y)-(t=H-b)*(h=v-A))===0?null:new d((h*(l=Y*b-P*H)-g*(c=A*N-v*M))/y,(t*c-o*l)/y)},r.angleOfVector=function(a,e,n,i){var o=void 0;return a!==n?(o=Math.atan((i-e)/(n-a)),n<a?o+=Math.PI:i<e&&(o+=this.TWO_PI)):o=i<e?this.ONE_AND_HALF_PI:this.HALF_PI,o},r.doIntersect=function(a,e,n,i){var o=a.x,t=a.y,h=e.x,g=e.y,c=n.x,l=n.y,y=i.x,v=i.y,N=(h-o)*(v-l)-(y-c)*(g-t);if(N===0)return!1;var A=((v-l)*(y-o)+(c-y)*(v-t))/N,M=((t-g)*(y-o)+(h-o)*(v-t))/N;return 0<A&&A<1&&0<M&&M<1},r.findCircleLineIntersections=function(a,e,n,i,o,t,h){var g=(n-a)*(n-a)+(i-e)*(i-e),c=2*((a-o)*(n-a)+(e-t)*(i-e)),l=(a-o)*(a-o)+(e-t)*(e-t)-h*h;if(c*c-4*g*l>=0){var y=(-c+Math.sqrt(c*c-4*g*l))/(2*g),v=(-c-Math.sqrt(c*c-4*g*l))/(2*g);return y>=0&&y<=1?[y]:v>=0&&v<=1?[v]:null}return null},r.HALF_PI=.5*Math.PI,r.ONE_AND_HALF_PI=1.5*Math.PI,r.TWO_PI=2*Math.PI,r.THREE_PI=3*Math.PI,T.exports=r},function(T,L,E){function d(){}d.sign=function(r){return r>0?1:r<0?-1:0},d.floor=function(r){return r<0?Math.ceil(r):Math.floor(r)},d.ceil=function(r){return r<0?Math.floor(r):Math.ceil(r)},T.exports=d},function(T,L,E){function d(){}d.MAX_VALUE=2147483647,d.MIN_VALUE=-2147483648,T.exports=d},function(T,L,E){var d=(function(){function i(o,t){for(var h=0;h<t.length;h++){var g=t[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(o,g.key,g)}}return function(o,t,h){return t&&i(o.prototype,t),h&&i(o,h),o}})(),r=function(i){return{value:i,next:null,prev:null}},a=function(i,o,t,h){return i!==null?i.next=o:h.head=o,t!==null?t.prev=o:h.tail=o,o.prev=i,o.next=t,h.length++,o},e=function(i,o){var t=i.prev,h=i.next;return t!==null?t.next=h:o.head=h,h!==null?h.prev=t:o.tail=t,i.prev=i.next=null,o.length--,i},n=(function(){function i(o){var t=this;(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,i),this.length=0,this.head=null,this.tail=null,o!=null&&o.forEach(function(h){return t.push(h)})}return d(i,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(o,t){return a(t.prev,r(o),t,this)}},{key:"insertAfter",value:function(o,t){return a(t,r(o),t.next,this)}},{key:"insertNodeBefore",value:function(o,t){return a(t.prev,o,t,this)}},{key:"insertNodeAfter",value:function(o,t){return a(t,o,t.next,this)}},{key:"push",value:function(o){return a(this.tail,r(o),null,this)}},{key:"unshift",value:function(o){return a(null,r(o),this.head,this)}},{key:"remove",value:function(o){return e(o,this)}},{key:"pop",value:function(){return e(this.tail,this).value}},{key:"popNode",value:function(){return e(this.tail,this)}},{key:"shift",value:function(){return e(this.head,this).value}},{key:"shiftNode",value:function(){return e(this.head,this)}},{key:"get_object_at",value:function(o){if(o<=this.length()){for(var t=1,h=this.head;t<o;)h=h.next,t++;return h.value}}},{key:"set_object_at",value:function(o,t){if(o<=this.length()){for(var h=1,g=this.head;h<o;)g=g.next,h++;g.value=t}}}]),i})();T.exports=n},function(T,L,E){function d(r,a,e){this.x=null,this.y=null,r==null&&a==null&&e==null?(this.x=0,this.y=0):typeof r=="number"&&typeof a=="number"&&e==null?(this.x=r,this.y=a):r.constructor.name=="Point"&&a==null&&e==null&&(e=r,this.x=e.x,this.y=e.y)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.getLocation=function(){return new d(this.x,this.y)},d.prototype.setLocation=function(r,a,e){r.constructor.name=="Point"&&a==null&&e==null?(e=r,this.setLocation(e.x,e.y)):typeof r=="number"&&typeof a=="number"&&e==null&&(parseInt(r)==r&&parseInt(a)==a?this.move(r,a):(this.x=Math.floor(r+.5),this.y=Math.floor(a+.5)))},d.prototype.move=function(r,a){this.x=r,this.y=a},d.prototype.translate=function(r,a){this.x+=r,this.y+=a},d.prototype.equals=function(r){if(r.constructor.name=="Point"){var a=r;return this.x==a.x&&this.y==a.y}return this==r},d.prototype.toString=function(){return new d().constructor.name+"[x="+this.x+",y="+this.y+"]"},T.exports=d},function(T,L,E){function d(r,a,e,n){this.x=0,this.y=0,this.width=0,this.height=0,r!=null&&a!=null&&e!=null&&n!=null&&(this.x=r,this.y=a,this.width=e,this.height=n)}d.prototype.getX=function(){return this.x},d.prototype.setX=function(r){this.x=r},d.prototype.getY=function(){return this.y},d.prototype.setY=function(r){this.y=r},d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(r){this.width=r},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(r){this.height=r},d.prototype.getRight=function(){return this.x+this.width},d.prototype.getBottom=function(){return this.y+this.height},d.prototype.intersects=function(r){return!(this.getRight()<r.x||this.getBottom()<r.y||r.getRight()<this.x||r.getBottom()<this.y)},d.prototype.getCenterX=function(){return this.x+this.width/2},d.prototype.getMinX=function(){return this.getX()},d.prototype.getMaxX=function(){return this.getX()+this.width},d.prototype.getCenterY=function(){return this.y+this.height/2},d.prototype.getMinY=function(){return this.getY()},d.prototype.getMaxY=function(){return this.getY()+this.height},d.prototype.getWidthHalf=function(){return this.width/2},d.prototype.getHeightHalf=function(){return this.height/2},T.exports=d},function(T,L,E){var d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function r(){}r.lastID=0,r.createID=function(a){return r.isPrimitive(a)?a:(a.uniqueID!=null||(a.uniqueID=r.getString(),r.lastID++),a.uniqueID)},r.getString=function(a){return a==null&&(a=r.lastID),"Object#"+a},r.isPrimitive=function(a){var e=a===void 0?"undefined":d(a);return a==null||e!="object"&&e!="function"},T.exports=r},function(T,L,E){function d(c){if(Array.isArray(c)){for(var l=0,y=Array(c.length);l<c.length;l++)y[l]=c[l];return y}return Array.from(c)}var r=E(0),a=E(7),e=E(3),n=E(1),i=E(6),o=E(5),t=E(17),h=E(29);function g(c){h.call(this),this.layoutQuality=r.QUALITY,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=r.DEFAULT_INCREMENTAL,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null&&(this.isRemoteUse=c)}g.RANDOM_SEED=1,g.prototype=Object.create(h.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var c=new a(this);return this.graphManager=c,c},g.prototype.newGraph=function(c){return new i(null,this.graphManager,c)},g.prototype.newNode=function(c){return new e(this.graphManager,c)},g.prototype.newEdge=function(c){return new n(null,null,c)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){var c;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),c=!this.checkLayoutSuccess()&&this.layout(),r.ANIMATE!=="during"&&(c&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,c)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var c=this.graphManager.getAllEdges(),l=0;l<c.length;l++)c[l];var y=this.graphManager.getRoot().getNodes();for(l=0;l<y.length;l++)y[l];this.update(this.graphManager.getRoot())}},g.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof e){var l=c;if(l.getChild()!=null)for(var y=l.getChild().getNodes(),v=0;v<y.length;v++)update(y[v]);l.vGraphObject!=null&&l.vGraphObject.update(l)}else if(c instanceof n){var N=c;N.vGraphObject!=null&&N.vGraphObject.update(N)}else if(c instanceof i){var A=c;A.vGraphObject!=null&&A.vGraphObject.update(A)}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=r.QUALITY,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=r.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(c){if(c==null)this.transform(new o(0,0));else{var l=new t,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){l.setWorldOrgX(c.x),l.setWorldOrgY(c.y),l.setDeviceOrgX(y.x),l.setDeviceOrgY(y.y);for(var v=this.getAllNodes(),N=0;N<v.length;N++)v[N].transform(l)}}},g.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var l,y,v=c.getNodes(),N=0;N<v.length;N++)(y=(l=v[N]).getChild())==null||y.getNodes().length==0?l.scatter():(this.positionNodesRandomly(y),l.updateBounds())},g.prototype.getFlatForest=function(){for(var c=[],l=!0,y=this.graphManager.getRoot().getNodes(),v=!0,N=0;N<y.length;N++)y[N].getChild()!=null&&(v=!1);if(!v)return c;var A=new Set,M=[],P=new Map,b=[];for(b=b.concat(y);b.length>0&&l;){for(M.push(b[0]);M.length>0&&l;){var Y=M[0];M.splice(0,1),A.add(Y);var H=Y.getEdges();for(N=0;N<H.length;N++){var q=H[N].getOtherEnd(Y);if(P.get(Y)!=q){if(A.has(q)){l=!1;break}M.push(q),P.set(q,Y)}}}if(l){var _=[].concat(d(A));for(c.push(_),N=0;N<_.length;N++){var B=_[N],s=b.indexOf(B);s>-1&&b.splice(s,1)}A=new Set,P=new Map}else c=[]}return c},g.prototype.createDummyNodesForBendpoints=function(c){for(var l=[],y=c.source,v=this.graphManager.calcLowestCommonAncestor(c.source,c.target),N=0;N<c.bendpoints.length;N++){var A=this.newNode(null);A.setRect(new Point(0,0),new Dimension(1,1)),v.add(A);var M=this.newEdge(null);this.graphManager.add(M,y,A),l.add(A),y=A}return M=this.newEdge(null),this.graphManager.add(M,y,c.target),this.edgeToDummyNodes.set(c,l),c.isInterGraph()?this.graphManager.remove(c):v.remove(c),l},g.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(d(this.edgeToDummyNodes.keys())).concat(c);for(var l=0;l<c.length;l++){var y=c[l];if(y.bendpoints.length>0){for(var v=this.edgeToDummyNodes.get(y),N=0;N<v.length;N++){var A=v[N],M=new o(A.getCenterX(),A.getCenterY()),P=y.bendpoints.get(N);P.x=M.x,P.y=M.y,A.getOwner().remove(A)}this.graphManager.add(y,y.source,y.target)}}},g.transform=function(c,l,y,v){if(y!=null&&v!=null){var N=l;return c<=50?N-=(l-l/y)/50*(50-c):N+=(l*v-l)/50*(c-50),N}var A,M;return c<=50?(A=9*l/500,M=l/10):(A=9*l/50,M=-8*l),A*c+M},g.findCenterOfTree=function(c){var l=[];l=l.concat(c);var y=[],v=new Map,N=!1,A=null;l.length!=1&&l.length!=2||(N=!0,A=l[0]);for(var M=0;M<l.length;M++){var P=(H=l[M]).getNeighborsList().size;v.set(H,H.getNeighborsList().size),P==1&&y.push(H)}var b=[];for(b=b.concat(y);!N;){var Y=[];for(Y=Y.concat(b),b=[],M=0;M<l.length;M++){var H=l[M],q=l.indexOf(H);q>=0&&l.splice(q,1),H.getNeighborsList().forEach(function(_){if(y.indexOf(_)<0){var B=v.get(_)-1;B==1&&b.push(_),v.set(_,B)}})}y=y.concat(b),l.length!=1&&l.length!=2||(N=!0,A=l[0])}return A},g.prototype.setGraphManager=function(c){this.graphManager=c},T.exports=g},function(T,L,E){function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=1e4*Math.sin(d.seed++),d.x-Math.floor(d.x)},T.exports=d},function(T,L,E){var d=E(5);function r(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}r.prototype.getWorldOrgX=function(){return this.lworldOrgX},r.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},r.prototype.getWorldOrgY=function(){return this.lworldOrgY},r.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},r.prototype.getWorldExtX=function(){return this.lworldExtX},r.prototype.setWorldExtX=function(a){this.lworldExtX=a},r.prototype.getWorldExtY=function(){return this.lworldExtY},r.prototype.setWorldExtY=function(a){this.lworldExtY=a},r.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},r.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},r.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},r.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},r.prototype.getDeviceExtX=function(){return this.ldeviceExtX},r.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},r.prototype.getDeviceExtY=function(){return this.ldeviceExtY},r.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},r.prototype.transformX=function(a){var e=0,n=this.lworldExtX;return n!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/n),e},r.prototype.transformY=function(a){var e=0,n=this.lworldExtY;return n!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/n),e},r.prototype.inverseTransformX=function(a){var e=0,n=this.ldeviceExtX;return n!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/n),e},r.prototype.inverseTransformY=function(a){var e=0,n=this.ldeviceExtY;return n!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/n),e},r.prototype.inverseTransformPoint=function(a){return new d(this.inverseTransformX(a.x),this.inverseTransformY(a.y))},T.exports=r},function(T,L,E){var d=E(15),r=E(4),a=E(0),e=E(8),n=E(9);function i(){d.call(this),this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=r.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=r.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=r.MAX_ITERATIONS}for(var o in i.prototype=Object.create(d.prototype),d)i[o]=d[o];i.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var t,h,g,c,l,y,v,N=this.getGraphManager().getAllEdges(),A=0;A<N.length;A++)h=(t=N[A]).idealLength,t.isInterGraph&&(c=t.getSource(),l=t.getTarget(),y=t.getSourceInLca().getEstimatedSize(),v=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=y+v-2*a.SIMPLE_NODE_SIZE),g=t.getLca().getInclusionTreeDepth(),t.idealLength+=h*r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+l.getInclusionTreeDepth()-2*g))},i.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>r.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*r.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-r.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>r.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(r.COOLING_ADAPTATION_FACTOR,1-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*(1-r.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var t,h=this.getAllEdges(),g=0;g<h.length;g++)t=h[g],this.calcSpringForce(t,t.idealLength)},i.prototype.calcRepulsionForces=function(){var t,h,g,c,l,y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=arguments.length>1&&arguments[1]!==void 0&&arguments[1],N=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&y&&this.updateGrid(),l=new Set,t=0;t<N.length;t++)g=N[t],this.calculateRepulsionForceOfANode(g,l,y,v),l.add(g);else for(t=0;t<N.length;t++)for(g=N[t],h=t+1;h<N.length;h++)c=N[h],g.getOwner()==c.getOwner()&&this.calcRepulsionForce(g,c)},i.prototype.calcGravitationalForces=function(){for(var t,h=this.getAllNodesToApplyGravitation(),g=0;g<h.length;g++)t=h[g],this.calcGravitationalForce(t)},i.prototype.moveNodes=function(){for(var t=this.getAllNodes(),h=0;h<t.length;h++)t[h].move()},i.prototype.calcSpringForce=function(t,h){var g,c,l,y,v=t.getSource(),N=t.getTarget();if(this.uniformLeafNodeSizes&&v.getChild()==null&&N.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;(g=t.getLength())!=0&&(l=(c=t.edgeElasticity*(g-h))*(t.lengthX/g),y=c*(t.lengthY/g),v.springForceX+=l,v.springForceY+=y,N.springForceX-=l,N.springForceY-=y)},i.prototype.calcRepulsionForce=function(t,h){var g,c,l,y,v,N,A,M=t.getRect(),P=h.getRect(),b=new Array(2),Y=new Array(4);if(M.intersects(P)){e.calcSeparationAmount(M,P,b,r.DEFAULT_EDGE_LENGTH/2),N=2*b[0],A=2*b[1];var H=t.noOfChildren*h.noOfChildren/(t.noOfChildren+h.noOfChildren);t.repulsionForceX-=H*N,t.repulsionForceY-=H*A,h.repulsionForceX+=H*N,h.repulsionForceY+=H*A}else this.uniformLeafNodeSizes&&t.getChild()==null&&h.getChild()==null?(g=P.getCenterX()-M.getCenterX(),c=P.getCenterY()-M.getCenterY()):(e.getIntersection(M,P,Y),g=Y[2]-Y[0],c=Y[3]-Y[1]),Math.abs(g)<r.MIN_REPULSION_DIST&&(g=n.sign(g)*r.MIN_REPULSION_DIST),Math.abs(c)<r.MIN_REPULSION_DIST&&(c=n.sign(c)*r.MIN_REPULSION_DIST),l=g*g+c*c,y=Math.sqrt(l),N=(v=(t.nodeRepulsion/2+h.nodeRepulsion/2)*t.noOfChildren*h.noOfChildren/l)*g/y,A=v*c/y,t.repulsionForceX-=N,t.repulsionForceY-=A,h.repulsionForceX+=N,h.repulsionForceY+=A},i.prototype.calcGravitationalForce=function(t){var h,g,c,l,y,v,N,A;g=((h=t.getOwner()).getRight()+h.getLeft())/2,c=(h.getTop()+h.getBottom())/2,l=t.getCenterX()-g,y=t.getCenterY()-c,v=Math.abs(l)+t.getWidth()/2,N=Math.abs(y)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(v>(A=h.getEstimatedSize()*this.gravityRangeFactor)||N>A)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*y):(v>(A=h.getEstimatedSize()*this.compoundGravityRangeFactor)||N>A)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant)},i.prototype.isConverged=function(){var t,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||h},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,h=this.graphManager.getAllNodes(),g=0;g<h.length;g++)(t=h[g]).noOfChildren=t.getNoOfChildren()},i.prototype.calcGrid=function(t){var h,g;h=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var c=new Array(h),l=0;l<h;l++)c[l]=new Array(g);for(l=0;l<h;l++)for(var y=0;y<g;y++)c[l][y]=new Array;return c},i.prototype.addNodeToGrid=function(t,h,g){var c,l,y,v;c=parseInt(Math.floor((t.getRect().x-h)/this.repulsionRange)),l=parseInt(Math.floor((t.getRect().width+t.getRect().x-h)/this.repulsionRange)),y=parseInt(Math.floor((t.getRect().y-g)/this.repulsionRange)),v=parseInt(Math.floor((t.getRect().height+t.getRect().y-g)/this.repulsionRange));for(var N=c;N<=l;N++)for(var A=y;A<=v;A++)this.grid[N][A].push(t),t.setGridCoordinates(c,l,y,v)},i.prototype.updateGrid=function(){var t,h,g=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<g.length;t++)h=g[t],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(t,h,g,c){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&g||c){var l,y=new Set;t.surrounding=new Array;for(var v=this.grid,N=t.startX-1;N<t.finishX+2;N++)for(var A=t.startY-1;A<t.finishY+2;A++)if(!(N<0||A<0||N>=v.length||A>=v[0].length)){for(var M=0;M<v[N][A].length;M++)if(l=v[N][A][M],t.getOwner()==l.getOwner()&&t!=l&&!h.has(l)&&!y.has(l)){var P=Math.abs(t.getCenterX()-l.getCenterX())-(t.getWidth()/2+l.getWidth()/2),b=Math.abs(t.getCenterY()-l.getCenterY())-(t.getHeight()/2+l.getHeight()/2);P<=this.repulsionRange&&b<=this.repulsionRange&&y.add(l)}}t.surrounding=[].concat((function(Y){if(Array.isArray(Y)){for(var H=0,q=Array(Y.length);H<Y.length;H++)q[H]=Y[H];return q}return Array.from(Y)})(y))}for(N=0;N<t.surrounding.length;N++)this.calcRepulsionForce(t,t.surrounding[N])},i.prototype.calcRepulsionRange=function(){return 0},T.exports=i},function(T,L,E){var d=E(1),r=E(4);function a(n,i,o){d.call(this,n,i,o),this.idealLength=r.DEFAULT_EDGE_LENGTH,this.edgeElasticity=r.DEFAULT_SPRING_STRENGTH}for(var e in a.prototype=Object.create(d.prototype),d)a[e]=d[e];T.exports=a},function(T,L,E){var d=E(3),r=E(4);function a(n,i,o,t){d.call(this,n,i,o,t),this.nodeRepulsion=r.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var e in a.prototype=Object.create(d.prototype),d)a[e]=d[e];a.prototype.setGridCoordinates=function(n,i,o,t){this.startX=n,this.finishX=i,this.startY=o,this.finishY=t},T.exports=a},function(T,L,E){function d(r,a){this.width=0,this.height=0,r!==null&&a!==null&&(this.height=a,this.width=r)}d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(r){this.width=r},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(r){this.height=r},T.exports=d},function(T,L,E){var d=E(14);function r(){this.map={},this.keys=[]}r.prototype.put=function(a,e){var n=d.createID(a);this.contains(n)||(this.map[n]=e,this.keys.push(a))},r.prototype.contains=function(a){return d.createID(a),this.map[a]!=null},r.prototype.get=function(a){var e=d.createID(a);return this.map[e]},r.prototype.keySet=function(){return this.keys},T.exports=r},function(T,L,E){var d=E(14);function r(){this.set={}}r.prototype.add=function(a){var e=d.createID(a);this.contains(e)||(this.set[e]=a)},r.prototype.remove=function(a){delete this.set[d.createID(a)]},r.prototype.clear=function(){this.set={}},r.prototype.contains=function(a){return this.set[d.createID(a)]==a},r.prototype.isEmpty=function(){return this.size()===0},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAllTo=function(a){for(var e=Object.keys(this.set),n=e.length,i=0;i<n;i++)a.push(this.set[e[i]])},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAll=function(a){for(var e=a.length,n=0;n<e;n++){var i=a[n];this.add(i)}},T.exports=r},function(T,L,E){function d(){}d.multMat=function(r,a){for(var e=[],n=0;n<r.length;n++){e[n]=[];for(var i=0;i<a[0].length;i++){e[n][i]=0;for(var o=0;o<r[0].length;o++)e[n][i]+=r[n][o]*a[o][i]}}return e},d.transpose=function(r){for(var a=[],e=0;e<r[0].length;e++){a[e]=[];for(var n=0;n<r.length;n++)a[e][n]=r[n][e]}return a},d.multCons=function(r,a){for(var e=[],n=0;n<r.length;n++)e[n]=r[n]*a;return e},d.minusOp=function(r,a){for(var e=[],n=0;n<r.length;n++)e[n]=r[n]-a[n];return e},d.dotProduct=function(r,a){for(var e=0,n=0;n<r.length;n++)e+=r[n]*a[n];return e},d.mag=function(r){return Math.sqrt(this.dotProduct(r,r))},d.normalize=function(r){for(var a=[],e=this.mag(r),n=0;n<r.length;n++)a[n]=r[n]/e;return a},d.multGamma=function(r){for(var a=[],e=0,n=0;n<r.length;n++)e+=r[n];e*=-1/r.length;for(var i=0;i<r.length;i++)a[i]=e+r[i];return a},d.multL=function(r,a,e){for(var n=[],i=[],o=[],t=0;t<a[0].length;t++){for(var h=0,g=0;g<a.length;g++)h+=-.5*a[g][t]*r[g];i[t]=h}for(var c=0;c<e.length;c++){for(var l=0,y=0;y<e.length;y++)l+=e[c][y]*i[y];o[c]=l}for(var v=0;v<a.length;v++){for(var N=0,A=0;A<a[0].length;A++)N+=a[v][A]*o[A];n[v]=N}return n},T.exports=d},function(T,L,E){var d=(function(){function e(n,i){for(var o=0;o<i.length;o++){var t=i[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}return function(n,i,o){return i&&e(n.prototype,i),o&&e(n,o),n}})(),r=E(11),a=(function(){function e(n,i){(function(t,h){if(!(t instanceof h))throw new TypeError("Cannot call a class as a function")})(this,e),i===null&&i===void 0||(this.compareFunction=this._defaultCompareFunction);var o=void 0;o=n instanceof r?n.size():n.length,this._quicksort(n,0,o-1)}return d(e,[{key:"_quicksort",value:function(n,i,o){if(i<o){var t=this._partition(n,i,o);this._quicksort(n,i,t),this._quicksort(n,t+1,o)}}},{key:"_partition",value:function(n,i,o){for(var t=this._get(n,i),h=i,g=o;;){for(;this.compareFunction(t,this._get(n,g));)g--;for(;this.compareFunction(this._get(n,h),t);)h++;if(!(h<g))return g;this._swap(n,h,g),h++,g--}}},{key:"_get",value:function(n,i){return n instanceof r?n.get_object_at(i):n[i]}},{key:"_set",value:function(n,i,o){n instanceof r?n.set_object_at(i,o):n[i]=o}},{key:"_swap",value:function(n,i,o){var t=this._get(n,i);this._set(n,i,this._get(n,o)),this._set(n,o,t)}},{key:"_defaultCompareFunction",value:function(n,i){return i>n}}]),e})();T.exports=a},function(T,L,E){function d(){}d.svd=function(r){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=r.length,this.n=r[0].length;var a=Math.min(this.m,this.n);this.s=(function(At){for(var ct=[];At-- >0;)ct.push(0);return ct})(Math.min(this.m+1,this.n)),this.U=(function At(ct){if(ct.length==0)return 0;for(var Gt=[],Ct=0;Ct<ct[0];Ct++)Gt.push(At(ct.slice(1)));return Gt})([this.m,a]),this.V=(function(At){return(function ct(Gt){if(Gt.length==0)return 0;for(var Ct=[],Yt=0;Yt<Gt[0];Yt++)Ct.push(ct(Gt.slice(1)));return Ct})(At)})([this.n,this.n]);for(var e=(function(At){for(var ct=[];At-- >0;)ct.push(0);return ct})(this.n),n=(function(At){for(var ct=[];At-- >0;)ct.push(0);return ct})(this.m),i=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(i,o);t++){if(t<i){this.s[t]=0;for(var h=t;h<this.m;h++)this.s[t]=d.hypot(this.s[t],r[h][t]);if(this.s[t]!==0){r[t][t]<0&&(this.s[t]=-this.s[t]);for(var g=t;g<this.m;g++)r[g][t]/=this.s[t];r[t][t]+=1}this.s[t]=-this.s[t]}for(var c=t+1;c<this.n;c++){if((function(At,ct){return At&&ct})(t<i,this.s[t]!==0)){for(var l=0,y=t;y<this.m;y++)l+=r[y][t]*r[y][c];l=-l/r[t][t];for(var v=t;v<this.m;v++)r[v][c]+=l*r[v][t]}e[c]=r[t][c]}if((function(At,ct){return ct})(0,t<i))for(var N=t;N<this.m;N++)this.U[N][t]=r[N][t];if(t<o){e[t]=0;for(var A=t+1;A<this.n;A++)e[t]=d.hypot(e[t],e[A]);if(e[t]!==0){e[t+1]<0&&(e[t]=-e[t]);for(var M=t+1;M<this.n;M++)e[M]/=e[t];e[t+1]+=1}if(e[t]=-e[t],(function(At,ct){return At&&ct})(t+1<this.m,e[t]!==0)){for(var P=t+1;P<this.m;P++)n[P]=0;for(var b=t+1;b<this.n;b++)for(var Y=t+1;Y<this.m;Y++)n[Y]+=e[b]*r[Y][b];for(var H=t+1;H<this.n;H++)for(var q=-e[H]/e[t+1],_=t+1;_<this.m;_++)r[_][H]+=q*n[_]}for(var B=t+1;B<this.n;B++)this.V[B][t]=e[B]}}var s=Math.min(this.n,this.m+1);i<this.n&&(this.s[i]=r[i][i]),this.m<s&&(this.s[s-1]=0),o+1<s&&(e[o]=r[o][s-1]),e[s-1]=0;for(var m=i;m<a;m++){for(var u=0;u<this.m;u++)this.U[u][m]=0;this.U[m][m]=1}for(var p=i-1;p>=0;p--)if(this.s[p]!==0){for(var f=p+1;f<a;f++){for(var w=0,I=p;I<this.m;I++)w+=this.U[I][p]*this.U[I][f];w=-w/this.U[p][p];for(var x=p;x<this.m;x++)this.U[x][f]+=w*this.U[x][p]}for(var F=p;F<this.m;F++)this.U[F][p]=-this.U[F][p];this.U[p][p]=1+this.U[p][p];for(var G=0;G<p-1;G++)this.U[G][p]=0}else{for(var S=0;S<this.m;S++)this.U[S][p]=0;this.U[p][p]=1}for(var D=this.n-1;D>=0;D--){if((function(At,ct){return At&&ct})(D<o,e[D]!==0))for(var z=D+1;z<a;z++){for(var W=0,U=D+1;U<this.n;U++)W+=this.V[U][D]*this.V[U][z];W=-W/this.V[D+1][D];for(var O=D+1;O<this.n;O++)this.V[O][z]+=W*this.V[O][D]}for(var X=0;X<this.n;X++)this.V[X][D]=0;this.V[D][D]=1}for(var j=s-1,J=Math.pow(2,-52),it=Math.pow(2,-966);s>0;){var V=void 0,yt=void 0;for(V=s-2;V>=-1&&V!==-1;V--)if(Math.abs(e[V])<=it+J*(Math.abs(this.s[V])+Math.abs(this.s[V+1]))){e[V]=0;break}if(V===s-2)yt=4;else{var Lt=void 0;for(Lt=s-1;Lt>=V&&Lt!==V;Lt--){var Ut=(Lt!==s?Math.abs(e[Lt]):0)+(Lt!==V+1?Math.abs(e[Lt-1]):0);if(Math.abs(this.s[Lt])<=it+J*Ut){this.s[Lt]=0;break}}Lt===V?yt=3:Lt===s-1?yt=1:(yt=2,V=Lt)}switch(V++,yt){case 1:var Rt=e[s-2];e[s-2]=0;for(var K=s-2;K>=V;K--){var ot=d.hypot(this.s[K],Rt),ut=this.s[K]/ot,dt=Rt/ot;this.s[K]=ot,K!==V&&(Rt=-dt*e[K-1],e[K-1]=ut*e[K-1]);for(var vt=0;vt<this.n;vt++)ot=ut*this.V[vt][K]+dt*this.V[vt][s-1],this.V[vt][s-1]=-dt*this.V[vt][K]+ut*this.V[vt][s-1],this.V[vt][K]=ot}break;case 2:var Et=e[V-1];e[V-1]=0;for(var ht=V;ht<s;ht++){var Tt=d.hypot(this.s[ht],Et),_t=this.s[ht]/Tt,Ot=Et/Tt;this.s[ht]=Tt,Et=-Ot*e[ht],e[ht]=_t*e[ht];for(var Mt=0;Mt<this.m;Mt++)Tt=_t*this.U[Mt][ht]+Ot*this.U[Mt][V-1],this.U[Mt][V-1]=-Ot*this.U[Mt][ht]+_t*this.U[Mt][V-1],this.U[Mt][ht]=Tt}break;case 3:var xt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[s-1]),Math.abs(this.s[s-2])),Math.abs(e[s-2])),Math.abs(this.s[V])),Math.abs(e[V])),R=this.s[s-1]/xt,k=this.s[s-2]/xt,Q=e[s-2]/xt,Z=this.s[V]/xt,st=e[V]/xt,It=((k+R)*(k-R)+Q*Q)/2,rt=R*Q*(R*Q),mt=0;(function(At,ct){return At||ct})(It!==0,rt!==0)&&(mt=Math.sqrt(It*It+rt),It<0&&(mt=-mt),mt=rt/(It+mt));for(var ft=(Z+R)*(Z-R)+mt,St=Z*st,et=V;et<s-1;et++){var pt=d.hypot(ft,St),lt=ft/pt,$=St/pt;et!==V&&(e[et-1]=pt),ft=lt*this.s[et]+$*e[et],e[et]=lt*e[et]-$*this.s[et],St=$*this.s[et+1],this.s[et+1]=lt*this.s[et+1];for(var gt=0;gt<this.n;gt++)pt=lt*this.V[gt][et]+$*this.V[gt][et+1],this.V[gt][et+1]=-$*this.V[gt][et]+lt*this.V[gt][et+1],this.V[gt][et]=pt;if(lt=ft/(pt=d.hypot(ft,St)),$=St/pt,this.s[et]=pt,ft=lt*e[et]+$*this.s[et+1],this.s[et+1]=-$*e[et]+lt*this.s[et+1],St=$*e[et+1],e[et+1]=lt*e[et+1],et<this.m-1)for(var Nt=0;Nt<this.m;Nt++)pt=lt*this.U[Nt][et]+$*this.U[Nt][et+1],this.U[Nt][et+1]=-$*this.U[Nt][et]+lt*this.U[Nt][et+1],this.U[Nt][et]=pt}e[s-2]=ft;break;case 4:if(this.s[V]<=0){this.s[V]=this.s[V]<0?-this.s[V]:0;for(var at=0;at<=j;at++)this.V[at][V]=-this.V[at][V]}for(;V<j&&!(this.s[V]>=this.s[V+1]);){var Ft=this.s[V];if(this.s[V]=this.s[V+1],this.s[V+1]=Ft,V<this.n-1)for(var bt=0;bt<this.n;bt++)Ft=this.V[bt][V+1],this.V[bt][V+1]=this.V[bt][V],this.V[bt][V]=Ft;if(V<this.m-1)for(var Dt=0;Dt<this.m;Dt++)Ft=this.U[Dt][V+1],this.U[Dt][V+1]=this.U[Dt][V],this.U[Dt][V]=Ft;V++}s--}}return{U:this.U,V:this.V,S:this.s}},d.hypot=function(r,a){var e=void 0;return Math.abs(r)>Math.abs(a)?(e=a/r,e=Math.abs(r)*Math.sqrt(1+e*e)):a!=0?(e=r/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},T.exports=d},function(T,L,E){var d=(function(){function a(e,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,n,i){return n&&a(e.prototype,n),i&&a(e,i),e}})(),r=(function(){function a(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;(function(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")})(this,a),this.sequence1=e,this.sequence2=n,this.match_score=i,this.mismatch_penalty=o,this.gap_penalty=t,this.iMax=e.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=new Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[h][g]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[c][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return d(a,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var n=1;n<this.iMax;n++)this.grid[n][0]=this.grid[n-1][0]+this.gap_penalty,this.tracebackGrid[n][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var o=1;o<this.jMax;o++){var t=[this.sequence1[i-1]===this.sequence2[o-1]?this.grid[i-1][o-1]+this.match_score:this.grid[i-1][o-1]+this.mismatch_penalty,this.grid[i-1][o]+this.gap_penalty,this.grid[i][o-1]+this.gap_penalty],h=this.arrayAllMaxIndexes(t);this.grid[i][o]=t[h[0]],this.tracebackGrid[i][o]=[h.includes(0),h.includes(1),h.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});e[0];){var n=e[0],i=this.tracebackGrid[n.pos[0]][n.pos[1]];i[0]&&e.push({pos:[n.pos[0]-1,n.pos[1]-1],seq1:this.sequence1[n.pos[0]-1]+n.seq1,seq2:this.sequence2[n.pos[1]-1]+n.seq2}),i[1]&&e.push({pos:[n.pos[0]-1,n.pos[1]],seq1:this.sequence1[n.pos[0]-1]+n.seq1,seq2:"-"+n.seq2}),i[2]&&e.push({pos:[n.pos[0],n.pos[1]-1],seq1:"-"+n.seq1,seq2:this.sequence2[n.pos[1]-1]+n.seq2}),n.pos[0]===0&&n.pos[1]===0&&this.alignments.push({sequence1:n.seq1,sequence2:n.seq2}),e.shift()}return this.alignments}},{key:"getAllIndexes",value:function(e,n){for(var i=[],o=-1;(o=e.indexOf(n,o+1))!==-1;)i.push(o);return i}},{key:"arrayAllMaxIndexes",value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),a})();T.exports=r},function(T,L,E){var d=function(){};d.FDLayout=E(18),d.FDLayoutConstants=E(4),d.FDLayoutEdge=E(19),d.FDLayoutNode=E(20),d.DimensionD=E(21),d.HashMap=E(22),d.HashSet=E(23),d.IGeometry=E(8),d.IMath=E(9),d.Integer=E(10),d.Point=E(12),d.PointD=E(5),d.RandomSeed=E(16),d.RectangleD=E(13),d.Transform=E(17),d.UniqueIDGeneretor=E(14),d.Quicksort=E(25),d.LinkedList=E(11),d.LGraphObject=E(2),d.LGraph=E(6),d.LEdge=E(1),d.LGraphManager=E(7),d.LNode=E(3),d.Layout=E(15),d.LayoutConstants=E(0),d.NeedlemanWunsch=E(27),d.Matrix=E(24),d.SVD=E(26),T.exports=d},function(T,L,E){function d(){this.listeners=[]}var r=d.prototype;r.addListener=function(a,e){this.listeners.push({event:a,callback:e})},r.removeListener=function(a,e){for(var n=this.listeners.length;n>=0;n--){var i=this.listeners[n];i.event===a&&i.callback===e&&this.listeners.splice(n,1)}},r.emit=function(a,e){for(var n=0;n<this.listeners.length;n++){var i=this.listeners[n];a===i.event&&i.callback(e)}},T.exports=d}])},we.exports=C());var C}var Le;function dn(){return Le?Ae.exports:(Le=1,C=function(T){return L={45:(r,a,e)=>{var n={};n.layoutBase=e(551),n.CoSEConstants=e(806),n.CoSEEdge=e(767),n.CoSEGraph=e(880),n.CoSEGraphManager=e(578),n.CoSELayout=e(765),n.CoSENode=e(991),n.ConstraintHandler=e(902),r.exports=n},806:(r,a,e)=>{var n=e(551).FDLayoutConstants;function i(){}for(var o in n)i[o]=n[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,r.exports=i},767:(r,a,e)=>{var n=e(551).FDLayoutEdge;function i(t,h,g){n.call(this,t,h,g)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];r.exports=i},880:(r,a,e)=>{var n=e(551).LGraph;function i(t,h,g){n.call(this,t,h,g)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];r.exports=i},578:(r,a,e)=>{var n=e(551).LGraphManager;function i(t){n.call(this,t)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];r.exports=i},765:(r,a,e)=>{var n=e(551).FDLayout,i=e(578),o=e(880),t=e(991),h=e(767),g=e(806),c=e(902),l=e(551).FDLayoutConstants,y=e(551).LayoutConstants,v=e(551).Point,N=e(551).PointD,A=e(551).DimensionD,M=e(551).Layout,P=e(551).Integer,b=e(551).IGeometry,Y=e(551).LGraph,H=e(551).Transform,q=e(551).LinkedList;function _(){n.call(this),this.toBeTiled={},this.constraints={}}for(var B in _.prototype=Object.create(n.prototype),n)_[B]=n[B];_.prototype.newGraphManager=function(){var s=new i(this);return this.graphManager=s,s},_.prototype.newGraph=function(s){return new o(null,this.graphManager,s)},_.prototype.newNode=function(s){return new t(this.graphManager,s)},_.prototype.newEdge=function(s){return new h(null,null,s)},_.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.isSubLayout||(g.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},_.prototype.initSpringEmbedder=function(){n.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},_.prototype.layout=function(){return y.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},_.prototype.classicLayout=function(){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)g.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),m=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(p){return m.has(p)}),this.graphManager.setAllNodesToApplyGravitation(u));else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(p){return m.has(p)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),g.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},_.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}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))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(f){return s.has(f)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),g.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var u=!this.isTreeGrowing&&!this.isGrowthFinished,p=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(u,p),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},_.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),m={},u=0;u<s.length;u++){var p=s[u].rect,f=s[u].id;m[f]={id:f,x:p.getCenterX(),y:p.getCenterY(),w:p.width,h:p.height}}return m},_.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(l.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},_.prototype.moveNodes=function(){for(var s=this.getAllNodes(),m=0;m<s.length;m++)s[m].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),m=0;m<s.length;m++)s[m].move()},_.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var m=this.graphManager.getAllNodes(),u=0;u<m.length;u++){var p=m[u];this.idToNodeMap.set(p.id,p)}var f=function O(X){for(var j,J=X.getChild().getNodes(),it=0,V=0;V<J.length;V++)(j=J[V]).getChild()==null?s.fixedNodeSet.has(j.id)&&(it+=100):it+=O(j);return it};if(this.constraints.fixedNodeConstraint){for(this.constraints.fixedNodeConstraint.forEach(function(O){s.fixedNodeSet.add(O.nodeId)}),m=this.graphManager.getAllNodes(),u=0;u<m.length;u++)if((p=m[u]).getChild()!=null){var w=f(p);w>0&&(p.fixedNodeWeight=w)}}if(this.constraints.relativePlacementConstraint){var I=new Map,x=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){s.fixedNodesOnHorizontal.add(O),s.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var F=this.constraints.alignmentConstraint.vertical;for(u=0;u<F.length;u++)this.dummyToNodeForVerticalAlignment.set("dummy"+u,[]),F[u].forEach(function(O){I.set(O,"dummy"+u),s.dummyToNodeForVerticalAlignment.get("dummy"+u).push(O),s.fixedNodeSet.has(O)&&s.fixedNodesOnHorizontal.add("dummy"+u)})}if(this.constraints.alignmentConstraint.horizontal){var G=this.constraints.alignmentConstraint.horizontal;for(u=0;u<G.length;u++)this.dummyToNodeForHorizontalAlignment.set("dummy"+u,[]),G[u].forEach(function(O){x.set(O,"dummy"+u),s.dummyToNodeForHorizontalAlignment.get("dummy"+u).push(O),s.fixedNodeSet.has(O)&&s.fixedNodesOnVertical.add("dummy"+u)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(O){var X,j,J;for(J=O.length-1;J>=2*O.length/3;J--)X=Math.floor(Math.random()*(J+1)),j=O[J],O[J]=O[X],O[X]=j;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var X=I.has(O.left)?I.get(O.left):O.left,j=I.has(O.right)?I.get(O.right):O.right;s.nodesInRelativeHorizontal.includes(X)||(s.nodesInRelativeHorizontal.push(X),s.nodeToRelativeConstraintMapHorizontal.set(X,[]),s.dummyToNodeForVerticalAlignment.has(X)?s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(X).getCenterX())),s.nodesInRelativeHorizontal.includes(j)||(s.nodesInRelativeHorizontal.push(j),s.nodeToRelativeConstraintMapHorizontal.set(j,[]),s.dummyToNodeForVerticalAlignment.has(j)?s.nodeToTempPositionMapHorizontal.set(j,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(j)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(j,s.idToNodeMap.get(j).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(X).push({right:j,gap:O.gap}),s.nodeToRelativeConstraintMapHorizontal.get(j).push({left:X,gap:O.gap})}else{var J=x.has(O.top)?x.get(O.top):O.top,it=x.has(O.bottom)?x.get(O.bottom):O.bottom;s.nodesInRelativeVertical.includes(J)||(s.nodesInRelativeVertical.push(J),s.nodeToRelativeConstraintMapVertical.set(J,[]),s.dummyToNodeForHorizontalAlignment.has(J)?s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(J).getCenterY())),s.nodesInRelativeVertical.includes(it)||(s.nodesInRelativeVertical.push(it),s.nodeToRelativeConstraintMapVertical.set(it,[]),s.dummyToNodeForHorizontalAlignment.has(it)?s.nodeToTempPositionMapVertical.set(it,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(it)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(it,s.idToNodeMap.get(it).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(J).push({bottom:it,gap:O.gap}),s.nodeToRelativeConstraintMapVertical.get(it).push({top:J,gap:O.gap})}});else{var S=new Map,D=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var X=I.has(O.left)?I.get(O.left):O.left,j=I.has(O.right)?I.get(O.right):O.right;S.has(X)?S.get(X).push(j):S.set(X,[j]),S.has(j)?S.get(j).push(X):S.set(j,[X])}else{var J=x.has(O.top)?x.get(O.top):O.top,it=x.has(O.bottom)?x.get(O.bottom):O.bottom;D.has(J)?D.get(J).push(it):D.set(J,[it]),D.has(it)?D.get(it).push(J):D.set(it,[J])}});var z=function(O,X){var j=[],J=[],it=new q,V=new Set,yt=0;return O.forEach(function(Lt,Ut){if(!V.has(Ut)){j[yt]=[],J[yt]=!1;var Rt=Ut;for(it.push(Rt),V.add(Rt),j[yt].push(Rt);it.length!=0;)Rt=it.shift(),X.has(Rt)&&(J[yt]=!0),O.get(Rt).forEach(function(K){V.has(K)||(it.push(K),V.add(K),j[yt].push(K))});yt++}}),{components:j,isFixed:J}},W=z(S,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=W.components,this.fixedComponentsOnHorizontal=W.isFixed;var U=z(D,s.fixedNodesOnVertical);this.componentsOnVertical=U.components,this.fixedComponentsOnVertical=U.isFixed}}},_.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(U){var O=s.idToNodeMap.get(U.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,u=0;u<m.length;u++){for(var p=0,f=0;f<m[u].length;f++){if(this.fixedNodeSet.has(m[u][f])){p=0;break}p+=this.idToNodeMap.get(m[u][f]).displacementX}var w=p/m[u].length;for(f=0;f<m[u].length;f++)this.idToNodeMap.get(m[u][f]).displacementX=w}if(this.constraints.alignmentConstraint.horizontal){var I=this.constraints.alignmentConstraint.horizontal;for(u=0;u<I.length;u++){var x=0;for(f=0;f<I[u].length;f++){if(this.fixedNodeSet.has(I[u][f])){x=0;break}x+=this.idToNodeMap.get(I[u][f]).displacementY}var F=x/I[u].length;for(f=0;f<I[u].length;f++)this.idToNodeMap.get(I[u][f]).displacementY=F}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(U){if(!s.fixedNodesOnHorizontal.has(U)){var O=0;O=s.dummyToNodeForVerticalAlignment.has(U)?s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(U)[0]).displacementX:s.idToNodeMap.get(U).displacementX,s.nodeToRelativeConstraintMapHorizontal.get(U).forEach(function(X){var j;X.right?(j=s.nodeToTempPositionMapHorizontal.get(X.right)-s.nodeToTempPositionMapHorizontal.get(U)-O)<X.gap&&(O-=X.gap-j):(j=s.nodeToTempPositionMapHorizontal.get(U)-s.nodeToTempPositionMapHorizontal.get(X.left)+O)<X.gap&&(O+=X.gap-j)}),s.nodeToTempPositionMapHorizontal.set(U,s.nodeToTempPositionMapHorizontal.get(U)+O),s.dummyToNodeForVerticalAlignment.has(U)?s.dummyToNodeForVerticalAlignment.get(U).forEach(function(X){s.idToNodeMap.get(X).displacementX=O}):s.idToNodeMap.get(U).displacementX=O}}),this.nodesInRelativeVertical.forEach(function(U){if(!s.fixedNodesOnHorizontal.has(U)){var O=0;O=s.dummyToNodeForHorizontalAlignment.has(U)?s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(U)[0]).displacementY:s.idToNodeMap.get(U).displacementY,s.nodeToRelativeConstraintMapVertical.get(U).forEach(function(X){var j;X.bottom?(j=s.nodeToTempPositionMapVertical.get(X.bottom)-s.nodeToTempPositionMapVertical.get(U)-O)<X.gap&&(O-=X.gap-j):(j=s.nodeToTempPositionMapVertical.get(U)-s.nodeToTempPositionMapVertical.get(X.top)+O)<X.gap&&(O+=X.gap-j)}),s.nodeToTempPositionMapVertical.set(U,s.nodeToTempPositionMapVertical.get(U)+O),s.dummyToNodeForHorizontalAlignment.has(U)?s.dummyToNodeForHorizontalAlignment.get(U).forEach(function(X){s.idToNodeMap.get(X).displacementY=O}):s.idToNodeMap.get(U).displacementY=O}});else{for(u=0;u<this.componentsOnHorizontal.length;u++){var G=this.componentsOnHorizontal[u];if(this.fixedComponentsOnHorizontal[u])for(f=0;f<G.length;f++)this.dummyToNodeForVerticalAlignment.has(G[f])?this.dummyToNodeForVerticalAlignment.get(G[f]).forEach(function(U){s.idToNodeMap.get(U).displacementX=0}):this.idToNodeMap.get(G[f]).displacementX=0;else{var S=0,D=0;for(f=0;f<G.length;f++)this.dummyToNodeForVerticalAlignment.has(G[f])?(S+=(W=this.dummyToNodeForVerticalAlignment.get(G[f])).length*this.idToNodeMap.get(W[0]).displacementX,D+=W.length):(S+=this.idToNodeMap.get(G[f]).displacementX,D++);var z=S/D;for(f=0;f<G.length;f++)this.dummyToNodeForVerticalAlignment.has(G[f])?this.dummyToNodeForVerticalAlignment.get(G[f]).forEach(function(U){s.idToNodeMap.get(U).displacementX=z}):this.idToNodeMap.get(G[f]).displacementX=z}}for(u=0;u<this.componentsOnVertical.length;u++)if(G=this.componentsOnVertical[u],this.fixedComponentsOnVertical[u])for(f=0;f<G.length;f++)this.dummyToNodeForHorizontalAlignment.has(G[f])?this.dummyToNodeForHorizontalAlignment.get(G[f]).forEach(function(U){s.idToNodeMap.get(U).displacementY=0}):this.idToNodeMap.get(G[f]).displacementY=0;else{for(S=0,D=0,f=0;f<G.length;f++){var W;this.dummyToNodeForHorizontalAlignment.has(G[f])?(S+=(W=this.dummyToNodeForHorizontalAlignment.get(G[f])).length*this.idToNodeMap.get(W[0]).displacementY,D+=W.length):(S+=this.idToNodeMap.get(G[f]).displacementY,D++)}for(z=S/D,f=0;f<G.length;f++)this.dummyToNodeForHorizontalAlignment.has(G[f])?this.dummyToNodeForHorizontalAlignment.get(G[f]).forEach(function(U){s.idToNodeMap.get(U).displacementY=z}):this.idToNodeMap.get(G[f]).displacementY=z}}},_.prototype.calculateNodesToApplyGravitationTo=function(){var s,m,u=[],p=this.graphManager.getGraphs(),f=p.length;for(m=0;m<f;m++)(s=p[m]).updateConnected(),s.isConnected||(u=u.concat(s.getNodes()));return u},_.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var m,u=new Set;for(m=0;m<s.length;m++){var p=s[m];if(!u.has(p)){var f=p.getSource(),w=p.getTarget();if(f==w)p.getBendpoints().push(new N),p.getBendpoints().push(new N),this.createDummyNodesForBendpoints(p),u.add(p);else{var I=[];if(I=(I=I.concat(f.getEdgeListToNode(w))).concat(w.getEdgeListToNode(f)),!u.has(I[0])){var x;if(I.length>1)for(x=0;x<I.length;x++){var F=I[x];F.getBendpoints().push(new N),this.createDummyNodesForBendpoints(F)}I.forEach(function(G){u.add(G)})}}}if(u.size==s.length)break}},_.prototype.positionNodesRadially=function(s){for(var m=new v(0,0),u=Math.ceil(Math.sqrt(s.length)),p=0,f=0,w=0,I=new N(0,0),x=0;x<s.length;x++){x%u==0&&(w=0,f=p,x!=0&&(f+=g.DEFAULT_COMPONENT_SEPERATION),p=0);var F=s[x],G=M.findCenterOfTree(F);m.x=w,m.y=f,(I=_.radialLayout(F,G,m)).y>p&&(p=Math.floor(I.y)),w=Math.floor(I.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(y.WORLD_CENTER_X-I.x/2,y.WORLD_CENTER_Y-I.y/2))},_.radialLayout=function(s,m,u){var p=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);_.branchRadialLayout(m,null,0,359,0,p);var f=Y.calculateBounds(s),w=new H;w.setDeviceOrgX(f.getMinX()),w.setDeviceOrgY(f.getMinY()),w.setWorldOrgX(u.x),w.setWorldOrgY(u.y);for(var I=0;I<s.length;I++)s[I].transform(w);var x=new N(f.getMaxX(),f.getMaxY());return w.inverseTransformPoint(x)},_.branchRadialLayout=function(s,m,u,p,f,w){var I=(p-u+1)/2;I<0&&(I+=180);var x=(I+u)%360*b.TWO_PI/360,F=f*Math.cos(x),G=f*Math.sin(x);s.setCenter(F,G);var S=[],D=(S=S.concat(s.getEdges())).length;m!=null&&D--;for(var z,W=0,U=S.length,O=s.getEdgesBetween(m);O.length>1;){var X=O[0];O.splice(0,1);var j=S.indexOf(X);j>=0&&S.splice(j,1),U--,D--}z=m!=null?(S.indexOf(O[0])+1)%U:0;for(var J=Math.abs(p-u)/D,it=z;W!=D;it=++it%U){var V=S[it].getOtherEnd(s);if(V!=m){var yt=(u+W*J)%360,Lt=(yt+J)%360;_.branchRadialLayout(V,s,yt,Lt,f+w,w),W++}}},_.maxDiagonalInTree=function(s){for(var m=P.MIN_VALUE,u=0;u<s.length;u++){var p=s[u].getDiagonal();p>m&&(m=p)}return m},_.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},_.prototype.groupZeroDegreeMembers=function(){var s=this,m={};this.memberGroups={},this.idToDummyNode={};for(var u=[],p=this.graphManager.getAllNodes(),f=0;f<p.length;f++){var w=(I=p[f]).getParent();this.getNodeDegreeWithChildren(I)!==0||w.id!=null&&this.getToBeTiled(w)||u.push(I)}for(f=0;f<u.length;f++){var I,x=(I=u[f]).getParent().id;m[x]===void 0&&(m[x]=[]),m[x]=m[x].concat(I)}Object.keys(m).forEach(function(F){if(m[F].length>1){var G="DummyCompound_"+F;s.memberGroups[G]=m[F];var S=m[F][0].getParent(),D=new t(s.graphManager);D.id=G,D.paddingLeft=S.paddingLeft||0,D.paddingRight=S.paddingRight||0,D.paddingBottom=S.paddingBottom||0,D.paddingTop=S.paddingTop||0,s.idToDummyNode[G]=D;var z=s.getGraphManager().add(s.newGraph(),D),W=S.getChild();W.add(D);for(var U=0;U<m[F].length;U++){var O=m[F][U];W.remove(O),z.add(O)}}})},_.prototype.clearCompounds=function(){var s={},m={};this.performDFSOnCompounds();for(var u=0;u<this.compoundOrder.length;u++)m[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;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,m)},_.prototype.clearZeroDegreeMembers=function(){var s=this,m=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(u){var p=s.idToDummyNode[u];if(m[u]=s.tileNodes(s.memberGroups[u],p.paddingLeft+p.paddingRight),p.rect.width=m[u].width,p.rect.height=m[u].height,p.setCenter(m[u].centerX,m[u].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var f=p.rect.width,w=p.rect.height;p.labelWidth&&(p.labelPosHorizontal=="left"?(p.rect.x-=p.labelWidth,p.setWidth(f+p.labelWidth),p.labelMarginLeft=p.labelWidth):p.labelPosHorizontal=="center"&&p.labelWidth>f?(p.rect.x-=(p.labelWidth-f)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-f)/2):p.labelPosHorizontal=="right"&&p.setWidth(f+p.labelWidth)),p.labelHeight&&(p.labelPosVertical=="top"?(p.rect.y-=p.labelHeight,p.setHeight(w+p.labelHeight),p.labelMarginTop=p.labelHeight):p.labelPosVertical=="center"&&p.labelHeight>w?(p.rect.y-=(p.labelHeight-w)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-w)/2):p.labelPosVertical=="bottom"&&p.setHeight(w+p.labelHeight))}})},_.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var m=this.compoundOrder[s],u=m.id,p=m.paddingLeft,f=m.paddingTop,w=m.labelMarginLeft,I=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[u],m.rect.x,m.rect.y,p,f,w,I)}},_.prototype.repopulateZeroDegreeMembers=function(){var s=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(u){var p=s.idToDummyNode[u],f=p.paddingLeft,w=p.paddingTop,I=p.labelMarginLeft,x=p.labelMarginTop;s.adjustLocations(m[u],p.rect.x,p.rect.y,f,w,I,x)})},_.prototype.getToBeTiled=function(s){var m=s.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var u=s.getChild();if(u==null)return this.toBeTiled[m]=!1,!1;for(var p=u.getNodes(),f=0;f<p.length;f++){var w=p[f];if(this.getNodeDegree(w)>0)return this.toBeTiled[m]=!1,!1;if(w.getChild()!=null){if(!this.getToBeTiled(w))return this.toBeTiled[m]=!1,!1}else this.toBeTiled[w.id]=!1}return this.toBeTiled[m]=!0,!0},_.prototype.getNodeDegree=function(s){s.id;for(var m=s.getEdges(),u=0,p=0;p<m.length;p++){var f=m[p];f.getSource().id!==f.getTarget().id&&(u+=1)}return u},_.prototype.getNodeDegreeWithChildren=function(s){var m=this.getNodeDegree(s);if(s.getChild()==null)return m;for(var u=s.getChild().getNodes(),p=0;p<u.length;p++){var f=u[p];m+=this.getNodeDegreeWithChildren(f)}return m},_.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},_.prototype.fillCompexOrderByDFS=function(s){for(var m=0;m<s.length;m++){var u=s[m];u.getChild()!=null&&this.fillCompexOrderByDFS(u.getChild().getNodes()),this.getToBeTiled(u)&&this.compoundOrder.push(u)}},_.prototype.adjustLocations=function(s,m,u,p,f,w,I){u+=f+I;for(var x=m+=p+w,F=0;F<s.rows.length;F++){var G=s.rows[F];m=x;for(var S=0,D=0;D<G.length;D++){var z=G[D];z.rect.x=m,z.rect.y=u,m+=z.rect.width+s.horizontalPadding,z.rect.height>S&&(S=z.rect.height)}u+=S+s.verticalPadding}},_.prototype.tileCompoundMembers=function(s,m){var u=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(p){var f=m[p];if(u.tiledMemberPack[p]=u.tileNodes(s[p],f.paddingLeft+f.paddingRight),f.rect.width=u.tiledMemberPack[p].width,f.rect.height=u.tiledMemberPack[p].height,f.setCenter(u.tiledMemberPack[p].centerX,u.tiledMemberPack[p].centerY),f.labelMarginLeft=0,f.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var w=f.rect.width,I=f.rect.height;f.labelWidth&&(f.labelPosHorizontal=="left"?(f.rect.x-=f.labelWidth,f.setWidth(w+f.labelWidth),f.labelMarginLeft=f.labelWidth):f.labelPosHorizontal=="center"&&f.labelWidth>w?(f.rect.x-=(f.labelWidth-w)/2,f.setWidth(f.labelWidth),f.labelMarginLeft=(f.labelWidth-w)/2):f.labelPosHorizontal=="right"&&f.setWidth(w+f.labelWidth)),f.labelHeight&&(f.labelPosVertical=="top"?(f.rect.y-=f.labelHeight,f.setHeight(I+f.labelHeight),f.labelMarginTop=f.labelHeight):f.labelPosVertical=="center"&&f.labelHeight>I?(f.rect.y-=(f.labelHeight-I)/2,f.setHeight(f.labelHeight),f.labelMarginTop=(f.labelHeight-I)/2):f.labelPosVertical=="bottom"&&f.setHeight(I+f.labelHeight))}})},_.prototype.tileNodes=function(s,m){var u=this.tileNodesByFavoringDim(s,m,!0),p=this.tileNodesByFavoringDim(s,m,!1),f=this.getOrgRatio(u);return this.getOrgRatio(p)<f?p:u},_.prototype.getOrgRatio=function(s){var m=s.width/s.height;return m<1&&(m=1/m),m},_.prototype.calcIdealRowWidth=function(s,m){var u=g.TILING_PADDING_VERTICAL,p=g.TILING_PADDING_HORIZONTAL,f=s.length,w=0,I=0,x=0;s.forEach(function(U){w+=U.getWidth(),I+=U.getHeight(),U.getWidth()>x&&(x=U.getWidth())});var F,G=w/f,S=I/f,D=Math.pow(u-p,2)+4*(G+p)*(S+u)*f,z=(p-u+Math.sqrt(D))/(2*(G+p));m?(F=Math.ceil(z))==z&&F++:F=Math.floor(z);var W=F*(G+p)-p;return x>W&&(W=x),W+=2*p},_.prototype.tileNodesByFavoringDim=function(s,m,u){var p=g.TILING_PADDING_VERTICAL,f=g.TILING_PADDING_HORIZONTAL,w=g.TILING_COMPARE_BY,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:p,horizontalPadding:f,centerX:0,centerY:0};w&&(I.idealRowWidth=this.calcIdealRowWidth(s,u));var x=function(U){return U.rect.width*U.rect.height},F=function(U,O){return x(O)-x(U)};s.sort(function(U,O){var X=F;return I.idealRowWidth?(X=w)(U.id,O.id):X(U,O)});for(var G=0,S=0,D=0;D<s.length;D++)G+=(z=s[D]).getCenterX(),S+=z.getCenterY();for(I.centerX=G/s.length,I.centerY=S/s.length,D=0;D<s.length;D++){var z=s[D];if(I.rows.length==0)this.insertNodeToRow(I,z,0,m);else if(this.canAddHorizontal(I,z.rect.width,z.rect.height)){var W=I.rows.length-1;I.idealRowWidth||(W=this.getShortestRowIndex(I)),this.insertNodeToRow(I,z,W,m)}else this.insertNodeToRow(I,z,I.rows.length,m);this.shiftToLastRow(I)}return I},_.prototype.insertNodeToRow=function(s,m,u,p){var f=p;u==s.rows.length&&(s.rows.push([]),s.rowWidth.push(f),s.rowHeight.push(0));var w=s.rowWidth[u]+m.rect.width;s.rows[u].length>0&&(w+=s.horizontalPadding),s.rowWidth[u]=w,s.width<w&&(s.width=w);var I=m.rect.height;u>0&&(I+=s.verticalPadding);var x=0;I>s.rowHeight[u]&&(x=s.rowHeight[u],s.rowHeight[u]=I,x=s.rowHeight[u]-x),s.height+=x,s.rows[u].push(m)},_.prototype.getShortestRowIndex=function(s){for(var m=-1,u=Number.MAX_VALUE,p=0;p<s.rows.length;p++)s.rowWidth[p]<u&&(m=p,u=s.rowWidth[p]);return m},_.prototype.getLongestRowIndex=function(s){for(var m=-1,u=Number.MIN_VALUE,p=0;p<s.rows.length;p++)s.rowWidth[p]>u&&(m=p,u=s.rowWidth[p]);return m},_.prototype.canAddHorizontal=function(s,m,u){if(s.idealRowWidth){var p=s.rows.length-1;return s.rowWidth[p]+m+s.horizontalPadding<=s.idealRowWidth}var f=this.getShortestRowIndex(s);if(f<0)return!0;var w=s.rowWidth[f];if(w+s.horizontalPadding+m<=s.width)return!0;var I,x,F=0;return s.rowHeight[f]<u&&f>0&&(F=u+s.verticalPadding-s.rowHeight[f]),I=s.width-w>=m+s.horizontalPadding?(s.height+F)/(w+m+s.horizontalPadding):(s.height+F)/s.width,F=u+s.verticalPadding,(x=s.width<m?(s.height+F)/m:(s.height+F)/s.width)<1&&(x=1/x),I<1&&(I=1/I),I<x},_.prototype.shiftToLastRow=function(s){var m=this.getLongestRowIndex(s),u=s.rowWidth.length-1,p=s.rows[m],f=p[p.length-1],w=f.width+s.horizontalPadding;if(s.width-s.rowWidth[u]>w&&m!=u){p.splice(-1,1),s.rows[u].push(f),s.rowWidth[m]=s.rowWidth[m]-w,s.rowWidth[u]=s.rowWidth[u]+w,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var I=Number.MIN_VALUE,x=0;x<p.length;x++)p[x].height>I&&(I=p[x].height);m>0&&(I+=s.verticalPadding);var F=s.rowHeight[m]+s.rowHeight[u];s.rowHeight[m]=I,s.rowHeight[u]<f.height+s.verticalPadding&&(s.rowHeight[u]=f.height+s.verticalPadding);var G=s.rowHeight[m]+s.rowHeight[u];s.height+=G-F,this.shiftToLastRow(s)}},_.prototype.tilingPreLayout=function(){g.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},_.prototype.tilingPostLayout=function(){g.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},_.prototype.reduceTrees=function(){for(var s,m=[],u=!0;u;){var p=this.graphManager.getAllNodes(),f=[];u=!1;for(var w=0;w<p.length;w++)if((s=p[w]).getEdges().length==1&&!s.getEdges()[0].isInterGraph&&s.getChild()==null){if(g.PURE_INCREMENTAL){var I=s.getEdges()[0].getOtherEnd(s),x=new A(s.getCenterX()-I.getCenterX(),s.getCenterY()-I.getCenterY());f.push([s,s.getEdges()[0],s.getOwner(),x])}else f.push([s,s.getEdges()[0],s.getOwner()]);u=!0}if(u==1){for(var F=[],G=0;G<f.length;G++)f[G][0].getEdges().length==1&&(F.push(f[G]),f[G][0].getOwner().remove(f[G][0]));m.push(F),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=m},_.prototype.growTree=function(s){for(var m,u=s[s.length-1],p=0;p<u.length;p++)m=u[p],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},_.prototype.findPlaceforPrunedNode=function(s){var m,u,p=s[0];if(u=p==s[1].source?s[1].target:s[1].source,g.PURE_INCREMENTAL)p.setCenter(u.getCenterX()+s[3].getWidth(),u.getCenterY()+s[3].getHeight());else{var f=u.startX,w=u.finishX,I=u.startY,x=u.finishY,F=[0,0,0,0];if(I>0)for(var G=f;G<=w;G++)F[0]+=this.grid[G][I-1].length+this.grid[G][I].length-1;if(w<this.grid.length-1)for(G=I;G<=x;G++)F[1]+=this.grid[w+1][G].length+this.grid[w][G].length-1;if(x<this.grid[0].length-1)for(G=f;G<=w;G++)F[2]+=this.grid[G][x+1].length+this.grid[G][x].length-1;if(f>0)for(G=I;G<=x;G++)F[3]+=this.grid[f-1][G].length+this.grid[f][G].length-1;for(var S,D,z=P.MAX_VALUE,W=0;W<F.length;W++)F[W]<z?(z=F[W],S=1,D=W):F[W]==z&&S++;if(S==3&&z==0)F[0]==0&&F[1]==0&&F[2]==0?m=1:F[0]==0&&F[1]==0&&F[3]==0?m=0:F[0]==0&&F[2]==0&&F[3]==0?m=3:F[1]==0&&F[2]==0&&F[3]==0&&(m=2);else if(S==2&&z==0){var U=Math.floor(2*Math.random());m=F[0]==0&&F[1]==0?U==0?0:1:F[0]==0&&F[2]==0?U==0?0:2:F[0]==0&&F[3]==0?U==0?0:3:F[1]==0&&F[2]==0?U==0?1:2:F[1]==0&&F[3]==0?U==0?1:3:U==0?2:3}else m=S==4&&z==0?U=Math.floor(4*Math.random()):D;m==0?p.setCenter(u.getCenterX(),u.getCenterY()-u.getHeight()/2-l.DEFAULT_EDGE_LENGTH-p.getHeight()/2):m==1?p.setCenter(u.getCenterX()+u.getWidth()/2+l.DEFAULT_EDGE_LENGTH+p.getWidth()/2,u.getCenterY()):m==2?p.setCenter(u.getCenterX(),u.getCenterY()+u.getHeight()/2+l.DEFAULT_EDGE_LENGTH+p.getHeight()/2):p.setCenter(u.getCenterX()-u.getWidth()/2-l.DEFAULT_EDGE_LENGTH-p.getWidth()/2,u.getCenterY())}},r.exports=_},991:(r,a,e)=>{var n=e(551).FDLayoutNode,i=e(551).IMath;function o(h,g,c,l){n.call(this,h,g,c,l)}for(var t in o.prototype=Object.create(n.prototype),n)o[t]=n[t];o.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(h,g){for(var c,l=this.getChild().getNodes(),y=0;y<l.length;y++)(c=l[y]).getChild()==null?(c.displacementX+=h,c.displacementY+=g):c.propogateDisplacementToChildren(h,g)},o.prototype.move=function(){var h=this.graphManager.getLayout();this.child!=null&&this.child.getNodes().length!=0||(this.moveBy(this.displacementX,this.displacementY),h.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},o.prototype.setPred1=function(h){this.pred1=h},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(h){this.next=h},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(h){this.processed=h},o.prototype.isProcessed=function(){return processed},r.exports=o},902:(r,a,e)=>{function n(c){if(Array.isArray(c)){for(var l=0,y=Array(c.length);l<c.length;l++)y[l]=c[l];return y}return Array.from(c)}var i=e(806),o=e(551).LinkedList,t=e(551).Matrix,h=e(551).SVD;function g(){}g.handleConstraints=function(c){var l={};l.fixedNodeConstraint=c.constraints.fixedNodeConstraint,l.alignmentConstraint=c.constraints.alignmentConstraint,l.relativePlacementConstraint=c.constraints.relativePlacementConstraint;for(var y=new Map,v=new Map,N=[],A=[],M=c.getAllNodes(),P=0,b=0;b<M.length;b++){var Y=M[b];Y.getChild()==null&&(v.set(Y.id,P++),N.push(Y.getCenterX()),A.push(Y.getCenterY()),y.set(Y.id,Y))}l.relativePlacementConstraint&&l.relativePlacementConstraint.forEach(function(R){R.gap||R.gap==0||(R.left?R.gap=i.DEFAULT_EDGE_LENGTH+y.get(R.left).getWidth()/2+y.get(R.right).getWidth()/2:R.gap=i.DEFAULT_EDGE_LENGTH+y.get(R.top).getHeight()/2+y.get(R.bottom).getHeight()/2)});var H=function(R){var k=0,Q=0;return R.forEach(function(Z){k+=N[v.get(Z)],Q+=A[v.get(Z)]}),{x:k/R.size,y:Q/R.size}},q=function(R,k,Q,Z,st){var It=new Map;R.forEach(function(lt,$){It.set($,0)}),R.forEach(function(lt,$){lt.forEach(function(gt){It.set(gt.id,It.get(gt.id)+1)})});var rt=new Map,mt=new Map,ft=new o;It.forEach(function(lt,$){lt==0?(ft.push($),Q||(k=="horizontal"?rt.set($,v.has($)?N[v.get($)]:Z.get($)):rt.set($,v.has($)?A[v.get($)]:Z.get($)))):rt.set($,Number.NEGATIVE_INFINITY),Q&&mt.set($,new Set([$]))}),Q&&st.forEach(function(lt){var $=[];if(lt.forEach(function(at){Q.has(at)&&$.push(at)}),$.length>0){var gt=0;$.forEach(function(at){k=="horizontal"?(rt.set(at,v.has(at)?N[v.get(at)]:Z.get(at)),gt+=rt.get(at)):(rt.set(at,v.has(at)?A[v.get(at)]:Z.get(at)),gt+=rt.get(at))}),gt/=$.length,lt.forEach(function(at){Q.has(at)||rt.set(at,gt)})}else{var Nt=0;lt.forEach(function(at){Nt+=k=="horizontal"?v.has(at)?N[v.get(at)]:Z.get(at):v.has(at)?A[v.get(at)]:Z.get(at)}),Nt/=lt.length,lt.forEach(function(at){rt.set(at,Nt)})}});for(var St=function(){var lt=ft.shift();R.get(lt).forEach(function($){if(rt.get($.id)<rt.get(lt)+$.gap)if(Q&&Q.has($.id)){var gt=void 0;if(gt=k=="horizontal"?v.has($.id)?N[v.get($.id)]:Z.get($.id):v.has($.id)?A[v.get($.id)]:Z.get($.id),rt.set($.id,gt),gt<rt.get(lt)+$.gap){var Nt=rt.get(lt)+$.gap-gt;mt.get(lt).forEach(function(at){rt.set(at,rt.get(at)-Nt)})}}else rt.set($.id,rt.get(lt)+$.gap);It.set($.id,It.get($.id)-1),It.get($.id)==0&&ft.push($.id),Q&&mt.set($.id,(function(at,Ft){var bt=new Set(at),Dt=!0,At=!1,ct=void 0;try{for(var Gt,Ct=Ft[Symbol.iterator]();!(Dt=(Gt=Ct.next()).done);Dt=!0){var Yt=Gt.value;bt.add(Yt)}}catch(Xt){At=!0,ct=Xt}finally{try{!Dt&&Ct.return&&Ct.return()}finally{if(At)throw ct}}return bt})(mt.get(lt),mt.get($.id)))})};ft.length!=0;)St();if(Q){var et=new Set;R.forEach(function(lt,$){lt.length==0&&et.add($)});var pt=[];mt.forEach(function(lt,$){if(et.has($)){var gt=!1,Nt=!0,at=!1,Ft=void 0;try{for(var bt,Dt=lt[Symbol.iterator]();!(Nt=(bt=Dt.next()).done);Nt=!0){var At=bt.value;Q.has(At)&&(gt=!0)}}catch(Ct){at=!0,Ft=Ct}finally{try{!Nt&&Dt.return&&Dt.return()}finally{if(at)throw Ft}}if(!gt){var ct=!1,Gt=void 0;pt.forEach(function(Ct,Yt){Ct.has([].concat(n(lt))[0])&&(ct=!0,Gt=Yt)}),ct?lt.forEach(function(Ct){pt[Gt].add(Ct)}):pt.push(new Set(lt))}}}),pt.forEach(function(lt,$){var gt=Number.POSITIVE_INFINITY,Nt=Number.POSITIVE_INFINITY,at=Number.NEGATIVE_INFINITY,Ft=Number.NEGATIVE_INFINITY,bt=!0,Dt=!1,At=void 0;try{for(var ct,Gt=lt[Symbol.iterator]();!(bt=(ct=Gt.next()).done);bt=!0){var Ct=ct.value,Yt=void 0;Yt=k=="horizontal"?v.has(Ct)?N[v.get(Ct)]:Z.get(Ct):v.has(Ct)?A[v.get(Ct)]:Z.get(Ct);var Xt=rt.get(Ct);Yt<gt&&(gt=Yt),Yt>at&&(at=Yt),Xt<Nt&&(Nt=Xt),Xt>Ft&&(Ft=Xt)}}catch(Wt){Dt=!0,At=Wt}finally{try{!bt&&Gt.return&&Gt.return()}finally{if(Dt)throw At}}var ne=(gt+at)/2-(Nt+Ft)/2,Kt=!0,Bt=!1,jt=void 0;try{for(var qt,Vt=lt[Symbol.iterator]();!(Kt=(qt=Vt.next()).done);Kt=!0){var te=qt.value;rt.set(te,rt.get(te)+ne)}}catch(Wt){Bt=!0,jt=Wt}finally{try{!Kt&&Vt.return&&Vt.return()}finally{if(Bt)throw jt}}})}return rt},_=function(R){var k=0,Q=0,Z=0,st=0;if(R.forEach(function(ft){ft.left?N[v.get(ft.left)]-N[v.get(ft.right)]>=0?k++:Q++:A[v.get(ft.top)]-A[v.get(ft.bottom)]>=0?Z++:st++}),k>Q&&Z>st)for(var It=0;It<v.size;It++)N[It]=-1*N[It],A[It]=-1*A[It];else if(k>Q)for(var rt=0;rt<v.size;rt++)N[rt]=-1*N[rt];else if(Z>st)for(var mt=0;mt<v.size;mt++)A[mt]=-1*A[mt]},B=function(R){var k=[],Q=new o,Z=new Set,st=0;return R.forEach(function(It,rt){if(!Z.has(rt)){k[st]=[];var mt=rt;for(Q.push(mt),Z.add(mt),k[st].push(mt);Q.length!=0;)mt=Q.shift(),R.get(mt).forEach(function(ft){Z.has(ft.id)||(Q.push(ft.id),Z.add(ft.id),k[st].push(ft.id))});st++}}),k},s=function(R){var k=new Map;return R.forEach(function(Q,Z){k.set(Z,[])}),R.forEach(function(Q,Z){Q.forEach(function(st){k.get(Z).push(st),k.get(st.id).push({id:Z,gap:st.gap,direction:st.direction})})}),k},m=function(R){var k=new Map;return R.forEach(function(Q,Z){k.set(Z,[])}),R.forEach(function(Q,Z){Q.forEach(function(st){k.get(st.id).push({id:Z,gap:st.gap,direction:st.direction})})}),k},u=[],p=[],f=!1,w=!1,I=new Set,x=new Map,F=new Map,G=[];if(l.fixedNodeConstraint&&l.fixedNodeConstraint.forEach(function(R){I.add(R.nodeId)}),l.relativePlacementConstraint&&(l.relativePlacementConstraint.forEach(function(R){R.left?(x.has(R.left)?x.get(R.left).push({id:R.right,gap:R.gap,direction:"horizontal"}):x.set(R.left,[{id:R.right,gap:R.gap,direction:"horizontal"}]),x.has(R.right)||x.set(R.right,[])):(x.has(R.top)?x.get(R.top).push({id:R.bottom,gap:R.gap,direction:"vertical"}):x.set(R.top,[{id:R.bottom,gap:R.gap,direction:"vertical"}]),x.has(R.bottom)||x.set(R.bottom,[]))}),F=s(x),G=B(F)),i.TRANSFORM_ON_CONSTRAINT_HANDLING){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>1)l.fixedNodeConstraint.forEach(function(R,k){u[k]=[R.position.x,R.position.y],p[k]=[N[v.get(R.nodeId)],A[v.get(R.nodeId)]]}),f=!0;else if(l.alignmentConstraint)(function(){var R=0;if(l.alignmentConstraint.vertical){for(var k=l.alignmentConstraint.vertical,Q=function(mt){var ft=new Set;k[mt].forEach(function(pt){ft.add(pt)});var St=new Set([].concat(n(ft)).filter(function(pt){return I.has(pt)})),et=void 0;et=St.size>0?N[v.get(St.values().next().value)]:H(ft).x,k[mt].forEach(function(pt){u[R]=[et,A[v.get(pt)]],p[R]=[N[v.get(pt)],A[v.get(pt)]],R++})},Z=0;Z<k.length;Z++)Q(Z);f=!0}if(l.alignmentConstraint.horizontal){for(var st=l.alignmentConstraint.horizontal,It=function(mt){var ft=new Set;st[mt].forEach(function(pt){ft.add(pt)});var St=new Set([].concat(n(ft)).filter(function(pt){return I.has(pt)})),et=void 0;et=St.size>0?N[v.get(St.values().next().value)]:H(ft).y,st[mt].forEach(function(pt){u[R]=[N[v.get(pt)],et],p[R]=[N[v.get(pt)],A[v.get(pt)]],R++})},rt=0;rt<st.length;rt++)It(rt);f=!0}l.relativePlacementConstraint&&(w=!0)})();else if(l.relativePlacementConstraint){for(var S=0,D=0,z=0;z<G.length;z++)G[z].length>S&&(S=G[z].length,D=z);if(S<F.size/2)_(l.relativePlacementConstraint),f=!1,w=!1;else{var W=new Map,U=new Map,O=[];G[D].forEach(function(R){x.get(R).forEach(function(k){k.direction=="horizontal"?(W.has(R)?W.get(R).push(k):W.set(R,[k]),W.has(k.id)||W.set(k.id,[]),O.push({left:R,right:k.id})):(U.has(R)?U.get(R).push(k):U.set(R,[k]),U.has(k.id)||U.set(k.id,[]),O.push({top:R,bottom:k.id}))})}),_(O),w=!1;var X=q(W,"horizontal"),j=q(U,"vertical");G[D].forEach(function(R,k){p[k]=[N[v.get(R)],A[v.get(R)]],u[k]=[],X.has(R)?u[k][0]=X.get(R):u[k][0]=N[v.get(R)],j.has(R)?u[k][1]=j.get(R):u[k][1]=A[v.get(R)]}),f=!0}}if(f){for(var J,it=t.transpose(u),V=t.transpose(p),yt=0;yt<it.length;yt++)it[yt]=t.multGamma(it[yt]),V[yt]=t.multGamma(V[yt]);var Lt=t.multMat(it,t.transpose(V)),Ut=h.svd(Lt);J=t.multMat(Ut.V,t.transpose(Ut.U));for(var Rt=0;Rt<v.size;Rt++){var K=[N[Rt],A[Rt]],ot=[J[0][0],J[1][0]],ut=[J[0][1],J[1][1]];N[Rt]=t.dotProduct(K,ot),A[Rt]=t.dotProduct(K,ut)}w&&_(l.relativePlacementConstraint)}}if(i.ENFORCE_CONSTRAINTS){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>0){var dt={x:0,y:0};l.fixedNodeConstraint.forEach(function(R,k){var Q,Z,st={x:N[v.get(R.nodeId)],y:A[v.get(R.nodeId)]},It=R.position,rt=(Z=st,{x:(Q=It).x-Z.x,y:Q.y-Z.y});dt.x+=rt.x,dt.y+=rt.y}),dt.x/=l.fixedNodeConstraint.length,dt.y/=l.fixedNodeConstraint.length,N.forEach(function(R,k){N[k]+=dt.x}),A.forEach(function(R,k){A[k]+=dt.y}),l.fixedNodeConstraint.forEach(function(R){N[v.get(R.nodeId)]=R.position.x,A[v.get(R.nodeId)]=R.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var vt=l.alignmentConstraint.vertical,Et=function(R){var k=new Set;vt[R].forEach(function(st){k.add(st)});var Q=new Set([].concat(n(k)).filter(function(st){return I.has(st)})),Z=void 0;Z=Q.size>0?N[v.get(Q.values().next().value)]:H(k).x,k.forEach(function(st){I.has(st)||(N[v.get(st)]=Z)})},ht=0;ht<vt.length;ht++)Et(ht);if(l.alignmentConstraint.horizontal)for(var Tt=l.alignmentConstraint.horizontal,_t=function(R){var k=new Set;Tt[R].forEach(function(st){k.add(st)});var Q=new Set([].concat(n(k)).filter(function(st){return I.has(st)})),Z=void 0;Z=Q.size>0?A[v.get(Q.values().next().value)]:H(k).y,k.forEach(function(st){I.has(st)||(A[v.get(st)]=Z)})},Ot=0;Ot<Tt.length;Ot++)_t(Ot)}l.relativePlacementConstraint&&(function(){var R=new Map,k=new Map,Q=new Map,Z=new Map,st=new Map,It=new Map,rt=new Set,mt=new Set;if(I.forEach(function(tt){rt.add(tt),mt.add(tt)}),l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var ft=l.alignmentConstraint.vertical,St=function(tt){Q.set("dummy"+tt,[]),ft[tt].forEach(function(wt){R.set(wt,"dummy"+tt),Q.get("dummy"+tt).push(wt),I.has(wt)&&rt.add("dummy"+tt)}),st.set("dummy"+tt,N[v.get(ft[tt][0])])},et=0;et<ft.length;et++)St(et);if(l.alignmentConstraint.horizontal)for(var pt=l.alignmentConstraint.horizontal,lt=function(tt){Z.set("dummy"+tt,[]),pt[tt].forEach(function(wt){k.set(wt,"dummy"+tt),Z.get("dummy"+tt).push(wt),I.has(wt)&&mt.add("dummy"+tt)}),It.set("dummy"+tt,A[v.get(pt[tt][0])])},$=0;$<pt.length;$++)lt($)}var gt=new Map,Nt=new Map,at=function(tt){x.get(tt).forEach(function(wt){var kt=void 0,Ht=void 0;wt.direction=="horizontal"?(kt=R.get(tt)?R.get(tt):tt,Ht=R.get(wt.id)?{id:R.get(wt.id),gap:wt.gap,direction:wt.direction}:wt,gt.has(kt)?gt.get(kt).push(Ht):gt.set(kt,[Ht]),gt.has(Ht.id)||gt.set(Ht.id,[])):(kt=k.get(tt)?k.get(tt):tt,Ht=k.get(wt.id)?{id:k.get(wt.id),gap:wt.gap,direction:wt.direction}:wt,Nt.has(kt)?Nt.get(kt).push(Ht):Nt.set(kt,[Ht]),Nt.has(Ht.id)||Nt.set(Ht.id,[]))})},Ft=!0,bt=!1,Dt=void 0;try{for(var At,ct=x.keys()[Symbol.iterator]();!(Ft=(At=ct.next()).done);Ft=!0)at(At.value)}catch(tt){bt=!0,Dt=tt}finally{try{!Ft&&ct.return&&ct.return()}finally{if(bt)throw Dt}}var Gt=s(gt),Ct=s(Nt),Yt=B(Gt),Xt=B(Ct),ne=m(gt),Kt=m(Nt),Bt=[],jt=[];Yt.forEach(function(tt,wt){Bt[wt]=[],tt.forEach(function(kt){ne.get(kt).length==0&&Bt[wt].push(kt)})}),Xt.forEach(function(tt,wt){jt[wt]=[],tt.forEach(function(kt){Kt.get(kt).length==0&&jt[wt].push(kt)})});var qt=q(gt,"horizontal",rt,st,Bt),Vt=q(Nt,"vertical",mt,It,jt),te=function(tt){Q.get(tt)?Q.get(tt).forEach(function(wt){N[v.get(wt)]=qt.get(tt)}):N[v.get(tt)]=qt.get(tt)},Wt=!0,ce=!1,ue=void 0;try{for(var fe,re=qt.keys()[Symbol.iterator]();!(Wt=(fe=re.next()).done);Wt=!0)te(fe.value)}catch(tt){ce=!0,ue=tt}finally{try{!Wt&&re.return&&re.return()}finally{if(ce)throw ue}}var Xe=function(tt){Z.get(tt)?Z.get(tt).forEach(function(wt){A[v.get(wt)]=Vt.get(tt)}):A[v.get(tt)]=Vt.get(tt)},ie=!0,pe=!1,me=void 0;try{for(var ve,oe=Vt.keys()[Symbol.iterator]();!(ie=(ve=oe.next()).done);ie=!0)Xe(ve.value)}catch(tt){pe=!0,me=tt}finally{try{!ie&&oe.return&&oe.return()}finally{if(pe)throw me}}})()}for(var Mt=0;Mt<M.length;Mt++){var xt=M[Mt];xt.getChild()==null&&xt.setCenter(N[v.get(xt.id)],A[v.get(xt.id)])}},r.exports=g},551:r=>{r.exports=T}},E={},d=(function r(a){var e=E[a];if(e!==void 0)return e.exports;var n=E[a]={exports:{}};return L[a](n,n.exports,r),n.exports})(45),d;var L,E,d},Ae.exports=C(ln()));var C}var Ie,Ce,Me,le;const gn=an(Ie?Te.exports:(Ie=1,Te.exports=(Ce=dn(),Me={658:C=>{C.exports=Object.assign!=null?Object.assign.bind(Object):function(T){for(var L=arguments.length,E=Array(L>1?L-1:0),d=1;d<L;d++)E[d-1]=arguments[d];return E.forEach(function(r){Object.keys(r).forEach(function(a){return T[a]=r[a]})}),T}},548:(C,T,L)=>{var E=function(a,e){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a))return(function(n,i){var o=[],t=!0,h=!1,g=void 0;try{for(var c,l=n[Symbol.iterator]();!(t=(c=l.next()).done)&&(o.push(c.value),!i||o.length!==i);t=!0);}catch(y){h=!0,g=y}finally{try{!t&&l.return&&l.return()}finally{if(h)throw g}}return o})(a,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},d=L(140).layoutBase.LinkedList,r={getTopMostNodes:function(a){for(var e={},n=0;n<a.length;n++)e[a[n].id()]=!0;var i=a.filter(function(o,t){typeof o=="number"&&(o=t);for(var h=o.parent()[0];h!=null;){if(e[h.id()])return!1;h=h.parent()[0]}return!0});return i},connectComponents:function(a,e,n,i){var o=new d,t=new Set,h=[],g=void 0,c=void 0,l=void 0,y=!1,v=1,N=[],A=[],M=function(){var P=a.collection();A.push(P);var b=n[0],Y=a.collection();Y.merge(b).merge(b.descendants().intersection(e)),h.push(b),Y.forEach(function(_){o.push(_),t.add(_),P.merge(_)});for(var H=function(){b=o.shift();var _=a.collection();b.neighborhood().nodes().forEach(function(m){e.intersection(b.edgesWith(m)).length>0&&_.merge(m)});for(var B=0;B<_.length;B++){var s=_[B];(g=n.intersection(s.union(s.ancestors())))==null||t.has(g[0])||g.union(g.descendants()).forEach(function(m){o.push(m),t.add(m),P.merge(m),n.has(m)&&h.push(m)})}};o.length!=0;)H();if(P.forEach(function(_){e.intersection(_.connectedEdges()).forEach(function(B){P.has(B.source())&&P.has(B.target())&&P.merge(B)})}),h.length==n.length&&(y=!0),!y||y&&v>1){c=h[0],l=c.connectedEdges().length,h.forEach(function(_){_.connectedEdges().length<l&&(l=_.connectedEdges().length,c=_)}),N.push(c.id());var q=a.collection();q.merge(h[0]),h.forEach(function(_){q.merge(_)}),h=[],n=n.difference(q),v++}};do M();while(!y);return i&&N.length>0&&i.set("dummy"+(i.size+1),N),A},relocateComponent:function(a,e,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;if(n.quality=="draft"){var g=!0,c=!1,l=void 0;try{for(var y,v=e.nodeIndexes[Symbol.iterator]();!(g=(y=v.next()).done);g=!0){var N=y.value,A=E(N,2),M=A[0],P=A[1],b=n.cy.getElementById(M);if(b){var Y=b.boundingBox(),H=e.xCoords[P]-Y.w/2,q=e.xCoords[P]+Y.w/2,_=e.yCoords[P]-Y.h/2,B=e.yCoords[P]+Y.h/2;H<i&&(i=H),q>o&&(o=q),_<t&&(t=_),B>h&&(h=B)}}}catch(f){c=!0,l=f}finally{try{!g&&v.return&&v.return()}finally{if(c)throw l}}var s=a.x-(o+i)/2,m=a.y-(h+t)/2;e.xCoords=e.xCoords.map(function(f){return f+s}),e.yCoords=e.yCoords.map(function(f){return f+m})}else{Object.keys(e).forEach(function(f){var w=e[f],I=w.getRect().x,x=w.getRect().x+w.getRect().width,F=w.getRect().y,G=w.getRect().y+w.getRect().height;I<i&&(i=I),x>o&&(o=x),F<t&&(t=F),G>h&&(h=G)});var u=a.x-(o+i)/2,p=a.y-(h+t)/2;Object.keys(e).forEach(function(f){var w=e[f];w.setCenter(w.getCenterX()+u,w.getCenterY()+p)})}}},calcBoundingBox:function(a,e,n,i){for(var o=Number.MAX_SAFE_INTEGER,t=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,g=Number.MIN_SAFE_INTEGER,c=void 0,l=void 0,y=void 0,v=void 0,N=a.descendants().not(":parent"),A=N.length,M=0;M<A;M++){var P=N[M];o>(c=e[i.get(P.id())]-P.width()/2)&&(o=c),t<(l=e[i.get(P.id())]+P.width()/2)&&(t=l),h>(y=n[i.get(P.id())]-P.height()/2)&&(h=y),g<(v=n[i.get(P.id())]+P.height()/2)&&(g=v)}var b={};return b.topLeftX=o,b.topLeftY=h,b.width=t-o,b.height=g-h,b},calcParentsWithoutChildren:function(a,e){var n=a.collection();return e.nodes(":parent").forEach(function(i){var o=!1;i.children().forEach(function(t){t.css("display")!="none"&&(o=!0)}),o||n.merge(i)}),n}};C.exports=r},816:(C,T,L)=>{var E=L(548),d=L(140).CoSELayout,r=L(140).CoSENode,a=L(140).layoutBase.PointD,e=L(140).layoutBase.DimensionD,n=L(140).layoutBase.LayoutConstants,i=L(140).layoutBase.FDLayoutConstants,o=L(140).CoSEConstants;C.exports={coseLayout:function(t,h){var g=t.cy,c=t.eles,l=c.nodes(),y=c.edges(),v=void 0,N=void 0,A=void 0,M={};t.randomize&&(v=h.nodeIndexes,N=h.xCoords,A=h.yCoords);var P=function(_){return typeof _=="function"},b=function(_,B){return P(_)?_(B):_},Y=E.calcParentsWithoutChildren(g,c);t.nestingFactor!=null&&(o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),t.gravity!=null&&(o.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=t.gravity),t.numIter!=null&&(o.MAX_ITERATIONS=i.MAX_ITERATIONS=t.numIter),t.gravityRange!=null&&(o.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),t.gravityCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),t.gravityRangeCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),t.initialEnergyOnIncremental!=null&&(o.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),t.tilingCompareBy!=null&&(o.TILING_COMPARE_BY=t.tilingCompareBy),t.quality=="proof"?n.QUALITY=2:n.QUALITY=0,o.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=n.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,o.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=!t.randomize,o.ANIMATE=i.ANIMATE=n.ANIMATE=t.animate,o.TILE=t.tile,o.TILING_PADDING_VERTICAL=typeof t.tilingPaddingVertical=="function"?t.tilingPaddingVertical.call():t.tilingPaddingVertical,o.TILING_PADDING_HORIZONTAL=typeof t.tilingPaddingHorizontal=="function"?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,o.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=!0,o.PURE_INCREMENTAL=!t.randomize,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,t.step=="transformed"&&(o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,o.ENFORCE_CONSTRAINTS=!1,o.APPLY_LAYOUT=!1),t.step=="enforced"&&(o.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!1),t.step=="cose"&&(o.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,o.ENFORCE_CONSTRAINTS=!1,o.APPLY_LAYOUT=!0),t.step=="all"&&(t.randomize?o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:o.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?o.TREE_REDUCTION_ON_INCREMENTAL=!1:o.TREE_REDUCTION_ON_INCREMENTAL=!0;var H=new d,q=H.newGraphManager();return(function _(B,s,m,u){for(var p=s.length,f=0;f<p;f++){var w=s[f],I=null;w.intersection(Y).length==0&&(I=w.children());var x=void 0,F=w.layoutDimensions({nodeDimensionsIncludeLabels:u.nodeDimensionsIncludeLabels});if(w.outerWidth()!=null&&w.outerHeight()!=null)if(u.randomize)if(w.isParent()){var G=E.calcBoundingBox(w,N,A,v);x=w.intersection(Y).length==0?B.add(new r(m.graphManager,new a(G.topLeftX,G.topLeftY),new e(G.width,G.height))):B.add(new r(m.graphManager,new a(G.topLeftX,G.topLeftY),new e(parseFloat(F.w),parseFloat(F.h))))}else x=B.add(new r(m.graphManager,new a(N[v.get(w.id())]-F.w/2,A[v.get(w.id())]-F.h/2),new e(parseFloat(F.w),parseFloat(F.h))));else x=B.add(new r(m.graphManager,new a(w.position("x")-F.w/2,w.position("y")-F.h/2),new e(parseFloat(F.w),parseFloat(F.h))));else x=B.add(new r(this.graphManager));x.id=w.data("id"),x.nodeRepulsion=b(u.nodeRepulsion,w),x.paddingLeft=parseInt(w.css("padding")),x.paddingTop=parseInt(w.css("padding")),x.paddingRight=parseInt(w.css("padding")),x.paddingBottom=parseInt(w.css("padding")),u.nodeDimensionsIncludeLabels&&(x.labelWidth=w.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,x.labelHeight=w.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,x.labelPosVertical=w.css("text-valign"),x.labelPosHorizontal=w.css("text-halign")),M[w.data("id")]=x,isNaN(x.rect.x)&&(x.rect.x=0),isNaN(x.rect.y)&&(x.rect.y=0),I!=null&&I.length>0&&_(m.getGraphManager().add(m.newGraph(),x),I,m,u)}})(q.addRoot(),E.getTopMostNodes(l),H,t),(function(_,B,s){for(var m=0,u=0,p=0;p<s.length;p++){var f=s[p],w=M[f.data("source")],I=M[f.data("target")];if(w&&I&&w!==I&&w.getEdgesBetween(I).length==0){var x=B.add(_.newEdge(),w,I);x.id=f.id(),x.idealLength=b(t.idealEdgeLength,f),x.edgeElasticity=b(t.edgeElasticity,f),m+=x.idealLength,u++}}t.idealEdgeLength!=null&&(u>0?o.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=m/u:P(t.idealEdgeLength)?o.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=50:o.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,o.MIN_REPULSION_DIST=i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,o.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH)})(H,q,y),(function(_,B){B.fixedNodeConstraint&&(_.constraints.fixedNodeConstraint=B.fixedNodeConstraint),B.alignmentConstraint&&(_.constraints.alignmentConstraint=B.alignmentConstraint),B.relativePlacementConstraint&&(_.constraints.relativePlacementConstraint=B.relativePlacementConstraint)})(H,t),H.runLayout(),M}}},212:(C,T,L)=>{var E=(function(){function o(t,h){for(var g=0;g<h.length;g++){var c=h[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,h,g){return h&&o(t.prototype,h),g&&o(t,g),t}})(),d=L(658),r=L(548),a=L(657).spectralLayout,e=L(816).coseLayout,n=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(o){return 4500},idealEdgeLength:function(o){return 50},edgeElasticity:function(o){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),i=(function(){function o(t){(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,o),this.options=d({},n,t)}return E(o,[{key:"run",value:function(){var t=this.options,h=t.cy,g=t.eles,c=[],l=[],y=void 0,v=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&t.fixedNodeConstraint.length!=0||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&t.alignmentConstraint.vertical.length!=0||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&t.alignmentConstraint.horizontal.length!=0||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&t.relativePlacementConstraint.length!=0||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var N=void 0,A=!1;if(h.layoutUtilities&&t.packComponents&&((N=h.layoutUtilities("get"))||(N=h.layoutUtilities()),A=!0),g.nodes().length>0)if(A){var M=r.getTopMostNodes(t.eles.nodes());if((y=r.connectComponents(h,t.eles,M)).forEach(function(S){var D=S.boundingBox();v.push({x:D.x1+D.w/2,y:D.y1+D.h/2})}),t.randomize&&y.forEach(function(S){t.eles=S,c.push(a(t))}),t.quality=="default"||t.quality=="proof"){var P=h.collection();if(t.tile){var b=new Map,Y=0,H={nodeIndexes:b,xCoords:[],yCoords:[]},q=[];if(y.forEach(function(S,D){S.edges().length==0&&(S.nodes().forEach(function(z,W){P.merge(S.nodes()[W]),z.isParent()||(H.nodeIndexes.set(S.nodes()[W].id(),Y++),H.xCoords.push(S.nodes()[0].position().x),H.yCoords.push(S.nodes()[0].position().y))}),q.push(D))}),P.length>1){var _=P.boundingBox();v.push({x:_.x1+_.w/2,y:_.y1+_.h/2}),y.push(P),c.push(H);for(var B=q.length-1;B>=0;B--)y.splice(q[B],1),c.splice(q[B],1),v.splice(q[B],1)}}y.forEach(function(S,D){t.eles=S,l.push(e(t,c[D])),r.relocateComponent(v[D],l[D],t)})}else y.forEach(function(S,D){r.relocateComponent(v[D],c[D],t)});var s=new Set;if(y.length>1){var m=[],u=g.filter(function(S){return S.css("display")=="none"});y.forEach(function(S,D){var z=void 0;if(t.quality=="draft"&&(z=c[D].nodeIndexes),S.nodes().not(u).length>0){var W={edges:[],nodes:[]},U=void 0;S.nodes().not(u).forEach(function(O){if(t.quality=="draft")if(O.isParent()){var X=r.calcBoundingBox(O,c[D].xCoords,c[D].yCoords,z);W.nodes.push({x:X.topLeftX,y:X.topLeftY,width:X.width,height:X.height})}else U=z.get(O.id()),W.nodes.push({x:c[D].xCoords[U]-O.boundingbox().w/2,y:c[D].yCoords[U]-O.boundingbox().h/2,width:O.boundingbox().w,height:O.boundingbox().h});else l[D][O.id()]&&W.nodes.push({x:l[D][O.id()].getLeft(),y:l[D][O.id()].getTop(),width:l[D][O.id()].getWidth(),height:l[D][O.id()].getHeight()})}),S.edges().forEach(function(O){var X=O.source(),j=O.target();if(X.css("display")!="none"&&j.css("display")!="none")if(t.quality=="draft"){var J=z.get(X.id()),it=z.get(j.id()),V=[],yt=[];if(X.isParent()){var Lt=r.calcBoundingBox(X,c[D].xCoords,c[D].yCoords,z);V.push(Lt.topLeftX+Lt.width/2),V.push(Lt.topLeftY+Lt.height/2)}else V.push(c[D].xCoords[J]),V.push(c[D].yCoords[J]);if(j.isParent()){var Ut=r.calcBoundingBox(j,c[D].xCoords,c[D].yCoords,z);yt.push(Ut.topLeftX+Ut.width/2),yt.push(Ut.topLeftY+Ut.height/2)}else yt.push(c[D].xCoords[it]),yt.push(c[D].yCoords[it]);W.edges.push({startX:V[0],startY:V[1],endX:yt[0],endY:yt[1]})}else l[D][X.id()]&&l[D][j.id()]&&W.edges.push({startX:l[D][X.id()].getCenterX(),startY:l[D][X.id()].getCenterY(),endX:l[D][j.id()].getCenterX(),endY:l[D][j.id()].getCenterY()})}),W.nodes.length>0&&(m.push(W),s.add(D))}});var p=N.packComponents(m,t.randomize).shifts;if(t.quality=="draft")c.forEach(function(S,D){var z=S.xCoords.map(function(U){return U+p[D].dx}),W=S.yCoords.map(function(U){return U+p[D].dy});S.xCoords=z,S.yCoords=W});else{var f=0;s.forEach(function(S){Object.keys(l[S]).forEach(function(D){var z=l[S][D];z.setCenter(z.getCenterX()+p[f].dx,z.getCenterY()+p[f].dy)}),f++})}}}else{var w=t.eles.boundingBox();if(v.push({x:w.x1+w.w/2,y:w.y1+w.h/2}),t.randomize){var I=a(t);c.push(I)}t.quality=="default"||t.quality=="proof"?(l.push(e(t,c[0])),r.relocateComponent(v[0],l[0],t)):r.relocateComponent(v[0],c[0],t)}var x=function(S,D){if(t.quality=="default"||t.quality=="proof"){typeof S=="number"&&(S=D);var z=void 0,W=void 0,U=S.data("id");return l.forEach(function(X){U in X&&(z={x:X[U].getRect().getCenterX(),y:X[U].getRect().getCenterY()},W=X[U])}),t.nodeDimensionsIncludeLabels&&(W.labelWidth&&(W.labelPosHorizontal=="left"?z.x+=W.labelWidth/2:W.labelPosHorizontal=="right"&&(z.x-=W.labelWidth/2)),W.labelHeight&&(W.labelPosVertical=="top"?z.y+=W.labelHeight/2:W.labelPosVertical=="bottom"&&(z.y-=W.labelHeight/2))),z==null&&(z={x:S.position("x"),y:S.position("y")}),{x:z.x,y:z.y}}var O=void 0;return c.forEach(function(X){var j=X.nodeIndexes.get(S.id());j!=null&&(O={x:X.xCoords[j],y:X.yCoords[j]})}),O==null&&(O={x:S.position("x"),y:S.position("y")}),{x:O.x,y:O.y}};if(t.quality=="default"||t.quality=="proof"||t.randomize){var F=r.calcParentsWithoutChildren(h,g),G=g.filter(function(S){return S.css("display")=="none"});t.eles=g.not(G),g.nodes().not(":parent").not(G).layoutPositions(this,t,x),F.length>0&&F.forEach(function(S){S.position(x(S))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),o})();C.exports=i},657:(C,T,L)=>{var E=L(548),d=L(140).layoutBase.Matrix,r=L(140).layoutBase.SVD;C.exports={spectralLayout:function(a){var e=a.cy,n=a.eles,i=n.nodes(),o=n.nodes(":parent"),t=new Map,h=new Map,g=new Map,c=[],l=[],y=[],v=[],N=[],A=[],M=[],P=[],b=void 0,Y=1e8,H=1e-9,q=a.piTol,_=a.samplingType,B=a.nodeSeparation,s=void 0,m=function(K,ot,ut){for(var dt=[],vt=0,Et=0,ht=0,Tt=void 0,_t=[],Ot=0,Mt=1,xt=0;xt<b;xt++)_t[xt]=Y;for(dt[Et]=K,_t[K]=0;Et>=vt;){ht=dt[vt++];for(var R=c[ht],k=0;k<R.length;k++)_t[Tt=h.get(R[k])]==Y&&(_t[Tt]=_t[ht]+1,dt[++Et]=Tt);A[ht][ot]=_t[ht]*B}if(ut){for(var Q=0;Q<b;Q++)A[Q][ot]<N[Q]&&(N[Q]=A[Q][ot]);for(var Z=0;Z<b;Z++)N[Z]>Ot&&(Ot=N[Z],Mt=Z)}return Mt};E.connectComponents(e,n,E.getTopMostNodes(i),t),o.forEach(function(K){E.connectComponents(e,n,E.getTopMostNodes(K.descendants().intersection(n)),t)});for(var u=0,p=0;p<i.length;p++)i[p].isParent()||h.set(i[p].id(),u++);var f=!0,w=!1,I=void 0;try{for(var x,F=t.keys()[Symbol.iterator]();!(f=(x=F.next()).done);f=!0){var G=x.value;h.set(G,u++)}}catch(K){w=!0,I=K}finally{try{!f&&F.return&&F.return()}finally{if(w)throw I}}for(var S=0;S<h.size;S++)c[S]=[];o.forEach(function(K){for(var ot=K.children().intersection(n);ot.nodes(":childless").length==0;)ot=ot.nodes()[0].children().intersection(n);var ut=0,dt=ot.nodes(":childless")[0].connectedEdges().length;ot.nodes(":childless").forEach(function(vt,Et){vt.connectedEdges().length<dt&&(dt=vt.connectedEdges().length,ut=Et)}),g.set(K.id(),ot.nodes(":childless")[ut].id())}),i.forEach(function(K){var ot=void 0;ot=K.isParent()?h.get(g.get(K.id())):h.get(K.id()),K.neighborhood().nodes().forEach(function(ut){n.intersection(K.edgesWith(ut)).length>0&&(ut.isParent()?c[ot].push(g.get(ut.id())):c[ot].push(ut.id()))})});var D=function(K){var ot=h.get(K),ut=void 0;t.get(K).forEach(function(dt){ut=e.getElementById(dt).isParent()?g.get(dt):dt,c[ot].push(ut),c[h.get(ut)].push(K)})},z=!0,W=!1,U=void 0;try{for(var O,X=t.keys()[Symbol.iterator]();!(z=(O=X.next()).done);z=!0)D(O.value)}catch(K){W=!0,U=K}finally{try{!z&&X.return&&X.return()}finally{if(W)throw U}}var j=void 0;if((b=h.size)>2){s=b<a.sampleSize?b:a.sampleSize;for(var J=0;J<b;J++)A[J]=[];for(var it=0;it<s;it++)P[it]=[];return a.quality=="draft"||a.step=="all"?((function(K){var ot=void 0;if(K){ot=Math.floor(Math.random()*b);for(var ut=0;ut<b;ut++)N[ut]=Y;for(var dt=0;dt<s;dt++)v[dt]=ot,ot=m(ot,dt,K)}else{(function(){for(var Mt=0,xt=0,R=!1;xt<s;){Mt=Math.floor(Math.random()*b),R=!1;for(var k=0;k<xt;k++)if(v[k]==Mt){R=!0;break}R||(v[xt]=Mt,xt++)}})();for(var vt=0;vt<s;vt++)m(v[vt],vt,K)}for(var Et=0;Et<b;Et++)for(var ht=0;ht<s;ht++)A[Et][ht]*=A[Et][ht];for(var Tt=0;Tt<s;Tt++)M[Tt]=[];for(var _t=0;_t<s;_t++)for(var Ot=0;Ot<s;Ot++)M[_t][Ot]=A[v[Ot]][_t]})(_),(function(){for(var K=r.svd(M),ot=K.S,ut=K.U,dt=K.V,vt=ot[0]*ot[0]*ot[0],Et=[],ht=0;ht<s;ht++){Et[ht]=[];for(var Tt=0;Tt<s;Tt++)Et[ht][Tt]=0,ht==Tt&&(Et[ht][Tt]=ot[ht]/(ot[ht]*ot[ht]+vt/(ot[ht]*ot[ht])))}P=d.multMat(d.multMat(dt,Et),d.transpose(ut))})(),(function(){for(var K=void 0,ot=void 0,ut=[],dt=[],vt=[],Et=[],ht=0;ht<b;ht++)ut[ht]=Math.random(),dt[ht]=Math.random();ut=d.normalize(ut),dt=d.normalize(dt);for(var Tt=H,_t=H,Ot=void 0;;){for(var Mt=0;Mt<b;Mt++)vt[Mt]=ut[Mt];if(ut=d.multGamma(d.multL(d.multGamma(vt),A,P)),K=d.dotProduct(vt,ut),ut=d.normalize(ut),Tt=d.dotProduct(vt,ut),(Ot=Math.abs(Tt/_t))<=1+q&&Ot>=1)break;_t=Tt}for(var xt=0;xt<b;xt++)vt[xt]=ut[xt];for(_t=H;;){for(var R=0;R<b;R++)Et[R]=dt[R];if(Et=d.minusOp(Et,d.multCons(vt,d.dotProduct(vt,Et))),dt=d.multGamma(d.multL(d.multGamma(Et),A,P)),ot=d.dotProduct(Et,dt),dt=d.normalize(dt),Tt=d.dotProduct(Et,dt),(Ot=Math.abs(Tt/_t))<=1+q&&Ot>=1)break;_t=Tt}for(var k=0;k<b;k++)Et[k]=dt[k];l=d.multCons(vt,Math.sqrt(Math.abs(K))),y=d.multCons(Et,Math.sqrt(Math.abs(ot)))})(),j={nodeIndexes:h,xCoords:l,yCoords:y}):(h.forEach(function(K,ot){l.push(e.getElementById(ot).position("x")),y.push(e.getElementById(ot).position("y"))}),j={nodeIndexes:h,xCoords:l,yCoords:y}),j}var V=h.keys(),yt=e.getElementById(V.next().value),Lt=yt.position(),Ut=yt.outerWidth();if(l.push(Lt.x),y.push(Lt.y),b==2){var Rt=e.getElementById(V.next().value).outerWidth();l.push(Lt.x+Ut/2+Rt/2+a.idealEdgeLength),y.push(Lt.y)}return j={nodeIndexes:h,xCoords:l,yCoords:y}}}},579:(C,T,L)=>{var E=L(212),d=function(r){r&&r("layout","fcose",E)};typeof cytoscape<"u"&&d(cytoscape),C.exports=d},140:C=>{C.exports=Ce}},le={},(function C(T){var L=le[T];if(L!==void 0)return L.exports;var E=le[T]={exports:{}};return Me[T](E,E.exports,C),E.exports})(579))));var xe={L:"left",R:"right",T:"top",B:"bottom"},_e={L:nt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:nt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:nt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:nt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},ee={L:nt((C,T)=>C-T+2,"L"),R:nt((C,T)=>C-2,"R"),T:nt((C,T)=>C-T+2,"T"),B:nt((C,T)=>C-2,"B")},cn=nt(function(C){return Pt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Oe=nt(function(C){return C==="L"||C==="R"||C==="T"||C==="B"},"isArchitectureDirection"),Pt=nt(function(C){return C==="L"||C==="R"},"isArchitectureDirectionX"),zt=nt(function(C){return C==="T"||C==="B"},"isArchitectureDirectionY"),de=nt(function(C,T){const L=Pt(C)&&zt(T),E=zt(C)&&Pt(T);return L||E},"isArchitectureDirectionXY"),un=nt(function(C){const T=C[0],L=C[1],E=Pt(T)&&zt(L),d=zt(T)&&Pt(L);return E||d},"isArchitecturePairXY"),fn=nt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),ge=nt(function(C,T){const L=`${C}${T}`;return fn(L)?L:void 0},"getArchitectureDirectionPair"),pn=nt(function([C,T],L){const E=L[0],d=L[1];return Pt(E)?zt(d)?[C+(E==="L"?-1:1),T+(d==="T"?1:-1)]:[C+(E==="L"?-1:1),T]:Pt(d)?[C+(d==="L"?1:-1),T+(E==="T"?1:-1)]:[C,T+(E==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),mn=nt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),vn=nt(function(C,T){return de(C,T)?"bend":Pt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),yn=nt(function(C){return C.type==="service"},"isArchitectureService"),En=nt(function(C){return C.type==="junction"},"isArchitectureJunction"),De=nt(C=>C.data(),"edgeData"),$t=nt(C=>C.data(),"nodeData"),Nn=tn.architecture,Re=(Qt=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=We,this.getAccTitle=Be,this.setDiagramTitle=je,this.getDiagramTitle=qe,this.getAccDescription=$e,this.setAccDescription=Ze,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Qe()}addService({id:T,icon:L,in:E,title:d,iconText:r}){if(this.registeredIds[T]!==void 0)throw new Error(`The service id [${T}] is already in use by another ${this.registeredIds[T]}`);if(E!==void 0){if(T===E)throw new Error(`The service [${T}] cannot be placed within itself`);if(this.registeredIds[E]===void 0)throw new Error(`The service [${T}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[E]==="node")throw new Error(`The service [${T}]'s parent is not a group`)}this.registeredIds[T]="node",this.nodes[T]={id:T,type:"service",icon:L,iconText:r,title:d,edges:[],in:E}}getServices(){return Object.values(this.nodes).filter(yn)}addJunction({id:T,in:L}){this.registeredIds[T]="node",this.nodes[T]={id:T,type:"junction",edges:[],in:L}}getJunctions(){return Object.values(this.nodes).filter(En)}getNodes(){return Object.values(this.nodes)}getNode(T){return this.nodes[T]??null}addGroup({id:T,icon:L,in:E,title:d}){var r,a,e;if(((r=this.registeredIds)==null?void 0:r[T])!==void 0)throw new Error(`The group id [${T}] is already in use by another ${this.registeredIds[T]}`);if(E!==void 0){if(T===E)throw new Error(`The group [${T}] cannot be placed within itself`);if(((a=this.registeredIds)==null?void 0:a[E])===void 0)throw new Error(`The group [${T}]'s parent does not exist. Please make sure the parent is created before this group`);if(((e=this.registeredIds)==null?void 0:e[E])==="node")throw new Error(`The group [${T}]'s parent is not a group`)}this.registeredIds[T]="group",this.groups[T]={id:T,icon:L,title:d,in:E}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:T,rhsId:L,lhsDir:E,rhsDir:d,lhsInto:r,rhsInto:a,lhsGroup:e,rhsGroup:n,title:i}){if(!Oe(E))throw new Error(`Invalid direction given for left hand side of edge ${T}--${L}. Expected (L,R,T,B) got ${String(E)}`);if(!Oe(d))throw new Error(`Invalid direction given for right hand side of edge ${T}--${L}. Expected (L,R,T,B) got ${String(d)}`);if(this.nodes[T]===void 0&&this.groups[T]===void 0)throw new Error(`The left-hand id [${T}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The right-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);const o=this.nodes[T].in,t=this.nodes[L].in;if(e&&o&&t&&o==t)throw new Error(`The left-hand id [${T}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(n&&o&&t&&o==t)throw new Error(`The right-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const h={lhsId:T,lhsDir:E,lhsInto:r,lhsGroup:e,rhsId:L,rhsDir:d,rhsInto:a,rhsGroup:n,title:i};this.edges.push(h),this.nodes[T]&&this.nodes[L]&&(this.nodes[T].edges.push(this.edges[this.edges.length-1]),this.nodes[L].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const T={},L=Object.entries(this.nodes).reduce((n,[i,o])=>(n[i]=o.edges.reduce((t,h)=>{var l,y;const g=(l=this.getNode(h.lhsId))==null?void 0:l.in,c=(y=this.getNode(h.rhsId))==null?void 0:y.in;if(g&&c&&g!==c){const v=vn(h.lhsDir,h.rhsDir);v!=="bend"&&(T[g]??(T[g]={}),T[g][c]=v,T[c]??(T[c]={}),T[c][g]=v)}if(h.lhsId===i){const v=ge(h.lhsDir,h.rhsDir);v&&(t[v]=h.rhsId)}else{const v=ge(h.rhsDir,h.lhsDir);v&&(t[v]=h.lhsId)}return t},{}),n),{}),E=Object.keys(L)[0],d={[E]:1},r=Object.keys(L).reduce((n,i)=>i===E?n:{...n,[i]:1},{}),a=nt(n=>{const i={[n]:[0,0]},o=[n];for(;o.length>0;){const t=o.shift();if(t){d[t]=1,delete r[t];const h=L[t],[g,c]=i[t];Object.entries(h).forEach(([l,y])=>{d[y]||(i[y]=pn([g,c],l),o.push(y))})}}return i},"BFS"),e=[a(E)];for(;Object.keys(r).length>0;)e.push(a(Object.keys(r)[0]));this.dataStructures={adjList:L,spatialMaps:e,groupAlignments:T}}return this.dataStructures}setElementForId(T,L){this.elements[T]=L}getElementById(T){return this.elements[T]}getConfig(){return Ke({...Nn,...Je().architecture})}getConfigField(T){return this.getConfig()[T]}},nt(Qt,"ArchitectureDB"),Qt),Tn=nt((C,T)=>{on(C,T),C.groups.map(L=>T.addGroup(L)),C.services.map(L=>T.addService({...L,type:"service"})),C.junctions.map(L=>T.addJunction({...L,type:"junction"})),C.edges.map(L=>T.addEdge(L))},"populateDb"),be={parser:{yy:void 0},parse:nt(async C=>{var E;const T=await sn("architecture",C);ye.debug(T);const L=(E=be.parser)==null?void 0:E.yy;if(!(L instanceof Re))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Tn(T,L)},"parse")},An=nt(C=>`
2
- .edge {
3
- stroke-width: ${C.archEdgeWidth};
4
- stroke: ${C.archEdgeColor};
5
- fill: none;
6
- }
7
-
8
- .arrow {
9
- fill: ${C.archEdgeArrowColor};
10
- }
11
-
12
- .node-bkg {
13
- fill: none;
14
- stroke: ${C.archGroupBorderColor};
15
- stroke-width: ${C.archGroupBorderWidth};
16
- stroke-dasharray: 8;
17
- }
18
- .node-icon-text {
19
- display: flex;
20
- align-items: center;
21
- }
22
-
23
- .node-icon-text > div {
24
- color: #fff;
25
- margin: 1px;
26
- height: fit-content;
27
- text-align: center;
28
- overflow: hidden;
29
- display: -webkit-box;
30
- -webkit-box-orient: vertical;
31
- }
32
- `,"getStyles"),Zt=nt(C=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),Jt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Zt('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Zt('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Zt('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Zt('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Zt('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:rn,blank:{body:Zt("")}}},wn=nt(async function(C,T,L){const E=L.getConfigField("padding"),d=L.getConfigField("iconSize"),r=d/2,a=d/6,e=a/2;await Promise.all(T.edges().map(async n=>{var q,_;const{source:i,sourceDir:o,sourceArrow:t,sourceGroup:h,target:g,targetDir:c,targetArrow:l,targetGroup:y,label:v}=De(n);let{x:N,y:A}=n[0].sourceEndpoint();const{x:M,y:P}=n[0].midpoint();let{x:b,y:Y}=n[0].targetEndpoint();const H=E+4;if(h&&(Pt(o)?N+=o==="L"?-H:H:A+=o==="T"?-H:H+18),y&&(Pt(c)?b+=c==="L"?-H:H:Y+=c==="T"?-H:H+18),h||((q=L.getNode(i))==null?void 0:q.type)!=="junction"||(Pt(o)?N+=o==="L"?r:-r:A+=o==="T"?r:-r),y||((_=L.getNode(g))==null?void 0:_.type)!=="junction"||(Pt(c)?b+=c==="L"?r:-r:Y+=c==="T"?r:-r),n[0]._private.rscratch){const B=C.insert("g");if(B.insert("path").attr("d",`M ${N},${A} L ${M},${P} L${b},${Y} `).attr("class","edge"),t){const s=Pt(o)?ee[o](N,a):N-e,m=zt(o)?ee[o](A,a):A-e;B.insert("polygon").attr("points",_e[o](a)).attr("transform",`translate(${s},${m})`).attr("class","arrow")}if(l){const s=Pt(c)?ee[c](b,a):b-e,m=zt(c)?ee[c](Y,a):Y-e;B.insert("polygon").attr("points",_e[c](a)).attr("transform",`translate(${s},${m})`).attr("class","arrow")}if(v){const s=de(o,c)?"XY":Pt(o)?"X":"Y";let m=0;m=s==="X"?Math.abs(N-b):s==="Y"?Math.abs(A-Y)/1.5:Math.abs(N-b)/2;const u=B.append("g");if(await ae(u,v,{useHtmlLabels:!1,width:m,classes:"architecture-service-label"},se()),u.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),s==="X")u.attr("transform","translate("+M+", "+P+")");else if(s==="Y")u.attr("transform","translate("+M+", "+P+") rotate(-90)");else if(s==="XY"){const p=ge(o,c);if(p&&un(p)){const f=u.node().getBoundingClientRect(),[w,I]=mn(p);u.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*w*I*45})`);const x=u.node().getBoundingClientRect();u.attr("transform",`
33
- translate(${M}, ${P-f.height/2})
34
- translate(${w*x.width/2}, ${I*x.height/2})
35
- rotate(${-1*w*I*45}, 0, ${f.height/2})
36
- `)}}}}}))},"drawEdges"),Ln=nt(async function(C,T,L){const E=.75*L.getConfigField("padding"),d=L.getConfigField("fontSize"),r=L.getConfigField("iconSize")/2;await Promise.all(T.nodes().map(async a=>{const e=$t(a);if(e.type==="group"){const{h:n,w:i,x1:o,y1:t}=a.boundingBox();C.append("rect").attr("x",o+r).attr("y",t+r).attr("width",i).attr("height",n).attr("class","node-bkg");const h=C.append("g");let g=o,c=t;if(e.icon){const l=h.append("g");l.html(`<g>${await he(e.icon,{height:E,width:E,fallbackPrefix:Jt.prefix})}</g>`),l.attr("transform","translate("+(g+r+1)+", "+(c+r+1)+")"),g+=E,c+=d/2-1-2}if(e.label){const l=h.append("g");await ae(l,e.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},se()),l.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),l.attr("transform","translate("+(g+r+4)+", "+(c+r+2)+")")}}}))},"drawGroups"),In=nt(async function(C,T,L){const E=se();for(const d of L){const r=T.append("g"),a=C.getConfigField("iconSize");if(d.title){const o=r.append("g");await ae(o,d.title,{useHtmlLabels:!1,width:1.5*a,classes:"architecture-service-label"},E),o.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),o.attr("transform","translate("+a/2+", "+a+")")}const e=r.append("g");if(d.icon)e.html(`<g>${await he(d.icon,{height:a,width:a,fallbackPrefix:Jt.prefix})}</g>`);else if(d.iconText){e.html(`<g>${await he("blank",{height:a,width:a,fallbackPrefix:Jt.prefix})}</g>`);const o=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(en(d.iconText,E)),t=parseInt(window.getComputedStyle(o.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;o.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/t)};`)}else e.append("path").attr("class","node-bkg").attr("id","node-"+d.id).attr("d",`M0 ${a} v${-a} q0,-5 5,-5 h${a} q5,0 5,5 v${a} H0 Z`);r.attr("class","architecture-service");const{width:n,height:i}=r._groups[0][0].getBBox();d.width=n,d.height=i,C.setElementForId(d.id,r)}return 0},"drawServices"),Cn=nt(function(C,T,L){L.forEach(E=>{const d=T.append("g"),r=C.getConfigField("iconSize");d.append("g").append("rect").attr("id","node-"+E.id).attr("fill-opacity","0").attr("width",r).attr("height",r),d.attr("class","architecture-junction");const{width:a,height:e}=d._groups[0][0].getBBox();d.width=a,d.height=e,C.setElementForId(E.id,d)})},"drawJunctions");function Fe(C,T,L){C.forEach(E=>{T.add({group:"nodes",data:{type:"service",id:E.id,icon:E.icon,label:E.title,parent:E.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-service"})})}function Ge(C,T,L){C.forEach(E=>{T.add({group:"nodes",data:{type:"junction",id:E.id,parent:E.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-junction"})})}function Se(C,T){T.nodes().map(L=>{const E=$t(L);E.type!=="group"&&(E.x=L.position().x,E.y=L.position().y,C.getElementById(E.id).attr("transform","translate("+(E.x||0)+","+(E.y||0)+")"))})}function Pe(C,T){C.forEach(L=>{T.add({group:"nodes",data:{type:"group",id:L.id,icon:L.icon,label:L.title,parent:L.in},classes:"node-group"})})}function Ue(C,T){C.forEach(L=>{const{lhsId:E,rhsId:d,lhsInto:r,lhsGroup:a,rhsInto:e,lhsDir:n,rhsDir:i,rhsGroup:o,title:t}=L,h=de(L.lhsDir,L.rhsDir)?"segments":"straight",g={id:`${E}-${d}`,label:t,source:E,sourceDir:n,sourceArrow:r,sourceGroup:a,sourceEndpoint:n==="L"?"0 50%":n==="R"?"100% 50%":n==="T"?"50% 0":"50% 100%",target:d,targetDir:i,targetArrow:e,targetGroup:o,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};T.add({group:"edges",data:g,classes:h})})}function Ye(C,T,L){const E=nt((e,n)=>Object.entries(e).reduce((i,[o,t])=>{var c;let h=0;const g=Object.entries(t);if(g.length===1)return i[o]=g[0][1],i;for(let l=0;l<g.length-1;l++)for(let y=l+1;y<g.length;y++){const[v,N]=g[l],[A,M]=g[y];((c=L[v])==null?void 0:c[A])===n?(i[o]??(i[o]=[]),i[o]=[...i[o],...N,...M]):v==="default"||A==="default"?(i[o]??(i[o]=[]),i[o]=[...i[o],...N,...M]):(i[`${o}-${h++}`]=N,i[`${o}-${h++}`]=M)}return i},{}),"flattenAlignments"),d=T.map(e=>{const n={},i={};return Object.entries(e).forEach(([o,[t,h]])=>{var c,l,y;const g=((c=C.getNode(o))==null?void 0:c.in)??"default";n[h]??(n[h]={}),(l=n[h])[g]??(l[g]=[]),n[h][g].push(o),i[t]??(i[t]={}),(y=i[t])[g]??(y[g]=[]),i[t][g].push(o)}),{horiz:Object.values(E(n,"horizontal")).filter(o=>o.length>1),vert:Object.values(E(i,"vertical")).filter(o=>o.length>1)}}),[r,a]=d.reduce(([e,n],{horiz:i,vert:o})=>[[...e,...i],[...n,...o]],[[],[]]);return{horizontal:r,vertical:a}}function ke(C,T){const L=[],E=nt(r=>`${r[0]},${r[1]}`,"posToStr"),d=nt(r=>r.split(",").map(a=>parseInt(a)),"strToPos");return C.forEach(r=>{const a=Object.fromEntries(Object.entries(r).map(([o,t])=>[E(t),o])),e=[E([0,0])],n={},i={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;e.length>0;){const o=e.shift();if(o){n[o]=1;const t=a[o];if(t){const h=d(o);Object.entries(i).forEach(([g,c])=>{const l=E([h[0]+c[0],h[1]+c[1]]),y=a[l];y&&!n[l]&&(e.push(l),L.push({[xe[g]]:y,[xe[cn(g)]]:t,gap:1.5*T.getConfigField("iconSize")}))})}}}}),L}function He(C,T,L,E,d,{spatialMaps:r,groupAlignments:a}){return new Promise(e=>{const n=hn("body").append("div").attr("id","cy").attr("style","display:none"),i=Ee({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${d.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${d.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});n.remove(),Pe(L,i),Fe(C,i,d),Ge(T,i,d),Ue(E,i);const o=Ye(d,r,a),t=ke(r,d),h=i.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(g){const[c,l]=g.connectedNodes(),{parent:y}=$t(c),{parent:v}=$t(l);return y===v?1.5*d.getConfigField("iconSize"):.5*d.getConfigField("iconSize")},edgeElasticity(g){const[c,l]=g.connectedNodes(),{parent:y}=$t(c),{parent:v}=$t(l);return y===v?.45:.001},alignmentConstraint:o,relativePlacementConstraint:t});h.one("layoutstop",()=>{var c;function g(l,y,v,N){let A,M;const{x:P,y:b}=l,{x:Y,y:H}=y;M=(N-b+(P-v)*(b-H)/(P-Y))/Math.sqrt(1+Math.pow((b-H)/(P-Y),2)),A=Math.sqrt(Math.pow(N-b,2)+Math.pow(v-P,2)-Math.pow(M,2)),A/=Math.sqrt(Math.pow(Y-P,2)+Math.pow(H-b,2));let q=(Y-P)*(N-b)-(H-b)*(v-P);switch(!0){case q>=0:q=1;break;case q<0:q=-1}let _=(Y-P)*(v-P)+(H-b)*(N-b);switch(!0){case _>=0:_=1;break;case _<0:_=-1}return M=Math.abs(M)*q,A*=_,{distances:M,weights:A}}nt(g,"getSegmentWeights"),i.startBatch();for(const l of Object.values(i.edges()))if((c=l.data)!=null&&c.call(l)){const{x:y,y:v}=l.source().position(),{x:N,y:A}=l.target().position();if(y!==N&&v!==A){const M=l.sourceEndpoint(),P=l.targetEndpoint(),{sourceDir:b}=De(l),[Y,H]=zt(b)?[M.x,P.y]:[P.x,M.y],{weights:q,distances:_}=g(M,P,Y,H);l.style("segment-distances",_),l.style("segment-weights",q)}}i.endBatch(),h.run()}),h.run(),i.ready(g=>{ye.info("Ready",g),e(i)})})}nn([{name:Jt.prefix,icons:Jt}]),Ee.use(gn),nt(Fe,"addServices"),nt(Ge,"addJunctions"),nt(Se,"positionNodes"),nt(Pe,"addGroups"),nt(Ue,"addEdges"),nt(Ye,"getAlignments"),nt(ke,"getRelativeConstraints"),nt(He,"layoutArchitecture");var Mn={draw:nt(async(C,T,L,E)=>{const d=E.db,r=d.getServices(),a=d.getJunctions(),e=d.getGroups(),n=d.getEdges(),i=d.getDataStructures(),o=ze(T),t=o.append("g");t.attr("class","architecture-edges");const h=o.append("g");h.attr("class","architecture-services");const g=o.append("g");g.attr("class","architecture-groups"),await In(d,h,r),Cn(d,h,a);const c=await He(r,a,e,n,d,i);await wn(t,c,d),await Ln(g,c,d),Se(d,c),Ve(void 0,o,d.getConfigField("padding"),d.getConfigField("useMaxWidth"))},"draw")},xn={parser:be,get db(){return new Re},renderer:Mn,styles:An};export{xn as diagram};
@@ -1 +0,0 @@
1
- import{U as r,C as s}from"./mermaid.core-4nVOEVX3.js";const n=(a,o)=>r.lang.round(s.parse(a)[o]);export{n as c};
@@ -1,7 +0,0 @@
1
- import{r as f,dG as Z,dH as Wt,j as o,dI as Ft,dJ as te,dK as ie,dL as $,dM as q,dN as Ut,dO as Xt,a as D,I as V,L as J,bc as Yt,M as Bt,cS as Ue,dP as Vt,u as $t,Q as qt,bH as Jt,p as Qt,aO as W,H as Kt,bn as Gt,B as ce,bm as Zt,bs as er,dQ as tr,dR as rr,dS as Xe,dT as fe,dU as Ye,dV as Be,dW as Ve,dX as or,bV as nr,dY as $e,dZ as sr,d_ as ar,d$ as lr,e0 as ir,e1 as cr,e2 as dr,e3 as mr,cA as Q,am as ur,cd as pr,e4 as hr,al as fr,e5 as xr,e6 as gr,e7 as vr,S as wr,e8 as br,e9 as qe,ea as Je,eb as Qe,E as yr,ec as jr,ed as Ke,C as Nr,ee as Sr,ef as Cr,eg as _r,eh as Er,ei as Rr,ej as Tr,ap as ee,ek as kr,bF as Ar,el as Pr,em as Ir,en as Lr,eo as zr,ep as Dr,V as Mr,eq as Or,ac as Hr,ad as Wr,d2 as Fr,ae as Ur,d0 as Xr,__tla as Yr}from"./index-OC46250R.js";import{e as Ge,g as Br,__tla as Vr}from"./edit-page-DJ8kJZ9w.js";import{d as $r,u as Ze}from"./links-CbvGxbsJ.js";import{P as et}from"./empty-state-BIBXzY_0.js";import{I as qr,__tla as Jr}from"./storage-CGlP4lCF.js";import{u as Qr,r as Kr,a as Gr,V as Zr,b as eo,v as to,t as ro,c as xe,d as oo}from"./index-DcCIe7np.js";import{B as no}from"./between-horizontal-start-FyewyCGn.js";import"./_createAggregator-Bn38fDd3.js";import"./_baseEach-C1FLm7WW.js";import{__tla as so}from"./loro_wasm_bg-C1ks32Vm.js";import"./index-Dt9UWeWn.js";import"./index-BAH034Ue.js";import"./index-DqzMPAC8.js";import"./index-DSU75csX.js";import"./index-CSgxTUzD.js";import"./index-BLu5CX6z.js";import"./index-B8llrTSo.js";import"./index-CPN7TRA1.js";import"./index-BFSnz7iM.js";import"./index-Bq516OmX.js";import"./index-CB2pnVQG.js";import"./index-DWOaniGT.js";import"./index-c6If577Q.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asn1-DWPaVWf6.js";import"./brainfuck-CtZaYBKt.js";import"./cobol-stawOqaz.js";import"./clike-BgBwzOhw.js";import"./clojure-DiuoqK-z.js";import"./css-ZjFoif2m.js";import"./cmake-DXn5xaP-.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./cypher-gJDei3ni.js";import"./python-DD-Q2bae.js";import"./crystal-CRzZ78HM.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./simple-mode-C3vEBAcb.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./mllike-3c2dg9RT.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./idl-pcmmZuaN.js";import"./javascript-BpzJj0-u.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mirc-DkvFAiy5.js";import"./mathematica-IIbmv7SK.js";import"./modelica-DSrSSXCg.js";import"./mumps-zvxmGV4l.js";import"./mbox-z_N2Mo3d.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./pug-BTvK5tSS.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./rpm-DI_rRufH.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./sparql-BRLJFz69.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./verilog-B4LBqg_1.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./ttcn-cfg-CKJxb-l2.js";import"./turtle-BkSuIpt-.js";import"./webidl-CGwyPRYs.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./vhdl-CWWH2SUo.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./mscgen-B2igx18G.js";import"./index-DMomwMcN.js";import"./trash-UBqfK4mR.js";let tt,ao=Promise.all([(()=>{try{return Yr}catch{}})(),(()=>{try{return Vr}catch{}})(),(()=>{try{return Jr}catch{}})(),(()=>{try{return so}catch{}})()]).then(async()=>{var de="ScrollArea",[ge,lo]=Ft(de),[rt,M]=ge(de),ve=f.forwardRef((r,e)=>{const{__scopeScrollArea:t,type:s="hover",dir:n,scrollHideDelay:a=600,...l}=r,[i,c]=f.useState(null),[m,d]=f.useState(null),[u,p]=f.useState(null),[h,g]=f.useState(null),[b,v]=f.useState(null),[x,y]=f.useState(0),[_,S]=f.useState(0),[E,C]=f.useState(!1),[k,T]=f.useState(!1),N=Z(e,L=>c(L)),A=Wt(n);return o.jsx(rt,{scope:t,type:s,dir:A,scrollHideDelay:a,scrollArea:i,viewport:m,onViewportChange:d,content:u,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:k,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:S,children:o.jsx(te.div,{dir:A,...l,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":_+"px",...r.style}})})});ve.displayName=de;var we="ScrollAreaViewport",be=f.forwardRef((r,e)=>{const{__scopeScrollArea:t,children:s,nonce:n,...a}=r,l=M(we,t),i=f.useRef(null),c=Z(e,i,l.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),o.jsx(te.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...r.style},children:o.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});be.displayName=we;var F="ScrollAreaScrollbar",me=f.forwardRef((r,e)=>{const{forceMount:t,...s}=r,n=M(F,r.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:l}=n,i=r.orientation==="horizontal";return f.useEffect(()=>(i?a(!0):l(!0),()=>{i?a(!1):l(!1)}),[i,a,l]),n.type==="hover"?o.jsx(ot,{...s,ref:e,forceMount:t}):n.type==="scroll"?o.jsx(nt,{...s,ref:e,forceMount:t}):n.type==="auto"?o.jsx(ye,{...s,ref:e,forceMount:t}):n.type==="always"?o.jsx(ue,{...s,ref:e}):null});me.displayName=F;var ot=f.forwardRef((r,e)=>{const{forceMount:t,...s}=r,n=M(F,r.__scopeScrollArea),[a,l]=f.useState(!1);return f.useEffect(()=>{const i=n.scrollArea;let c=0;if(i){const m=()=>{window.clearTimeout(c),l(!0)},d=()=>{c=window.setTimeout(()=>l(!1),n.scrollHideDelay)};return i.addEventListener("pointerenter",m),i.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",m),i.removeEventListener("pointerleave",d)}}},[n.scrollArea,n.scrollHideDelay]),o.jsx(ie,{present:t||a,children:o.jsx(ye,{"data-state":a?"visible":"hidden",...s,ref:e})})}),nt=f.forwardRef((r,e)=>{const{forceMount:t,...s}=r,n=M(F,r.__scopeScrollArea),a=r.orientation==="horizontal",l=se(()=>c("SCROLL_END"),100),[i,c]=(m="hidden",d={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},f.useReducer((u,p)=>d[u][p]??u,m));var m,d;return f.useEffect(()=>{if(i==="idle"){const u=window.setTimeout(()=>c("HIDE"),n.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,n.scrollHideDelay,c]),f.useEffect(()=>{const u=n.viewport,p=a?"scrollLeft":"scrollTop";if(u){let h=u[p];const g=()=>{const b=u[p];h!==b&&(c("SCROLL"),l()),h=b};return u.addEventListener("scroll",g),()=>u.removeEventListener("scroll",g)}},[n.viewport,a,c,l]),o.jsx(ie,{present:t||i!=="hidden",children:o.jsx(ue,{"data-state":i==="hidden"?"hidden":"visible",...s,ref:e,onPointerEnter:$(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:$(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),ye=f.forwardRef((r,e)=>{const t=M(F,r.__scopeScrollArea),{forceMount:s,...n}=r,[a,l]=f.useState(!1),i=r.orientation==="horizontal",c=se(()=>{if(t.viewport){const m=t.viewport.offsetWidth<t.viewport.scrollWidth,d=t.viewport.offsetHeight<t.viewport.scrollHeight;l(i?m:d)}},10);return K(t.viewport,c),K(t.content,c),o.jsx(ie,{present:s||a,children:o.jsx(ue,{"data-state":a?"visible":"hidden",...n,ref:e})})}),ue=f.forwardRef((r,e)=>{const{orientation:t="vertical",...s}=r,n=M(F,r.__scopeScrollArea),a=f.useRef(null),l=f.useRef(0),[i,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=_e(i.viewport,i.content),d={...s,sizes:i,onSizesChange:c,hasThumb:m>0&&m<1,onThumbChange:p=>a.current=p,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:p=>l.current=p};function u(p,h){return(function(g,b,v,x="ltr"){const y=ne(v),_=y/2,S=b||_,E=y-S,C=v.scrollbar.paddingStart+S,k=v.scrollbar.size-v.scrollbar.paddingEnd-E,T=v.content-v.viewport,N=x==="ltr"?[0,T]:[-1*T,0];return Re([C,k],N)(g)})(p,l.current,i,h)}return t==="horizontal"?o.jsx(st,{...d,ref:e,onThumbPositionChange:()=>{if(n.viewport&&a.current){const p=Ee(n.viewport.scrollLeft,i,n.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:p=>{n.viewport&&(n.viewport.scrollLeft=p)},onDragScroll:p=>{n.viewport&&(n.viewport.scrollLeft=u(p,n.dir))}}):t==="vertical"?o.jsx(at,{...d,ref:e,onThumbPositionChange:()=>{if(n.viewport&&a.current){const p=Ee(n.viewport.scrollTop,i);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:p=>{n.viewport&&(n.viewport.scrollTop=p)},onDragScroll:p=>{n.viewport&&(n.viewport.scrollTop=u(p))}}):null}),st=f.forwardRef((r,e)=>{const{sizes:t,onSizesChange:s,...n}=r,a=M(F,r.__scopeScrollArea),[l,i]=f.useState(),c=f.useRef(null),m=Z(e,c,a.onScrollbarXChange);return f.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),o.jsx(Ne,{"data-orientation":"horizontal",...n,ref:m,sizes:t,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ne(t)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.x),onDragScroll:d=>r.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(a.viewport){const p=a.viewport.scrollLeft+d.deltaX;r.onWheelScroll(p),Te(p,u)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&l&&s({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:oe(l.paddingLeft),paddingEnd:oe(l.paddingRight)}})}})}),at=f.forwardRef((r,e)=>{const{sizes:t,onSizesChange:s,...n}=r,a=M(F,r.__scopeScrollArea),[l,i]=f.useState(),c=f.useRef(null),m=Z(e,c,a.onScrollbarYChange);return f.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),o.jsx(Ne,{"data-orientation":"vertical",...n,ref:m,sizes:t,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ne(t)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.y),onDragScroll:d=>r.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(a.viewport){const p=a.viewport.scrollTop+d.deltaY;r.onWheelScroll(p),Te(p,u)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&l&&s({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:oe(l.paddingTop),paddingEnd:oe(l.paddingBottom)}})}})}),[lt,je]=ge(F),Ne=f.forwardRef((r,e)=>{const{__scopeScrollArea:t,sizes:s,hasThumb:n,onThumbChange:a,onThumbPointerUp:l,onThumbPointerDown:i,onThumbPositionChange:c,onDragScroll:m,onWheelScroll:d,onResize:u,...p}=r,h=M(F,t),[g,b]=f.useState(null),v=Z(e,N=>b(N)),x=f.useRef(null),y=f.useRef(""),_=h.viewport,S=s.content-s.viewport,E=q(d),C=q(c),k=se(u,10);function T(N){if(x.current){const A=N.clientX-x.current.left,L=N.clientY-x.current.top;m({x:A,y:L})}}return f.useEffect(()=>{const N=A=>{const L=A.target;(g==null?void 0:g.contains(L))&&E(A,S)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[_,g,S,E]),f.useEffect(C,[s,C]),K(g,k),K(h.content,k),o.jsx(lt,{scope:t,scrollbar:g,hasThumb:n,onThumbChange:q(a),onThumbPointerUp:q(l),onThumbPositionChange:C,onThumbPointerDown:q(i),children:o.jsx(te.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:$(r.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),x.current=g.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(N))}),onPointerMove:$(r.onPointerMove,T),onPointerUp:$(r.onPointerUp,N=>{const A=N.target;A.hasPointerCapture(N.pointerId)&&A.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),re="ScrollAreaThumb",Se=f.forwardRef((r,e)=>{const{forceMount:t,...s}=r,n=je(re,r.__scopeScrollArea);return o.jsx(ie,{present:t||n.hasThumb,children:o.jsx(it,{ref:e,...s})})}),it=f.forwardRef((r,e)=>{const{__scopeScrollArea:t,style:s,...n}=r,a=M(re,t),l=je(re,t),{onThumbPositionChange:i}=l,c=Z(e,u=>l.onThumbChange(u)),m=f.useRef(void 0),d=se(()=>{m.current&&(m.current(),m.current=void 0)},100);return f.useEffect(()=>{const u=a.viewport;if(u){const p=()=>{if(d(),!m.current){const h=dt(u,i);m.current=h,i()}};return i(),u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[a.viewport,d,i]),o.jsx(te.div,{"data-state":l.hasThumb?"visible":"hidden",...n,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:$(r.onPointerDownCapture,u=>{const p=u.target.getBoundingClientRect(),h=u.clientX-p.left,g=u.clientY-p.top;l.onThumbPointerDown({x:h,y:g})}),onPointerUp:$(r.onPointerUp,l.onThumbPointerUp)})});Se.displayName=re;var pe="ScrollAreaCorner",Ce=f.forwardRef((r,e)=>{const t=M(pe,r.__scopeScrollArea),s=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&s?o.jsx(ct,{...r,ref:e}):null});Ce.displayName=pe;var ct=f.forwardRef((r,e)=>{const{__scopeScrollArea:t,...s}=r,n=M(pe,t),[a,l]=f.useState(0),[i,c]=f.useState(0),m=!!(a&&i);return K(n.scrollbarX,()=>{var u;const d=((u=n.scrollbarX)==null?void 0:u.offsetHeight)||0;n.onCornerHeightChange(d),c(d)}),K(n.scrollbarY,()=>{var u;const d=((u=n.scrollbarY)==null?void 0:u.offsetWidth)||0;n.onCornerWidthChange(d),l(d)}),m?o.jsx(te.div,{...s,ref:e,style:{width:a,height:i,position:"absolute",right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function oe(r){return r?parseInt(r,10):0}function _e(r,e){const t=r/e;return isNaN(t)?0:t}function ne(r){const e=_e(r.viewport,r.content),t=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,s=(r.scrollbar.size-t)*e;return Math.max(s,18)}function Ee(r,e,t="ltr"){const s=ne(e),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=e.scrollbar.size-n,l=e.content-e.viewport,i=a-s,c=Xt(r,t==="ltr"?[0,l]:[-1*l,0]);return Re([0,l],[0,i])(c)}function Re(r,e){return t=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const s=(e[1]-e[0])/(r[1]-r[0]);return e[0]+s*(t-r[0])}}function Te(r,e){return r>0&&r<e}var dt=(r,e=()=>{})=>{let t={left:r.scrollLeft,top:r.scrollTop},s=0;return(function n(){const a={left:r.scrollLeft,top:r.scrollTop},l=t.left!==a.left,i=t.top!==a.top;(l||i)&&e(),t=a,s=window.requestAnimationFrame(n)})(),()=>window.cancelAnimationFrame(s)};function se(r,e){const t=q(r),s=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(s.current),[]),f.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(t,e)},[t,e])}function K(r,e){const t=q(e);Ut(()=>{let s=0;if(r){const n=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(t)});return n.observe(r),()=>{window.cancelAnimationFrame(s),n.unobserve(r)}}},[r,t])}var ke=ve,mt=be,ut=Ce;const Ae=f.forwardRef((r,e)=>{const t=D.c(15);let s,n,a,l,i,c,m,d;return t[0]!==r?({className:n,children:s,...a}=r,t[0]=r,t[1]=s,t[2]=n,t[3]=a):(s=t[1],n=t[2],a=t[3]),t[4]!==n?(l=V("relative overflow-hidden",n),t[4]=n,t[5]=l):l=t[5],t[6]!==s?(i=o.jsx(mt,{className:"h-full w-full rounded-[inherit]",children:s}),t[6]=s,t[7]=i):i=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Pe,{}),m=o.jsx(ut,{}),t[8]=c,t[9]=m):(c=t[8],m=t[9]),t[10]!==a||t[11]!==e||t[12]!==l||t[13]!==i?(d=o.jsxs(ke,{ref:e,className:l,...a,children:[i,c,m]}),t[10]=a,t[11]=e,t[12]=l,t[13]=i,t[14]=d):d=t[14],d});Ae.displayName=ke.displayName;const Pe=f.forwardRef((r,e)=>{const t=D.c(14);let s,n,a;t[0]!==r?({className:s,orientation:a,...n}=r,t[0]=r,t[1]=s,t[2]=n,t[3]=a):(s=t[1],n=t[2],a=t[3]);const l=a===void 0?"vertical":a,i=l==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",c=l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px";let m,d,u;return t[4]!==s||t[5]!==i||t[6]!==c?(m=V("flex touch-none select-none transition-colors",i,c,s),t[4]=s,t[5]=i,t[6]=c,t[7]=m):m=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Se,{className:"relative flex-1 rounded-full bg-border"}),t[8]=d):d=t[8],t[9]!==l||t[10]!==n||t[11]!==e||t[12]!==m?(u=o.jsx(me,{ref:e,orientation:l,className:m,...n,children:d}),t[9]=l,t[10]=n,t[11]=e,t[12]=m,t[13]=u):u=t[13],u});Pe.displayName=me.displayName;const pt=r=>{var a;const e=D.c(6),{attachment:t}=r;if((a=t.mediaType)!=null&&a.startsWith("image/")){let l;return e[0]!==t.filename||e[1]!==t.url?(l=o.jsx("img",{src:t.url,alt:t.filename,className:"max-h-[100px] max-w-[100px] object-contain mb-1.5"}),e[0]=t.filename,e[1]=t.url,e[2]=l):l=e[2],l}let s,n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Ue,{className:"h-3 w-3 mt-0.5"}),e[3]=s):s=e[3],e[4]!==t.filename?(n=o.jsxs("div",{className:"flex flex-row gap-1 items-center text-xs",children:[s,t.filename]}),e[4]=t.filename,e[5]=n):n=e[5],n},ht=r=>{const e=D.c(12),{file:t,className:s,onRemove:n}=r,[a,l]=f.useState(!1);let i,c,m,d,u;return e[0]!==s?(i=V("py-1 px-1.5 bg-muted rounded-md cursor-pointer flex flex-row gap-1 items-center text-xs",s),e[0]=s,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>l(!0),m=()=>l(!1),e[2]=c,e[3]=m):(c=e[2],m=e[3]),e[4]!==t||e[5]!==a||e[6]!==n?(d=a?o.jsx(Yt,{className:"h-3 w-3 mt-0.5",onClick:n}):(function(p){const h="h-3 w-3 mt-0.5";return p.type.startsWith("image/")?o.jsx(qr,{className:h}):p.type.startsWith("text/")?o.jsx(Bt,{className:h}):o.jsx(Ue,{className:h})})(t),e[4]=t,e[5]=a,e[6]=n,e[7]=d):d=e[7],e[8]!==t.name||e[9]!==i||e[10]!==d?(u=o.jsxs("div",{className:i,onMouseEnter:c,onMouseLeave:m,children:[d,t.name]}),e[8]=t.name,e[9]=i,e[10]=d,e[11]=u):u=e[11],u},ft="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ie=[],Le={allowDangerousHtml:!0},xt=/^(https?|ircs?|mailto|xmpp)$/i,gt=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function vt(r){const e=(function(s){const n=s.rehypePlugins||Ie,a=s.remarkPlugins||Ie,l=s.remarkRehypeOptions?{...s.remarkRehypeOptions,...Le}:Le;return Qr().use(Kr).use(a).use(Gr,l).use(n)})(r),t=(function(s){const n=s.children||"",a=new Zr;return typeof n=="string"&&(a.value=n),a})(r);return(function(s,n){const a=n.allowedElements,l=n.allowElement,i=n.components,c=n.disallowedElements,m=n.skipHtml,d=n.unwrapDisallowed,u=n.urlTransform||wt;for(const h of gt)Object.hasOwn(n,h.from)&&eo("Unexpected `"+h.from+"` prop, "+(h.to?"use `"+h.to+"` instead":"remove it")+" (see <"+ft+"#"+h.id+"> for more info)");return n.className&&(s={type:"element",tagName:"div",properties:{className:n.className},children:s.type==="root"?s.children:[s]}),to(s,p),ro(s,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function p(h,g,b){if(h.type==="raw"&&b&&typeof g=="number")return m?b.children.splice(g,1):b.children[g]={type:"text",value:h.value},g;if(h.type==="element"){let v;for(v in xe)if(Object.hasOwn(xe,v)&&Object.hasOwn(h.properties,v)){const x=h.properties[v],y=xe[v];(y===null||y.includes(h.tagName))&&(h.properties[v]=u(String(x||""),v,h))}}if(h.type==="element"){let v=a?!a.includes(h.tagName):!!c&&c.includes(h.tagName);if(!v&&l&&typeof g=="number"&&(v=!l(h,g,b)),v&&b&&typeof g=="number")return d&&h.children?b.children.splice(g,1,...h.children):b.children.splice(g,1),g}}})(e.runSync(e.parse(t),t),r)}function wt(r){const e=r.indexOf(":"),t=r.indexOf("?"),s=r.indexOf("#"),n=r.indexOf("/");return e===-1||n!==-1&&e>n||t!==-1&&e>t||s!==-1&&e>s||xt.test(r.slice(0,e))?r:""}const bt=[Qt.lineWrapping],yt=new Set(["python","markdown","sql","json","yaml","toml","shell","javascript","typescript","jsx","tsx","css","html"]),jt=r=>{const e=D.c(9),{code:t,language:s}=r,{createNewCell:n}=Kt(),a=Gt(),l=ce(Zt);let i;e[0]!==l||e[1]!==t||e[2]!==n||e[3]!==s||e[4]!==a?(i=()=>{const u=(function(p,h){return p?p==="python"?{language:p,code:h}:p==="sql"?{language:"python",code:tr.fromQuery(h)}:p==="markdown"?{language:"python",code:rr.fromMarkdown(h)}:p==="shell"||p==="bash"?{language:"python",code:`import subprocess
2
- subprocess.run("${h}")`}:{language:"python",code:`_${p} = """
3
- ${h}
4
- """`}:{language:"python",code:h}})(s,t);s==="sql"&&er({autoInstantiate:l,createNewCell:n,fromCellId:a}),n({code:u.code,before:!1,cellId:a??"__end__"})},e[0]=l,e[1]=t,e[2]=n,e[3]=s,e[4]=a,e[5]=i):i=e[5];const c=i;let m,d;return e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(no,{className:"ml-2 h-4 w-4"}),e[6]=m):m=e[6],e[7]!==c?(d=o.jsxs(W,{size:"xs",variant:"outline",onClick:c,children:["Add to Notebook",m]}),e[7]=c,e[8]=d):d=e[8],d},Nt=r=>{const e=D.c(20),{code:t,language:s}=r,{theme:n}=$t(),[a,l]=f.useState(t);let i,c,m;e[0]!==t?(i=()=>{l(t)},c=[t],e[0]=t,e[1]=i,e[2]=c):(i=e[1],c=e[2]),f.useEffect(i,c),e[3]!==a?(m=async()=>{await qt(a)},e[3]=a,e[4]=m):m=e[4];const d=m,u=n==="dark"?"dark":"light",p=s&&yt.has(s)?s:void 0;let h,g,b,v,x;return e[5]!==u||e[6]!==p||e[7]!==a?(h=o.jsx(f.Suspense,{children:o.jsx(Jt,{theme:u,language:p,className:"cm border rounded overflow-hidden",extensions:bt,value:a,onChange:l})}),e[5]=u,e[6]=p,e[7]=a,e[8]=h):h=e[8],e[9]!==d?(g=o.jsx(St,{size:"xs",variant:"outline",onClick:d,children:"Copy"}),e[9]=d,e[10]=g):g=e[10],e[11]!==s||e[12]!==a?(b=o.jsx(jt,{code:a,language:s}),e[11]=s,e[12]=a,e[13]=b):b=e[13],e[14]!==g||e[15]!==b?(v=o.jsxs("div",{className:"flex justify-end mt-2 space-x-2",children:[g,b]}),e[14]=g,e[15]=b,e[16]=v):v=e[16],e[17]!==h||e[18]!==v?(x=o.jsxs("div",{className:"relative",children:[h,v]}),e[17]=h,e[18]=v,e[19]=x):x=e[19],x},St=r=>{const e=D.c(12);let t,s;e[0]!==r?({onClick:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const[n,a]=f.useState(!1);let l,i,c;e[3]!==n?(l=()=>{n&&setTimeout(()=>a(!1),1e3)},i=[n],e[3]=n,e[4]=l,e[5]=i):(l=e[4],i=e[5]),f.useEffect(l,i),e[6]!==t?(c=u=>{t==null||t(u),a(!0)},e[6]=t,e[7]=c):c=e[7];const m=n?"Copied":"Copy";let d;return e[8]!==s||e[9]!==c||e[10]!==m?(d=o.jsx(W,{...s,onClick:c,children:m}),e[8]=s,e[9]=c,e[10]=m,e[11]=d):d=e[11],d},Ct={code:({children:r,className:e})=>{const t=e==null?void 0:e.replace("language-","");return t&&typeof r=="string"?o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground pl-1",children:t}),o.jsx(Nt,{code:r.trim(),language:t})]}):o.jsx("code",{className:e,children:r})}},_t=[oo],ze=f.memo(r=>{const e=D.c(2),{content:t}=r;let s;return e[0]!==t?(s=o.jsx(vt,{components:Ct,remarkPlugins:_t,className:"mo-markdown-renderer prose dark:prose-invert max-w-none prose-pre:pl-0",children:t}),e[0]=t,e[1]=s):s=e[1],s},(r,e)=>r.content===e.content);ze.displayName="MemoizedMarkdownBlock";const ae=f.memo(({content:r})=>{const e=f.useMemo(()=>{return t=r,Vt.lexer(t).map(s=>s.raw);var t},[r]);return o.jsx(o.Fragment,{children:e.map((t,s)=>o.jsx(ze,{content:t},`markdown-block-${s}`))})});ae.displayName="MarkdownRenderer";const Et=r=>{const e=D.c(13),{reasoning:t,index:s,isStreaming:n}=r,a=s===void 0?0:s,l=n!==void 0&&n,i=l?"reasoning":void 0;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(fe,{className:"h-3 w-3"}),e[0]=c):c=e[0];const m=l?"Thinking":"View reasoning";let d,u,p,h;return e[1]!==t.length||e[2]!==m?(d=o.jsx(Xe,{className:"text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",children:o.jsxs("span",{className:"flex items-center gap-2",children:[c,m," (",t.length," ","chars)"]})}),e[1]=t.length,e[2]=m,e[3]=d):d=e[3],e[4]!==t?(u=o.jsx(Ye,{className:"pb-2 px-2",children:o.jsx("div",{className:"bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",children:o.jsx("div",{className:"pr-6",children:o.jsx(ae,{content:t})})})}),e[4]=t,e[5]=u):u=e[5],e[6]!==d||e[7]!==u?(p=o.jsxs(Be,{value:"reasoning",className:"border-0",children:[d,u]}),e[6]=d,e[7]=u,e[8]=p):p=e[8],e[9]!==a||e[10]!==i||e[11]!==p?(h=o.jsx(Ve,{type:"single",collapsible:!0,className:"w-full mb-2",value:i,children:p},a),e[9]=a,e[10]=i,e[11]=p,e[12]=h):h=e[12],h},De=r=>{const e=D.c(32),{toolName:t,result:s,error:n,index:a,state:l}=r,i=a===void 0?0:a,c=l==="output-available"&&(s||n),m=n?"error":c?"success":"loading";let d;e[0]!==m?(d=()=>{switch(m){case"loading":return o.jsx($e,{className:"h-3 w-3 animate-spin"});case"error":return o.jsx(nr,{className:"h-3 w-3 text-destructive"});case"success":return o.jsx($r,{className:"h-3 w-3 text-green-600"});default:return o.jsx(or,{className:"h-3 w-3"})}},e[0]=m,e[1]=d):d=e[1];const u=d;let p;e[2]!==n||e[3]!==c||e[4]!==m?(p=()=>m==="loading"?"Running: ":n?"Failed: ":c?"Done: ":"Tool call",e[2]=n,e[3]=c,e[4]=m,e[5]=p):p=e[5];const h=p,g=`tool-${i}`,b=m==="error"&&"text-destructive/80",v=m==="success"&&"text-green-600/80";let x,y;e[6]!==b||e[7]!==v?(x=V("h-6 text-xs border-border shadow-none! ring-0! bg-muted hover:bg-muted/30 py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180",b,v),e[6]=b,e[7]=v,e[8]=x):x=e[8],e[9]!==u?(y=u(),e[9]=u,e[10]=y):y=e[10];const _=h();let S,E,C,k,T,N,A;return e[11]!==t?(S=o.jsx("code",{className:"font-mono text-xs",children:t}),e[11]=t,e[12]=S):S=e[12],e[13]!==S||e[14]!==y||e[15]!==_?(E=o.jsxs("span",{className:"flex items-center gap-1",children:[y,_,":"," ",S]}),e[13]=S,e[14]=y,e[15]=_,e[16]=E):E=e[16],e[17]!==E||e[18]!==x?(C=o.jsx(Xe,{className:x,children:E}),e[17]=E,e[18]=x,e[19]=C):C=e[19],e[20]!==n||e[21]!==c||e[22]!==s?(k=c&&o.jsxs("div",{className:"space-y-3",children:[s!=null&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-medium text-muted-foreground mt-2 mb-1",children:"Result:"}),o.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:typeof s=="string"?s:JSON.stringify(s,null,2)})]}),n&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-medium text-destructive mb-1",children:"Error:"}),o.jsx("div",{className:"bg-destructive/10 border border-destructive/20 rounded-md p-3 text-sm text-destructive",children:n})]})]}),e[20]=n,e[21]=c,e[22]=s,e[23]=k):k=e[23],e[24]!==k?(T=o.jsx(Ye,{className:"pb-2 px-2",children:k}),e[24]=k,e[25]=T):T=e[25],e[26]!==C||e[27]!==T?(N=o.jsxs(Be,{value:"tool-call",className:"border-0",children:[C,T]}),e[26]=C,e[27]=T,e[28]=N):N=e[28],e[29]!==N||e[30]!==g?(A=o.jsx(Ve,{type:"single",collapsible:!0,className:"w-full",children:N},g),e[29]=N,e[30]=g,e[31]=A):A=e[31],A},Rt=new Set(["openai","google","anthropic"]),Tt=["image/*","text/*"],kt=({onNewChat:r,activeChatId:e,setActiveChat:t})=>{const{handleClick:s}=Ze(),n=ce(Ge),a=f.useMemo(()=>[...n.chats.values()].sort((l,i)=>i.updatedAt-l.updatedAt),[n.chats]);return o.jsxs("div",{className:"flex border-b px-2 py-1 justify-between shrink-0 items-center",children:[o.jsx(ee,{content:"New chat",children:o.jsx(W,{variant:"text",size:"icon",onClick:r,children:o.jsx(Mr,{className:"h-4 w-4"})})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ee,{content:"AI Settings",children:o.jsx(W,{variant:"text",size:"xs",className:"hover:bg-foreground/10 py-2",onClick:()=>s("ai"),children:o.jsx(Or,{className:"h-4 w-4"})})}),o.jsxs(Hr,{children:[o.jsx(ee,{content:"Previous chats",children:o.jsx(Wr,{asChild:!0,children:o.jsx(W,{variant:"text",size:"icon",children:o.jsx(Fr,{className:"h-4 w-4"})})})}),o.jsx(Ur,{className:"w-[520px] p-0",align:"start",side:"right",children:o.jsx(Ae,{className:"h-[500px] p-4",children:o.jsxs("div",{className:"space-y-4",children:[a.length===0&&o.jsx(et,{title:"No chats yet",description:"Start a new chat to get started",icon:o.jsx(fe,{})}),a.map(l=>o.jsxs("button",{className:V("w-full p-3 rounded-md cursor-pointer hover:bg-accent text-left",l.id===e&&"bg-accent"),onClick:()=>{t(l.id)},type:"button",children:[o.jsx("div",{className:"font-medium",children:l.title}),o.jsx("div",{className:"text-sm text-muted-foreground",children:Xr(l.updatedAt)})]},l.id))]})})})]})]})]})},Me=f.memo(r=>{const e=D.c(15),{message:t,index:s,onEdit:n,isStreamingReasoning:a,isLast:l}=r;let i;e[0]!==s||e[1]!==n?(i=b=>{var _,S;const v=(_=b.parts)==null?void 0:_.filter(At),x=v==null?void 0:v.map(Pt).join(`
5
- `),y=(S=b.parts)==null?void 0:S.filter(It);return o.jsxs("div",{className:"w-[95%] bg-background border p-1 rounded-sm",children:[y==null?void 0:y.map(Lt),o.jsx(Ke,{value:x,placeholder:"Type your message...",onChange:zt,onSubmit:(E,C)=>{C.trim()&&n(s,C)},onClose:Dt},b.id)]})},e[0]=s,e[1]=n,e[2]=i):i=e[2];const c=i;let m;e[3]!==l||e[4]!==a?(m=b=>{const v=b.parts.filter(Mt).map(Ot).join(`
6
- `);return o.jsxs("div",{className:"w-[95%] break-words",children:[o.jsx("div",{className:"absolute right-1 top-1 opacity-0 group-hover:opacity-100 transition-opacity",children:o.jsx(Nr,{className:"h-3 w-3",value:v||""})}),b.parts.map((x,y)=>{if((function(_){return _.type.startsWith("tool-")})(x))return o.jsx(De,{index:y,toolName:x.type,result:x.output,state:x.state},y);switch(x.type){case"text":return o.jsx(ae,{content:x.text},y);case"reasoning":return o.jsx(Et,{reasoning:x.text,index:y,isStreaming:l&&a&&y===(b.parts.length||0)-1},y);case"dynamic-tool":return o.jsx(De,{index:y,toolName:x.type,result:x.output,state:x.state},y);case"data-reasoning-signature":return null;default:if(x.type.startsWith("data-"))return J.log("Found data part",x),null;J.error("Unhandled part type:",x.type);try{return o.jsx(ae,{content:JSON.stringify(x,null,2)},y)}catch(_){const S=_;return J.error("Error rendering part:",x.type,S),null}}})]})},e[3]=l,e[4]=a,e[5]=m):m=e[5];const d=m,u=t.role==="user"?"justify-end":"justify-start";let p,h,g;return e[6]!==u?(p=V("flex group relative",u),e[6]=u,e[7]=p):p=e[7],e[8]!==t||e[9]!==d||e[10]!==c?(h=t.role==="user"?c(t):d(t),e[8]=t,e[9]=d,e[10]=c,e[11]=h):h=e[11],e[12]!==p||e[13]!==h?(g=o.jsx("div",{className:p,children:h}),e[12]=p,e[13]=h,e[14]=g):g=e[14],g});Me.displayName="ChatMessage";const Oe=f.memo(r=>{var le;const e=D.c(34),{isEmpty:t,onSendClick:s,isLoading:n,onStop:a,fileInputRef:l,onAddFiles:i,onAddContext:c}=r,m=ce(ar),d=(m==null?void 0:m.mode)||"manual",u=((le=m==null?void 0:m.models)==null?void 0:le.chat_model)||lr,p=ir.parse(u).providerId,{saveModeChange:h}=cr();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[{value:"ask",label:"Ask",subtitle:"Use AI with access to read-only tools like documentation search"},{value:"manual",label:"Manual",subtitle:"Pure chat, no tool usage"}],e[0]=g):g=e[0];const b=g,v=Rt.has(p);let x,y,_,S,E,C,k,T,N;e[1]!==d?(x=o.jsx(Sr,{className:"h-6 text-xs border-border shadow-none! ring-0! bg-muted hover:bg-muted/30 py-0 px-2 gap-1 capitalize",children:d}),e[1]=d,e[2]=x):x=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Cr,{children:"AI Mode"}),e[3]=y):y=e[3],e[4]!==b?(_=o.jsx(dr,{children:o.jsxs(mr,{children:[y,b.map(Ht)]})}),e[4]=b,e[5]=_):_=e[5],e[6]!==d||e[7]!==h||e[8]!==x||e[9]!==_?(S=o.jsx(_r,{feature:"mcp_docs",children:o.jsxs(Er,{value:d,onValueChange:h,children:[x,_]})}),e[6]=d,e[7]=h,e[8]=x,e[9]=_,e[10]=S):S=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx(Rr,{placeholder:"Model",triggerClassName:"h-6 text-xs shadow-none! ring-0! bg-muted hover:bg-muted/30 rounded-sm",iconSize:"small",showAddCustomModelDocs:!0,forRole:"chat"}),e[11]=E):E=e[11],e[12]!==S?(C=o.jsxs("div",{className:"flex items-center gap-2",children:[S,E]}),e[12]=S,e[13]=C):C=e[13],e[14]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(Tr,{className:"h-3.5 w-3.5"}),e[14]=k):k=e[14],e[15]!==c?(T=o.jsx(ee,{content:"Add context",children:o.jsx(W,{variant:"text",size:"icon",onClick:c,children:k})}),e[15]=c,e[16]=T):T=e[16],e[17]!==l||e[18]!==v||e[19]!==i?(N=v&&o.jsxs(o.Fragment,{children:[o.jsx(ee,{content:"Attach a file",children:o.jsx(W,{variant:"text",size:"icon",className:"cursor-pointer",onClick:()=>{var U;return(U=l.current)==null?void 0:U.click()},title:"Attach a file",children:o.jsx(kr,{className:"h-3.5 w-3.5"})})}),o.jsx(Ar,{ref:l,type:"file",multiple:!0,hidden:!0,onChange:U=>{U.target.files&&i([...U.target.files])},accept:Tt.join(",")})]}),e[17]=l,e[18]=v,e[19]=i,e[20]=N):N=e[20];const A=n?a:s,L=!n&&t;let X,Y,B,G;return e[21]!==n?(X=n?o.jsx(Pr,{className:"h-3 w-3 fill-current"}):o.jsx(Ir,{className:"h-3 w-3"}),e[21]=n,e[22]=X):X=e[22],e[23]!==A||e[24]!==L||e[25]!==X?(Y=o.jsx(ee,{content:"Submit",children:o.jsx(W,{variant:"text",size:"sm",className:"h-6 w-6 p-0 hover:bg-muted/30 cursor-pointer",onClick:A,disabled:L,children:X})}),e[23]=A,e[24]=L,e[25]=X,e[26]=Y):Y=e[26],e[27]!==N||e[28]!==Y||e[29]!==T?(B=o.jsxs("div",{className:"flex flex-row",children:[T,N,Y]}),e[27]=N,e[28]=Y,e[29]=T,e[30]=B):B=e[30],e[31]!==B||e[32]!==C?(G=o.jsx(Qe,{children:o.jsxs("div",{className:"px-3 py-2 border-t border-border/20 flex flex-row items-center justify-between",children:[C,B]})}),e[31]=B,e[32]=C,e[33]=G):G=e[33],G});Oe.displayName="ChatInputFooter";const he=f.memo(r=>{const e=D.c(29),{placeholder:t,input:s,inputClassName:n,setInput:a,onSubmit:l,inputRef:i,isLoading:c,onStop:m,fileInputRef:d,onAddFiles:u,onClose:p}=r;let h;e[0]!==s||e[1]!==l?(h=()=>{s.trim()&&l(void 0,s)},e[0]=s,e[1]=l,e[2]=h):h=e[2];const g=Q(h);let b;e[3]!==n?(b=V("px-2 py-3 flex-1",n),e[3]=n,e[4]=b):b=e[4];const v=t||"Type your message...";let x,y;e[5]!==s||e[6]!==i||e[7]!==u||e[8]!==p||e[9]!==l||e[10]!==a||e[11]!==v?(x=o.jsx(Ke,{inputRef:i,value:s,onChange:a,onSubmit:l,onClose:p,onAddFiles:u,placeholder:v}),e[5]=s,e[6]=i,e[7]=u,e[8]=p,e[9]=l,e[10]=a,e[11]=v,e[12]=x):x=e[12],e[13]!==b||e[14]!==x?(y=o.jsx("div",{className:b,children:x}),e[13]=b,e[14]=x,e[15]=y):y=e[15];const _=!s.trim();let S,E,C;return e[16]!==i?(S=()=>Lr(i),e[16]=i,e[17]=S):S=e[17],e[18]!==d||e[19]!==g||e[20]!==c||e[21]!==u||e[22]!==m||e[23]!==_||e[24]!==S?(E=o.jsx(Oe,{isEmpty:_,onAddContext:S,onSendClick:g,isLoading:c,onStop:m,fileInputRef:d,onAddFiles:u}),e[18]=d,e[19]=g,e[20]=c,e[21]=u,e[22]=m,e[23]=_,e[24]=S,e[25]=E):E=e[25],e[26]!==y||e[27]!==E?(C=o.jsxs("div",{className:"relative shrink-0 min-h-[80px] flex flex-col border-t",children:[y,E]}),e[26]=y,e[27]=E,e[28]=C):C=e[28],C});he.displayName="ChatInput";let He;tt=()=>{const r=D.c(6),e=ce(sr),{handleClick:t}=Ze();if(!e){let n,a,l;return r[0]!==t?(n=o.jsx(W,{variant:"outline",size:"sm",onClick:()=>t("ai"),children:"Edit AI settings"}),r[0]=t,r[1]=n):n=r[1],r[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(fe,{}),r[2]=a):a=r[2],r[3]!==n?(l=o.jsx(et,{title:"Chat with AI",description:"AI is currently disabled. Add your API key to enable.",action:n,icon:a}),r[3]=n,r[4]=l):l=r[4],l}let s;return r[5]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(He,{}),r[5]=s):s=r[5],s},He=()=>{const r=ur(Ge),[e,t]=pr(Br),[s,n]=f.useState(""),[a,l]=f.useState(""),[i,c]=f.useState(),m=f.useRef(null),d=f.useRef(null),u=f.useRef(null),p=f.useRef(null),h=f.useRef(null),g=hr(),{invokeAiTool:b}=fr(),v=e==null?void 0:e.id,{messages:x,sendMessage:y,error:_,status:S,regenerate:E,stop:C,addToolResult:k,id:T}=xr({id:v,sendAutomaticallyWhen:({messages:w})=>{var I;if(w.length===0)return!1;const j=w[w.length-1],R=j.parts;if(R.length===0||j.role!=="assistant")return!1;const z=R.filter(H=>H.type.startsWith("tool-")).some(H=>H.state==="output-available"),O=R[R.length-1],P=O.type==="text"&&((I=O.text)==null?void 0:I.trim().length)>0;return z&&!P},messages:(e==null?void 0:e.messages)||[],transport:new gr({api:g.getAiURL("chat").toString(),headers:g.headers(),prepareSendMessagesRequest:async w=>{function j(P){return P.map(I=>I.type==="text"?I.text:"").join(`
7
- `)}const R=j(w.messages.flatMap(P=>P.parts)),z=await vr({input:R});function O(P,I){const H=P.parts;return I&&H.push(...z.attachments),{role:P.role,content:j(P.parts),parts:H}}return{body:{...w,...z.body,messages:w.messages.map((P,I)=>({...P,...O(P,I===w.messages.length-1)}))}}}}),onFinish:({messages:w})=>{r(j=>(({chatState:R,chatId:z,messages:O})=>{if(!z)return J.warn("No active chat"),R;const P=R.chats.get(z);if(!P)return J.warn("No active chat"),R;const I=new Map(R.chats),H=Date.now();return I.set(P.id,{...P,messages:O,updatedAt:H}),{...R,chats:I}})({chatState:j,chatId:j.activeChatId,messages:w}))},onToolCall:async({toolCall:w})=>{try{const j=await b({toolName:w.toolName,arguments:w.input});k({tool:w.toolName,toolCallId:w.toolCallId,output:j.result||j.error})}catch(j){J.error("Tool call failed:",j),k({tool:w.toolName,toolCallId:w.toolCallId,output:`Error: ${j instanceof Error?j.message:String(j)}`})}},onError:w=>{J.error("An error occurred:",w)}}),N=Q(w=>{if(w.length===0)return;let j=0;for(const R of w)j+=R.size;j>52428800?wr({title:"File size exceeds 50MB limit",description:"Please remove some files and try again."}):c(R=>[...R??[],...w])}),A=Q(w=>{i&&c(i.filter(j=>j!==w))}),L=S==="submitted"||S==="streaming",X=L&&x.length>0&&br(x);f.useEffect(()=>{requestAnimationFrame(()=>{if(u.current){const w=u.current;w.scrollTop=w.scrollHeight}})},[v]);const Y=Q(()=>{t(null),n(""),l(""),c(void 0)}),B=Q((w,j)=>{var P;const R=x[w],z=(P=R.parts)==null?void 0:P.filter(I=>I.type==="file"),O=R.id;y({messageId:O,role:"user",parts:[{type:"text",text:j},...z]})}),G=Q(async(w,j)=>{var z;if(!j.trim())return;(z=d.current)!=null&&z.view&&qe(d.current.view);const R=i?await Je(i):void 0;w==null||w.preventDefault(),y({text:j,files:R}),n(""),c(void 0)}),le=Q(()=>{var w;a.trim()&&((w=m.current)!=null&&w.view&&qe(m.current.view),(async(j,R)=>{const z=Date.now(),O={id:T,title:zr(j),messages:[],createdAt:z,updatedAt:z};r(I=>{const H=new Map(I.chats);return H.set(O.id,O),{...I,chats:H,activeChatId:O.id}});const P=R&&R.length>0?await Je(R):void 0;y({role:"user",parts:[{type:"text",text:j},...P??[]]}),c(void 0),n("")})(a.trim(),i))}),U=x.length===0,We=U?o.jsx(he,{placeholder:`Ask anything, ${Dr} to include context about tables or dataframes`,input:a,inputRef:m,inputClassName:"px-1 py-0",setInput:l,onSubmit:le,isLoading:L,onStop:C,fileInputRef:p,onAddFiles:N,onClose:()=>{var w,j;return(j=(w=m.current)==null?void 0:w.editor)==null?void 0:j.blur()}},"new-thread-input"):o.jsx(he,{input:s,setInput:n,onSubmit:G,inputRef:d,isLoading:L,onStop:C,onClose:()=>{var w,j;return(j=(w=d.current)==null?void 0:w.editor)==null?void 0:j.blur()},fileInputRef:p,onAddFiles:N}),Fe=i&&i.length>0&&o.jsx("div",{className:V("flex flex-row gap-1 flex-wrap p-1",U&&"py-2 px-1"),children:i==null?void 0:i.map(w=>o.jsx(ht,{file:w,onRemove:()=>A(w)},w.name))});return o.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[o.jsx(Qe,{children:o.jsx(kt,{onNewChat:Y,activeChatId:e==null?void 0:e.id,setActiveChat:t})}),o.jsxs("div",{className:"flex-1 px-3 bg-(--slate-1) gap-4 py-3 flex flex-col overflow-y-auto",ref:u,children:[U&&o.jsxs("div",{className:"rounded-md border bg-background",children:[Fe,We]}),x.map((w,j)=>o.jsx(Me,{message:w,index:j,onEdit:B,isStreamingReasoning:X,isLast:j===x.length-1},w.id)),L&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx($e,{className:"h-4 w-4 animate-spin"})}),_&&o.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[o.jsx(yr,{error:_}),o.jsx(W,{variant:"outline",size:"sm",onClick:()=>{E()},children:"Retry"})]}),o.jsx("div",{ref:h})]}),L&&o.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:o.jsx(W,{variant:"linkDestructive",size:"sm",onClick:C,children:"Stop"})}),!U&&o.jsxs(o.Fragment,{children:[Fe,We]})]})};function At(r){return r.type==="text"}function Pt(r){return r.text}function It(r){return r.type==="file"}function Lt(r,e){return o.jsx(pt,{attachment:r},e)}function zt(){}function Dt(){}function Mt(r){return r.type==="text"}function Ot(r){return r.text}function Ht(r){return o.jsx(jr,{value:r.value,className:"text-xs",children:o.jsxs("div",{className:"flex flex-col",children:[r.label,o.jsx("div",{className:"text-muted-foreground text-xs pt-1 block",children:r.subtitle})]})},r.value)}});export{ao as __tla,tt as default};
@@ -1 +0,0 @@
1
- .mo-markdown-renderer{h1,h2,h3,h4,h5,h6{margin-top:10px}hr{margin-bottom:12px;margin-top:8px}}
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as t,C as o}from"./chunk-K7UQS3LO-DxaMrGgG.js";import{_ as e}from"./mermaid.core-4nVOEVX3.js";import"./transform-D9VCJYws.js";import"./chunk-FMBD7UC4-R5o-nSiG.js";import"./chunk-55IACEB6-DdzvO3HR.js";import"./chunk-QN33PNHL-DqS9-FYm.js";import"./index-OC46250R.js";import"./step-BwsUM5iJ.js";import"./timer-Bqd5yn_a.js";var i={parser:t,get db(){return new o},renderer:s,styles:a,init:e(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as t,C as o}from"./chunk-K7UQS3LO-DxaMrGgG.js";import{_ as e}from"./mermaid.core-4nVOEVX3.js";import"./transform-D9VCJYws.js";import"./chunk-FMBD7UC4-R5o-nSiG.js";import"./chunk-55IACEB6-DdzvO3HR.js";import"./chunk-QN33PNHL-DqS9-FYm.js";import"./index-OC46250R.js";import"./step-BwsUM5iJ.js";import"./timer-Bqd5yn_a.js";var i={parser:t,get db(){return new o},renderer:s,styles:a,init:e(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
@@ -1 +0,0 @@
1
- import{b as n}from"./_baseUniq-Dk7ZPJ3N.js";function o(r){return n(r,4)}export{o as c};
@@ -1 +0,0 @@
1
- import{a as nt,r as Nt,cb as Rt,ak as $t,cc as zt,al as It,cd as Pt,ce as Ut,B as St,cf as Vt,cg as Jt,ch as Ot,ci as Tt,j as a,cj as vt,ck as Kt,cl as Lt,cm as Qt,cn as Wt,co as Xt,br as Ht,cp as At,cq as Dt,bb as Yt,bJ as Zt,__tla as te}from"./index-OC46250R.js";import{c as ee,u as oe,b as ie,__tla as le}from"./edit-page-DJ8kJZ9w.js";import{g as re}from"./links-CbvGxbsJ.js";import{__tla as ae}from"./storage-CGlP4lCF.js";import"./index-Dt9UWeWn.js";import"./index-BAH034Ue.js";import"./index-DqzMPAC8.js";import"./index-DSU75csX.js";import"./index-CSgxTUzD.js";import"./index-BLu5CX6z.js";import"./index-B8llrTSo.js";import"./index-CPN7TRA1.js";import"./index-BFSnz7iM.js";import"./index-Bq516OmX.js";import"./index-CB2pnVQG.js";import"./index-DWOaniGT.js";import"./index-c6If577Q.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asn1-DWPaVWf6.js";import"./brainfuck-CtZaYBKt.js";import"./cobol-stawOqaz.js";import"./clike-BgBwzOhw.js";import"./clojure-DiuoqK-z.js";import"./css-ZjFoif2m.js";import"./cmake-DXn5xaP-.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./cypher-gJDei3ni.js";import"./python-DD-Q2bae.js";import"./crystal-CRzZ78HM.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./simple-mode-C3vEBAcb.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./mllike-3c2dg9RT.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./idl-pcmmZuaN.js";import"./javascript-BpzJj0-u.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mirc-DkvFAiy5.js";import"./mathematica-IIbmv7SK.js";import"./modelica-DSrSSXCg.js";import"./mumps-zvxmGV4l.js";import"./mbox-z_N2Mo3d.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./pug-BTvK5tSS.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./rpm-DI_rRufH.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./sparql-BRLJFz69.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./verilog-B4LBqg_1.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./ttcn-cfg-CKJxb-l2.js";import"./turtle-BkSuIpt-.js";import"./webidl-CGwyPRYs.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./vhdl-CWWH2SUo.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./mscgen-B2igx18G.js";import"./index-DMomwMcN.js";import"./trash-UBqfK4mR.js";import"./_createAggregator-Bn38fDd3.js";import"./_baseEach-C1FLm7WW.js";import{__tla as ne}from"./loro_wasm_bg-C1ks32Vm.js";let qt,pe=Promise.all([(()=>{try{return te}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return ne}catch{}})()]).then(async()=>{function Bt(){const e=nt.c(7);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[r,C]=(function(m,h){const l=nt.c(11);let _;l[0]!==h?(_=new Rt(h),l[0]=h,l[1]=_):_=l[1];const u=_;let x;l[2]!==m||l[3]!==u?(x=()=>u.get(m),l[2]=m,l[3]=u,l[4]=x):x=l[4];const[b,j]=Nt.useState(x);let g;l[5]!==m||l[6]!==u?(g=w=>{j(w),u.set(m,w)},l[5]=m,l[6]=u,l[7]=g):g=l[7];const f=g;let y;return l[8]!==f||l[9]!==b?(y=[b,f],l[8]=f,l[9]=b,l[10]=y):y=l[10],y})("marimo:commands",s);let c,n;return e[1]!==r||e[2]!==C?(c=m=>{const h=(l=[m,...r],[...new Set(l)]);var l;C(h.slice(0,3))},e[1]=r,e[2]=C,e[3]=c):c=e[3],e[4]!==r||e[5]!==c?(n={recentCommands:r,addRecentCommand:c},e[4]=r,e[5]=c,e[6]=n):n=e[6],n}function xt(e){return e.dropdown!==void 0}function P(e,s=""){return e.flatMap(r=>r.label?xt(r)?P(r.dropdown,`${s+r.label} > `):{...r,label:s+r.label}:[])}function Et(e){return!e.hidden}qt=()=>{const e=nt.c(37),[s,r]=Pt(ee),C=Ut(),c=St(Vt),n=St(Jt);let m;e[0]!==c?(m={cell:c},e[0]=c,e[1]=m):m=e[1];let h=oe(m).flat();h=P(h);const l=(function(){const t=nt.c(73),[o,k]=$t(),[p,q]=zt(),{saveAppConfig:S,saveUserConfig:bt}=It();let O;t[0]!==bt||t[1]!==k?(O=async d=>{await bt({config:d}).then(()=>{k(d)})},t[0]=bt,t[1]=k,t[2]=O):O=t[2];const i=O;let T;t[3]!==S||t[4]!==q?(T=async d=>{await S({config:d}).then(()=>{q(d)})},t[3]=S,t[4]=q,t[5]=T):T=t[5];const I=T;let K;if(t[6]!==p||t[7]!==o||t[8]!==I||t[9]!==i){let d,L,Q,W,X;t[11]!==p?(d=at=>at!==p.width,t[11]=p,t[12]=d):d=t[12],t[13]!==p||t[14]!==I?(L=at=>({label:`App config > Set width=${at}`,handle:()=>{I({...p,width:at})}}),t[13]=p,t[14]=I,t[15]=L):L=t[15],t[16]!==o||t[17]!==i?(Q={label:"Config > Set theme: dark",handle:()=>{i({...o,display:{...o.display,theme:"dark"}})}},t[16]=o,t[17]=i,t[18]=Q):Q=t[18],t[19]!==o||t[20]!==i?(W={label:"Config > Set theme: light",handle:()=>{i({...o,display:{...o.display,theme:"light"}})}},t[19]=o,t[20]=i,t[21]=W):W=t[21],t[22]!==o||t[23]!==i?(X={label:"Config > Set theme: system",handle:()=>{i({...o,display:{...o.display,theme:"system"}})}},t[22]=o,t[23]=i,t[24]=X):X=t[24];const gt=o.keymap.preset==="vim";let B,Y;t[25]!==o||t[26]!==i?(B=()=>{i({...o,keymap:{...o.keymap,preset:"vim"}})},t[25]=o,t[26]=i,t[27]=B):B=t[27],t[28]!==gt||t[29]!==B?(Y={label:"Config > Switch keymap to VIM",hidden:gt,handle:B},t[28]=gt,t[29]=B,t[30]=Y):Y=t[30];const ft=o.keymap.preset==="default";let E,Z,F;t[31]!==o||t[32]!==i?(E=()=>{i({...o,keymap:{...o.keymap,preset:"default"}})},t[31]=o,t[32]=i,t[33]=E):E=t[33],t[34]!==ft||t[35]!==E?(Z={label:"Config > Switch keymap to default (current: VIM)",hidden:ft,handle:E},t[34]=ft,t[35]=E,t[36]=Z):Z=t[36],t[37]!==o||t[38]!==i?(F=()=>{i({...o,completion:{...o.completion,copilot:!1}})},t[37]=o,t[38]=i,t[39]=F):F=t[39];const yt=o.completion.copilot!=="github";let tt,G;t[40]!==F||t[41]!==yt?(tt={label:"Config > Disable GitHub Copilot",handle:F,hidden:yt},t[40]=F,t[41]=yt,t[42]=tt):tt=t[42],t[43]!==o||t[44]!==i?(G=()=>{i({...o,completion:{...o.completion,copilot:"github"}})},t[43]=o,t[44]=i,t[45]=G):G=t[45];const _t=o.completion.copilot==="github";let et;t[46]!==G||t[47]!==_t?(et={label:"Config > Enable GitHub Copilot",handle:G,hidden:_t},t[46]=G,t[47]=_t,t[48]=et):et=t[48];const jt=!o.display.reference_highlighting;let M,ot,N,it;t[49]!==o||t[50]!==i?(M=()=>{i({...o,display:{...o.display,reference_highlighting:!1}})},t[49]=o,t[50]=i,t[51]=M):M=t[51],t[52]!==jt||t[53]!==M?(ot={label:"Config > Disable reference highlighting",hidden:jt,handle:M},t[52]=jt,t[53]=M,t[54]=ot):ot=t[54],t[55]!==o||t[56]!==i?(N=()=>{i({...o,display:{...o.display,reference_highlighting:!0}})},t[55]=o,t[56]=i,t[57]=N):N=t[57],t[58]!==o.display.reference_highlighting||t[59]!==N?(it={label:"Config > Enable reference highlighting",hidden:o.display.reference_highlighting,handle:N},t[58]=o.display.reference_highlighting,t[59]=N,t[60]=it):it=t[60];const kt=o.display.cell_output==="above";let R,lt;t[61]!==o||t[62]!==i?(R=()=>{i({...o,display:{...o.display,cell_output:"above"}})},t[61]=o,t[62]=i,t[63]=R):R=t[63],t[64]!==kt||t[65]!==R?(lt={label:"Config > Set cell output area: above",hidden:kt,handle:R},t[64]=kt,t[65]=R,t[66]=lt):lt=t[66];const Ct=o.display.cell_output==="below";let $,rt;t[67]!==o||t[68]!==i?($=()=>{i({...o,display:{...o.display,cell_output:"below"}})},t[67]=o,t[68]=i,t[69]=$):$=t[69],t[70]!==Ct||t[71]!==$?(rt={label:"Config > Set cell output area: below",hidden:Ct,handle:$},t[70]=Ct,t[71]=$,t[72]=rt):rt=t[72],K=[...re().filter(d).map(L),Q,W,X,Y,Z,tt,et,ot,it,lt,rt].filter(Et),t[6]=p,t[7]=o,t[8]=I,t[9]=i,t[10]=K}else K=t[10];return K})();let _=ie();_=[...P(_),...P(l)];const u=_.filter(Ft),x=Ot.keyBy(u,Gt),{recentCommands:b,addRecentCommand:j}=Bt();let g;e[2]!==b?(g=new Set(b),e[2]=b,e[3]=g):g=e[3];const f=g;let y,w;e[4]!==n||e[5]!==r?(y=t=>{Xt(n.getHotkey("global.commandPalette").key)(t)&&(t.preventDefault(),r(Mt))},e[4]=n,e[5]=r,e[6]=y):y=e[6],Tt(document,"keydown",y),e[7]!==j||e[8]!==n||e[9]!==C||e[10]!==r?(w=(t,o)=>{const k=C[t];if(!k)return null;const p=n.getHotkey(t);return a.jsxs(Ht,{disabled:o.disabled,onSelect:()=>{j(t),r(!1),requestAnimationFrame(()=>{k()})},value:p.name,children:[a.jsxs("span",{children:[p.name,o.tooltip&&a.jsx("span",{className:"ml-2",children:o.tooltip})]}),a.jsx(At,{children:a.jsx(Dt,{shortcut:p.key})})]},t)},e[7]=j,e[8]=n,e[9]=C,e[10]=r,e[11]=w):w=e[11];const wt=w;let U;e[12]!==j||e[13]!==n||e[14]!==r?(U=t=>{const{label:o,handle:k,props:p,hotkey:q}=t,S=p===void 0?{}:p;return a.jsxs(Ht,{disabled:S.disabled,onSelect:()=>{j(o),r(!1),requestAnimationFrame(()=>{k()})},value:o,children:[a.jsxs("span",{children:[o,S.tooltip&&a.jsxs("span",{className:"ml-2",children:["(",S.tooltip,")"]})]}),q&&a.jsx(At,{children:a.jsx(Dt,{shortcut:n.getHotkey(q).key})})]},o)},e[12]=j,e[13]=n,e[14]=r,e[15]=U):U=e[15];const z=U,pt=Wt;let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Yt,{placeholder:"Type to search..."}),e[16]=v):v=e[16];const mt=Qt;let H;e[17]===Symbol.for("react.memo_cache_sentinel")?(H=a.jsx(Zt,{children:"No results found."}),e[17]=H):H=e[17];const st=b.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(vt,{heading:"Recently Used",children:b.map(t=>{const o=x[t];return Kt(t)?wt(t,{disabled:o==null?void 0:o.disabled,tooltip:o==null?void 0:o.tooltip}):o&&!xt(o)?z({label:o.label,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip}}):null})}),a.jsx(Lt,{})]}),ct=vt,dt=n.iterate().map(t=>{if(f.has(t))return null;const o=x[t];return wt(t,{disabled:o==null?void 0:o.disabled,tooltip:o==null?void 0:o.tooltip})}),ht=u.map(t=>f.has(t.label)?null:z({label:t.label,handle:t.handleHeadless||t.handle,props:{disabled:t.disabled,tooltip:t.tooltip}}));let V;e[18]!==f||e[19]!==z?(V=t=>f.has(t.label)?null:z({label:`Cell > ${t.label}`,handle:t.handleHeadless||t.handle,props:{disabled:t.disabled,tooltip:t.tooltip}}),e[18]=f,e[19]=z,e[20]=V):V=e[20];const ut=h.map(V);let A,D,J;return e[21]!==ct||e[22]!==ht||e[23]!==ut||e[24]!==dt?(A=a.jsxs(ct,{heading:"Commands",children:[dt,ht,ut]}),e[21]=ct,e[22]=ht,e[23]=ut,e[24]=dt,e[25]=A):A=e[25],e[26]!==mt||e[27]!==A||e[28]!==H||e[29]!==st?(D=a.jsxs(mt,{children:[H,st,A]}),e[26]=mt,e[27]=A,e[28]=H,e[29]=st,e[30]=D):D=e[30],e[31]!==pt||e[32]!==s||e[33]!==r||e[34]!==D||e[35]!==v?(J=a.jsxs(pt,{open:s,onOpenChange:r,children:[v,D]}),e[31]=pt,e[32]=s,e[33]=r,e[34]=D,e[35]=v,e[36]=J):J=e[36],J};function Ft(e){return!e.hotkey}function Gt(e){return e.label}function Mt(e){return!e}});export{pe as __tla,qt as default};
@@ -1 +0,0 @@
1
- import{a as j,ab as v,j as r,ac as w,ad as k,ae as C,K as g,Q as N,S as y,P as b}from"./index-OC46250R.js";const S=x=>{const e=j.c(18),{maxCount:i,cellIds:s,onClick:l,skipScroll:c}=x,d=v();let t,n,o,m;if(e[0]!==s||e[1]!==d||e[2]!==i||e[3]!==l||e[4]!==c){o=Symbol.for("react.early_return_sentinel");e:{let h;e[8]!==d?(h=(a,u)=>d.inOrderIds.indexOf(a)-d.inOrderIds.indexOf(u),e[8]=d,e[9]=h):h=e[9];const f=[...s].sort(h);if(s.length===0){let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=a):a=e[10],o=a;break e}let p;e[11]!==s.length||e[12]!==l||e[13]!==c?(p=(a,u)=>r.jsxs("span",{className:"truncate",children:[r.jsx(g,{variant:"focus",cellId:a,skipScroll:c,className:"whitespace-nowrap",onClick:l?()=>l(a):void 0},a),u<s.length-1&&", "]},a),e[11]=s.length,e[12]=l,e[13]=c,e[14]=p):p=e[14],t=f.slice(0,i).map(p),n=s.length>i&&r.jsxs(w,{children:[r.jsx(k,{asChild:!0,children:r.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",s.length-i," more"]})}),r.jsx(C,{className:"w-auto",children:r.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(i).map(a=>r.jsx(g,{variant:"focus",cellId:a,className:"whitespace-nowrap",onClick:l?()=>l(a):void 0},a))})})]})}e[0]=s,e[1]=d,e[2]=i,e[3]=l,e[4]=c,e[5]=t,e[6]=n,e[7]=o}else t=e[5],n=e[6],o=e[7];return o!==Symbol.for("react.early_return_sentinel")?o:(e[15]!==t||e[16]!==n?(m=r.jsxs(r.Fragment,{children:[t,n]}),e[15]=t,e[16]=n,e[17]=m):m=e[17],m)},_=x=>{const e=j.c(15);let i,s,l,c;e[0]!==x?({name:s,declaredBy:i,onClick:l,...c}=x,e[0]=x,e[1]=i,e[2]=s,e[3]=l,e[4]=c):(i=e[1],s=e[2],l=e[3],c=e[4]);const d=i.length>1?"destructive":"outline";let t,n,o;return e[5]!==s||e[6]!==l?(t=async m=>{l?l(m):(await N(s),y({title:"Copied to clipboard"}))},e[5]=s,e[6]=l,e[7]=t):t=e[7],e[8]!==s||e[9]!==d||e[10]!==t?(n=r.jsx(b,{title:s,variant:d,className:"rounded-sm text-ellipsis block overflow-hidden max-w-fit cursor-pointer font-medium",onClick:t,children:s}),e[8]=s,e[9]=d,e[10]=t,e[11]=n):n=e[11],e[12]!==c||e[13]!==n?(o=r.jsx("div",{className:"max-w-[130px]",...c,children:n}),e[12]=c,e[13]=n,e[14]=o):o=e[14],o};export{S as C,_ as V};