@cagent/chat-embedding-core 0.0.13 → 0.0.14

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 (320) hide show
  1. package/.env +6 -0
  2. package/README.md +213 -213
  3. package/bun.lock +1548 -1548
  4. package/dist/abnfDiagram-VRR7QNED-3cfb3856.js +1 -0
  5. package/dist/abnfDiagram-VRR7QNED-686410b0.js +1 -0
  6. package/dist/abnfDiagram-VRR7QNED-fb22812d.js +1 -0
  7. package/dist/api/chatRoom.d.ts.map +1 -0
  8. package/dist/arc-24dd4755.js +1 -0
  9. package/dist/arc-5d6257cf.js +1 -0
  10. package/dist/arc-90e71e7e.js +1 -0
  11. package/dist/architecture-TIHT7OUA-a997f441.js +1 -0
  12. package/dist/architecture-TIHT7OUA-faa1f9b3.js +1 -0
  13. package/dist/architectureDiagram-ZJ3FMSHR-87443299.js +1 -0
  14. package/dist/architectureDiagram-ZJ3FMSHR-93988e41.js +1 -0
  15. package/dist/architectureDiagram-ZJ3FMSHR-bde2dd21.js +1 -0
  16. package/dist/blockDiagram-677ZJIJ3-25a94a47.js +1 -0
  17. package/dist/blockDiagram-677ZJIJ3-88bd543c.js +1 -0
  18. package/dist/blockDiagram-677ZJIJ3-c769a3c8.js +1 -0
  19. package/dist/c4Diagram-LMCZKHZV-763880d7.js +1 -0
  20. package/dist/c4Diagram-LMCZKHZV-d7fc839e.js +1 -0
  21. package/dist/c4Diagram-LMCZKHZV-da04a76e.js +1 -0
  22. package/dist/channel-11d3f4bc.js +1 -0
  23. package/dist/channel-534c2e17.js +1 -0
  24. package/dist/channel-c3cf6060.js +1 -0
  25. package/dist/chunk-2Q5K7J3B-2892df89.js +1 -0
  26. package/dist/chunk-2Q5K7J3B-7960ff8e.js +1 -0
  27. package/dist/chunk-2Q5K7J3B-9497bf31.js +1 -0
  28. package/dist/chunk-32BRIVSS-10123eba.js +1 -0
  29. package/dist/chunk-32BRIVSS-10ac68f7.js +1 -0
  30. package/dist/chunk-32BRIVSS-8a8507a2.js +1 -0
  31. package/dist/chunk-5VM5RSS4-36b32f6e.js +1 -0
  32. package/dist/chunk-5VM5RSS4-4b2efd20.js +1 -0
  33. package/dist/chunk-5VM5RSS4-5fc85a49.js +1 -0
  34. package/dist/chunk-EX3LRPZG-36494b87.js +1 -0
  35. package/dist/chunk-EX3LRPZG-6cd1f2fa.js +1 -0
  36. package/dist/chunk-EX3LRPZG-7ac6d0d7.js +1 -0
  37. package/dist/chunk-JWPE2WC7-15a55950.js +1 -0
  38. package/dist/chunk-JWPE2WC7-84faee3d.js +1 -0
  39. package/dist/chunk-JWPE2WC7-e2521b1e.js +1 -0
  40. package/dist/chunk-MOJQB5TN-47f0392f.js +1 -0
  41. package/dist/chunk-MOJQB5TN-5cc2e61b.js +1 -0
  42. package/dist/chunk-MOJQB5TN-ea88675c.js +1 -0
  43. package/dist/chunk-PUDLZKDR-057ec46a.js +1 -0
  44. package/dist/chunk-PUDLZKDR-53309be9.js +1 -0
  45. package/dist/chunk-PUDLZKDR-6de50ada.js +1 -0
  46. package/dist/chunk-RYQCIY6F-06b096c5.js +1 -0
  47. package/dist/chunk-RYQCIY6F-453400cd.js +1 -0
  48. package/dist/chunk-RYQCIY6F-8de649c8.js +1 -0
  49. package/dist/chunk-V7JOEXUC-4083766f.js +1 -0
  50. package/dist/chunk-V7JOEXUC-4e8d7729.js +1 -0
  51. package/dist/chunk-V7JOEXUC-bb2df9b0.js +1 -0
  52. package/dist/chunk-VR4S4FIN-5feb7571.js +1 -0
  53. package/dist/chunk-VR4S4FIN-9df47127.js +1 -0
  54. package/dist/chunk-VR4S4FIN-c4f2681d.js +1 -0
  55. package/dist/chunk-XXDRQBXY-3c9d8bf9.js +1 -0
  56. package/dist/chunk-XXDRQBXY-de00e988.js +1 -0
  57. package/dist/chunk-XXDRQBXY-f923ffed.js +1 -0
  58. package/dist/classDiagram-OUVF2IWQ-5cdf5fe6.js +1 -0
  59. package/dist/classDiagram-OUVF2IWQ-d51bd736.js +1 -0
  60. package/dist/classDiagram-OUVF2IWQ-fc2b54d6.js +1 -0
  61. package/dist/classDiagram-v2-EOCWNBFH-5cdf5fe6.js +1 -0
  62. package/dist/classDiagram-v2-EOCWNBFH-d51bd736.js +1 -0
  63. package/dist/classDiagram-v2-EOCWNBFH-fc2b54d6.js +1 -0
  64. package/dist/components/Badge.d.ts.map +1 -0
  65. package/dist/components/Bot.d.ts.map +1 -0
  66. package/dist/components/FeedbackContentDialog.d.ts.map +1 -0
  67. package/dist/components/RoomReconnectAlert.d.ts.map +1 -0
  68. package/dist/components/Toast.d.ts.map +1 -0
  69. package/dist/components/TypingBubble.d.ts.map +1 -0
  70. package/dist/components/avatars/Avatar.d.ts.map +1 -0
  71. package/dist/components/avatars/DefaultAvatar.d.ts.map +1 -0
  72. package/dist/components/bubbles/AgentReasoningBubble.d.ts.map +1 -0
  73. package/dist/components/bubbles/BotBubble.d.ts.map +1 -0
  74. package/dist/components/bubbles/ChartBubble.d.ts.map +1 -0
  75. package/dist/components/bubbles/ChartLoadingPlaceholder.d.ts.map +1 -0
  76. package/dist/components/bubbles/ChartPlaceholder.d.ts.map +1 -0
  77. package/dist/components/bubbles/ChartPopupModal.d.ts.map +1 -0
  78. package/dist/components/bubbles/FollowUpPromptBubble.d.ts.map +1 -0
  79. package/dist/components/bubbles/GuestBubble.d.ts.map +1 -0
  80. package/dist/components/bubbles/LeadCaptureBubble.d.ts.map +1 -0
  81. package/dist/components/bubbles/LoadingBubble.d.ts.map +1 -0
  82. package/dist/components/bubbles/SourceBubble.d.ts.map +1 -0
  83. package/dist/components/bubbles/StableChartWrapper.d.ts.map +1 -0
  84. package/dist/components/bubbles/StarterPromptBubble.d.ts.map +1 -0
  85. package/dist/components/buttons/AttachmentUploadButton.d.ts.map +1 -0
  86. package/dist/components/buttons/CancelButton.d.ts.map +1 -0
  87. package/dist/components/buttons/CopyMessageButton.d.ts.map +1 -0
  88. package/dist/components/buttons/EditMessageButton.d.ts.map +1 -0
  89. package/dist/components/buttons/FeedbackButtons.d.ts.map +1 -0
  90. package/dist/components/buttons/ImageUploadButton.d.ts.map +1 -0
  91. package/dist/components/buttons/LeadCaptureButtons.d.ts.map +1 -0
  92. package/dist/components/buttons/PopupToast.d.ts.map +1 -0
  93. package/dist/components/buttons/RecordAudioButton.d.ts.map +1 -0
  94. package/dist/components/buttons/SendButton.d.ts.map +1 -0
  95. package/dist/components/dialogs/EditMessageDialog.d.ts.map +1 -0
  96. package/dist/components/icons/AddImageIcon.d.ts.map +1 -0
  97. package/dist/components/icons/AttachmentIcon.d.ts.map +1 -0
  98. package/dist/components/icons/CheckIcon.d.ts.map +1 -0
  99. package/dist/components/icons/CircleDotIcon.d.ts.map +1 -0
  100. package/dist/components/icons/ClipboardIcon.d.ts.map +1 -0
  101. package/dist/components/icons/CopyIcon.d.ts.map +1 -0
  102. package/dist/components/icons/DeleteIcon.d.ts.map +1 -0
  103. package/dist/components/icons/EditIcon.d.ts.map +1 -0
  104. package/dist/components/icons/FullScreenIcon.d.ts.map +1 -0
  105. package/dist/components/icons/RecordIcon.d.ts.map +1 -0
  106. package/dist/components/icons/ResetZoomIcon.d.ts.map +1 -0
  107. package/dist/components/icons/SendIcon.d.ts.map +1 -0
  108. package/dist/components/icons/SparklesIcon.d.ts.map +1 -0
  109. package/dist/components/icons/StopIcon.d.ts.map +1 -0
  110. package/dist/components/icons/ThumbsDownIcon.d.ts.map +1 -0
  111. package/dist/components/icons/ThumbsUpIcon.d.ts.map +1 -0
  112. package/dist/components/icons/TickIcon.d.ts.map +1 -0
  113. package/dist/components/icons/TrashIcon.d.ts.map +1 -0
  114. package/dist/components/icons/XIcon.d.ts.map +1 -0
  115. package/dist/components/icons/ZoomInIcon.d.ts.map +1 -0
  116. package/dist/components/icons/ZoomOutIcon.d.ts.map +1 -0
  117. package/dist/components/icons/index.d.ts.map +1 -0
  118. package/dist/components/image/PreviewImage.d.ts.map +1 -0
  119. package/dist/components/index.d.ts.map +1 -0
  120. package/dist/components/inputs/textInput/components/FilePreview.d.ts.map +1 -0
  121. package/dist/components/inputs/textInput/components/ShortTextInput.d.ts.map +1 -0
  122. package/dist/components/inputs/textInput/components/TextInput.d.ts.map +1 -0
  123. package/dist/components/inputs/textInput/index.d.ts.map +1 -0
  124. package/dist/constants.d.ts.map +1 -0
  125. package/dist/cose-bilkent-JH36ORCC-ac4d2e28.js +1 -0
  126. package/dist/cose-bilkent-JH36ORCC-c3560feb.js +1 -0
  127. package/dist/cose-bilkent-JH36ORCC-f0ddc3e7.js +1 -0
  128. package/dist/cynefin-VYW2F7L2-2458ad91.js +1 -0
  129. package/dist/cynefin-VYW2F7L2-a8648cf6.js +1 -0
  130. package/dist/cynefinDiagram-TSTJHNR4-62a29383.js +1 -0
  131. package/dist/cynefinDiagram-TSTJHNR4-910b3dfd.js +1 -0
  132. package/dist/cynefinDiagram-TSTJHNR4-deb0bb2c.js +1 -0
  133. package/dist/cytoscape.esm-56d2239f.js +1 -0
  134. package/dist/cytoscape.esm-c9352dc8.js +1 -0
  135. package/dist/dagre-VKFMJZFB-1467d0af.js +1 -0
  136. package/dist/dagre-VKFMJZFB-35daad97.js +1 -0
  137. package/dist/dagre-VKFMJZFB-c5b9a4a0.js +1 -0
  138. package/dist/defaultLocale-b4977250.js +1 -0
  139. package/dist/defaultLocale-e35a4def.js +1 -0
  140. package/dist/diagram-FQU43EPY-41eed431.js +1 -0
  141. package/dist/diagram-FQU43EPY-613e9e4e.js +1 -0
  142. package/dist/diagram-FQU43EPY-d256050e.js +1 -0
  143. package/dist/diagram-G47NLZAW-813bbb70.js +1 -0
  144. package/dist/diagram-G47NLZAW-8ef917d1.js +1 -0
  145. package/dist/diagram-G47NLZAW-aa02607c.js +1 -0
  146. package/dist/diagram-NH7WQ7WH-0af7a921.js +1 -0
  147. package/dist/diagram-NH7WQ7WH-0e4f7f17.js +1 -0
  148. package/dist/diagram-NH7WQ7WH-6f91f6aa.js +1 -0
  149. package/dist/diagram-OA4YK3LP-0fba2475.js +1 -0
  150. package/dist/diagram-OA4YK3LP-587273f4.js +1 -0
  151. package/dist/diagram-OA4YK3LP-6cbfc7a5.js +1 -0
  152. package/dist/diagram-WEI45ONY-0241463f.js +1 -0
  153. package/dist/diagram-WEI45ONY-dd634033.js +1 -0
  154. package/dist/diagram-WEI45ONY-e002e844.js +1 -0
  155. package/dist/ebnfDiagram-CCIWWBDH-20ac4ba3.js +1 -0
  156. package/dist/ebnfDiagram-CCIWWBDH-e9974165.js +1 -0
  157. package/dist/ebnfDiagram-CCIWWBDH-ead44055.js +1 -0
  158. package/dist/erDiagram-Q63AITRT-1febb8fc.js +1 -0
  159. package/dist/erDiagram-Q63AITRT-4ea4b93d.js +1 -0
  160. package/dist/erDiagram-Q63AITRT-bcb00855.js +1 -0
  161. package/dist/eventmodeling-45OFAUF4-a82f1f18.js +1 -0
  162. package/dist/eventmodeling-45OFAUF4-dcf667fc.js +1 -0
  163. package/dist/features/bubble/components/Bubble.d.ts.map +1 -0
  164. package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -0
  165. package/dist/features/bubble/components/Tooltip.d.ts.map +1 -0
  166. package/dist/features/bubble/components/index.d.ts.map +1 -0
  167. package/dist/features/bubble/index.d.ts.map +1 -0
  168. package/dist/features/bubble/types.d.ts.map +1 -0
  169. package/dist/features/full/components/Full.d.ts.map +1 -0
  170. package/dist/features/full/components/index.d.ts.map +1 -0
  171. package/dist/features/full/index.d.ts.map +1 -0
  172. package/dist/features/popup/components/DisclaimerPopup.d.ts.map +1 -0
  173. package/dist/features/popup/components/Popup.d.ts.map +1 -0
  174. package/dist/features/popup/components/index.d.ts.map +1 -0
  175. package/dist/features/popup/index.d.ts.map +1 -0
  176. package/dist/features/popup/types.d.ts.map +1 -0
  177. package/dist/flowDiagram-23GEKE2U-14ee2b3c.js +1 -0
  178. package/dist/flowDiagram-23GEKE2U-7ab9c2e4.js +1 -0
  179. package/dist/flowDiagram-23GEKE2U-f7309569.js +1 -0
  180. package/dist/ganttDiagram-NO4QXBWP-249a167d.js +1 -0
  181. package/dist/ganttDiagram-NO4QXBWP-bd530d12.js +1 -0
  182. package/dist/ganttDiagram-NO4QXBWP-e5e495d6.js +1 -0
  183. package/dist/gitGraph-TEB2WS4Q-72ba3362.js +1 -0
  184. package/dist/gitGraph-TEB2WS4Q-d07b15b3.js +1 -0
  185. package/dist/gitGraphDiagram-IHSO6WYX-2964ff91.js +1 -0
  186. package/dist/gitGraphDiagram-IHSO6WYX-4d9324ad.js +1 -0
  187. package/dist/gitGraphDiagram-IHSO6WYX-97bf868b.js +1 -0
  188. package/dist/graph-0df36b9d.js +1 -0
  189. package/dist/graph-c6801890.js +1 -0
  190. package/dist/index.d.ts.map +1 -0
  191. package/dist/info-DKCQHKI2-d8e8a901.js +1 -0
  192. package/dist/info-DKCQHKI2-dd69502c.js +1 -0
  193. package/dist/infoDiagram-FWYZ7A6U-1267309e.js +1 -0
  194. package/dist/infoDiagram-FWYZ7A6U-5b9d28af.js +1 -0
  195. package/dist/infoDiagram-FWYZ7A6U-cc33afe4.js +1 -0
  196. package/dist/init-b029a625.js +1 -0
  197. package/dist/init-cf76ae07.js +1 -0
  198. package/dist/ishikawaDiagram-FXEZZL3T-3f0977e8.js +1 -0
  199. package/dist/ishikawaDiagram-FXEZZL3T-89c1b2f4.js +1 -0
  200. package/dist/ishikawaDiagram-FXEZZL3T-9fef4653.js +1 -0
  201. package/dist/journeyDiagram-5HDEW3XC-563a68ff.js +1 -0
  202. package/dist/journeyDiagram-5HDEW3XC-c8c8d701.js +1 -0
  203. package/dist/journeyDiagram-5HDEW3XC-e6c5e84b.js +1 -0
  204. package/dist/kanban-definition-HUTT4EX6-3719e367.js +1 -0
  205. package/dist/kanban-definition-HUTT4EX6-7bc0cd1e.js +1 -0
  206. package/dist/kanban-definition-HUTT4EX6-d8b002e3.js +1 -0
  207. package/dist/katex-67456a45.js +1 -0
  208. package/dist/katex-b134d23c.js +1 -0
  209. package/dist/layout-e44354bf.js +1 -0
  210. package/dist/layout-ff5d33a1.js +1 -0
  211. package/dist/linear-7b1a23f3.js +1 -0
  212. package/dist/linear-d7ad6d25.js +1 -0
  213. package/dist/linear-e5c99c88.js +1 -0
  214. package/dist/map-05f0ff95.js +1 -0
  215. package/dist/map-d3292a5b.js +1 -0
  216. package/dist/mermaid-parser.core-6df0beec.js +1 -0
  217. package/dist/mermaid-parser.core-d8d1c2b9.js +1 -0
  218. package/dist/mermaid.core-2d237a1e.js +1 -0
  219. package/dist/mermaid.core-70d5aead.js +1 -0
  220. package/dist/mermaid.core-8797d6a9.js +1 -0
  221. package/dist/mindmap-definition-LN4V7U3C-04a12a88.js +1 -0
  222. package/dist/mindmap-definition-LN4V7U3C-86a890ce.js +1 -0
  223. package/dist/mindmap-definition-LN4V7U3C-f495948c.js +1 -0
  224. package/dist/ordinal-221e41d7.js +1 -0
  225. package/dist/ordinal-4a51e46c.js +1 -0
  226. package/dist/packet-7NZHBO7P-b4586e10.js +1 -0
  227. package/dist/packet-7NZHBO7P-f62750ff.js +1 -0
  228. package/dist/pegDiagram-2B236MQR-234fe6d1.js +1 -0
  229. package/dist/pegDiagram-2B236MQR-2826e278.js +1 -0
  230. package/dist/pegDiagram-2B236MQR-64eeb662.js +1 -0
  231. package/dist/pie-RZYD4A2V-106ba3d7.js +1 -0
  232. package/dist/pie-RZYD4A2V-752eda00.js +1 -0
  233. package/dist/pieDiagram-ENE6RG2P-0c3b09b8.js +1 -0
  234. package/dist/pieDiagram-ENE6RG2P-3fb5f734.js +1 -0
  235. package/dist/pieDiagram-ENE6RG2P-af928526.js +1 -0
  236. package/dist/quadrantDiagram-ABIIQ3AL-1a55c0f5.js +1 -0
  237. package/dist/quadrantDiagram-ABIIQ3AL-3d15c26d.js +1 -0
  238. package/dist/quadrantDiagram-ABIIQ3AL-9110fa9c.js +1 -0
  239. package/dist/queries/sendMessageQuery.d.ts.map +1 -0
  240. package/dist/radar-I7S5WNFK-53bde9ff.js +1 -0
  241. package/dist/radar-I7S5WNFK-87e8c5ba.js +1 -0
  242. package/dist/railroad-3IZDKUUU-99427b9f.js +1 -0
  243. package/dist/railroad-3IZDKUUU-9e29587d.js +1 -0
  244. package/dist/railroad-abnf-AHOZXSZD-1d11cb5b.js +1 -0
  245. package/dist/railroad-abnf-AHOZXSZD-c27db0bc.js +1 -0
  246. package/dist/railroad-ebnf-EBAXGLYW-38dff87c.js +1 -0
  247. package/dist/railroad-ebnf-EBAXGLYW-6bb5de0c.js +1 -0
  248. package/dist/railroad-peg-LSFZ7HO6-c9f0aa71.js +1 -0
  249. package/dist/railroad-peg-LSFZ7HO6-efcb0a43.js +1 -0
  250. package/dist/railroadDiagram-RFXS5EU6-14373a87.js +1 -0
  251. package/dist/railroadDiagram-RFXS5EU6-ec9e696e.js +1 -0
  252. package/dist/railroadDiagram-RFXS5EU6-effa5611.js +1 -0
  253. package/dist/register.d.ts.map +1 -0
  254. package/dist/requirementDiagram-TGXJPOKE-3d199581.js +1 -0
  255. package/dist/requirementDiagram-TGXJPOKE-5a337f1a.js +1 -0
  256. package/dist/requirementDiagram-TGXJPOKE-a7960859.js +1 -0
  257. package/dist/sankeyDiagram-HTMAVEWB-209eac30.js +1 -0
  258. package/dist/sankeyDiagram-HTMAVEWB-3c852fda.js +1 -0
  259. package/dist/sankeyDiagram-HTMAVEWB-46aa1eb1.js +1 -0
  260. package/dist/sequenceDiagram-DBY2YBRQ-4121f7c2.js +1 -0
  261. package/dist/sequenceDiagram-DBY2YBRQ-7bad18e4.js +1 -0
  262. package/dist/sequenceDiagram-DBY2YBRQ-af96f48e.js +1 -0
  263. package/dist/sizeCapture-X5ZJPWSS-13826306.js +1 -0
  264. package/dist/sizeCapture-X5ZJPWSS-32e2eec7.js +1 -0
  265. package/dist/sizeCapture-X5ZJPWSS-a078176f.js +1 -0
  266. package/dist/stateDiagram-2N3HPSRC-527374a2.js +1 -0
  267. package/dist/stateDiagram-2N3HPSRC-8047e124.js +1 -0
  268. package/dist/stateDiagram-2N3HPSRC-ba344b5d.js +1 -0
  269. package/dist/stateDiagram-v2-6OUMAXLB-7580bf69.js +1 -0
  270. package/dist/stateDiagram-v2-6OUMAXLB-d4c58fd3.js +1 -0
  271. package/dist/stateDiagram-v2-6OUMAXLB-e5921044.js +1 -0
  272. package/dist/store/constant.d.ts.map +1 -0
  273. package/dist/swimlanes-5IMT3BWC-5834b232.js +1 -0
  274. package/dist/swimlanes-5IMT3BWC-791a3547.js +1 -0
  275. package/dist/swimlanes-5IMT3BWC-db2c593a.js +1 -0
  276. package/dist/swimlanesDiagram-G3AALYLV-36c30eec.js +1 -0
  277. package/dist/swimlanesDiagram-G3AALYLV-89220ddd.js +1 -0
  278. package/dist/swimlanesDiagram-G3AALYLV-b621330d.js +1 -0
  279. package/dist/timeline-definition-FHXFAJF6-0482a67a.js +1 -0
  280. package/dist/timeline-definition-FHXFAJF6-1d165a67.js +1 -0
  281. package/dist/timeline-definition-FHXFAJF6-f9600b97.js +1 -0
  282. package/dist/treeView-QDETBFTQ-0ecf20cd.js +1 -0
  283. package/dist/treeView-QDETBFTQ-96ed8e2f.js +1 -0
  284. package/dist/treemap-6X3UGDF4-0a7f19ca.js +1 -0
  285. package/dist/treemap-6X3UGDF4-9f498e0c.js +1 -0
  286. package/dist/types/chart.d.ts.map +1 -0
  287. package/dist/types.d.ts +1 -0
  288. package/dist/types.d.ts.map +1 -0
  289. package/dist/utils/audioRecording.d.ts.map +1 -0
  290. package/dist/utils/chartInstanceManager.d.ts.map +1 -0
  291. package/dist/utils/chartTagParser.d.ts.map +1 -0
  292. package/dist/utils/chatInputHistory.d.ts.map +1 -0
  293. package/dist/utils/chatStreamHelper.d.ts.map +1 -0
  294. package/dist/utils/index.d.ts.map +1 -0
  295. package/dist/utils/isMobileSignal.d.ts.map +1 -0
  296. package/dist/utils/transcriptApi.d.ts.map +1 -0
  297. package/dist/utils/ultimateJsonParser.d.ts.map +1 -0
  298. package/dist/vennDiagram-L72KCM5P-05176193.js +1 -0
  299. package/dist/vennDiagram-L72KCM5P-25a48393.js +1 -0
  300. package/dist/vennDiagram-L72KCM5P-28cffef7.js +1 -0
  301. package/dist/wardley-OPB4EBWU-08c5f013.js +1 -0
  302. package/dist/wardley-OPB4EBWU-9803a1d9.js +1 -0
  303. package/dist/wardleyDiagram-EHGQE667-052e6de9.js +1 -0
  304. package/dist/wardleyDiagram-EHGQE667-6a614fd9.js +1 -0
  305. package/dist/wardleyDiagram-EHGQE667-d11fe904.js +1 -0
  306. package/dist/web-25bb78b9.js +1 -0
  307. package/dist/web-753300e1.js +1 -0
  308. package/dist/web-c3ed22c4.js +1 -0
  309. package/dist/web.d.ts.map +1 -0
  310. package/dist/web.js +1 -1
  311. package/dist/window.d.ts.map +1 -0
  312. package/dist/xychartDiagram-FW5EYKEG-43118b83.js +1 -0
  313. package/dist/xychartDiagram-FW5EYKEG-d77187fe.js +1 -0
  314. package/dist/xychartDiagram-FW5EYKEG-f2fac492.js +1 -0
  315. package/package.json +86 -86
  316. package/server.js +477 -477
  317. package/.idea/flowise-chatbox.iml +0 -10
  318. package/.idea/modules.xml +0 -8
  319. package/.idea/workspace.xml +0 -4
  320. package/docs/embedding-style-guide.md +0 -417
@@ -0,0 +1 @@
1
+ import{p as t}from"./chunk-JWPE2WC7-e2521b1e.js";import{E as e,s as i,g as n,n as r,o,b as s,c as a,_ as h,v as l,F as d,G as g,b9 as c,al as u,l as p,j as f,K as m,X as y,r as v,b2 as E,d as N,am as T,i as A}from"./mermaid.core-8797d6a9.js";import{v as w}from"./mermaid-parser.core-d8d1c2b9.js";import{c as I}from"./cytoscape.esm-c9352dc8.js";import{c as L,g as C}from"./web-c3ed22c4.js";var _,M,x,O={exports:{}},D={exports:{}},b={exports:{}};function R(){var t;return M||(M=1,t=function(t){return e={45:(t,e,i)=>{var n={};n.layoutBase=i(551),n.CoSEConstants=i(806),n.CoSEEdge=i(767),n.CoSEGraph=i(880),n.CoSEGraphManager=i(578),n.CoSELayout=i(765),n.CoSENode=i(991),n.ConstraintHandler=i(902),t.exports=n},806:(t,e,i)=>{var n,r=i(551).FDLayoutConstants;function o(){}for(n in r)o[n]=r[n];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!0,o.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,o.TREE_REDUCTION_ON_INCREMENTAL=!0,o.PURE_INCREMENTAL=o.DEFAULT_INCREMENTAL,t.exports=o},767:(t,e,i)=>{var n,r=i(551).FDLayoutEdge;function o(t,e,i){r.call(this,t,e,i)}for(n in o.prototype=Object.create(r.prototype),r)o[n]=r[n];t.exports=o},880:(t,e,i)=>{var n,r=i(551).LGraph;function o(t,e,i){r.call(this,t,e,i)}for(n in o.prototype=Object.create(r.prototype),r)o[n]=r[n];t.exports=o},578:(t,e,i)=>{var n,r=i(551).LGraphManager;function o(t){r.call(this,t)}for(n in o.prototype=Object.create(r.prototype),r)o[n]=r[n];t.exports=o},765:(t,e,i)=>{var n,r=i(551).FDLayout,o=i(578),s=i(880),a=i(991),h=i(767),l=i(806),d=i(902),g=i(551).FDLayoutConstants,c=i(551).LayoutConstants,u=i(551).Point,p=i(551).PointD,f=i(551).DimensionD,m=i(551).Layout,y=i(551).Integer,v=i(551).IGeometry,E=i(551).LGraph,N=i(551).Transform,T=i(551).LinkedList;function A(){r.call(this),this.toBeTiled={},this.constraints={}}for(n in A.prototype=Object.create(r.prototype),r)A[n]=r[n];A.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t},A.prototype.newGraph=function(t){return new s(null,this.graphManager,t)},A.prototype.newNode=function(t){return new a(this.graphManager,t)},A.prototype.newEdge=function(t){return new h(null,null,t)},A.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){var t,e,i;return 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?l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(i)):0<(t=this.getFlatForest()).length?this.positionNodesRadially(t):(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(i),this.positionNodesRandomly()),0<Object.keys(this.constraints).length&&(d.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(0<this.prunedNodesAll.length))return!0;this.isTreeGrowing=!0}if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(0<this.prunedNodesAll.length))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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))}var t;if(this.isTreeGrowing&&(this.growTreeIterations%10==0&&(0<this.prunedNodesAll.length?(this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL):(this.isTreeGrowing=!1,this.isGrowthFinished=!0)),this.growTreeIterations++),this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var e=!this.isTreeGrowing&&!this.isGrowthFinished,i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(e,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var n=t[i].rect,r=t[i].id;e[r]={id:r,x:n.getCenterX(),y:n.getCenterY(),w:n.width,h:n.height}}return e},A.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===g.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},A.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();for(0<Object.keys(this.constraints).length&&this.updateDisplacements(),e=0;e<t.length;e++)t[e].move()},A.prototype.initConstraintVariables=function(){for(var t=this,e=(this.idToNodeMap=new Map,this.fixedNodeSet=new Set,this.graphManager.getAllNodes()),i=0;i<e.length;i++){var n=e[i];this.idToNodeMap.set(n.id,n)}function r(e){for(var i,n=e.getChild().getNodes(),o=0,s=0;s<n.length;s++)null==(i=n[s]).getChild()?t.fixedNodeSet.has(i.id)&&(o+=100):o+=r(i);return o}if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach((function(e){t.fixedNodeSet.add(e.nodeId)}));var o;for(e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)null!=(n=e[i]).getChild()&&0<(o=r(n))&&(n.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var s,a,h,d,g=new Map,c=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(i=0;i<u.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),u[i].forEach((function(e){g.set(e,"dummy"+i),t.dummyToNodeForVerticalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+i)}))}if(this.constraints.alignmentConstraint.horizontal){var p=this.constraints.alignmentConstraint.horizontal;for(i=0;i<p.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),p[i].forEach((function(e){c.set(e,"dummy"+i),t.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+i)}))}}l.RELAX_MOVEMENT_ON_CONSTRAINTS?(this.shuffle=function(t){for(var e,i,n=t.length-1;n>=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),i=t[n],t[n]=t[e],t[e]=i;return t},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(e){var i,n;e.left?(n=g.has(e.left)?g.get(e.left):e.left,i=g.has(e.right)?g.get(e.right):e.right,t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodesInRelativeHorizontal.includes(i)||(t.nodesInRelativeHorizontal.push(i),t.nodeToRelativeConstraintMapHorizontal.set(i,[]),t.dummyToNodeForVerticalAlignment.has(i)?t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:i,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(i).push({left:n,gap:e.gap})):(i=c.has(e.top)?c.get(e.top):e.top,n=c.has(e.bottom)?c.get(e.bottom):e.bottom,t.nodesInRelativeVertical.includes(i)||(t.nodesInRelativeVertical.push(i),t.nodeToRelativeConstraintMapVertical.set(i,[]),t.dummyToNodeForHorizontalAlignment.has(i)?t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(i).getCenterY())),t.nodesInRelativeVertical.includes(n)||(t.nodesInRelativeVertical.push(n),t.nodeToRelativeConstraintMapVertical.set(n,[]),t.dummyToNodeForHorizontalAlignment.has(n)?t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(n)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(n).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(i).push({bottom:n,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(n).push({top:i,gap:e.gap}))}))):(s=new Map,a=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){var e,i;t.left?(i=g.has(t.left)?g.get(t.left):t.left,e=g.has(t.right)?g.get(t.right):t.right,s.has(i)?s.get(i).push(e):s.set(i,[e]),s.has(e)?s.get(e).push(i):s.set(e,[i])):(e=c.has(t.top)?c.get(t.top):t.top,i=c.has(t.bottom)?c.get(t.bottom):t.bottom,a.has(e)?a.get(e).push(i):a.set(e,[i]),a.has(i)?a.get(i).push(e):a.set(i,[e]))})),d=(h=function(t,e){var i=[],n=[],r=new T,o=new Set,s=0;return t.forEach((function(a,h){if(!o.has(h)){for(i[s]=[],n[s]=!1,r.push(l=h),o.add(l),i[s].push(l);0!=r.length;){var l=r.shift();e.has(l)&&(n[s]=!0),t.get(l).forEach((function(t){o.has(t)||(r.push(t),o.add(t),i[s].push(t))}))}s++}})),{components:i,isFixed:n}})(s,t.fixedNodesOnHorizontal),this.componentsOnHorizontal=d.components,this.fixedComponentsOnHorizontal=d.isFixed,d=h(a,t.fixedNodesOnVertical),this.componentsOnVertical=d.components,this.fixedComponentsOnVertical=d.isFixed)}},A.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){(e=t.idToNodeMap.get(e.nodeId)).displacementX=0,e.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,i=0;i<e.length;i++){for(var n=0,r=0;r<e[i].length;r++){if(this.fixedNodeSet.has(e[i][r])){n=0;break}n+=this.idToNodeMap.get(e[i][r]).displacementX}var o=n/e[i].length;for(r=0;r<e[i].length;r++)this.idToNodeMap.get(e[i][r]).displacementX=o}if(this.constraints.alignmentConstraint.horizontal){var s=this.constraints.alignmentConstraint.horizontal;for(i=0;i<s.length;i++){var a=0;for(r=0;r<s[i].length;r++){if(this.fixedNodeSet.has(s[i][r])){a=0;break}a+=this.idToNodeMap.get(s[i][r]).displacementY}var h=a/s[i].length;for(r=0;r<s[i].length;r++)this.idToNodeMap.get(s[i][r]).displacementY=h}}}if(this.constraints.relativePlacementConstraint)if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach((function(e){var i;t.fixedNodesOnHorizontal.has(e)||(i=0,i=(t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]):t.idToNodeMap.get(e)).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach((function(n){var r;n.right?(r=t.nodeToTempPositionMapHorizontal.get(n.right)-t.nodeToTempPositionMapHorizontal.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(n.left)+i)<n.gap&&(i+=n.gap-r)})),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+i),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementX=i})):t.idToNodeMap.get(e).displacementX=i)})),this.nodesInRelativeVertical.forEach((function(e){var i;t.fixedNodesOnHorizontal.has(e)||(i=0,i=(t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]):t.idToNodeMap.get(e)).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach((function(n){var r;n.bottom?(r=t.nodeToTempPositionMapVertical.get(n.bottom)-t.nodeToTempPositionMapVertical.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(n.top)+i)<n.gap&&(i+=n.gap-r)})),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+i),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementY=i})):t.idToNodeMap.get(e).displacementY=i)}));else{for(i=0;i<this.componentsOnHorizontal.length;i++){var d=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementX=0})):this.idToNodeMap.get(d[r]).displacementX=0;else{var g=0,c=0;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?(g+=(p=this.dummyToNodeForVerticalAlignment.get(d[r])).length*this.idToNodeMap.get(p[0]).displacementX,c+=p.length):(g+=this.idToNodeMap.get(d[r]).displacementX,c++);var u=g/c;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementX=u})):this.idToNodeMap.get(d[r]).displacementX=u}}for(i=0;i<this.componentsOnVertical.length;i++)if(d=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementY=0})):this.idToNodeMap.get(d[r]).displacementY=0;else{var p;for(g=0,c=0,r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?(g+=(p=this.dummyToNodeForHorizontalAlignment.get(d[r])).length*this.idToNodeMap.get(p[0]).displacementY,c+=p.length):(g+=this.idToNodeMap.get(d[r]).displacementY,c++);for(u=g/c,r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementY=u})):this.idToNodeMap.get(d[r]).displacementY=u}}},A.prototype.calculateNodesToApplyGravitationTo=function(){for(var t,e=[],i=this.graphManager.getGraphs(),n=i.length,r=0;r<n;r++)(t=i[r]).updateConnected(),t.isConnected||(e=e.concat(t.getNodes()));return e},A.prototype.createBendpoints=function(){for(var t=(t=[]).concat(this.graphManager.getAllEdges()),e=new Set,i=0;i<t.length;i++){var n=t[i];if(!e.has(n)){var r=n.getSource(),o=n.getTarget();if(r==o)n.getBendpoints().push(new p),n.getBendpoints().push(new p),this.createDummyNodesForBendpoints(n),e.add(n);else{var s=[];if(s=(s=s.concat(r.getEdgeListToNode(o))).concat(o.getEdgeListToNode(r)),!e.has(s[0])){if(1<s.length)for(var a=0;a<s.length;a++){var h=s[a];h.getBendpoints().push(new p),this.createDummyNodesForBendpoints(h)}s.forEach((function(t){e.add(t)}))}}}if(e.size==t.length)break}},A.prototype.positionNodesRadially=function(t){for(var e=new u(0,0),i=Math.ceil(Math.sqrt(t.length)),n=0,r=0,o=0,s=new p(0,0),a=0;a<t.length;a++){a%i==0&&(r=n,(o=0)!=a&&(r+=l.DEFAULT_COMPONENT_SEPERATION),n=0);var h=t[a],d=m.findCenterOfTree(h);e.x=o,e.y=r,(s=A.radialLayout(h,d,e)).y>n&&(n=Math.floor(s.y)),o=Math.floor(s.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(c.WORLD_CENTER_X-s.x/2,c.WORLD_CENTER_Y-s.y/2))},A.radialLayout=function(t,e,i){var n=Math.max(this.maxDiagonalInTree(t),l.DEFAULT_RADIAL_SEPARATION),r=(e=(A.branchRadialLayout(e,null,0,359,0,n),E.calculateBounds(t)),new N);r.setDeviceOrgX(e.getMinX()),r.setDeviceOrgY(e.getMinY()),r.setWorldOrgX(i.x),r.setWorldOrgY(i.y);for(var o=0;o<t.length;o++)t[o].transform(r);return n=new p(e.getMaxX(),e.getMaxY()),r.inverseTransformPoint(n)},A.branchRadialLayout=function(t,e,i,n,r,o){(s=(n-i+1)/2)<0&&(s+=180);for(var s=(s+i)%360*v.TWO_PI/360,a=r*Math.cos(s),h=(s=r*Math.sin(s),t.setCenter(a,s),[]),l=(h=h.concat(t.getEdges())).length,d=(null!=e&&l--,0),g=h.length,c=t.getEdgesBetween(e);1<c.length;){var u=c[0];0<=(u=(c.splice(0,1),h.indexOf(u)))&&h.splice(u,1),g--,l--}a=null!=e?(h.indexOf(c[0])+1)%g:0;for(var p=Math.abs(n-i)/l,f=a;d!=l;f=++f%g){var m=h[f].getOtherEnd(t);m!=e&&(A.branchRadialLayout(m,t,m=(i+d*p)%360,(m+p)%360,r+o,o),d++)}},A.maxDiagonalInTree=function(t){for(var e=y.MIN_VALUE,i=0;i<t.length;i++){var n=t[i].getDiagonal();e<n&&(e=n)}return e},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){for(var t=this,e={},i=(this.memberGroups={},this.idToDummyNode={},[]),n=this.graphManager.getAllNodes(),r=0;r<n.length;r++){var o=(s=n[r]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=o.id&&this.getToBeTiled(o)||i.push(s)}for(r=0;r<i.length;r++){var s,h=(s=i[r]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(s)}Object.keys(e).forEach((function(i){if(1<e[i].length){var n="DummyCompound_"+i,r=(t.memberGroups[n]=e[i],e[i][0].getParent()),o=new a(t.graphManager),s=(o.id=n,o.paddingLeft=r.paddingLeft||0,o.paddingRight=r.paddingRight||0,o.paddingBottom=r.paddingBottom||0,o.paddingTop=r.paddingTop||0,t.idToDummyNode[n]=o,t.getGraphManager().add(t.newGraph(),o)),h=r.getChild();h.add(o);for(var l=0;l<e[i].length;l++){var d=e[i][l];h.remove(d),s.add(d)}}}))},A.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},A.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(i){var n,r=t.idToDummyNode[i];e[i]=t.tileNodes(t.memberGroups[i],r.paddingLeft+r.paddingRight),r.rect.width=e[i].width,r.rect.height=e[i].height,r.setCenter(e[i].centerX,e[i].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS&&(i=r.rect.width,n=r.rect.height,r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(i+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>i?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight)&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(n+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>n?(r.rect.y-=(r.labelHeight-n)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-n)/2):"bottom"==r.labelPosVertical&&r.setHeight(n+r.labelHeight))}))},A.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;0<=t;t--){var e=this.compoundOrder[t],i=e.id,n=e.paddingLeft,r=e.paddingTop,o=e.labelMarginLeft,s=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,n,r,o,s)}},A.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(i){var n=t.idToDummyNode[i],r=n.paddingLeft,o=n.paddingTop,s=n.labelMarginLeft,a=n.labelMarginTop;t.adjustLocations(e[i],n.rect.x,n.rect.y,r,o,s,a)}))},A.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];if(null==(t=t.getChild()))return this.toBeTiled[e]=!1;for(var i=t.getNodes(),n=0;n<i.length;n++){var r=i[n];if(0<this.getNodeDegree(r))return this.toBeTiled[e]=!1;if(null==r.getChild())this.toBeTiled[r.id]=!1;else if(!this.getToBeTiled(r))return this.toBeTiled[e]=!1}return this.toBeTiled[e]=!0},A.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,n=0;n<e.length;n++){var r=e[n];r.getSource().id!==r.getTarget().id&&(i+=1)}return i},A.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null!=t.getChild())for(var i=t.getChild().getNodes(),n=0;n<i.length;n++){var r=i[n];e+=this.getNodeDegreeWithChildren(r)}return e},A.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},A.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},A.prototype.adjustLocations=function(t,e,i,n,r,o,s){i+=r+s;for(var a=e+=n+o,h=0;h<t.rows.length;h++){for(var l=t.rows[h],d=(e=a,0),g=0;g<l.length;g++){var c=l[g];c.rect.x=e,c.rect.y=i,e+=c.rect.width+t.horizontalPadding,c.rect.height>d&&(d=c.rect.height)}i+=d+t.verticalPadding}},A.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var r,o=e[n];i.tiledMemberPack[n]=i.tileNodes(t[n],o.paddingLeft+o.paddingRight),o.rect.width=i.tiledMemberPack[n].width,o.rect.height=i.tiledMemberPack[n].height,o.setCenter(i.tiledMemberPack[n].centerX,i.tiledMemberPack[n].centerY),o.labelMarginLeft=0,o.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS&&(n=o.rect.width,r=o.rect.height,o.labelWidth&&("left"==o.labelPosHorizontal?(o.rect.x-=o.labelWidth,o.setWidth(n+o.labelWidth),o.labelMarginLeft=o.labelWidth):"center"==o.labelPosHorizontal&&o.labelWidth>n?(o.rect.x-=(o.labelWidth-n)/2,o.setWidth(o.labelWidth),o.labelMarginLeft=(o.labelWidth-n)/2):"right"==o.labelPosHorizontal&&o.setWidth(n+o.labelWidth)),o.labelHeight)&&("top"==o.labelPosVertical?(o.rect.y-=o.labelHeight,o.setHeight(r+o.labelHeight),o.labelMarginTop=o.labelHeight):"center"==o.labelPosVertical&&o.labelHeight>r?(o.rect.y-=(o.labelHeight-r)/2,o.setHeight(o.labelHeight),o.labelMarginTop=(o.labelHeight-r)/2):"bottom"==o.labelPosVertical&&o.setHeight(r+o.labelHeight))}))},A.prototype.tileNodes=function(t,e){var i=this.tileNodesByFavoringDim(t,e,!0);t=this.tileNodesByFavoringDim(t,e,!1),e=this.getOrgRatio(i);return e=this.getOrgRatio(t)<e?t:i},A.prototype.getOrgRatio=function(t){return(t=t.width/t.height)<1?1/t:t},A.prototype.calcIdealRowWidth=function(t,e){var i,n=l.TILING_PADDING_VERTICAL,r=l.TILING_PADDING_HORIZONTAL,o=t.length,s=0,a=0,h=0,d=(t=(t.forEach((function(t){s+=t.getWidth(),a+=t.getHeight(),t.getWidth()>h&&(h=t.getWidth())})),s/o),a/o);d=Math.pow(n-r,2)+4*(t+r)*(d+n)*o,o=(r-n+Math.sqrt(d))/(2*(t+r));return(n=(e?(i=Math.ceil(o))==o&&i++:i=Math.floor(o),i*(t+r)-r))<h&&(n=h),n+2*r},A.prototype.tileNodesByFavoringDim=function(t,e,i){function n(t,e){return h(e)-h(t)}for(var r=l.TILING_PADDING_VERTICAL,o=l.TILING_PADDING_HORIZONTAL,s=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:r,horizontalPadding:o,centerX:0,centerY:0},h=(s&&(a.idealRowWidth=this.calcIdealRowWidth(t,i)),function(t){return t.rect.width*t.rect.height}),d=(t.sort((function(t,e){var i=n;return a.idealRowWidth?(i=s)(t.id,e.id):i(t,e)})),0),g=0,c=0;c<t.length;c++)d+=(p=t[c]).getCenterX(),g+=p.getCenterY();for(a.centerX=d/t.length,a.centerY=g/t.length,c=0;c<t.length;c++){var u,p=t[c];0==a.rows.length?this.insertNodeToRow(a,p,0,e):this.canAddHorizontal(a,p.rect.width,p.rect.height)?(u=a.rows.length-1,a.idealRowWidth||(u=this.getShortestRowIndex(a)),this.insertNodeToRow(a,p,u,e)):this.insertNodeToRow(a,p,a.rows.length,e),this.shiftToLastRow(a)}return a},A.prototype.insertNodeToRow=function(t,e,i,n){i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(n),t.rowHeight.push(0));n=t.rowWidth[i]+e.rect.width,0<t.rows[i].length&&(n+=t.horizontalPadding),t.rowWidth[i]=n,t.width<n&&(t.width=n),n=e.rect.height;var r=(0<i&&(n+=t.verticalPadding),0);n>t.rowHeight[i]&&(r=t.rowHeight[i],t.rowHeight[i]=n,r=t.rowHeight[i]-r),t.height+=r,t.rows[i].push(e)},A.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]<i&&(e=n,i=t.rowWidth[n]);return e},A.prototype.getLongestRowIndex=function(t){for(var e=-1,i=Number.MIN_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]>i&&(e=n,i=t.rowWidth[n]);return e},A.prototype.canAddHorizontal=function(t,e,i){var n,r,o;return t.idealRowWidth?(r=t.rows.length-1,t.rowWidth[r]+e+t.horizontalPadding<=t.idealRowWidth):(r=this.getShortestRowIndex(t))<0||(o=t.rowWidth[r])+t.horizontalPadding+e<=t.width||(n=0,t.rowHeight[r]<i&&0<r&&(n=i+t.verticalPadding-t.rowHeight[r]),r=t.width-o>=e+t.horizontalPadding?(t.height+n)/(o+e+t.horizontalPadding):(t.height+n)/t.width,n=i+t.verticalPadding,(r=r<1?1/r:r)<(o=(o=t.width<e?(t.height+n)/e:(t.height+n)/t.width)<1?1/o:o))},A.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,n=t.rows[e],r=n[n.length-1],o=r.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>o&&e!=i){n.splice(-1,1),t.rows[i].push(r),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[i]=t.rowWidth[i]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,a=0;a<n.length;a++)n[a].height>s&&(s=n[a].height);0<e&&(s+=t.verticalPadding),o=t.rowHeight[e]+t.rowHeight[i],t.rowHeight[e]=s,t.rowHeight[i]<r.height+t.verticalPadding&&(t.rowHeight[i]=r.height+t.verticalPadding),r=t.rowHeight[e]+t.rowHeight[i],t.height+=r-o,this.shiftToLastRow(t)}},A.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var t=[],e=!0;e;){for(var i,n,r=this.graphManager.getAllNodes(),o=[],s=(e=!1,0);s<r.length;s++)1!=(n=r[s]).getEdges().length||n.getEdges()[0].isInterGraph||null!=n.getChild()||(l.PURE_INCREMENTAL?(i=n.getEdges()[0].getOtherEnd(n),i=new f(n.getCenterX()-i.getCenterX(),n.getCenterY()-i.getCenterY()),o.push([n,n.getEdges()[0],n.getOwner(),i])):o.push([n,n.getEdges()[0],n.getOwner()]),e=!0);if(1==e){for(var a=[],h=0;h<o.length;h++)1==o[h][0].getEdges().length&&(a.push(o[h]),o[h][0].getOwner().remove(o[h][0]));t.push(a),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=t},A.prototype.growTree=function(t){for(var e,i=t[t.length-1],n=0;n<i.length;n++)e=i[n],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},A.prototype.findPlaceforPrunedNode=function(t){var e=t[0],i=e==t[1].source?t[1].target:t[1].source;if(l.PURE_INCREMENTAL)e.setCenter(i.getCenterX()+t[3].getWidth(),i.getCenterY()+t[3].getHeight());else{var n=i.startX,r=i.finishX,o=i.startY,s=i.finishY,a=[0,0,0,0];if(0<o)for(var h=n;h<=r;h++)a[0]+=this.grid[h][o-1].length+this.grid[h][o].length-1;if(r<this.grid.length-1)for(h=o;h<=s;h++)a[1]+=this.grid[r+1][h].length+this.grid[r][h].length-1;if(s<this.grid[0].length-1)for(h=n;h<=r;h++)a[2]+=this.grid[h][s+1].length+this.grid[h][s].length-1;if(0<n)for(h=o;h<=s;h++)a[3]+=this.grid[n-1][h].length+this.grid[n][h].length-1;for(var d,c,u,p,f=y.MAX_VALUE,m=0;m<a.length;m++)a[m]<f?(f=a[m],d=1,c=m):a[m]==f&&d++;3==d&&0==f?0==a[0]&&0==a[1]&&0==a[2]?u=1:0==a[0]&&0==a[1]&&0==a[3]?u=0:0==a[0]&&0==a[2]&&0==a[3]?u=3:0==a[1]&&0==a[2]&&0==a[3]&&(u=2):u=2==d&&0==f?(p=Math.floor(2*Math.random()),0==a[0]&&0==a[1]?0==p?0:1:0==a[0]&&0==a[2]?0==p?0:2:0==a[0]&&0==a[3]?0==p?0:3:0==a[1]&&0==a[2]?0==p?1:2:0==a[1]&&0==a[3]?0==p?1:3:0==p?2:3):4==d&&0==f?p=Math.floor(4*Math.random()):c,0==u?e.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-g.DEFAULT_EDGE_LENGTH-e.getHeight()/2):1==u?e.setCenter(i.getCenterX()+i.getWidth()/2+g.DEFAULT_EDGE_LENGTH+e.getWidth()/2,i.getCenterY()):2==u?e.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+g.DEFAULT_EDGE_LENGTH+e.getHeight()/2):e.setCenter(i.getCenterX()-i.getWidth()/2-g.DEFAULT_EDGE_LENGTH-e.getWidth()/2,i.getCenterY())}},t.exports=A},991:(t,e,i)=>{var n,r=i(551).FDLayoutNode,o=i(551).IMath;function s(t,e,i,n){r.call(this,t,e,i,n)}for(n in s.prototype=Object.create(r.prototype),r)s[n]=r[n];s.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementY)),this.child&&0<this.child.getNodes().length&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},s.prototype.propogateDisplacementToChildren=function(t,e){for(var i,n=this.getChild().getNodes(),r=0;r<n.length;r++)null==(i=n[r]).getChild()?(i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},s.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.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},s.prototype.setPred1=function(t){this.pred1=t},s.prototype.getPred1=function(){return pred1},s.prototype.getPred2=function(){return pred2},s.prototype.setNext=function(t){this.next=t},s.prototype.getNext=function(){return next},s.prototype.setProcessed=function(t){this.processed=t},s.prototype.isProcessed=function(){return processed},t.exports=s},902:(t,e,i)=>{function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(806),o=i(551).LinkedList,s=i(551).Matrix,a=i(551).SVD;function h(){}h.handleConstraints=function(t){for(var e={},i=(e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint,new Map),h=new Map,l=[],d=[],g=t.getAllNodes(),c=0,u=0;u<g.length;u++){var p=g[u];null==p.getChild()&&(h.set(p.id,c++),l.push(p.getCenterX()),d.push(p.getCenterY()),i.set(p.id,p))}function f(t,e,i,r,s){function a(){var n=m.shift();t.get(n).forEach((function(t){var o,s;p.get(t.id)<p.get(n)+t.gap&&(i&&i.has(t.id)?(void 0,s="horizontal"==e?h.has(t.id)?l[h.get(t.id)]:r.get(t.id):h.has(t.id)?d[h.get(t.id)]:r.get(t.id),p.set(t.id,s),s<p.get(n)+t.gap&&(o=p.get(n)+t.gap-s,f.get(n).forEach((function(t){p.set(t,p.get(t)-o)})))):p.set(t.id,p.get(n)+t.gap)),u.set(t.id,u.get(t.id)-1),0==u.get(t.id)&&m.push(t.id),i&&f.set(t.id,function(t,e){var i=new Set(t),n=!0,r=(t=!1,void 0);try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var a=o.value;i.add(a)}}catch(e){t=!0,r=e}finally{try{!n&&s.return&&s.return()}finally{if(t)throw r}}return i}(f.get(n),f.get(t.id)))}))}var g,c,u=new Map,p=(t.forEach((function(t,e){u.set(e,0)})),t.forEach((function(t,e){t.forEach((function(t){u.set(t.id,u.get(t.id)+1)}))})),new Map),f=new Map,m=new o;for(u.forEach((function(t,n){0==t?(m.push(n),i||("horizontal"==e?p.set(n,h.has(n)?l[h.get(n)]:r.get(n)):p.set(n,h.has(n)?d[h.get(n)]:r.get(n)))):p.set(n,Number.NEGATIVE_INFINITY),i&&f.set(n,new Set([n]))})),i&&s.forEach((function(t){var n,o,s=[];t.forEach((function(t){i.has(t)&&s.push(t)})),0<s.length?(n=0,s.forEach((function(t){"horizontal"==e?p.set(t,h.has(t)?l[h.get(t)]:r.get(t)):p.set(t,h.has(t)?d[h.get(t)]:r.get(t)),n+=p.get(t)})),n/=s.length,t.forEach((function(t){i.has(t)||p.set(t,n)}))):(o=0,t.forEach((function(t){o+="horizontal"==e?h.has(t)?l[h.get(t)]:r.get(t):h.has(t)?d[h.get(t)]:r.get(t)})),o/=t.length,t.forEach((function(t){p.set(t,o)})))}));0!=m.length;)a();return i&&(g=new Set,t.forEach((function(t,e){0==t.length&&g.add(e)})),c=[],f.forEach((function(t,e){if(g.has(e)){var r,o,s=!1,a=!0,h=(e=!1,void 0);try{for(var l,d=t[Symbol.iterator]();!(a=(l=d.next()).done);a=!0){var u=l.value;i.has(u)&&(s=!0)}}catch(s){e=!0,h=s}finally{try{!a&&d.return&&d.return()}finally{if(e)throw h}}s||(r=!1,o=void 0,c.forEach((function(e,i){e.has([].concat(n(t))[0])&&(r=!0,o=i)})),r?t.forEach((function(t){c[o].add(t)})):c.push(new Set(t)))}})),c.forEach((function(t,i){var n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,g=!0,c=!1,u=void 0;try{for(var f,m=t[Symbol.iterator]();!(g=(f=m.next()).done);g=!0){var y=f.value,v="horizontal"==e?h.has(y)?l[h.get(y)]:r.get(y):h.has(y)?d[h.get(y)]:r.get(y),E=p.get(y);v<n&&(n=v),s<v&&(s=v),E<o&&(o=E),a<E&&(a=E)}}catch(t){c=!0,u=t}finally{try{!g&&m.return&&m.return()}finally{if(c)throw u}}var N=(n+s)/2-(o+a)/2,T=!0;c=!1,u=void 0;try{for(var A,w=t[Symbol.iterator]();!(T=(A=w.next()).done);T=!0){var I=A.value;p.set(I,p.get(I)+N)}}catch(t){c=!0,u=t}finally{try{!T&&w.return&&w.return()}finally{if(c)throw u}}}))),p}function m(t){var e=0,i=0,n=0,r=0;if(t.forEach((function(t){t.left?0<=l[h.get(t.left)]-l[h.get(t.right)]?e++:i++:0<=d[h.get(t.top)]-d[h.get(t.bottom)]?n++:r++})),i<e&&r<n)for(var o=0;o<h.size;o++)l[o]=-1*l[o],d[o]=-1*d[o];else if(i<e)for(var s=0;s<h.size;s++)l[s]=-1*l[s];else if(r<n)for(var a=0;a<h.size;a++)d[a]=-1*d[a]}function y(t){var e=[],i=new o,n=new Set,r=0;return t.forEach((function(o,s){if(!n.has(s)){for(e[r]=[],i.push(a=s),n.add(a),e[r].push(a);0!=i.length;){var a=i.shift();t.get(a).forEach((function(t){n.has(t.id)||(i.push(t.id),n.add(t.id),e[r].push(t.id))}))}r++}})),e}function v(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(i).push(t),e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e}function E(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach((function(t){t.gap||0==t.gap||(t.left?t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.left).getWidth()/2+i.get(t.right).getWidth()/2:t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.top).getHeight()/2+i.get(t.bottom).getHeight()/2)}));var N,T=function(t){var e=0,i=0;return t.forEach((function(t){e+=l[h.get(t)],i+=d[h.get(t)]})),{x:e/t.size,y:i/t.size}},A=[],w=[],I=(t=!1,!1),L=new Set,C=new Map,_=new Map,M=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach((function(t){L.add(t.nodeId)})),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach((function(t){t.left?(C.has(t.left)?C.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):C.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),C.has(t.right)||C.set(t.right,[])):(C.has(t.top)?C.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):C.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),C.has(t.bottom)||C.set(t.bottom,[]))})),M=y(_=v(C))),r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&1<e.fixedNodeConstraint.length)e.fixedNodeConstraint.forEach((function(t,e){A[e]=[t.position.x,t.position.y],w[e]=[l[h.get(t.nodeId)],d[h.get(t.nodeId)]]})),t=!0;else if(e.alignmentConstraint){var x=0;if(e.alignmentConstraint.vertical){for(var O=e.alignmentConstraint.vertical,D=0;D<O.length;D++)!function(t){var e=new Set,i=(O[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return L.has(t)})))),r=0<i.size?l[h.get(i.values().next().value)]:T(e).x;O[t].forEach((function(t){A[x]=[r,d[h.get(t)]],w[x]=[l[h.get(t)],d[h.get(t)]],x++}))}(D);t=!0}if(e.alignmentConstraint.horizontal){for(var b=e.alignmentConstraint.horizontal,R=0;R<b.length;R++)!function(t){var e=new Set,i=(b[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return L.has(t)})))),r=0<i.size?l[h.get(i.values().next().value)]:T(e).y;b[t].forEach((function(t){A[x]=[l[h.get(t)],r],w[x]=[l[h.get(t)],d[h.get(t)]],x++}))}(R);t=!0}e.relativePlacementConstraint&&(I=!0)}else if(e.relativePlacementConstraint){for(var F,G,S,P,U,Y=0,k=0,H=0;H<M.length;H++)M[H].length>Y&&(Y=M[H].length,k=H);Y<_.size/2?(m(e.relativePlacementConstraint),I=t=!1):(F=new Map,G=new Map,S=[],M[k].forEach((function(t){C.get(t).forEach((function(e){"horizontal"==e.direction?(F.has(t)?F.get(t).push(e):F.set(t,[e]),F.has(e.id)||F.set(e.id,[]),S.push({left:t,right:e.id})):(G.has(t)?G.get(t).push(e):G.set(t,[e]),G.has(e.id)||G.set(e.id,[]),S.push({top:t,bottom:e.id}))}))})),m(S),I=!1,P=f(F,"horizontal"),U=f(G,"vertical"),M[k].forEach((function(t,e){w[e]=[l[h.get(t)],d[h.get(t)]],A[e]=[],P.has(t)?A[e][0]=P.get(t):A[e][0]=l[h.get(t)],U.has(t)?A[e][1]=U.get(t):A[e][1]=d[h.get(t)]})),t=!0)}if(t){for(var X=s.transpose(A),z=s.transpose(w),V=0;V<X.length;V++)X[V]=s.multGamma(X[V]),z[V]=s.multGamma(z[V]);_=s.multMat(X,s.transpose(z)),t=a.svd(_);for(var B=s.multMat(t.V,s.transpose(t.U)),W=0;W<h.size;W++){var j=[l[W],d[W]],q=[B[0][0],B[1][0]],$=[B[0][1],B[1][1]];l[W]=s.dotProduct(j,q),d[W]=s.dotProduct(j,$)}I&&m(e.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&0<e.fixedNodeConstraint.length&&(N={x:0,y:0},e.fixedNodeConstraint.forEach((function(t,e){var i=l[h.get(t.nodeId)],n=d[h.get(t.nodeId)];t={x:(t=t.position).x-i,y:t.y-n};N.x+=t.x,N.y+=t.y})),N.x/=e.fixedNodeConstraint.length,N.y/=e.fixedNodeConstraint.length,l.forEach((function(t,e){l[e]+=N.x})),d.forEach((function(t,e){d[e]+=N.y})),e.fixedNodeConstraint.forEach((function(t){l[h.get(t.nodeId)]=t.position.x,d[h.get(t.nodeId)]=t.position.y}))),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var Z=e.alignmentConstraint.vertical,Q=0;Q<Z.length;Q++)!function(t){var e=new Set,i=(t=(Z[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return L.has(t)})))),0<t.size?l[h.get(t.values().next().value)]:T(e).x);e.forEach((function(t){L.has(t)||(l[h.get(t)]=i)}))}(Q);if(e.alignmentConstraint.horizontal)for(var J=e.alignmentConstraint.horizontal,K=0;K<J.length;K++)!function(t){var e=new Set,i=(t=(J[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return L.has(t)})))),0<t.size?d[h.get(t.values().next().value)]:T(e).y);e.forEach((function(t){L.has(t)||(d[h.get(t)]=i)}))}(K)}if(e.relativePlacementConstraint){var tt=new Map,et=new Map,it=new Map,nt=new Map,rt=new Map,ot=new Map,st=new Set,at=new Set;if(L.forEach((function(t){st.add(t),at.add(t)})),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var ht=e.alignmentConstraint.vertical,lt=0;lt<ht.length;lt++)!function(t){it.set("dummy"+t,[]),ht[t].forEach((function(e){tt.set(e,"dummy"+t),it.get("dummy"+t).push(e),L.has(e)&&st.add("dummy"+t)})),rt.set("dummy"+t,l[h.get(ht[t][0])])}(lt);if(e.alignmentConstraint.horizontal)for(var dt=e.alignmentConstraint.horizontal,gt=0;gt<dt.length;gt++)!function(t){nt.set("dummy"+t,[]),dt[t].forEach((function(e){et.set(e,"dummy"+t),nt.get("dummy"+t).push(e),L.has(e)&&at.add("dummy"+t)})),ot.set("dummy"+t,d[h.get(dt[t][0])])}(gt)}var ct=new Map,ut=new Map,pt=!0;_=!1,t=void 0;try{for(var ft,mt=C.keys()[Symbol.iterator]();!(pt=(ft=mt.next()).done);pt=!0)!function(t){C.get(t).forEach((function(e){var i=void 0,n=void 0;"horizontal"==e.direction?(i=tt.get(t)?tt.get(t):t,n=tt.get(e.id)?{id:tt.get(e.id),gap:e.gap,direction:e.direction}:e,ct.has(i)?ct.get(i).push(n):ct.set(i,[n]),ct.has(n.id)||ct.set(n.id,[])):(i=et.get(t)?et.get(t):t,n=et.get(e.id)?{id:et.get(e.id),gap:e.gap,direction:e.direction}:e,ut.has(i)?ut.get(i).push(n):ut.set(i,[n]),ut.has(n.id)||ut.set(n.id,[]))}))}(ft.value)}catch(e){_=!0,t=e}finally{try{!pt&&mt.return&&mt.return()}finally{if(_)throw t}}_=v(ct),t=v(ut),_=y(_),t=y(t);var yt=E(ct),vt=E(ut),Et=[],Nt=[],Tt=(_.forEach((function(t,e){Et[e]=[],t.forEach((function(t){0==yt.get(t).length&&Et[e].push(t)}))})),t.forEach((function(t,e){Nt[e]=[],t.forEach((function(t){0==vt.get(t).length&&Nt[e].push(t)}))})),f(ct,"horizontal",st,rt,Et)),At=f(ut,"vertical",at,ot,Nt),wt=!0;_=!1,t=void 0;try{for(var It,Lt=Tt.keys()[Symbol.iterator]();!(wt=(It=Lt.next()).done);wt=!0)!function(t){it.get(t)?it.get(t).forEach((function(e){l[h.get(e)]=Tt.get(t)})):l[h.get(t)]=Tt.get(t)}(It.value)}catch(e){_=!0,t=e}finally{try{!wt&&Lt.return&&Lt.return()}finally{if(_)throw t}}var Ct=!0;_=!1,t=void 0;try{for(var _t,Mt=At.keys()[Symbol.iterator]();!(Ct=(_t=Mt.next()).done);Ct=!0)!function(t){nt.get(t)?nt.get(t).forEach((function(e){d[h.get(e)]=At.get(t)})):d[h.get(t)]=At.get(t)}(_t.value)}catch(e){_=!0,t=e}finally{try{!Ct&&Mt.return&&Mt.return()}finally{if(_)throw t}}}}for(var xt=0;xt<g.length;xt++){var Ot=g[xt];null==Ot.getChild()&&Ot.setCenter(l[h.get(Ot.id)],d[h.get(Ot.id)])}},t.exports=h},551:e=>{e.exports=t}},i={},function t(n){var r=i[n];return void 0===r&&(r=i[n]={exports:{}},e[n](r,r.exports,t)),r.exports}(45);var e,i},D.exports=t(function(){var t;return _||(_=1,t=function(){return e=[function(t,e,i){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_HALF_SIZE=(n.SIMPLE_NODE_SIZE=40)/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.INITIAL_WORLD_BOUNDARY=(n.WORLD_BOUNDARY=1e6)/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,i){var n,r=i(2),o=i(8),s=i(9);function a(t,e,i){r.call(this,i),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=i,this.bendpoints=[],this.source=t,this.target=e}for(n in a.prototype=Object.create(r.prototype),r)a[n]=r[n];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(t,e){for(var i=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(i.getOwner()==e)return i;if(i.getOwner()==n)break;i=i.getOwner().getParent()}return null},a.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.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=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=a},function(t,e,i){t.exports=function(t){this.vGraphObject=t}},function(t,e,i){var n,r=i(2),o=i(10),s=i(13),a=i(0),h=i(16),l=i(5);function d(t,e,i,n){r.call(this,n=null==i&&null==n?e:n),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=n,this.edges=[],this.graphManager=t,this.rect=null!=i&&null!=e?new s(e.x,e.y,i.width,i.height):new s}for(n in d.prototype=Object.create(r.prototype),r)d[n]=r[n];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(t){this.rect.width=t},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(t){this.rect.height=t},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},d.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},d.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},d.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},d.prototype.getEdgeListToNode=function(t){var e=[],i=this;return i.edges.forEach((function(n){if(n.target==t){if(n.source!=i)throw"Incorrect edge source!";e.push(n)}})),e},d.prototype.getEdgesBetween=function(t){var e=[],i=this;return i.edges.forEach((function(n){if(n.source!=i&&n.target!=i)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)})),e},d.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(i){if(i.source==e)t.add(i.target);else{if(i.target!=e)throw"Incorrect incidency!";t.add(i.source)}})),t},d.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),i=0;i<e.length;i++)e[i].withChildren().forEach((function(e){t.add(e)}));return t},d.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),i=0;i<e.length;i++)t+=e[i].getNoOfChildren();return 0==t?1:t},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return null==this.child?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)},d.prototype.scatter=function(){var t=-a.INITIAL_WORLD_BOUNDARY,e=a.INITIAL_WORLD_BOUNDARY,i=(e=a.WORLD_CENTER_X+h.nextDouble()*(e-t)+t,t=-a.INITIAL_WORLD_BOUNDARY,a.INITIAL_WORLD_BOUNDARY);i=a.WORLD_CENTER_Y+h.nextDouble()*(i-t)+t,this.rect.x=e,this.rect.y=i},d.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";var t,e;0!=this.getChild().getNodes().length&&((e=this.getChild()).updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),a.NODE_DIMENSIONS_INCLUDE_LABELS)&&(t=e.getRight()-e.getLeft(),e=e.getBottom()-e.getTop(),this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(t+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>t?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight)&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(e+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>e?(this.rect.y-=(this.labelHeight-e)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(e+this.labelHeight))},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(t){var e=((e=this.rect.x)>a.WORLD_BOUNDARY?e=a.WORLD_BOUNDARY:e<-a.WORLD_BOUNDARY&&(e=-a.WORLD_BOUNDARY),(i=this.rect.y)>a.WORLD_BOUNDARY?i=a.WORLD_BOUNDARY:i<-a.WORLD_BOUNDARY&&(i=-a.WORLD_BOUNDARY),new l(e,i)),i=t.inverseTransformPoint(e);this.setLocation(i.x,i.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=d},function(t,e,i){var n,r=i(0);function o(){}for(n in r)o[n]=r[n];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT=3*(o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100),o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=o},function(t,e,i){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,i){var n,r=i(2),o=i(10),s=i(0),a=i(7),h=i(3),l=i(1),d=i(13),g=i(12),c=i(11);function u(t,e,i){r.call(this,i),this.estimatedSize=o.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof a?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(n in u.prototype=Object.create(r.prototype),r)u[n]=r[n];u.prototype.getNodes=function(){return this.nodes},u.prototype.getEdges=function(){return this.edges},u.prototype.getGraphManager=function(){return this.graphManager},u.prototype.getParent=function(){return this.parent},u.prototype.getLeft=function(){return this.left},u.prototype.getRight=function(){return this.right},u.prototype.getTop=function(){return this.top},u.prototype.getBottom=function(){return this.bottom},u.prototype.isConnected=function(){return this.isConnected},u.prototype.add=function(t,e,i){if(null==e&&null==i){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(-1<this.getNodes().indexOf(n))throw"Node already in graph!";return(n.owner=this).getNodes().push(n),n}if(n=t,!(-1<this.getNodes().indexOf(e)&&-1<this.getNodes().indexOf(i)))throw"Source or target not in graph!";if(e.owner!=i.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=i.owner?null:(n.source=e,n.target=i,n.isInterGraph=!1,this.getEdges().push(n),e.edges.push(n),i!=e&&i.edges.push(n),n)},u.prototype.remove=function(t){var e=t;if(t instanceof h){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var i,n=e.edges.slice(),r=n.length,o=0;o<r;o++)((i=n[o]).isInterGraph?this.graphManager:i.source.owner).remove(i);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof l){if(null==(i=t))throw"Edge is null!";if(null==i.source||null==i.target)throw"Source and/or target is null!";if(null==i.source.owner||null==i.target.owner||i.source.owner!=this||i.target.owner!=this)throw"Source and/or target owner is invalid!";var s;if(e=i.source.edges.indexOf(i),t=i.target.edges.indexOf(i),!(-1<e&&-1<t))throw"Source and/or target doesn't know this edge!";if(i.source.edges.splice(e,1),i.target!=i.source&&i.target.edges.splice(t,1),-1==(s=i.source.owner.getEdges().indexOf(i)))throw"Not in owner's edge list!";i.source.owner.getEdges().splice(s,1)}},u.prototype.updateLeftTop=function(){for(var t,e=o.MAX_VALUE,i=o.MAX_VALUE,n=this.getNodes(),r=n.length,s=0;s<r;s++){var a,h=n[s];(a=h.getTop())<e&&(e=a),(a=h.getLeft())<i&&(i=a)}return e==o.MAX_VALUE?null:(t=null!=n[0].getParent().paddingLeft?n[0].getParent().paddingLeft:this.margin,this.left=i-t,this.top=e-t,new g(this.left,this.top))},u.prototype.updateBounds=function(t){for(var e,i,n=o.MAX_VALUE,r=-o.MAX_VALUE,s=o.MAX_VALUE,a=-o.MAX_VALUE,h=this.nodes,l=h.length,g=0;g<l;g++){var c=h[g];t&&null!=c.child&&c.updateBounds(),(e=c.getLeft())<n&&(n=e),r<(e=c.getRight())&&(r=e),(e=c.getTop())<s&&(s=e),a<(e=c.getBottom())&&(a=e)}var u=new d(n,s,r-n,a-s);n==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),i=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=u.x-i,this.right=u.x+u.width+i,this.top=u.y-i,this.bottom=u.y+u.height+i},u.calculateBounds=function(t){for(var e=o.MAX_VALUE,i=-o.MAX_VALUE,n=o.MAX_VALUE,r=-o.MAX_VALUE,s=t.length,a=0;a<s;a++){var h,l=t[a];(h=l.getLeft())<e&&(e=h),i<(h=l.getRight())&&(i=h),(h=l.getTop())<n&&(n=h),r<(h=l.getBottom())&&(r=h)}return new d(e,n,i-e,r-n)},u.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,i=e.length,n=0;n<i;n++)t+=e[n].calcEstimatedSize();return this.estimatedSize=0==t?s.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},u.prototype.updateConnected=function(){var t=this;if(0==this.nodes.length)this.isConnected=!0;else{var e,i=new c,n=new Set,r=this.nodes[0];for(r.withChildren().forEach((function(t){i.push(t),n.add(t)}));0!==i.length;)for(var o,s,a=(o=(r=i.shift()).getEdges()).length,h=0;h<a;h++)null==(s=o[h].getOtherEndInGraph(r,this))||n.has(s)||s.withChildren().forEach((function(t){i.push(t),n.add(t)}));this.isConnected=!1,n.size>=this.nodes.length&&(e=0,n.forEach((function(i){i.owner==t&&e++})),e==this.nodes.length)&&(this.isConnected=!0)}},t.exports=u},function(t,e,i){var n,r=i(1);function o(t){n=i(6),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null);return t=this.add(t,e),this.setRootGraph(t),this.rootGraph},o.prototype.add=function(t,e,i,n,r){if(null==i&&null==n&&null==r){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(-1<this.graphs.indexOf(t))throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return(t.parent=e).child=t}if(r=i,i=t,t=(n=e).getOwner(),e=r.getOwner(),null==t||t.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==e||e.getGraphManager()!=this)throw"Target not in this graph mgr!";if(t==e)return i.isInterGraph=!1,t.add(i,n,r);if(i.isInterGraph=!0,i.source=n,i.target=r,-1<this.edges.indexOf(i))throw"Edge already in inter-graph edge list!";if(this.edges.push(i),null==i.source||null==i.target)throw"Edge source and/or target is null!";if(-1!=i.source.edges.indexOf(i)||-1!=i.target.edges.indexOf(i))throw"Edge already in source and/or target incidency list!";return i.source.edges.push(i),i.target.edges.push(i),i},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var i,o=[],s=(o=o.concat(e.getEdges())).length,a=0;a<s;a++)i=o[a],e.remove(i);var h,l=[];for(s=(l=l.concat(e.getNodes())).length,a=0;a<s;a++)h=l[a],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(e);this.graphs.splice(d,1),e.parent=null}else if(t instanceof r){if(null==(i=t))throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(null==i.source||null==i.target)throw"Source and/or target is null!";if(-1==i.source.edges.indexOf(i)||-1==i.target.edges.indexOf(i))throw"Source and/or target doesn't know this edge!";if(d=i.source.edges.indexOf(i),i.source.edges.splice(d,1),d=i.target.edges.indexOf(i),i.target.edges.splice(d,1),null==i.source.owner||null==i.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==i.source.owner.getGraphManager().edges.indexOf(i))throw"Not in owner graph manager's edge list!";d=i.source.owner.getGraphManager().edges.indexOf(i),i.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),i=e.length,n=0;n<i;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var i=0;i<e.length;i++)t=t.concat(e[i].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";null==(this.rootGraph=t).parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var i,n=t.getOwner();null!=(i=n.getParent());){if(i==e)return!0;if(null==(n=i.getOwner()))break}for(n=e.getOwner();null!=(i=n.getParent());){if(i==t)return!0;if(null==(n=i.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,i,n,r,o=this.getAllEdges(),s=o.length,a=0;a<s;a++)if(e=(t=o[a]).source,i=t.target,t.lca=null,(t.sourceInLca=e)==(t.targetInLca=i))t.lca=e.getOwner();else{for(n=e.getOwner();null==t.lca;){for(r=(t.targetInLca=i).getOwner();null==t.lca;){if(r==n){t.lca=r;break}if(r==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=r.getParent(),r=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var i=t.getOwner();null!=i;){for(var n=e.getOwner();null!=n;){if(n==i)return n;n=n.getParent().getOwner()}i=i.getParent().getOwner()}return i},o.prototype.calcInclusionTreeDepths=function(t,e){null==t&&null==e&&(t=this.rootGraph,e=1);for(var i,n=t.getNodes(),r=n.length,o=0;o<r;o++)(i=n[o]).inclusionTreeDepth=e,null!=i.child&&this.calcInclusionTreeDepths(i.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=[],i=this.edges.length,n=0;n<i;n++)t=this.edges[n],this.isOneAncestorOfOther(t.source,t.target)&&e.push(t);for(n=0;n<e.length;n++)this.remove(e[n]);return!1},t.exports=o},function(t,e,i){var n=i(12);function r(){}r.calcSeparationAmount=function(t,e,i,n){if(!t.intersects(e))throw"assert failed";var r=new Array(2),o=(this.decideDirectionsForOverlappingNodes(t,e,r),i[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),i[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?i[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(i[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(i[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom())),Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX())));e=(o=e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()?1:o)*i[0],t=i[1]/o,i[0]<t?t=i[0]:e=i[1],i[0]=-1*r[0]*(t/2+n),i[1]=-1*r[1]*(e/2+n)},r.decideDirectionsForOverlappingNodes=function(t,e,i){t.getCenterX()<e.getCenterX()?i[0]=-1:i[0]=1,t.getCenterY()<e.getCenterY()?i[1]=-1:i[1]=1},r.getIntersection2=function(t,e,i){var n=t.getCenterX(),r=t.getCenterY(),o=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return i[0]=n,i[1]=r,i[2]=o,i[3]=s,!0;var a=t.getX(),h=t.getY(),l=t.getRight(),d=t.getX(),g=t.getBottom(),c=t.getRight(),u=t.getWidthHalf(),p=t.getHeightHalf(),f=e.getX(),m=e.getY(),y=e.getRight(),v=e.getX(),E=e.getBottom(),N=e.getRight(),T=e.getWidthHalf(),A=e.getHeightHalf(),w=!1,I=!1;if(n===o){if(s<r)return i[0]=n,i[1]=h,i[2]=o,i[3]=E,!1;r<s&&(i[0]=n,i[1]=g,i[2]=o,i[3]=m)}else if(r===s){if(o<n)return i[0]=a,i[1]=r,i[2]=y,i[3]=s,!1;n<o&&(i[0]=l,i[1]=r,i[2]=f,i[3]=s)}else{t=t.height/t.width,e=e.height/e.width;var L,C=(s-r)/(o-n),_=void 0,M=void 0,x=void 0;if(-t==C?(o<n?(i[0]=d,i[1]=g):(i[0]=l,i[1]=h),w=!0):t==C&&(o<n?(i[0]=a,i[1]=h):(i[0]=c,i[1]=g),w=!0),-e==C?(n<o?(i[2]=v,i[3]=E):(i[2]=y,i[3]=m),I=!0):e==C&&(n<o?(i[2]=f,i[3]=m):(i[2]=N,i[3]=E),I=!0),w&&I)return!1;if(L=o<n?s<r?(_=this.getCardinalDirection(t,C,4),this.getCardinalDirection(e,C,2)):(_=this.getCardinalDirection(-t,C,3),this.getCardinalDirection(-e,C,1)):s<r?(_=this.getCardinalDirection(-t,C,1),this.getCardinalDirection(-e,C,3)):(_=this.getCardinalDirection(t,C,2),this.getCardinalDirection(e,C,4)),!w)switch(_){case 1:M=h,i[0]=n+-p/C,i[1]=M;break;case 2:M=r+u*C,i[0]=c,i[1]=M;break;case 3:M=g,i[0]=n+p/C,i[1]=M;break;case 4:M=r+-u*C,i[0]=d,i[1]=M}if(!I)switch(L){case 1:x=m,i[2]=o+-A/C,i[3]=x;break;case 2:x=s+T*C,i[2]=N,i[3]=x;break;case 3:x=E,i[2]=o+A/C,i[3]=x;break;case 4:x=s+-T*C,i[2]=v,i[3]=x}}return!1},r.getCardinalDirection=function(t,e,i){return e<t?i:1+i%4},r.getIntersection=function(t,e,i,r){var o,s,a,h,l,d,g,c,u,p,f;return null==r?this.getIntersection2(t,e,i):(o=t.x,t=t.y,s=e.x,e=e.y,a=i.x,i=i.y,p=g=void 0,0==(f=(l=e-t)*(u=a-(h=r.x))-(c=(r=r.y)-i)*(d=o-s))?null:new n((d*(p=h*i-a*r)-u*(g=s*t-o*e))/f,(c*g-l*p)/f))},r.angleOfVector=function(t,e,i,n){var r=void 0;return t!==i?(r=Math.atan((n-e)/(i-t)),i<t?r+=Math.PI:n<e&&(r+=this.TWO_PI)):r=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,r},r.doIntersect=function(t,e,i,n){var r=t.x,o=(t=t.y,e.x),s=(e=e.y,i.x),a=(i=i.y,n.x),h=(o-r)*((n=n.y)-i)-(a-s)*(e-t);return 0!=h&&(e=((t-e)*(a-r)+(o-r)*(n-t))/h,0<(o=((n-i)*(a-r)+(s-a)*(n-t))/h))&&o<1&&0<e&&e<1},r.findCircleLineIntersections=function(t,e,i,n,r,o,s){var a=(i-t)*(i-t)+(n-e)*(n-e);return 0<=(i=2*((t-r)*(i-t)+(e-o)*(n-e)))*i-4*a*(n=(t-r)*(t-r)+(e-o)*(e-o)-s*s)?(t=(-i+Math.sqrt(i*i-4*a*n))/(2*a),r=(-i-Math.sqrt(i*i-4*a*n))/(2*a),0<=t&&t<=1?[t]:0<=r&&r<=1?[r]:null):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,e,i){function n(){}n.sign=function(t){return 0<t?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,i){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t){return{value:t,next:null,prev:null}}function o(t,e,i,n){return null!==t?t.next=e:n.head=e,null!==i?i.prev=e:n.tail=e,e.prev=t,e.next=i,n.length++,e}function s(t,e){var i=t.prev,n=t.next;return null!==i?i.next=n:e.head=n,null!==n?n.prev=i:e.tail=i,t.prev=t.next=null,e.length--,t}function a(t){var e=this;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.length=0,this.head=null,(this.tail=null)!=t&&t.forEach((function(t){return e.push(t)}))}(function(t,e,i){e&&n(t.prototype,e)})(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,r(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,r(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,r(t),null,this)}},{key:"unshift",value:function(t){return o(null,r(t),this.head,this)}},{key:"remove",value:function(t){return s(t,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,i=this.head;e<t;)i=i.next,e++;return i.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;n.value=e}}}]),t.exports=a},function(t,e,i){function n(t,e,i){this.x=null,(this.y=null)==t&&null==e&&null==i?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==i?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==i&&(this.x=(i=t).x,this.y=i.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,i){"Point"==t.constructor.name&&null==e&&null==i?this.setLocation((i=t).x,i.y):"number"==typeof t&&"number"==typeof e&&null==i&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){return"Point"==t.constructor.name?this.x==t.x&&this.y==t.y:this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,i){function n(t,e,i,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=i&&null!=n&&(this.x=t,this.y=e,this.width=i,this.height=n)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,i){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function r(){}r.lastID=0,r.createID=function(t){return r.isPrimitive(t)?t:(null==t.uniqueID&&(t.uniqueID=r.getString(),r.lastID++),t.uniqueID)},r.getString=function(t){return"Object#"+(null==t?r.lastID:t)},r.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=r},function(t,e,i){function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(0),o=i(7),s=i(3),a=i(1),h=i(6),l=i(5),d=i(17),g=i(29);function c(t){g.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 o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}c.RANDOM_SEED=1,(c.prototype=Object.create(g.prototype)).getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t},c.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},c.prototype.newNode=function(t){return new s(this.graphManager,t)},c.prototype.newEdge=function(t){return new a(null,null,t)},c.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==r.ANIMATE&&(t&&!this.isSubLayout&&this.doPostLayout(),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var i=this.graphManager.getRoot().getNodes();for(e=0;e<i.length;e++)i[e];this.update(this.graphManager.getRoot())}},c.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var i=e.getChild().getNodes(),n=0;n<i.length;n++)update(i[n]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else t instanceof a?null!=t.vGraphObject&&t.vGraphObject.update(t):t instanceof h&&null!=t.vGraphObject&&t.vGraphObject.update(t)},c.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)},c.prototype.transform=function(t){if(null==t)this.transform(new l(0,0));else{var e=new d,i=this.graphManager.getRoot().updateLeftTop();if(null!=i){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(i.x),e.setDeviceOrgY(i.y);for(var n=this.getAllNodes(),r=0;r<n.length;r++)n[r].transform(e)}}},c.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,i,n=t.getNodes(),r=0;r<n.length;r++)null==(i=(e=n[r]).getChild())||0==i.getNodes().length?e.scatter():(this.positionNodesRandomly(i),e.updateBounds())},c.prototype.getFlatForest=function(){for(var t=[],e=!0,i=this.graphManager.getRoot().getNodes(),r=!0,o=0;o<i.length;o++)null!=i[o].getChild()&&(r=!1);if(r)for(var s=new Set,a=[],h=new Map,l=(l=[]).concat(i);0<l.length&&e;){for(a.push(l[0]);0<a.length&&e;){var d=a[0],g=(a.splice(0,1),s.add(d),d.getEdges());for(o=0;o<g.length;o++){var c=g[o].getOtherEnd(d);if(h.get(d)!=c){if(s.has(c)){e=!1;break}a.push(c),h.set(c,d)}}}if(e){var u=[].concat(n(s));for(t.push(u),o=0;o<u.length;o++){var p=u[o];-1<(p=l.indexOf(p))&&l.splice(p,1)}s=new Set,h=new Map}else t=[]}return t},c.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],i=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),r=0;r<t.bendpoints.length;r++){var o=this.newNode(null),s=(o.setRect(new Point(0,0),new Dimension(1,1)),n.add(o),this.newEdge(null));this.graphManager.add(s,i,o),e.add(o),i=o}return s=this.newEdge(null),this.graphManager.add(s,i,t.target),this.edgeToDummyNodes.set(t,e),(t.isInterGraph()?this.graphManager:n).remove(t),e},c.prototype.createBendpointsFromDummyNodes=function(){var t=(t=[]).concat(this.graphManager.getAllEdges());t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var i=t[e];if(0<i.bendpoints.length){for(var r=this.edgeToDummyNodes.get(i),o=0;o<r.length;o++){var s=r[o],a=new l(s.getCenterX(),s.getCenterY()),h=i.bendpoints.get(o);h.x=a.x,h.y=a.y,s.getOwner().remove(s)}this.graphManager.add(i,i.source,i.target)}}},c.transform=function(t,e,i,n){var r,o;return null!=i&&null!=n?(r=e,t<=50?r-=(e-e/i)/50*(50-t):r+=(e*n-e)/50*(t-50),r):(i=t<=50?(o=9*e/500,e/10):(o=9*e/50,-8*e),o*t+i)},c.findCenterOfTree=function(t){var e=(e=[]).concat(t),i=[],n=new Map,r=!1,o=null;1!=e.length&&2!=e.length||(r=!0,o=e[0]);for(var s=0;s<e.length;s++){var a=(l=e[s]).getNeighborsList().size;n.set(l,l.getNeighborsList().size),1==a&&i.push(l)}for(h=(h=[]).concat(i);!r;){[].concat(h);var h=[];for(s=0;s<e.length;s++){var l=e[s],d=e.indexOf(l);0<=d&&e.splice(d,1),l.getNeighborsList().forEach((function(t){var e;i.indexOf(t)<0&&(1==(e=n.get(t)-1)&&h.push(t),n.set(t,e))}))}i=i.concat(h),1!=e.length&&2!=e.length||(r=!0,o=e[0])}return o},c.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=c},function(t,e,i){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return(n.x=1e4*Math.sin(n.seed++))-Math.floor(n.x)},t.exports=n},function(t,e,i){var n=i(5);function r(t,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(t){this.lworldOrgX=t},r.prototype.getWorldOrgY=function(){return this.lworldOrgY},r.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},r.prototype.getWorldExtX=function(){return this.lworldExtX},r.prototype.setWorldExtX=function(t){this.lworldExtX=t},r.prototype.getWorldExtY=function(){return this.lworldExtY},r.prototype.setWorldExtY=function(t){this.lworldExtY=t},r.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},r.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},r.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},r.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},r.prototype.getDeviceExtX=function(){return this.ldeviceExtX},r.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},r.prototype.getDeviceExtY=function(){return this.ldeviceExtY},r.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},r.prototype.transformX=function(t){var e=0,i=this.lworldExtX;return 0!=i?this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/i:e},r.prototype.transformY=function(t){var e=0,i=this.lworldExtY;return 0!=i?this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/i:e},r.prototype.inverseTransformX=function(t){var e=0,i=this.ldeviceExtX;return 0!=i?this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/i:e},r.prototype.inverseTransformY=function(t){var e=0,i=this.ldeviceExtY;return 0!=i?this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/i:e},r.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=r},function(t,e,i){var n,r=i(15),o=i(4),s=i(0),a=i(8),h=i(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}for(n in l.prototype=Object.create(r.prototype),r)l[n]=r[n];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var t,e,i,n,r,a,h=this.getGraphManager().getAllEdges(),l=0;l<h.length;l++)e=(t=h[l]).idealLength,t.isInterGraph&&(i=t.getSource(),n=t.getTarget(),r=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=r+a-2*s.SIMPLE_NODE_SIZE),r=t.getLca().getInclusionTreeDepth(),t.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(i.getInclusionTreeDepth()+n.getInclusionTreeDepth()-2*r))},l.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),i=0;i<e.length;i++)t=e[i],this.calcSpringForce(t,t.idealLength)},l.prototype.calcRepulsionForces=function(){var t,e,i,n,r,s=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],a=1<arguments.length&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),r=new Set,t=0;t<h.length;t++)i=h[t],this.calculateRepulsionForceOfANode(i,r,s,a),r.add(i);else for(t=0;t<h.length;t++)for(i=h[t],e=t+1;e<h.length;e++)n=h[e],i.getOwner()==n.getOwner()&&this.calcRepulsionForce(i,n)},l.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),i=0;i<e.length;i++)t=e[i],this.calcGravitationalForce(t)},l.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},l.prototype.calcSpringForce=function(t,e){var i,n,r=t.getSource(),o=t.getTarget();if(this.uniformLeafNodeSizes&&null==r.getChild()&&null==o.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(i=t.getLength())&&(n=(e=t.edgeElasticity*(i-e))*(t.lengthX/i),e*=t.lengthY/i,r.springForceX+=n,r.springForceY+=e,o.springForceX-=n,o.springForceY-=e)},l.prototype.calcRepulsionForce=function(t,e){var i,n,r,s=t.getRect(),l=e.getRect(),d=new Array(2),g=new Array(4);s.intersects(l)?(a.calcSeparationAmount(s,l,d,o.DEFAULT_EDGE_LENGTH/2),n=2*d[0],r=2*d[1],d=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren),t.repulsionForceX-=d*n,t.repulsionForceY-=d*r,e.repulsionForceX+=d*n,e.repulsionForceY+=d*r):(d=this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(i=l.getCenterX()-s.getCenterX(),l.getCenterY()-s.getCenterY()):(a.getIntersection(s,l,g),i=g[2]-g[0],g[3]-g[1]),s=(i=Math.abs(i)<o.MIN_REPULSION_DIST?h.sign(i)*o.MIN_REPULSION_DIST:i)*i+(d=Math.abs(d)<o.MIN_REPULSION_DIST?h.sign(d)*o.MIN_REPULSION_DIST:d)*d,l=Math.sqrt(s),r=(g=(t.nodeRepulsion/2+e.nodeRepulsion/2)*t.noOfChildren*e.noOfChildren/s)*d/l,t.repulsionForceX-=n=g*i/l,t.repulsionForceY-=r,e.repulsionForceX+=n,e.repulsionForceY+=r)},l.prototype.calcGravitationalForce=function(t){var e,i=t.getOwner(),n=(i.getRight()+i.getLeft())/2,r=(i.getTop()+i.getBottom())/2,o=(n=t.getCenterX()-n,r=t.getCenterY()-r,Math.abs(n)+t.getWidth()/2),s=Math.abs(r)+t.getHeight()/2;t.getOwner()==this.graphManager.getRoot()?((e=i.getEstimatedSize()*this.gravityRangeFactor)<o||e<s)&&(t.gravitationForceX=-this.gravityConstant*n,t.gravitationForceY=-this.gravityConstant*r):((e=i.getEstimatedSize()*this.compoundGravityRangeFactor)<o||e<s)&&(t.gravitationForceX=-this.gravityConstant*n*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*r*this.compoundGravityConstant)},l.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},l.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},l.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)(t=e[i]).noOfChildren=t.getNoOfChildren()},l.prototype.calcGrid=function(t){for(var e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),i=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange)),n=new Array(e),r=0;r<e;r++)n[r]=new Array(i);for(r=0;r<e;r++)for(var o=0;o<i;o++)n[r][o]=new Array;return n},l.prototype.addNodeToGrid=function(t,e,i){for(var n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),r=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-i)/this.repulsionRange)),a=n;a<=r;a++)for(var h=o;h<=s;h++)this.grid[a][h].push(t),t.setGridCoordinates(n,r,o,s)},l.prototype.updateGrid=function(){var t,e,i=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<i.length;t++)e=i[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},l.prototype.calculateRepulsionForceOfANode=function(t,e,i,n){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i||n){for(var r=new Set,s=(t.surrounding=new Array,this.grid),a=t.startX-1;a<t.finishX+2;a++)for(var h=t.startY-1;h<t.finishY+2;h++)if(!(a<0||h<0||a>=s.length||h>=s[0].length))for(var l=0;l<s[a][h].length;l++){var d,g,c=s[a][h][l];t.getOwner()!=c.getOwner()||t==c||e.has(c)||r.has(c)||(d=Math.abs(t.getCenterX()-c.getCenterX())-(t.getWidth()/2+c.getWidth()/2),g=Math.abs(t.getCenterY()-c.getCenterY())-(t.getHeight()/2+c.getHeight()/2),d<=this.repulsionRange&&g<=this.repulsionRange&&r.add(c))}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}(r))}for(a=0;a<t.surrounding.length;a++)this.calcRepulsionForce(t,t.surrounding[a])},l.prototype.calcRepulsionRange=function(){return 0},t.exports=l},function(t,e,i){var n,r=i(1),o=i(4);function s(t,e,i){r.call(this,t,e,i),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}for(n in s.prototype=Object.create(r.prototype),r)s[n]=r[n];t.exports=s},function(t,e,i){var n,r=i(3),o=i(4);function s(t,e,i,n){r.call(this,t,e,i,n),this.nodeRepulsion=o.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(n in s.prototype=Object.create(r.prototype),r)s[n]=r[n];s.prototype.setGridCoordinates=function(t,e,i,n){this.startX=t,this.finishX=e,this.startY=i,this.finishY=n},t.exports=s},function(t,e,i){function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,i){var n=i(14);function r(){this.map={},this.keys=[]}r.prototype.put=function(t,e){var i=n.createID(t);this.contains(i)||(this.map[i]=e,this.keys.push(t))},r.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},r.prototype.get=function(t){return t=n.createID(t),this.map[t]},r.prototype.keySet=function(){return this.keys},t.exports=r},function(t,e,i){var n=i(14);function r(){this.set={}}r.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},r.prototype.remove=function(t){delete this.set[n.createID(t)]},r.prototype.clear=function(){this.set={}},r.prototype.contains=function(t){return this.set[n.createID(t)]==t},r.prototype.isEmpty=function(){return 0===this.size()},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),i=e.length,n=0;n<i;n++)t.push(this.set[e[n]])},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAll=function(t){for(var e=t.length,i=0;i<e;i++){var n=t[i];this.add(n)}},t.exports=r},function(t,e,i){function n(){}n.multMat=function(t,e){for(var i=[],n=0;n<t.length;n++){i[n]=[];for(var r=0;r<e[0].length;r++)for(var o=i[n][r]=0;o<t[0].length;o++)i[n][r]+=t[n][o]*e[o][r]}return i},n.transpose=function(t){for(var e=[],i=0;i<t[0].length;i++){e[i]=[];for(var n=0;n<t.length;n++)e[i][n]=t[n][i]}return e},n.multCons=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]*e;return i},n.minusOp=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]-e[n];return i},n.dotProduct=function(t,e){for(var i=0,n=0;n<t.length;n++)i+=t[n]*e[n];return i},n.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},n.normalize=function(t){for(var e=[],i=this.mag(t),n=0;n<t.length;n++)e[n]=t[n]/i;return e},n.multGamma=function(t){for(var e=[],i=0,n=0;n<t.length;n++)i+=t[n];i*=-1/t.length;for(var r=0;r<t.length;r++)e[r]=i+t[r];return e},n.multL=function(t,e,i){for(var n=[],r=[],o=[],s=0;s<e[0].length;s++){for(var a=0,h=0;h<e.length;h++)a+=-.5*e[h][s]*t[h];r[s]=a}for(var l=0;l<i.length;l++){for(var d=0,g=0;g<i.length;g++)d+=i[l][g]*r[g];o[l]=d}for(var c=0;c<e.length;c++){for(var u=0,p=0;p<e[0].length;p++)u+=e[c][p]*o[p];n[c]=u}return n},t.exports=n},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var r=i(11);function o(t,e){if(!(this instanceof o))throw new TypeError("Cannot call a class as a function");null===e&&void 0===e||(this.compareFunction=this._defaultCompareFunction),e=void 0,e=t instanceof r?t.size():t.length,this._quicksort(t,0,e-1)}(function(t,e,i){e&&n(t.prototype,e),i&&n(t,i)})(o,[{key:"_quicksort",value:function(t,e,i){var n;e<i&&(n=this._partition(t,e,i),this._quicksort(t,e,n),this._quicksort(t,n+1,i))}},{key:"_partition",value:function(t,e,i){for(var n=this._get(t,e),r=e,o=i;;){for(;this.compareFunction(n,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,r),n);)r++;if(!(r<o))return o;this._swap(t,r,o),r++,o--}}},{key:"_get",value:function(t,e){return t instanceof r?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,i){t instanceof r?t.set_object_at(e,i):t[e]=i}},{key:"_swap",value:function(t,e,i){var n=this._get(t,e);this._set(t,e,this._get(t,i)),this._set(t,i,n)}},{key:"_defaultCompareFunction",value:function(t,e){return t<e}}]),i=o,t.exports=i},function(t,e,i){function n(){}n.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;for(var e,i,r,o=Math.min(this.m,this.n),s=(this.s=function(t){for(var e=[];0<t--;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}([this.m,o]),this.V=function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}([this.n,this.n]),function(t){for(var e=[];0<t--;)e.push(0);return e}(this.n)),a=function(t){for(var e=[];0<t--;)e.push(0);return e}(this.m),h=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),d=0;d<Math.max(h,l);d++){if(d<h){this.s[d]=0;for(var g=d;g<this.m;g++)this.s[d]=n.hypot(this.s[d],t[g][d]);if(0!==this.s[d]){t[d][d]<0&&(this.s[d]=-this.s[d]);for(var c=d;c<this.m;c++)t[c][d]/=this.s[d];t[d][d]+=1}this.s[d]=-this.s[d]}for(var u=d+1;u<this.n;u++){if(r=0!==this.s[d],d<h&&r){for(var p=0,f=d;f<this.m;f++)p+=t[f][d]*t[f][u];p=-p/t[d][d];for(var m=d;m<this.m;m++)t[m][u]+=p*t[m][d]}s[u]=t[d][u]}if(d<h)for(var y=d;y<this.m;y++)this.U[y][d]=t[y][d];if(d<l){s[d]=0;for(var v=d+1;v<this.n;v++)s[d]=n.hypot(s[d],s[v]);if(0!==s[d]){s[d+1]<0&&(s[d]=-s[d]);for(var E=d+1;E<this.n;E++)s[E]/=s[d];s[d+1]+=1}if(s[d]=-s[d],e=d+1<this.m,i=0!==s[d],e&&i){for(var N=d+1;N<this.m;N++)a[N]=0;for(var T=d+1;T<this.n;T++)for(var A=d+1;A<this.m;A++)a[A]+=s[T]*t[A][T];for(var w=d+1;w<this.n;w++)for(var I=-s[w]/s[d+1],L=d+1;L<this.m;L++)t[L][w]+=I*a[L]}for(var C=d+1;C<this.n;C++)this.V[C][d]=s[C]}}var _=Math.min(this.n,this.m+1);h<this.n&&(this.s[h]=t[h][h]),this.m<_&&(this.s[_-1]=0),l+1<_&&(s[l]=t[l][_-1]),s[_-1]=0;for(var M=h;M<o;M++){for(var x=0;x<this.m;x++)this.U[x][M]=0;this.U[M][M]=1}for(var O=h-1;0<=O;O--)if(0!==this.s[O]){for(var D=O+1;D<o;D++){for(var b=0,R=O;R<this.m;R++)b+=this.U[R][O]*this.U[R][D];b=-b/this.U[O][O];for(var F=O;F<this.m;F++)this.U[F][D]+=b*this.U[F][O]}for(var G=O;G<this.m;G++)this.U[G][O]=-this.U[G][O];this.U[O][O]=1+this.U[O][O];for(var S=0;S<O-1;S++)this.U[S][O]=0}else{for(var P=0;P<this.m;P++)this.U[P][O]=0;this.U[O][O]=1}for(var U,Y=this.n-1;0<=Y;Y--){if(U=0!==s[Y],Y<l&&U)for(var k=Y+1;k<o;k++){for(var H=0,X=Y+1;X<this.n;X++)H+=this.V[X][Y]*this.V[X][k];H=-H/this.V[Y+1][Y];for(var z=Y+1;z<this.n;z++)this.V[z][k]+=H*this.V[z][Y]}for(var V=0;V<this.n;V++)this.V[V][Y]=0;this.V[Y][Y]=1}for(var B=_-1,W=Math.pow(2,-52),j=Math.pow(2,-966);0<_;){var q=void 0,$=void 0;for(q=_-2;-1<=q&&-1!==q;q--)if(Math.abs(s[q])<=j+W*(Math.abs(this.s[q])+Math.abs(this.s[q+1]))){s[q]=0;break}if(q===_-2)$=4;else{var Z=void 0;for(Z=_-1;q<=Z&&Z!==q;Z--){var Q=(Z!==_?Math.abs(s[Z]):0)+(Z!==q+1?Math.abs(s[Z-1]):0);if(Math.abs(this.s[Z])<=j+W*Q){this.s[Z]=0;break}}Z===q?$=3:Z===_-1?$=1:($=2,q=Z)}switch(q++,$){case 1:var J=s[_-2];s[_-2]=0;for(var K=_-2;q<=K;K--){var tt=n.hypot(this.s[K],J),et=this.s[K]/tt,it=J/tt;this.s[K]=tt,K!==q&&(J=-it*s[K-1],s[K-1]=et*s[K-1]);for(var nt=0;nt<this.n;nt++)tt=et*this.V[nt][K]+it*this.V[nt][_-1],this.V[nt][_-1]=-it*this.V[nt][K]+et*this.V[nt][_-1],this.V[nt][K]=tt}break;case 2:var rt=s[q-1];s[q-1]=0;for(var ot=q;ot<_;ot++){var st=n.hypot(this.s[ot],rt),at=this.s[ot]/st,ht=rt/st;this.s[ot]=st,rt=-ht*s[ot],s[ot]=at*s[ot];for(var lt=0;lt<this.m;lt++)st=at*this.U[lt][ot]+ht*this.U[lt][q-1],this.U[lt][q-1]=-ht*this.U[lt][ot]+at*this.U[lt][q-1],this.U[lt][ot]=st}break;case 3:for(var dt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[_-1]),Math.abs(this.s[_-2])),Math.abs(s[_-2])),Math.abs(this.s[q])),Math.abs(s[q])),gt=this.s[_-1]/dt,ct=this.s[_-2]/dt,ut=s[_-2]/dt,pt=this.s[q]/dt,ft=(dt=s[q]/dt,ct=((ct+gt)*(ct-gt)+ut*ut)/2,ut=gt*ut*(gt*ut),0),mt=(0==ct&&0==ut||(ft=Math.sqrt(ct*ct+ut),ft=ut/(ct+(ft=ct<0?-ft:ft))),(pt+gt)*(pt-gt)+ft),yt=pt*dt,vt=q;vt<_-1;vt++){var Et=n.hypot(mt,yt),Nt=mt/Et,Tt=yt/Et;vt!==q&&(s[vt-1]=Et),mt=Nt*this.s[vt]+Tt*s[vt],s[vt]=Nt*s[vt]-Tt*this.s[vt],yt=Tt*this.s[vt+1],this.s[vt+1]=Nt*this.s[vt+1];for(var At=0;At<this.n;At++)Et=Nt*this.V[At][vt]+Tt*this.V[At][vt+1],this.V[At][vt+1]=-Tt*this.V[At][vt]+Nt*this.V[At][vt+1],this.V[At][vt]=Et;if(Nt=mt/(Et=n.hypot(mt,yt)),Tt=yt/Et,this.s[vt]=Et,mt=Nt*s[vt]+Tt*this.s[vt+1],this.s[vt+1]=-Tt*s[vt]+Nt*this.s[vt+1],yt=Tt*s[vt+1],s[vt+1]=Nt*s[vt+1],vt<this.m-1)for(var wt=0;wt<this.m;wt++)Et=Nt*this.U[wt][vt]+Tt*this.U[wt][vt+1],this.U[wt][vt+1]=-Tt*this.U[wt][vt]+Nt*this.U[wt][vt+1],this.U[wt][vt]=Et}s[_-2]=mt;break;case 4:if(this.s[q]<=0){this.s[q]=this.s[q]<0?-this.s[q]:0;for(var It=0;It<=B;It++)this.V[It][q]=-this.V[It][q]}for(;q<B&&!(this.s[q]>=this.s[q+1]);){var Lt=this.s[q];if(this.s[q]=this.s[q+1],this.s[q+1]=Lt,q<this.n-1)for(var Ct=0;Ct<this.n;Ct++)Lt=this.V[Ct][q+1],this.V[Ct][q+1]=this.V[Ct][q],this.V[Ct][q]=Lt;if(q<this.m-1)for(var _t=0;_t<this.m;_t++)Lt=this.U[_t][q+1],this.U[_t][q+1]=this.U[_t][q],this.U[_t][q]=Lt;q++}_--}}return{U:this.U,V:this.V,S:this.s}},n.hypot=function(t,e){var i=void 0;return Math.abs(t)>Math.abs(e)?(i=e/t,Math.abs(t)*Math.sqrt(1+i*i)):0!=e?(i=t/e,Math.abs(e)*Math.sqrt(1+i*i)):0},t.exports=n},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}!function(t,e,i){e&&n(t.prototype,e)}(o,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var n=1;n<this.jMax;n++){var r=[this.sequence1[i-1]===this.sequence2[n-1]?this.grid[i-1][n-1]+this.match_score:this.grid[i-1][n-1]+this.mismatch_penalty,this.grid[i-1][n]+this.gap_penalty,this.grid[i][n-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(r);this.grid[i][n]=r[o[0]],this.tracebackGrid[i][n]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],i=this.tracebackGrid[e.pos[0]][e.pos[1]];i[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),i[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),i[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var i=[],n=-1;-1!==(n=t.indexOf(e,n+1));)i.push(n);return i}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]);var r=o;function o(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:-1,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:-1;if(!(this instanceof o))throw new TypeError("Cannot call a class as a function");this.sequence1=t,this.sequence2=e,this.match_score=i,this.mismatch_penalty=n,this.gap_penalty=r,this.iMax=t.length+1,this.jMax=e.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[s][a]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[h][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}t.exports=r},function(t,e,i){function n(){}n.FDLayout=i(18),n.FDLayoutConstants=i(4),n.FDLayoutEdge=i(19),n.FDLayoutNode=i(20),n.DimensionD=i(21),n.HashMap=i(22),n.HashSet=i(23),n.IGeometry=i(8),n.IMath=i(9),n.Integer=i(10),n.Point=i(12),n.PointD=i(5),n.RandomSeed=i(16),n.RectangleD=i(13),n.Transform=i(17),n.UniqueIDGeneretor=i(14),n.Quicksort=i(25),n.LinkedList=i(11),n.LGraphObject=i(2),n.LGraph=i(6),n.LEdge=i(1),n.LGraphManager=i(7),n.LNode=i(3),n.Layout=i(15),n.LayoutConstants=i(0),n.NeedlemanWunsch=i(27),n.Matrix=i(24),n.SVD=i(26),t.exports=n},function(t,e,i){function n(){this.listeners=[]}var r=n.prototype;r.addListener=function(t,e){this.listeners.push({event:t,callback:e})},r.removeListener=function(t,e){for(var i=this.listeners.length;0<=i;i--){var n=this.listeners[i];n.event===t&&n.callback===e&&this.listeners.splice(i,1)}},r.emit=function(t,e){for(var i=0;i<this.listeners.length;i++){var n=this.listeners[i];t===n.event&&n.callback(e)}},t.exports=n}],i={},t.m=e,t.c=i,t.i=function(t){return t},t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=28);function t(n){var r;return(i[n]||(r=i[n]={i:n,l:!1,exports:{}},e[n].call(r.exports,r,r.exports,t),r.l=!0,r)).exports}var e,i},b.exports=t()),b.exports}())),D.exports}x=function(t){return e={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,i=Array(1<e?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i.forEach((function(e){Object.keys(e).forEach((function(i){return t[i]=e[i]}))})),t}},548:(t,e,i)=>{var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var i=e,n=[],r=!0,o=void(e=!1);try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!i||n.length!==i);r=!0);}catch(t){e=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(e)throw o}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=i(140).layoutBase.LinkedList;i={getTopMostNodes:function(t){for(var e={},i=0;i<t.length;i++)e[t[i].id()]=!0;return t.filter((function(t,i){for(var n=(t="number"==typeof t?i:t).parent()[0];null!=n;){if(e[n.id()])return!1;n=n.parent()[0]}return!0}))},connectComponents:function(t,e,i,n){function o(){var n,r=t.collection(),o=(f.push(r),i[0]),m=t.collection();for(m.merge(o).merge(o.descendants().intersection(e)),h.push(o),m.forEach((function(t){s.push(t),a.add(t),r.merge(t)}));0!=s.length;)!function(){o=s.shift();var n=t.collection();o.neighborhood().nodes().forEach((function(t){0<e.intersection(o.edgesWith(t)).length&&n.merge(t)}));for(var d=0;d<n.length;d++){var g=n[d];null==(l=i.intersection(g.union(g.ancestors())))||a.has(l[0])||l.union(l.descendants()).forEach((function(t){s.push(t),a.add(t),r.merge(t),i.has(t)&&h.push(t)}))}}();r.forEach((function(t){e.intersection(t.connectedEdges()).forEach((function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)}))})),(!(c=h.length==i.length||c)||1<u)&&(d=h[0],g=d.connectedEdges().length,h.forEach((function(t){t.connectedEdges().length<g&&(g=t.connectedEdges().length,d=t)})),p.push(d.id()),(n=t.collection()).merge(h[0]),h.forEach((function(t){n.merge(t)})),h=[],i=i.difference(n),u++)}for(var s=new r,a=new Set,h=[],l=void 0,d=void 0,g=void 0,c=!1,u=1,p=[],f=[];o(),!c;);return n&&0<p.length&&n.set("dummy"+(n.size+1),p),f},relocateComponent:function(t,e,i){if(!i.fixedNodeConstraint){var r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if("draft"==i.quality){var h=!0,l=!1,d=void 0;try{for(var g,c=e.nodeIndexes[Symbol.iterator]();!(h=(g=c.next()).done);h=!0){var u,p,f,m,y,v=g.value,E=n(v,2),N=E[0],T=E[1],A=i.cy.getElementById(N);A&&(u=A.boundingBox(),p=e.xCoords[T]-u.w/2,f=e.xCoords[T]+u.w/2,m=e.yCoords[T]-u.h/2,y=e.yCoords[T]+u.h/2,p<r&&(r=p),o<f&&(o=f),m<s&&(s=m),a<y)&&(a=y)}}catch(t){l=!0,d=t}finally{try{!h&&c.return&&c.return()}finally{if(l)throw d}}var w=t.x-(o+r)/2,I=t.y-(a+s)/2;e.xCoords=e.xCoords.map((function(t){return t+w})),e.yCoords=e.yCoords.map((function(t){return t+I}))}else{Object.keys(e).forEach((function(t){var i=(t=e[t]).getRect().x,n=t.getRect().x+t.getRect().width,h=t.getRect().y;t=t.getRect().y+t.getRect().height,i<r&&(r=i),o<n&&(o=n),h<s&&(s=h),a<t&&(a=t)}));var L=t.x-(o+r)/2,C=t.y-(a+s)/2;Object.keys(e).forEach((function(t){(t=e[t]).setCenter(t.getCenterX()+L,t.getCenterY()+C)}))}}},calcBoundingBox:function(t,e,i,n){for(var r=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,h=t.descendants().not(":parent"),l=h.length,d=0;d<l;d++){var g,c=h[d];(g=e[n.get(c.id())]-c.width()/2)<r&&(r=g),o<(g=e[n.get(c.id())]+c.width()/2)&&(o=g),(g=i[n.get(c.id())]-c.height()/2)<s&&(s=g),a<(g=i[n.get(c.id())]+c.height()/2)&&(a=g)}return(t={}).topLeftX=r,t.topLeftY=s,t.width=o-r,t.height=a-s,t},calcParentsWithoutChildren:function(t,e){var i=t.collection();return e.nodes(":parent").forEach((function(t){var e=!1;t.children().forEach((function(t){"none"!=t.css("display")&&(e=!0)})),e||i.merge(t)})),i}},t.exports=i},816:(t,e,i)=>{var n=i(548),r=i(140).CoSELayout,o=i(140).CoSENode,s=i(140).layoutBase.PointD,a=i(140).layoutBase.DimensionD,h=i(140).layoutBase.LayoutConstants,l=i(140).layoutBase.FDLayoutConstants,d=i(140).CoSEConstants;t.exports={coseLayout:function(t,e){function i(t,e){return E(t)?t(e):t}var g=t.cy,c=t.eles,u=c.nodes(),p=c.edges(),f=void 0,m=void 0,y=void 0,v={},E=(t.randomize&&(f=e.nodeIndexes,m=e.xCoords,y=e.yCoords),function(t){return"function"==typeof t}),N=n.calcParentsWithoutChildren(g,c);null!=t.nestingFactor&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(d.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(d.MAX_ITERATIONS=l.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(d.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?h.QUALITY=2:h.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!t.randomize,d.ANIMATE=l.ANIMATE=h.ANIMATE=t.animate,d.TILE=t.tile,d.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!t.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),"enforced"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),"cose"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;for(var T=(function t(e,r,h,l){for(var d=r.length,g=0;g<d;g++){var c,u=r[g],p=null,E=void(0==u.intersection(N).length&&(p=u.children())),T=u.layoutDimensions({nodeDimensionsIncludeLabels:l.nodeDimensionsIncludeLabels});(E=null!=u.outerWidth()&&null!=u.outerHeight()?l.randomize?u.isParent()?(c=n.calcBoundingBox(u,m,y,f),0==u.intersection(N).length?e.add(new o(h.graphManager,new s(c.topLeftX,c.topLeftY),new a(c.width,c.height))):e.add(new o(h.graphManager,new s(c.topLeftX,c.topLeftY),new a(parseFloat(T.w),parseFloat(T.h))))):e.add(new o(h.graphManager,new s(m[f.get(u.id())]-T.w/2,y[f.get(u.id())]-T.h/2),new a(parseFloat(T.w),parseFloat(T.h)))):e.add(new o(h.graphManager,new s(u.position("x")-T.w/2,u.position("y")-T.h/2),new a(parseFloat(T.w),parseFloat(T.h)))):e.add(new o(this.graphManager))).id=u.data("id"),E.nodeRepulsion=i(l.nodeRepulsion,u),E.paddingLeft=parseInt(u.css("padding")),E.paddingTop=parseInt(u.css("padding")),E.paddingRight=parseInt(u.css("padding")),E.paddingBottom=parseInt(u.css("padding")),l.nodeDimensionsIncludeLabels&&(E.labelWidth=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,E.labelHeight=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,E.labelPosVertical=u.css("text-valign"),E.labelPosHorizontal=u.css("text-halign")),v[u.data("id")]=E,isNaN(E.rect.x)&&(E.rect.x=0),isNaN(E.rect.y)&&(E.rect.y=0),null!=p&&0<p.length&&t(h.getGraphManager().add(h.newGraph(),E),p,h,l)}}((g=(e=new r).newGraphManager()).addRoot(),n.getTopMostNodes(u),e,t),e),A=g,w=p,I=0,L=0,C=0;C<w.length;C++){var _=w[C],M=v[_.data("source")],x=v[_.data("target")];M&&x&&M!==x&&0==M.getEdgesBetween(x).length&&((M=A.add(T.newEdge(),M,x)).id=_.id(),M.idealLength=i(t.idealEdgeLength,_),M.edgeElasticity=i(t.edgeElasticity,_),I+=M.idealLength,L++)}return null!=t.idealEdgeLength&&(0<L?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=I/L:E(t.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,d.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH),c=e,(u=t).fixedNodeConstraint&&(c.constraints.fixedNodeConstraint=u.fixedNodeConstraint),u.alignmentConstraint&&(c.constraints.alignmentConstraint=u.alignmentConstraint),u.relativePlacementConstraint&&(c.constraints.relativePlacementConstraint=u.relativePlacementConstraint),e.runLayout(),v}}},212:(t,e,i)=>{function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var r=i(658),o=i(548),s=i(657).spectralLayout,a=i(816).coseLayout,h=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(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){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(){}});function l(t){if(!(this instanceof l))throw new TypeError("Cannot call a class as a function");this.options=r({},h,t)}(function(t,e,i){e&&n(t.prototype,e),i&&n(t,i)})(l,[{key:"run",value:function(){var t=this.options,e=t.cy,i=t.eles,n=[],r=[],h=void 0,l=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var d=void 0,g=!1;if(e.layoutUtilities&&t.packComponents&&(d=(d=e.layoutUtilities("get"))||e.layoutUtilities(),g=!0),0<i.nodes().length)if(g){if(g=o.getTopMostNodes(t.eles.nodes()),(h=o.connectComponents(e,t.eles,g)).forEach((function(t){t=t.boundingBox(),l.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),t.randomize&&h.forEach((function(e){t.eles=e,n.push(s(t))})),"default"==t.quality||"proof"==t.quality){var c=e.collection();if(t.tile){g=new Map;var u=0,p={nodeIndexes:g,xCoords:[],yCoords:[]},f=[];if(h.forEach((function(t,e){0==t.edges().length&&(t.nodes().forEach((function(e,i){c.merge(t.nodes()[i]),e.isParent()||(p.nodeIndexes.set(t.nodes()[i].id(),u++),p.xCoords.push(t.nodes()[0].position().x),p.yCoords.push(t.nodes()[0].position().y))})),f.push(e))})),1<c.length){g=c.boundingBox(),l.push({x:g.x1+g.w/2,y:g.y1+g.h/2}),h.push(c),n.push(p);for(var m=f.length-1;0<=m;m--)h.splice(f[m],1),n.splice(f[m],1),l.splice(f[m],1)}}h.forEach((function(e,i){t.eles=e,r.push(a(t,n[i])),o.relocateComponent(l[i],r[i],t)}))}else h.forEach((function(e,i){o.relocateComponent(l[i],n[i],t)}));var y,v,E,N,T=new Set;1<h.length&&(y=[],v=i.filter((function(t){return"none"==t.css("display")})),h.forEach((function(e,i){var s,a,h=void 0;"draft"==t.quality&&(h=n[i].nodeIndexes),0<e.nodes().not(v).length&&(s={edges:[],nodes:[]},a=void 0,e.nodes().not(v).forEach((function(e){var l;"draft"==t.quality?e.isParent()?(l=o.calcBoundingBox(e,n[i].xCoords,n[i].yCoords,h),s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})):(a=h.get(e.id()),s.nodes.push({x:n[i].xCoords[a]-e.boundingbox().w/2,y:n[i].yCoords[a]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h})):r[i][e.id()]&&s.nodes.push({x:r[i][e.id()].getLeft(),y:r[i][e.id()].getTop(),width:r[i][e.id()].getWidth(),height:r[i][e.id()].getHeight()})})),e.edges().forEach((function(e){var a,l,d,g,c,u=e.source();e=e.target(),"none"!=u.css("display")&&"none"!=e.css("display")&&("draft"==t.quality?(a=h.get(u.id()),l=h.get(e.id()),d=[],g=[],u.isParent()?(c=o.calcBoundingBox(u,n[i].xCoords,n[i].yCoords,h),d.push(c.topLeftX+c.width/2),d.push(c.topLeftY+c.height/2)):(d.push(n[i].xCoords[a]),d.push(n[i].yCoords[a])),e.isParent()?(c=o.calcBoundingBox(e,n[i].xCoords,n[i].yCoords,h),g.push(c.topLeftX+c.width/2),g.push(c.topLeftY+c.height/2)):(g.push(n[i].xCoords[l]),g.push(n[i].yCoords[l])),s.edges.push({startX:d[0],startY:d[1],endX:g[0],endY:g[1]})):r[i][u.id()]&&r[i][e.id()]&&s.edges.push({startX:r[i][u.id()].getCenterX(),startY:r[i][u.id()].getCenterY(),endX:r[i][e.id()].getCenterX(),endY:r[i][e.id()].getCenterY()}))})),0<s.nodes.length)&&(y.push(s),T.add(i))})),E=d.packComponents(y,t.randomize).shifts,"draft"==t.quality?n.forEach((function(t,e){var i=t.xCoords.map((function(t){return t+E[e].dx})),n=t.yCoords.map((function(t){return t+E[e].dy}));t.xCoords=i,t.yCoords=n})):(N=0,T.forEach((function(t){Object.keys(r[t]).forEach((function(e){(e=r[t][e]).setCenter(e.getCenterX()+E[N].dx,e.getCenterY()+E[N].dy)})),N++}))))}else g=t.eles.boundingBox(),l.push({x:g.x1+g.w/2,y:g.y1+g.h/2}),t.randomize&&(d=s(t),n.push(d)),"default"==t.quality||"proof"==t.quality?(r.push(a(t,n[0])),o.relocateComponent(l[0],r[0],t)):o.relocateComponent(l[0],n[0],t);function A(e,i){var o,s,a,h;return"default"==t.quality||"proof"==t.quality?(s=o=void 0,a=(e="number"==typeof e?i:e).data("id"),r.forEach((function(t){a in t&&(o={x:t[a].getRect().getCenterX(),y:t[a].getRect().getCenterY()},s=t[a])})),t.nodeDimensionsIncludeLabels&&(s.labelWidth&&("left"==s.labelPosHorizontal?o.x+=s.labelWidth/2:"right"==s.labelPosHorizontal&&(o.x-=s.labelWidth/2)),s.labelHeight)&&("top"==s.labelPosVertical?o.y+=s.labelHeight/2:"bottom"==s.labelPosVertical&&(o.y-=s.labelHeight/2)),{x:(o=null==o?{x:e.position("x"),y:e.position("y")}:o).x,y:o.y}):(h=void 0,n.forEach((function(t){var i=t.nodeIndexes.get(e.id());null!=i&&(h={x:t.xCoords[i],y:t.yCoords[i]})})),{x:(h=null==h?{x:e.position("x"),y:e.position("y")}:h).x,y:h.y})}"default"==t.quality||"proof"==t.quality||t.randomize?(g=o.calcParentsWithoutChildren(e,i),d=i.filter((function(t){return"none"==t.css("display")})),t.eles=i.not(d),i.nodes().not(":parent").not(d).layoutPositions(this,t,A),0<g.length&&g.forEach((function(t){t.position(A(t))}))):console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),i=l,t.exports=i},657:(t,e,i)=>{var n=i(548),r=i(140).layoutBase.Matrix,o=i(140).layoutBase.SVD;t.exports={spectralLayout:function(t){function e(t,e,i){for(var n,r=[],o=0,s=0,a=[],h=0,l=1,g=0;g<N;g++)a[g]=T;for(a[r[s]=t]=0;o<=s;){for(var u=r[o++],p=c[u],f=0;f<p.length;f++)a[n=d.get(p[f])]==T&&(a[n]=a[u]+1,r[++s]=n);y[u][e]=a[u]*I}if(i){for(var v=0;v<N;v++)y[v][e]<m[v]&&(m[v]=y[v][e]);for(var E=0;E<N;E++)m[E]>h&&(h=m[E],l=E)}return l}for(var i=t.cy,s=t.eles,a=s.nodes(),h=s.nodes(":parent"),l=new Map,d=new Map,g=new Map,c=[],u=[],p=[],f=[],m=[],y=[],v=[],E=[],N=void 0,T=1e8,A=t.piTol,w=t.samplingType,I=t.nodeSeparation,L=void 0,C=(n.connectComponents(i,s,n.getTopMostNodes(a),l),h.forEach((function(t){n.connectComponents(i,s,n.getTopMostNodes(t.descendants().intersection(s)),l)})),0),_=0;_<a.length;_++)a[_].isParent()||d.set(a[_].id(),C++);var M=!0,x=!1,O=void 0;try{for(var D,b=l.keys()[Symbol.iterator]();!(M=(D=b.next()).done);M=!0){var R=D.value;d.set(R,C++)}}catch(t){x=!0,O=t}finally{try{!M&&b.return&&b.return()}finally{if(x)throw O}}for(var F=0;F<d.size;F++)c[F]=[];h.forEach((function(t){for(var e=t.children().intersection(s);0==e.nodes(":childless").length;)e=e.nodes()[0].children().intersection(s);var i=0,n=e.nodes(":childless")[0].connectedEdges().length;e.nodes(":childless").forEach((function(t,e){t.connectedEdges().length<n&&(n=t.connectedEdges().length,i=e)})),g.set(t.id(),e.nodes(":childless")[i].id())})),a.forEach((function(t){var e=t.isParent()?d.get(g.get(t.id())):d.get(t.id());t.neighborhood().nodes().forEach((function(i){0<s.intersection(t.edgesWith(i)).length&&(i.isParent()?c[e].push(g.get(i.id())):c[e].push(i.id()))}))}));var G=!0;x=!1,O=void 0;try{for(var S,P=l.keys()[Symbol.iterator]();!(G=(S=P.next()).done);G=!0)!function(t){var e=d.get(t),n=void 0;l.get(t).forEach((function(r){n=i.getElementById(r).isParent()?g.get(r):r,c[e].push(n),c[d.get(n)].push(t)}))}(S.value)}catch(t){x=!0,O=t}finally{try{!G&&P.return&&P.return()}finally{if(x)throw O}}if(2<(N=d.size)){L=N<t.sampleSize?N:t.sampleSize;for(var U=0;U<N;U++)y[U]=[];for(var Y=0;Y<L;Y++)E[Y]=[];if("draft"==t.quality||"all"==t.step){!function(t){var i=void 0;if(t){i=Math.floor(Math.random()*N);for(var n=0;n<N;n++)m[n]=T;for(var r=0;r<L;r++)f[r]=i,i=e(i,r,t)}else{for(var o=0,s=!1;o<L;){for(var a=Math.floor(Math.random()*N),h=(s=!1,0);h<o;h++)if(f[h]==a){s=!0;break}s||(f[o]=a,o++)}for(var l=0;l<L;l++)e(f[l],l,t)}for(var d=0;d<N;d++)for(var g=0;g<L;g++)y[d][g]*=y[d][g];for(var c=0;c<L;c++)v[c]=[];for(var u=0;u<L;u++)for(var p=0;p<L;p++)v[u][p]=y[f[p]][u]}(w);for(var k=(h=o.svd(v)).S,H=(x=h.U,h=h.V,k[0]*k[0]*k[0]),X=[],z=0;z<L;z++){X[z]=[];for(var V=0;V<L;V++)X[z][V]=0,z==V&&(X[z][V]=k[z]/(k[z]*k[z]+H/(k[z]*k[z])))}E=r.multMat(r.multMat(h,X),r.transpose(x));for(var B=void 0,W=void 0,j=[],q=[],$=[],Z=[],Q=0;Q<N;Q++)j[Q]=Math.random(),q[Q]=Math.random();j=r.normalize(j),q=r.normalize(q);for(var J=1e-9,K=1e-9,tt=void 0;;){for(var et=0;et<N;et++)$[et]=j[et];if(j=r.multGamma(r.multL(r.multGamma($),y,E)),B=r.dotProduct($,j),j=r.normalize(j),J=r.dotProduct($,j),(tt=Math.abs(J/K))<=1+A&&1<=tt)break;K=J}for(var it=0;it<N;it++)$[it]=j[it];for(K=1e-9;;){for(var nt=0;nt<N;nt++)Z[nt]=q[nt];if(Z=r.minusOp(Z,r.multCons($,r.dotProduct($,Z))),q=r.multGamma(r.multL(r.multGamma(Z),y,E)),W=r.dotProduct(Z,q),q=r.normalize(q),J=r.dotProduct(Z,q),(tt=Math.abs(J/K))<=1+A&&1<=tt)break;K=J}for(var rt=0;rt<N;rt++)Z[rt]=q[rt];u=r.multCons($,Math.sqrt(Math.abs(B))),p=r.multCons(Z,Math.sqrt(Math.abs(W)))}else d.forEach((function(t,e){u.push(i.getElementById(e).position("x")),p.push(i.getElementById(e).position("y"))}));return{nodeIndexes:d,xCoords:u,yCoords:p}}return O=d.keys(),h=(w=i.getElementById(O.next().value)).position(),x=w.outerWidth(),u.push(h.x),p.push(h.y),2==N&&(w=i.getElementById(O.next().value).outerWidth(),u.push(h.x+x/2+w/2+t.idealEdgeLength),p.push(h.y)),{nodeIndexes:d,xCoords:u,yCoords:p}}}},579:(t,e,i)=>{function n(t){t&&t("layout","fcose",r)}var r=i(212);"undefined"!=typeof cytoscape&&n(cytoscape),t.exports=n},140:e=>{e.exports=t}},i={},function t(n){var r=i[n];return void 0===r&&(r=i[n]={exports:{}},e[n](r,r.exports,t)),r.exports}(579);var e,i},O.exports=x(R());var F=C(O.exports),G={L:"left",R:"right",T:"top",B:"bottom"},S={L:h((t=>t+`,${t/2} 0,${t} 0,0`),"L"),R:h((t=>`0,${t/2} ${t},0 ${t},`+t),"R"),T:h((t=>`0,0 ${t},0 ${t/2},`+t),"T"),B:h((t=>t/2+`,0 ${t},${t} 0,`+t),"B")},P={L:h(((t,e)=>t-e+2),"L"),R:h(((t,e)=>t-2),"R"),T:h(((t,e)=>t-e+2),"T"),B:h(((t,e)=>t-2),"B")},U=h((function(t){return k(t)?"L"===t?"R":"L":"T"===t?"B":"T"}),"getOppositeArchitectureDirection"),Y=h((function(t){return"L"===t||"R"===t||"T"===t||"B"===t}),"isArchitectureDirection"),k=h((function(t){return"L"===t||"R"===t}),"isArchitectureDirectionX"),H=h((function(t){return"T"===t||"B"===t}),"isArchitectureDirectionY"),X=h((function(t,e){var i=k(t)&&H(e);t=H(t)&&k(e);return i||t}),"isArchitectureDirectionXY"),z=h((function(t){var e=t[0],i=(t=t[1],k(e)&&H(t));e=H(e)&&k(t);return i||e}),"isArchitecturePairXY"),V=h((function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t}),"isValidArchitectureDirectionPair"),B=h((function(t,e){return V(t=""+t+e)?t:void 0}),"getArchitectureDirectionPair"),W=h((function([t,e],i){var n=i[0];i=i[1];return k(n)?H(i)?[t+("L"===n?-1:1),e+("T"===i?1:-1)]:[t+("L"===n?-1:1),e]:k(i)?[t+("L"===i?1:-1),e+("T"===n?1:-1)]:[t,e+("T"===n?1:-1)]}),"shiftPositionByArchitectureDirectionPair"),j=h((function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]}),"getArchitectureDirectionXYFactors"),q=h((function(t,e){return X(t,e)?"bend":k(t)?"horizontal":"vertical"}),"getArchitectureDirectionAlignment"),$=h((function(t){return"service"===t.type}),"isArchitectureService"),Z=h((function(t){return"junction"===t.type}),"isArchitectureJunction"),Q=h((t=>t.data()),"edgeData"),J=h((t=>t.data()),"nodeData"),K=e.architecture,tt=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=i,this.getAccTitle=n,this.setDiagramTitle=r,this.getDiagramTitle=o,this.getAccDescription=s,this.setAccDescription=a,this.clear()}static{h(this,"ArchitectureDB")}setDiagramId(t){this.diagramId=t}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",l()}addService({id:t,icon:e,in:i,title:n,iconText:r}){if(void 0!==this.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another `+this.registeredIds[t]);if(void 0!==i){if(t===i)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[i])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[i])throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:e,iconText:r,title:n,edges:[],in:i}}getServices(){return Object.values(this.nodes).filter($)}addJunction({id:t,in:e}){if(void 0!==this.registeredIds[t])throw new Error(`The junction id [${t}] is already in use by another `+this.registeredIds[t]);if(void 0!==e){if(t===e)throw new Error(`The junction [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[e])throw new Error(`The junction [${t}]'s parent does not exist. Please make sure the parent is created before this junction`);if("node"===this.registeredIds[e])throw new Error(`The junction [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:e}}getJunctions(){return Object.values(this.nodes).filter(Z)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:e,in:i,title:n}){if(void 0!==this.registeredIds?.[t])throw new Error(`The group id [${t}] is already in use by another `+this.registeredIds[t]);if(void 0!==i){if(t===i)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===this.registeredIds?.[i])throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===this.registeredIds?.[i])throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:e,title:n,in:i}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:e,lhsDir:i,rhsDir:n,lhsInto:r,rhsInto:o,lhsGroup:s,rhsGroup:a,title:h}){if(!Y(i))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got `+String(i));if(!Y(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got `+String(n));if(void 0===this.nodes[t]&&void 0===this.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[e]&&void 0===this.groups[e])throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);var l=this.nodes[t].in,d=this.nodes[e].in;if(s&&l&&d&&l==d)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(a&&l&&d&&l==d)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);this.edges.push({lhsId:t,lhsDir:i,lhsInto:r,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:o,rhsGroup:a,title:h}),this.nodes[t]&&this.nodes[e]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[e].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(t){if(t.members.length<2)throw new Error("An align directive requires at least two members; got "+t.members.length);const e=new Set;t.members.forEach((i=>{if("node"!==this.registeredIds[i])throw new Error(`align ${t.direction} references [${i}], which is not a service or junction`);if(e.has(i))throw new Error(`align ${t.direction} lists [${i}] more than once`);e.add(i)})),this.layoutHints.push(t)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(void 0===this.dataStructures){const i={},n=Object.entries(this.nodes).reduce(((t,[e,n])=>(t[e]=n.edges.reduce(((t,n)=>{var r,o=this.getNode(n.lhsId)?.in,s=this.getNode(n.rhsId)?.in;return o&&s&&o!==s&&"bend"!==(r=q(n.lhsDir,n.rhsDir))&&(i[o]??={},i[o][s]=r,i[s]??={},i[s][o]=r),n.lhsId===e?(s=B(n.lhsDir,n.rhsDir))&&(t[s]=n.rhsId):(o=B(n.rhsDir,n.lhsDir))&&(t[o]=n.lhsId),t}),{}),t)),{}),r=Object.keys(n)[0],o={[r]:1},s=Object.keys(n).reduce(((t,e)=>e===r?t:{...t,[e]:1}),{});for(var t=h((t=>{const e={[t]:[0,0]},i=[t];for(;0<i.length;){var r=i.shift();if(r){o[r]=1,delete s[r];var a=n[r];const[t,h]=e[r];Object.entries(a).forEach((([n,r])=>{o[r]||(e[r]=W([t,h],n),i.push(r))}))}}return e}),"BFS"),e=[t(r)];0<Object.keys(s).length;)e.push(t(Object.keys(s)[0]));this.dataStructures={adjList:n,spatialMaps:e,groupAlignments:i}}return this.dataStructures}setElementForId(t,e){this.elements[t]=e}getElementById(t){return this.elements[t]}getConfig(){return d({...K,...g().architecture})}getConfigField(t){return this.getConfig()[t]}},et=h(((e,i)=>{t(e,i),e.groups.map((t=>i.addGroup(t))),e.services.map((t=>i.addService({...t,type:"service"}))),e.junctions.map((t=>i.addJunction({...t,type:"junction"}))),e.edges.map((t=>i.addEdge(t))),e.alignments?.map((t=>i.addLayoutHint({direction:t.direction,members:[...t.members]})))}),"populateDb"),it={parser:{yy:void 0},parse:h((async t=>{t=await w("architecture",t);var e=(p.debug(t),it.parser?.yy);if(!(e instanceof tt))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.");et(t,e)}),"parse")},nt=h((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles"),rt=nt;function ot(t,e){if(0===t)return e();var i=Math.random;let n=t>>>0;Math.random=function(){var t=n=n+1831565813>>>0;t=Math.imul(t^t>>>15,1|t);return(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=i}}h(ot,"withSeededRandom");var st=h((t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`),"wrapIcon"),at={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:st('<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:st('<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:st('<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:st('<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:st('<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:c,blank:{body:st("")}}},ht=h((async function(t,e,i,n){const r=i.getConfigField("padding");var o=i.getConfigField("iconSize");const s=o/2,a=o/6,h=a/2;await Promise.all(e.edges().map((async e=>{var{source:o,sourceDir:l,sourceArrow:d,sourceGroup:g,target:c,targetDir:u,targetArrow:p,targetGroup:f,label:m}=Q(e);let{x:y,y:T}=e[0].sourceEndpoint();var{x:A,y:w}=e[0].midpoint();let{x:I,y:L}=e[0].targetEndpoint();var C=r+4;if(g&&(k(l)?y+="L"===l?-C:C:T+="T"===l?-C:C+18),f&&(k(u)?I+="L"===u?-C:C:L+="T"===u?-C:C+18),g||"junction"!==i.getNode(o)?.type||(k(l)?y+="L"===l?s:-s:T+="T"===l?s:-s),f||"junction"!==i.getNode(c)?.type||(k(u)?I+="L"===u?s:-s:L+="T"===u?s:-s),e[0]._private.rscratch&&((C=t.insert("g")).insert("path").attr("d",`M ${y},${T} L ${A},${w} L${I},${L} `).attr("class","edge").attr("id",n+"-"+v(o,c,{prefix:"L"})),d&&(g=k(l)?P[l](y,a):y-h,f=H(l)?P[l](T,a):T-h,C.insert("polygon").attr("points",S[l](a)).attr("transform",`translate(${g},${f})`).attr("class","arrow")),p&&(e=k(u)?P[u](I,a):I-h,o=H(u)?P[u](L,a):L-h,C.insert("polygon").attr("points",S[u](a)).attr("transform",`translate(${e},${o})`).attr("class","arrow")),m)){let t=0;t="X"==(c=X(l,u)?"XY":k(l)?"X":"Y")?Math.abs(y-I):"Y"==c?Math.abs(T-L)/1.5:Math.abs(y-I)/2,d=C.append("g"),await E(d,m,{useHtmlLabels:!1,width:t,classes:"architecture-service-label"},N()),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"==c?d.attr("transform","translate("+A+", "+w+")"):"Y"==c?d.attr("transform","translate("+A+", "+w+") rotate(-90)"):"XY"==c&&(g=B(l,u))&&z(g)&&(f=d.node().getBoundingClientRect(),[p,e]=j(g),d.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*e*45})`),o=d.node().getBoundingClientRect(),d.attr("transform",`\n translate(${A}, ${w-f.height/2})\n translate(${p*o.width/2}, ${e*o.height/2})\n rotate(${-1*p*e*45}, 0, ${f.height/2})\n `))}})))}),"drawEdges"),lt=h((async function(t,e,i,n){const r=.75*i.getConfigField("padding"),o=i.getConfigField("fontSize"),s=i.getConfigField("iconSize")/2;await Promise.all(e.nodes().map((async e=>{var a=J(e);if("group"===a.type){var{h:e,w:h,x1:l,y1:d}=e.boundingBox(),g=t.append("rect");e=(g.attr("id",n+"-group-"+a.id).attr("x",l+s).attr("y",d+s).attr("width",h).attr("height",e).attr("class","node-bkg"),t.append("g"));let c=l,u=d;a.icon&&((l=e.append("g")).html(`<g>${await T(a.icon,{height:r,width:r,fallbackPrefix:at.prefix})}</g>`),l.attr("transform","translate("+(c+s+1)+", "+(u+s+1)+")"),c+=r,u+=o/2-1-2),a.label&&(d=e.append("g"),await E(d,a.label,{useHtmlLabels:!1,width:h,classes:"architecture-service-label"},N()),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),d.attr("transform","translate("+(c+s+4)+", "+(u+s+2)+")")),i.setElementForId(a.id,g)}})))}),"drawGroups"),dt=h((async function(t,e,i,n){var r=N();for(const d of i){var o=e.append("g"),s=t.getConfigField("iconSize"),a=(d.title&&(a=o.append("g"),await E(a,d.title,{useHtmlLabels:!1,width:1.5*s,classes:"architecture-service-label"},r),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+s/2+", "+s+")")),o.append("g")),{width:h,height:l}=(d.icon?a.html(`<g>${await T(d.icon,{height:s,width:s,fallbackPrefix:at.prefix})}</g>`):d.iconText?(a.html(`<g>${await T("blank",{height:s,width:s,fallbackPrefix:at.prefix})}</g>`),h=a.append("g").append("foreignObject").attr("width",s).attr("height",s).append("div").attr("class","node-icon-text").attr("style",`height: ${s}px;`).append("div").html(A(d.iconText,r)),l=parseInt(window.getComputedStyle(h.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16,h.attr("style",`-webkit-line-clamp: ${Math.floor((s-2)/l)};`)):a.append("path").attr("class","node-bkg").attr("id",n+"-node-"+d.id).attr("d",`M0,${s} V5 Q0,0 5,0 H${s-5} Q${s},0 ${s},5 V${s} Z`),o.attr("id",n+"-service-"+d.id).attr("class","architecture-service"),o.node().getBBox());d.width=h,d.height=l,t.setElementForId(d.id,o)}return 0}),"drawServices"),gt=h((function(t,e,i,n){i.forEach((i=>{var r=e.append("g"),o=t.getConfigField("iconSize"),{width:o,height:s}=(r.append("g").append("rect").attr("id",n+"-node-"+i.id).attr("fill-opacity","0").attr("width",o).attr("height",o),r.attr("class","architecture-junction"),r._groups[0][0].getBBox());r.width=o,r.height=s,t.setElementForId(i.id,r)}))}),"drawJunctions");function ct(t,e,i){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-service"})}))}function ut(t,e,i){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-junction"})}))}function pt(t,e){e.nodes().map((e=>{var i=J(e);"group"!==i.type&&(i.x=e.position().x,i.y=e.position().y,t.getElementById(i.id).attr("transform","translate("+(i.x||0)+","+(i.y||0)+")"))}))}function ft(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}function mt(t,e){t.forEach((t=>{var{lhsId:i,rhsId:n,lhsInto:r,lhsGroup:o,rhsInto:s,lhsDir:a,rhsDir:h,rhsGroup:l,title:d}=t;t=X(t.lhsDir,t.rhsDir)?"segments":"straight";e.add({group:"edges",data:{id:i+"-"+n,label:d,source:i,sourceDir:a,sourceArrow:r,sourceGroup:o,sourceEndpoint:"L"===a?"0 50%":"R"===a?"100% 50%":"T"===a?"50% 0":"50% 100%",target:n,targetDir:h,targetArrow:s,targetGroup:l,targetEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%"},classes:t})}))}function yt(t,e,i,n=[]){const r=h(((t,e)=>Object.entries(t).reduce(((t,[n,r])=>{let o=0;var s=Object.entries(r);if(1===s.length)t[n]=s[0][1];else for(let r=0;r<s.length-1;r++)for(let g=r+1;g<s.length;g++){var[a,h]=s[r],[l,d]=s[g];i[a]?.[l]===e||"default"===a||"default"===l?(t[n]??=[],t[n]=[...t[n],...h,...d]):(t[n+"-"+o++]=h,t[n+"-"+o++]=d)}return t}),{})),"flattenAlignments");var[e,o]=e.map((e=>{const i={},n={};return Object.entries(e).forEach((([e,[r,o]])=>{var s=t.getNode(e)?.in??"default";i[o]??={},i[o][s]??=[],i[o][s].push(e),n[r]??={},n[r][s]??=[],n[r][s].push(e)})),{horiz:Object.values(r(i,"horizontal")).filter((t=>1<t.length)),vert:Object.values(r(n,"vertical")).filter((t=>1<t.length))}})).reduce((([t,e],{horiz:i,vert:n})=>[[...t,...i],[...e,...n]]),[[],[]]);const s=new Set;n.forEach((t=>t.members.forEach((t=>s.add(t)))));var a=h((t=>t.filter((t=>!t.some((t=>s.has(t)))))),"dropOverlapping");const l=a(e),d=a(o);return n.forEach((t=>{t.members.length<2||("row"===t.direction?l:d).push([...t.members])})),{horizontal:l,vertical:d}}function vt(t,e,i=[]){const n=[],r=e.getConfigField("iconSize"),o=e.getConfigField("idealEdgeLengthMultiplier"),s=o*r,a=new Set,l=(i.forEach((t=>{for(let r=0;r<t.members.length-1;r++){var e=t.members[r],i=t.members[r+1];a.add(e+"|"+i),a.add(i+"|"+e),"row"===t.direction?n.push({left:e,right:i,gap:s}):n.push({top:e,bottom:i,gap:s})}})),h((t=>t[0]+","+t[1]),"posToStr")),d=h((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");return t.forEach((t=>{const e=Object.fromEntries(Object.entries(t).map((([t,e])=>[l(e),t]))),i=[l([0,0])],s={};for(var h={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};0<i.length;){var g=i.shift();if(g){s[g]=1;const t=e[g];if(t){const c=d(g);Object.entries(h).forEach((([h,d])=>{d=l([c[0]+d[0],c[1]+d[1]]);var g=e[d];g&&!s[d]&&(i.push(d),a.has(t+"|"+g)||n.push({[G[h]]:g,[G[U(h)]]:t,gap:o*r}))}))}}}})),n}function Et(t,e,i,n,r,{spatialMaps:o,groupAlignments:s}){return new Promise((a=>{var l=f("body").append("div").attr("id","cy").attr("style","display:none");const d=I({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{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":r.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:r.getConfigField("padding")+"px"}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),ft(i,d),ct(t,d,r),ut(e,d,r),mt(n,d);l=r.getLayoutHints();var g=yt(r,o,s,l),c=(l=vt(o,r,l),r.getConfigField("iconSize"));const u=r.getConfigField("idealEdgeLengthMultiplier")*c,m=.5*c,y=r.getConfigField("edgeElasticity"),v=r.getConfigField("seed"),E=d.layout({name:"fcose",quality:"proof",randomize:r.getConfigField("randomize"),nodeSeparation:r.getConfigField("nodeSeparation"),numIter:r.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){var e,[t,e]=t.connectedNodes();return(t=J(t).parent)===(e=J(e).parent)?u:m},edgeElasticity(t){var e,[t,e]=t.connectedNodes();return(t=J(t).parent)===(e=J(e).parent)?y:.001},alignmentConstraint:g,relativePlacementConstraint:l});E.one("layoutstop",(()=>{function t(t,e,i,n){var{x:t,y:r}=t,{x:e,y:o}=e,s=(n-r+(t-i)*(r-o)/(t-e))/Math.sqrt(1+Math.pow((r-o)/(t-e),2)),a=Math.sqrt(Math.pow(n-r,2)+Math.pow(i-t,2)-Math.pow(s,2));a/=Math.sqrt(Math.pow(e-t,2)+Math.pow(o-r,2));let h=(e-t)*(n-r)-(o-r)*(i-t);switch(!0){case 0<=h:h=1;break;case h<0:h=-1}let l=(e-t)*(i-t)+(o-r)*(n-r);switch(!0){case 0<=l:l=1;break;case l<0:l=-1}return{distances:Math.abs(s)*h,weights:a*=l}}h(t,"getSegmentWeights"),d.startBatch();for(const o of Object.values(d.edges())){var e,i,n,r;o.data?.()&&(({x:n,y:i}=o.source().position()),({x:r,y:e}=o.target().position()),n!==r)&&i!==e&&(n=o.sourceEndpoint(),r=o.targetEndpoint(),i=Q(o).sourceDir,[e,i]=H(i)?[n.x,r.y]:[r.x,n.y],({weights:n,distances:r}=t(n,r,e,i)),o.style("segment-distances",r),o.style("segment-weights",n))}d.endBatch(),ot(v,(()=>E.run()))}));try{ot(v,(()=>E.run()))}catch(l){if(l instanceof RangeError&&l.message.includes("Invalid array length"))throw new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw l}d.ready((t=>{p.info("Ready",t),a(d)}))}))}u([{name:at.prefix,icons:at}]),I.use(F),h(ct,"addServices"),h(ut,"addJunctions"),h(pt,"positionNodes"),h(ft,"addGroups"),h(mt,"addEdges"),h(yt,"getAlignments"),h(vt,"getRelativeConstraints"),h(Et,"layoutArchitecture");var Nt=h((async(t,e,i,n)=>{var r=((n=n.db).setDiagramId(e),n.getServices()),o=n.getJunctions(),s=n.getGroups(),a=n.getEdges(),h=n.getDataStructures(),l=m(e),d=l.append("g"),g=((c=(d.attr("class","architecture-edges"),l.append("g"))).attr("class","architecture-services"),l.append("g")),c=(g.attr("class","architecture-groups"),await dt(n,c,r,e),gt(n,c,o,e),await Et(r,o,s,a,n,h));await ht(d,c,n,e),await lt(g,c,n,e),pt(n,c),y(void 0,l,n.getConfigField("padding"),n.getConfigField("useMaxWidth"))}),"draw"),Tt={parser:it,get db(){return new tt},renderer:{draw:Nt},styles:rt};export{Tt as diagram};