@cagent/chat-embedding-core 0.0.13 → 0.0.17

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 (322) 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/public/index.html +4 -1
  317. package/public/popup.html +20 -0
  318. package/server.js +477 -477
  319. package/.idea/flowise-chatbox.iml +0 -10
  320. package/.idea/modules.xml +0 -8
  321. package/.idea/workspace.xml +0 -4
  322. package/docs/embedding-style-guide.md +0 -417
@@ -0,0 +1 @@
1
+ var t,e;(t=self.document)&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e));import{p as i}from"./chunk-JWPE2WC7-84faee3d.js";import{E as n,s as r,g as o,n as a,o as s,b as h,c as l,_ as d,v as g,F as c,G as u,b9 as p,al as f,l as m,j as y,K as v,X as E,r as N,b2 as T,d as A,am as w,i as I}from"./mermaid.core-2d237a1e.js";import{v as C}from"./mermaid-parser.core-6df0beec.js";import{c as L}from"./cytoscape.esm-56d2239f.js";import{c as _,g as M}from"./web-753300e1.js";var x,O,D={exports:{}},b={exports:{}},R={exports:{}};function F(){var t;return O||(O=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),a=i(880),s=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 a(null,this.graphManager,t)},A.prototype.newNode=function(t){return new s(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,a=0;a<n.length;a++)null==(i=n[a]).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 a,s,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}))})):(a=new Map,s=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,a.has(i)?a.get(i).push(e):a.set(i,[e]),a.has(e)?a.get(e).push(i):a.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,s.has(e)?s.get(e).push(i):s.set(e,[i]),s.has(i)?s.get(i).push(e):s.set(i,[e]))}),d=(h=function(t,e){var i=[],n=[],r=new T,o=new Set,a=0;return t.forEach(function(s,h){if(!o.has(h)){for(i[a]=[],n[a]=!1,r.push(l=h),o.add(l),i[a].push(l);0!=r.length;){var l=r.shift();e.has(l)&&(n[a]=!0),t.get(l).forEach(function(t){o.has(t)||(r.push(t),o.add(t),i[a].push(t))})}a++}}),{components:i,isFixed:n}})(a,t.fixedNodesOnHorizontal),this.componentsOnHorizontal=d.components,this.fixedComponentsOnHorizontal=d.isFixed,d=h(s,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 a=this.constraints.alignmentConstraint.horizontal;for(i=0;i<a.length;i++){var s=0;for(r=0;r<a[i].length;r++){if(this.fixedNodeSet.has(a[i][r])){s=0;break}s+=this.idToNodeMap.get(a[i][r]).displacementY}var h=s/a[i].length;for(r=0;r<a[i].length;r++)this.idToNodeMap.get(a[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 a=[];if(a=(a=a.concat(r.getEdgeListToNode(o))).concat(o.getEdgeListToNode(r)),!e.has(a[0])){if(1<a.length)for(var s=0;s<a.length;s++){var h=a[s];h.getBendpoints().push(new p),this.createDummyNodesForBendpoints(h)}a.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,a=new p(0,0),s=0;s<t.length;s++){s%i==0&&(r=n,(o=0)!=s&&(r+=l.DEFAULT_COMPONENT_SEPERATION),n=0);var h=t[s],d=m.findCenterOfTree(h);e.x=o,e.y=r,(a=A.radialLayout(h,d,e)).y>n&&(n=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(c.WORLD_CENTER_X-a.x/2,c.WORLD_CENTER_Y-a.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){(a=(n-i+1)/2)<0&&(a+=180);for(var a=(a+i)%360*v.TWO_PI/360,s=r*Math.cos(a),h=(a=r*Math.sin(a),t.setCenter(s,a),[]),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--}s=null!=e?(h.indexOf(c[0])+1)%g:0;for(var p=Math.abs(n-i)/l,f=s;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=(a=n[r]).getParent();0!==this.getNodeDegreeWithChildren(a)||null!=o.id&&this.getToBeTiled(o)||i.push(a)}for(r=0;r<i.length;r++){var a,h=(a=i[r]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(a)}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 s(t.graphManager),a=(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),a.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;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,e.paddingLeft,e.paddingTop,e.labelMarginLeft,e.labelMarginTop)}},A.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach(function(i){var n=t.idToDummyNode[i],r=n.paddingLeft;t.adjustLocations(e[i],n.rect.x,n.rect.y,r,n.paddingTop,n.labelMarginLeft,n.labelMarginTop)})},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,a){i+=r+a;for(var s=e+=n+o,h=0;h<t.rows.length;h++){for(var l=t.rows[h],d=(e=s,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,a=0,s=0,h=0,d=(t=(t.forEach(function(t){a+=t.getWidth(),s+=t.getHeight(),t.getWidth()>h&&(h=t.getWidth())}),a/o),s/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){for(var n=l.TILING_PADDING_VERTICAL,r=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:n,horizontalPadding:r,centerX:0,centerY:0},s=(o&&(a.idealRowWidth=this.calcIdealRowWidth(t,i)),function(t){return t.rect.width*t.rect.height}),h=function(t,e){return s(e)-s(t)},d=(t.sort(function(t,e){var i=h;return a.idealRowWidth?(i=o)(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=e+t.horizontalPadding<=t.width-o?(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 a=Number.MIN_VALUE,s=0;s<n.length;s++)n[s].height>a&&(a=n[s].height);0<e&&(a+=t.verticalPadding),o=t.rowHeight[e]+t.rowHeight[i],t.rowHeight[e]=a,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=[],a=(e=!1,0);a<r.length;a++)1!=(n=r[a]).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 s=[],h=0;h<o.length;h++)1==o[h][0].getEdges().length&&(s.push(o[h]),o[h][0].getOwner().remove(o[h][0]));t.push(s),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,a=i.finishY,s=[0,0,0,0];if(0<o)for(var h=n;h<=r;h++)s[0]+=this.grid[h][o-1].length+this.grid[h][o].length-1;if(r<this.grid.length-1)for(h=o;h<=a;h++)s[1]+=this.grid[r+1][h].length+this.grid[r][h].length-1;if(a<this.grid[0].length-1)for(h=n;h<=r;h++)s[2]+=this.grid[h][a+1].length+this.grid[h][a].length-1;if(0<n)for(h=o;h<=a;h++)s[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<s.length;m++)s[m]<f?(f=s[m],d=1,c=m):s[m]==f&&d++;3==d&&0==f?0==s[0]&&0==s[1]&&0==s[2]?u=1:0==s[0]&&0==s[1]&&0==s[3]?u=0:0==s[0]&&0==s[2]&&0==s[3]?u=3:0==s[1]&&0==s[2]&&0==s[3]&&(u=2):u=2==d&&0==f?(p=Math.floor(2*Math.random()),0==s[0]&&0==s[1]?0==p?0:1:0==s[0]&&0==s[2]?0==p?0:2:0==s[0]&&0==s[3]?0==p?0:3:0==s[1]&&0==s[2]?0==p?1:2:0==s[1]&&0==s[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 a(t,e,i,n){r.call(this,t,e,i,n)}for(n in a.prototype=Object.create(r.prototype),r)a[n]=r[n];a.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)},a.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)},a.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},a.prototype.setPred1=function(t){this.pred1=t},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(t){this.next=t},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(t){this.processed=t},a.prototype.isProcessed=function(){return processed},t.exports=a},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,a=i(551).Matrix,s=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,a){for(var s,g,c=new Map,u=(t.forEach(function(t,e){c.set(e,0)}),t.forEach(function(t,e){t.forEach(function(t){c.set(t.id,c.get(t.id)+1)})}),new Map),p=new Map,f=new o,m=(c.forEach(function(t,n){0==t?(f.push(n),i||("horizontal"==e?u.set(n,h.has(n)?l[h.get(n)]:r.get(n)):u.set(n,h.has(n)?d[h.get(n)]:r.get(n)))):u.set(n,Number.NEGATIVE_INFINITY),i&&p.set(n,new Set([n]))}),i&&a.forEach(function(t){var n,o,a=[];t.forEach(function(t){i.has(t)&&a.push(t)}),0<a.length?(n=0,a.forEach(function(t){"horizontal"==e?u.set(t,h.has(t)?l[h.get(t)]:r.get(t)):u.set(t,h.has(t)?d[h.get(t)]:r.get(t)),n+=u.get(t)}),n/=a.length,t.forEach(function(t){i.has(t)||u.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){u.set(t,o)}))}),function(){var n=f.shift();t.get(n).forEach(function(t){var o,a;u.get(t.id)<u.get(n)+t.gap&&(i&&i.has(t.id)?(void 0,a="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),u.set(t.id,a),a<u.get(n)+t.gap&&(o=u.get(n)+t.gap-a,p.get(n).forEach(function(t){u.set(t,u.get(t)-o)}))):u.set(t.id,u.get(n)+t.gap)),c.set(t.id,c.get(t.id)-1),0==c.get(t.id)&&f.push(t.id),i&&p.set(t.id,((t,e)=>{var i=new Set(t),n=!0,r=(t=!1,void 0);try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;i.add(s)}}catch(e){t=!0,r=e}finally{try{!n&&a.return&&a.return()}finally{if(t)throw r}}return i})(p.get(n),p.get(t.id)))})});0!=f.length;)m();return i&&(s=new Set,t.forEach(function(t,e){0==t.length&&s.add(e)}),g=[],p.forEach(function(t,e){if(s.has(e)){var r,o,a=!1,h=!0,l=(e=!1,void 0);try{for(var d,c=t[Symbol.iterator]();!(h=(d=c.next()).done);h=!0){var u=d.value;i.has(u)&&(a=!0)}}catch(a){e=!0,l=a}finally{try{!h&&c.return&&c.return()}finally{if(e)throw l}}a||(r=!1,o=void 0,g.forEach(function(e,i){e.has([].concat(n(t))[0])&&(r=!0,o=i)}),r?t.forEach(function(t){g[o].add(t)}):g.push(new Set(t)))}}),g.forEach(function(t,i){var n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,g=!0,c=!1,p=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=u.get(y);v<n&&(n=v),a<v&&(a=v),E<o&&(o=E),s<E&&(s=E)}}catch(t){c=!0,p=t}finally{try{!g&&m.return&&m.return()}finally{if(c)throw p}}var N=(n+a)/2-(o+s)/2,T=!0;c=!1,p=void 0;try{for(var A,w=t[Symbol.iterator]();!(T=(A=w.next()).done);T=!0){var I=A.value;u.set(I,u.get(I)+N)}}catch(t){c=!0,p=t}finally{try{!T&&w.return&&w.return()}finally{if(c)throw p}}})),u}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 a=0;a<h.size;a++)l[a]=-1*l[a];else if(r<n)for(var s=0;s<h.size;s++)d[s]=-1*d[s]}function y(t){var e=[],i=new o,n=new Set,r=0;return t.forEach(function(o,a){if(!n.has(a)){for(e[r]=[],i.push(s=a),n.add(s),e[r].push(s);0!=i.length;){var s=i.shift();t.get(s).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),C=new Set,L=new Map,_=new Map,M=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach(function(t){C.add(t.nodeId)}),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach(function(t){t.left?(L.has(t.left)?L.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):L.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),L.has(t.right)||L.set(t.right,[])):(L.has(t.top)?L.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):L.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),L.has(t.bottom)||L.set(t.bottom,[]))}),M=y(_=v(L))),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++)(t=>{var e=new Set,i=(O[t].forEach(function(t){e.add(t)}),new Set([].concat(n(e)).filter(function(t){return C.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++)(t=>{var e=new Set,i=(b[t].forEach(function(t){e.add(t)}),new Set([].concat(n(e)).filter(function(t){return C.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){L.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=a.transpose(A),z=a.transpose(w),B=0;B<X.length;B++)X[B]=a.multGamma(X[B]),z[B]=a.multGamma(z[B]);_=a.multMat(X,a.transpose(z)),t=s.svd(_);for(var V=a.multMat(t.V,a.transpose(t.U)),W=0;W<h.size;W++){var j=[l[W],d[W]],q=[V[0][0],V[1][0]],$=[V[0][1],V[1][1]];l[W]=a.dotProduct(j,q),d[W]=a.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++)(t=>{var e=new Set,i=(t=(Z[t].forEach(function(t){e.add(t)}),new Set([].concat(n(e)).filter(function(t){return C.has(t)}))),0<t.size?l[h.get(t.values().next().value)]:T(e).x);e.forEach(function(t){C.has(t)||(l[h.get(t)]=i)})})(Q);if(e.alignmentConstraint.horizontal)for(var J=e.alignmentConstraint.horizontal,K=0;K<J.length;K++)(t=>{var e=new Set,i=(t=(J[t].forEach(function(t){e.add(t)}),new Set([].concat(n(e)).filter(function(t){return C.has(t)}))),0<t.size?d[h.get(t.values().next().value)]:T(e).y);e.forEach(function(t){C.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,at=new Set,st=new Set;if(C.forEach(function(t){at.add(t),st.add(t)}),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var ht=e.alignmentConstraint.vertical,lt=0;lt<ht.length;lt++)(t=>{it.set("dummy"+t,[]),ht[t].forEach(function(e){tt.set(e,"dummy"+t),it.get("dummy"+t).push(e),C.has(e)&&at.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++)(t=>{nt.set("dummy"+t,[]),dt[t].forEach(function(e){et.set(e,"dummy"+t),nt.get("dummy"+t).push(e),C.has(e)&&st.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=L.keys()[Symbol.iterator]();!(pt=(ft=mt.next()).done);pt=!0)(t=>{L.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",at,rt,Et)),At=f(ut,"vertical",st,ot,Nt),wt=!0;_=!1,t=void 0;try{for(var It,Ct=Tt.keys()[Symbol.iterator]();!(wt=(It=Ct.next()).done);wt=!0)(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&&Ct.return&&Ct.return()}finally{if(_)throw t}}var Lt=!0;_=!1,t=void 0;try{for(var _t,Mt=At.keys()[Symbol.iterator]();!(Lt=(_t=Mt.next()).done);Lt=!0)(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{!Lt&&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},b.exports=t(function(){var t;return x||(x=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),a=i(9);function s(t,e,i){r.call(this,i),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=i,this.bendpoints=[],this.source=t,this.target=e}for(n in s.prototype=Object.create(r.prototype),r)s[n]=r[n];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.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"},s.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},s.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,i){t.exports=function(t){this.vGraphObject=t}},function(t,e,i){var n,r=i(2),o=i(10),a=i(13),s=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 a(e.x,e.y,i.width,i.height):new a}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=-s.INITIAL_WORLD_BOUNDARY,e=s.INITIAL_WORLD_BOUNDARY,i=(e=s.WORLD_CENTER_X+h.nextDouble()*(e-t)+t,t=-s.INITIAL_WORLD_BOUNDARY,s.INITIAL_WORLD_BOUNDARY);i=s.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()),s.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)>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY),(i=this.rect.y)>s.WORLD_BOUNDARY?i=s.WORLD_BOUNDARY:i<-s.WORLD_BOUNDARY&&(i=-s.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),a=i(0),s=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=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?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==(a=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(a,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 a;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==(a=i.source.owner.getEdges().indexOf(i)))throw"Not in owner's edge list!";i.source.owner.getEdges().splice(a,1)}},u.prototype.updateLeftTop=function(){for(var t,e=o.MAX_VALUE,i=o.MAX_VALUE,n=this.getNodes(),r=n.length,a=0;a<r;a++){var s,h=n[a];(s=h.getTop())<e&&(e=s),(s=h.getLeft())<i&&(i=s)}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,a=o.MAX_VALUE,s=-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())<a&&(a=e),s<(e=c.getBottom())&&(s=e)}var u=new d(n,a,r-n,s-a);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,a=t.length,s=0;s<a;s++){var h,l=t[s];(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?a.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,a,s=(o=(r=i.shift()).getEdges()).length,h=0;h<s;h++)null==(a=o[h].getOtherEndInGraph(r,this))||n.has(a)||a.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=[],a=(o=o.concat(e.getEdges())).length,s=0;s<a;s++)i=o[s],e.remove(i);var h,l=[];for(a=(l=l.concat(e.getNodes())).length,s=0;s<a;s++)h=l[s],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(),a=o.length,s=0;s<a;s++)if(e=(t=o[s]).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(),a=e.getCenterY();if(t.intersects(e))return i[0]=n,i[1]=r,i[2]=o,i[3]=a,!0;var s=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(a<r)return i[0]=n,i[1]=h,i[2]=o,i[3]=E,!1;r<a&&(i[0]=n,i[1]=g,i[2]=o,i[3]=m)}else if(r===a){if(o<n)return i[0]=s,i[1]=r,i[2]=y,i[3]=a,!1;n<o&&(i[0]=l,i[1]=r,i[2]=f,i[3]=a)}else{t=t.height/t.width,e=e.height/e.width;var C,L=(a-r)/(o-n),_=void 0,M=void 0,x=void 0;if(-t==L?(o<n?(i[0]=d,i[1]=g):(i[0]=l,i[1]=h),w=!0):t==L&&(o<n?(i[0]=s,i[1]=h):(i[0]=c,i[1]=g),w=!0),-e==L?(n<o?(i[2]=v,i[3]=E):(i[2]=y,i[3]=m),I=!0):e==L&&(n<o?(i[2]=f,i[3]=m):(i[2]=N,i[3]=E),I=!0),w&&I)return!1;if(C=o<n?a<r?(_=this.getCardinalDirection(t,L,4),this.getCardinalDirection(e,L,2)):(_=this.getCardinalDirection(-t,L,3),this.getCardinalDirection(-e,L,1)):a<r?(_=this.getCardinalDirection(-t,L,1),this.getCardinalDirection(-e,L,3)):(_=this.getCardinalDirection(t,L,2),this.getCardinalDirection(e,L,4)),!w)switch(_){case 1:M=h,i[0]=n+-p/L,i[1]=M;break;case 2:M=r+u*L,i[0]=c,i[1]=M;break;case 3:M=g,i[0]=n+p/L,i[1]=M;break;case 4:M=r+-u*L,i[0]=d,i[1]=M}if(!I)switch(C){case 1:x=m,i[2]=o+-A/L,i[3]=x;break;case 2:x=a+T*L,i[2]=N,i[3]=x;break;case 3:x=E,i[2]=o+A/L,i[3]=x;break;case 4:x=a+-T*L,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,a,s,h,l,d,g,c,u,p,f;return null==r?this.getIntersection2(t,e,i):(o=t.x,a=e.x,p=g=void 0,0==(f=(l=(e=e.y)-(t=t.y))*(u=(s=i.x)-(h=r.x))-(c=(r=r.y)-(i=i.y))*(d=o-a))?null:new n((d*(p=h*i-s*r)-u*(g=a*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),a=(e=e.y,i.x),s=(i=i.y,n.x),h=(o-r)*((n=n.y)-i)-(s-a)*(e-t);return 0!=h&&(e=((t-e)*(s-r)+(o-r)*(n-t))/h,0<(o=((n-i)*(s-r)+(a-s)*(n-t))/h))&&o<1&&0<e&&e<1},r.findCircleLineIntersections=function(t,e,i,n,r,o,a){var s=(i-t)*(i-t)+(n-e)*(n-e);return 0<=(i=2*((t-r)*(i-t)+(e-o)*(n-e)))*i-4*s*(n=(t-r)*(t-r)+(e-o)*(e-o)-a*a)?(t=(-i+Math.sqrt(i*i-4*s*n))/(2*s),r=(-i-Math.sqrt(i*i-4*s*n))/(2*s),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 a(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 s(t){var e=this;if(!(this instanceof s))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){e&&n(t.prototype,e)})(s,[{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 a(t,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(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=s},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),a=i(3),s=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 a(this.graphManager,t)},c.prototype.newEdge=function(t){return new s(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 a){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 s?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 a=new Set,s=[],h=new Map,l=(l=[]).concat(i);0<l.length&&e;){for(s.push(l[0]);0<s.length&&e;){var d=s[0],g=(s.splice(0,1),a.add(d),d.getEdges());for(o=0;o<g.length;o++){var c=g[o].getOtherEnd(d);if(h.get(d)!=c){if(a.has(c)){e=!1;break}s.push(c),h.set(c,d)}}}if(e){var u=[].concat(n(a));for(t.push(u),o=0;o<u.length;o++){var p=u[o];-1<(p=l.indexOf(p))&&l.splice(p,1)}a=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),a=(o.setRect(new Point(0,0),new Dimension(1,1)),n.add(o),this.newEdge(null));this.graphManager.add(a,i,o),e.add(o),i=o}return a=this.newEdge(null),this.graphManager.add(a,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 a=r[o],s=new l(a.getCenterX(),a.getCenterY()),h=i.bendpoints.get(o);h.x=s.x,h.y=s.y,a.getOwner().remove(a)}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 a=0;a<e.length;a++){var s=(l=e[a]).getNeighborsList().size;n.set(l,l.getNeighborsList().size),1==s&&i.push(l)}for(h=(h=[]).concat(i);!r;){[].concat(h);var h=[];for(a=0;a<e.length;a++){var l=e[a],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),a=i(0),s=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,s,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(),s=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=r+s-2*a.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,a=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],s=1<arguments.length&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),r=new Set,t=0;t<h.length;t++)i=h[t],this.calculateRepulsionForceOfANode(i,r,a,s),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())&&(e=t.edgeElasticity*(i-e),n=t.lengthY/i*e,r.springForceX+=t=t.lengthX/i*e,r.springForceY+=n,o.springForceX-=t,o.springForceY-=n)},l.prototype.calcRepulsionForce=function(t,e){var i,n,r,a=t.getRect(),l=e.getRect(),d=new Array(2),g=new Array(4);a.intersects(l)?(s.calcSeparationAmount(a,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()-a.getCenterX(),l.getCenterY()-a.getCenterY()):(s.getIntersection(a,l,g),i=g[2]-g[0],g[3]-g[1]),a=(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(a),r=(g=(t.nodeRepulsion/2+e.nodeRepulsion/2)*t.noOfChildren*e.noOfChildren/a)*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),a=Math.abs(r)+t.getHeight()/2;t.getOwner()==this.graphManager.getRoot()?((e=i.getEstimatedSize()*this.gravityRangeFactor)<o||e<a)&&(t.gravitationForceX=-this.gravityConstant*n,t.gravitationForceY=-this.gravityConstant*r):((e=i.getEstimatedSize()*this.compoundGravityRangeFactor)<o||e<a)&&(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)),a=parseInt(Math.floor((t.getRect().height+t.getRect().y-i)/this.repulsionRange)),s=n;s<=r;s++)for(var h=o;h<=a;h++)this.grid[s][h].push(t),t.setGridCoordinates(n,r,o,a)},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,a=(t.surrounding=new Array,this.grid),s=t.startX-1;s<t.finishX+2;s++)for(var h=t.startY-1;h<t.finishY+2;h++)if(!(s<0||h<0||s>=a.length||h>=a[0].length))for(var l=0;l<a[s][h].length;l++){var d,g,c=a[s][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((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(s=0;s<t.surrounding.length;s++)this.calcRepulsionForce(t,t.surrounding[s])},l.prototype.calcRepulsionRange=function(){return 0},t.exports=l},function(t,e,i){var n,r=i(1),o=i(4);function a(t,e,i){r.call(this,t,e,i),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}for(n in a.prototype=Object.create(r.prototype),r)a[n]=r[n];t.exports=a},function(t,e,i){var n,r=i(3),o=i(4);function a(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 a.prototype=Object.create(r.prototype),r)a[n]=r[n];a.prototype.setGridCoordinates=function(t,e,i,n){this.startX=t,this.finishX=e,this.startY=i,this.finishY=n},t.exports=a},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=[],a=0;a<e[0].length;a++){for(var s=0,h=0;h<e.length;h++)s+=-.5*e[h][a]*t[h];r[a]=s}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),a=(this.s=(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]),(t=>{for(var e=[];0<t--;)e.push(0);return e})(this.n)),s=(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]}a[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){a[d]=0;for(var v=d+1;v<this.n;v++)a[d]=n.hypot(a[d],a[v]);if(0!==a[d]){a[d+1]<0&&(a[d]=-a[d]);for(var E=d+1;E<this.n;E++)a[E]/=a[d];a[d+1]+=1}if(a[d]=-a[d],e=d+1<this.m,i=0!==a[d],e&&i){for(var N=d+1;N<this.m;N++)s[N]=0;for(var T=d+1;T<this.n;T++)for(var A=d+1;A<this.m;A++)s[A]+=a[T]*t[A][T];for(var w=d+1;w<this.n;w++)for(var I=-a[w]/a[d+1],C=d+1;C<this.m;C++)t[C][w]+=I*s[C]}for(var L=d+1;L<this.n;L++)this.V[L][d]=a[L]}}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<_&&(a[l]=t[l][_-1]),a[_-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!==a[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 B=0;B<this.n;B++)this.V[B][Y]=0;this.V[Y][Y]=1}for(var V=_-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(a[q])<=j+W*(Math.abs(this.s[q])+Math.abs(this.s[q+1]))){a[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(a[Z]):0)+(Z!==q+1?Math.abs(a[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=a[_-2];a[_-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*a[K-1],a[K-1]=et*a[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=a[q-1];a[q-1]=0;for(var ot=q;ot<_;ot++){var at=n.hypot(this.s[ot],rt),st=this.s[ot]/at,ht=rt/at;this.s[ot]=at,rt=-ht*a[ot],a[ot]=st*a[ot];for(var lt=0;lt<this.m;lt++)at=st*this.U[lt][ot]+ht*this.U[lt][q-1],this.U[lt][q-1]=-ht*this.U[lt][ot]+st*this.U[lt][q-1],this.U[lt][ot]=at}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(a[_-2])),Math.abs(this.s[q])),Math.abs(a[q])),gt=this.s[_-1]/dt,ct=this.s[_-2]/dt,ut=a[_-2]/dt,pt=this.s[q]/dt,ft=(dt=a[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&&(a[vt-1]=Et),mt=Nt*this.s[vt]+Tt*a[vt],a[vt]=Nt*a[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*a[vt]+Tt*this.s[vt+1],this.s[vt+1]=-Tt*a[vt]+Nt*this.s[vt+1],yt=Tt*a[vt+1],a[vt+1]=Nt*a[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}a[_-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<=V;It++)this.V[It][q]=-this.V[It][q]}for(;q<V&&!(this.s[q]>=this.s[q+1]);){var Ct=this.s[q];if(this.s[q]=this.s[q+1],this.s[q+1]=Ct,q<this.n-1)for(var Lt=0;Lt<this.n;Lt++)Ct=this.V[Lt][q+1],this.V[Lt][q+1]=this.V[Lt][q],this.V[Lt][q]=Ct;if(q<this.m-1)for(var _t=0;_t<this.m;_t++)Ct=this.U[_t][q+1],this.U[_t][q+1]=this.U[_t][q],this.U[_t][q]=Ct;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){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 a=0;a<this.iMax;a++){this.grid[a]=new Array(this.jMax);for(var s=0;s<this.jMax;s++)this.grid[a][s]=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},R.exports=t()),R.exports}())),b.exports}(()=>{var t;t=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=(e=!1,void 0);try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!i||n.length!==i);r=!0);}catch(t){e=!0,o=t}finally{try{!r&&s.return&&s.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){for(var o=new r,a=new Set,s=[],h=void 0,l=void 0,d=void 0,g=!1,c=1,u=[],p=[],f=function(){var n,r=t.collection(),f=(p.push(r),i[0]),m=t.collection();for(m.merge(f).merge(f.descendants().intersection(e)),s.push(f),m.forEach(function(t){o.push(t),a.add(t),r.merge(t)});0!=o.length;)(()=>{f=o.shift();var n=t.collection();f.neighborhood().nodes().forEach(function(t){0<e.intersection(f.edgesWith(t)).length&&n.merge(t)});for(var l=0;l<n.length;l++){var d=n[l];null==(h=i.intersection(d.union(d.ancestors())))||a.has(h[0])||h.union(h.descendants()).forEach(function(t){o.push(t),a.add(t),r.merge(t),i.has(t)&&s.push(t)})}})();r.forEach(function(t){e.intersection(t.connectedEdges()).forEach(function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)})}),(!(g=s.length==i.length||g)||1<c)&&(l=s[0],d=l.connectedEdges().length,s.forEach(function(t){t.connectedEdges().length<d&&(d=t.connectedEdges().length,l=t)}),u.push(l.id()),(n=t.collection()).merge(s[0]),s.forEach(function(t){n.merge(t)}),s=[],i=i.difference(n),c++)};f(),!g;);return n&&0<u.length&&n.set("dummy"+(n.size+1),u),p},relocateComponent:function(t,e,i){if(!i.fixedNodeConstraint){var r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=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=n(g.value,2),E=v[0],N=v[1],T=i.cy.getElementById(E);T&&(u=T.boundingBox(),p=e.xCoords[N]-u.w/2,f=e.xCoords[N]+u.w/2,m=e.yCoords[N]-u.h/2,y=e.yCoords[N]+u.h/2,p<r&&(r=p),o<f&&(o=f),m<a&&(a=m),s<y)&&(s=y)}}catch(t){l=!0,d=t}finally{try{!h&&c.return&&c.return()}finally{if(l)throw d}}var A=t.x-(o+r)/2,w=t.y-(s+a)/2;e.xCoords=e.xCoords.map(function(t){return t+A}),e.yCoords=e.yCoords.map(function(t){return t+w})}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<a&&(a=h),s<t&&(s=t)});var I=t.x-(o+r)/2,C=t.y-(s+a)/2;Object.keys(e).forEach(function(t){(t=e[t]).setCenter(t.getCenterX()+I,t.getCenterY()+C)})}}},calcBoundingBox:function(t,e,i,n){for(var r=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=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)<a&&(a=g),s<(g=i[n.get(c.id())]+c.height()/2)&&(s=g)}return(t={}).topLeftX=r,t.topLeftY=a,t.width=o-r,t.height=s-a,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,a=i(140).layoutBase.PointD,s=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),h.QUALITY="proof"==t.quality?2: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 a(c.topLeftX,c.topLeftY),new s(c.width,c.height))):e.add(new o(h.graphManager,new a(c.topLeftX,c.topLeftY),new s(parseFloat(T.w),parseFloat(T.h))))):e.add(new o(h.graphManager,new a(m[f.get(u.id())]-T.w/2,y[f.get(u.id())]-T.h/2),new s(parseFloat(T.w),parseFloat(T.h)))):e.add(new o(h.graphManager,new a(u.position("x")-T.w/2,u.position("y")-T.h/2),new s(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,C=0,L=0;L<w.length;L++){var _=w[L],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,C++)}return null!=t.idealEdgeLength&&(0<C?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=I/C: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),a=i(657).spectralLayout,s=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(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(a(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(s(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 a,s,h=void 0;"draft"==t.quality&&(h=n[i].nodeIndexes),0<e.nodes().not(v).length&&(a={edges:[],nodes:[]},s=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),a.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})):(s=h.get(e.id()),a.nodes.push({x:n[i].xCoords[s]-e.boundingbox().w/2,y:n[i].yCoords[s]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h})):r[i][e.id()]&&a.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 s,l,d,g,c,u=e.source();e=e.target();"none"!=u.css("display")&&"none"!=e.css("display")&&("draft"==t.quality?(s=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[s]),d.push(n[i].yCoords[s])),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])),a.edges.push({startX:d[0],startY:d[1],endX:g[0],endY:g[1]})):r[i][u.id()]&&r[i][e.id()]&&a.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<a.nodes.length)&&(y.push(a),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=a(t),n.push(d)),"default"==t.quality||"proof"==t.quality?(r.push(s(t,n[0])),o.relocateComponent(l[0],r[0],t)):o.relocateComponent(l[0],n[0],t);function A(e,i){var o,a,s,h;return"default"==t.quality||"proof"==t.quality?(a=o=void 0,s=(e="number"==typeof e?i:e).data("id"),r.forEach(function(t){s in t&&(o={x:t[s].getRect().getCenterX(),y:t[s].getRect().getCenterY()},a=t[s])}),t.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight)&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.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;function l(t){if(!(this instanceof l))throw new TypeError("Cannot call a class as a function");this.options=r({},h,t)}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){for(var e=t.cy,i=t.eles,a=i.nodes(),s=i.nodes(":parent"),h=new Map,l=new Map,d=new Map,g=[],c=[],u=[],p=[],f=[],m=[],y=[],v=[],E=void 0,N=1e8,T=t.piTol,A=t.samplingType,w=t.nodeSeparation,I=void 0,C=function(t,e,i){for(var n,r=[],o=0,a=0,s=[],h=0,d=1,c=0;c<E;c++)s[c]=N;for(s[r[a]=t]=0;o<=a;){for(var u=r[o++],p=g[u],y=0;y<p.length;y++)s[n=l.get(p[y])]==N&&(s[n]=s[u]+1,r[++a]=n);m[u][e]=s[u]*w}if(i){for(var v=0;v<E;v++)m[v][e]<f[v]&&(f[v]=m[v][e]);for(var T=0;T<E;T++)f[T]>h&&(h=f[T],d=T)}return d},L=function(t){var e=void 0;if(t){e=Math.floor(Math.random()*E);for(var i=0;i<E;i++)f[i]=N;for(var n=0;n<I;n++)p[n]=e,e=C(e,n,t)}else{for(var r=0,o=!1;r<I;){for(var a=Math.floor(Math.random()*E),s=(o=!1,0);s<r;s++)if(p[s]==a){o=!0;break}o||(p[r]=a,r++)}for(var h=0;h<I;h++)C(p[h],h,t)}for(var l=0;l<E;l++)for(var d=0;d<I;d++)m[l][d]*=m[l][d];for(var g=0;g<I;g++)y[g]=[];for(var c=0;c<I;c++)for(var u=0;u<I;u++)y[c][u]=m[p[u]][c]},_=(n.connectComponents(e,i,n.getTopMostNodes(a),h),s.forEach(function(t){n.connectComponents(e,i,n.getTopMostNodes(t.descendants().intersection(i)),h)}),0),M=0;M<a.length;M++)a[M].isParent()||l.set(a[M].id(),_++);var x=!0,O=!1,D=void 0;try{for(var b,R=h.keys()[Symbol.iterator]();!(x=(b=R.next()).done);x=!0){var F=b.value;l.set(F,_++)}}catch(t){O=!0,D=t}finally{try{!x&&R.return&&R.return()}finally{if(O)throw D}}for(var G=0;G<l.size;G++)g[G]=[];s.forEach(function(t){for(var e=t.children().intersection(i);0==e.nodes(":childless").length;)e=e.nodes()[0].children().intersection(i);var n=0,r=e.nodes(":childless")[0].connectedEdges().length;e.nodes(":childless").forEach(function(t,e){t.connectedEdges().length<r&&(r=t.connectedEdges().length,n=e)}),d.set(t.id(),e.nodes(":childless")[n].id())}),a.forEach(function(t){var e=t.isParent()?l.get(d.get(t.id())):l.get(t.id());t.neighborhood().nodes().forEach(function(n){0<i.intersection(t.edgesWith(n)).length&&(n.isParent()?g[e].push(d.get(n.id())):g[e].push(n.id()))})});var S=!0;O=!1,D=void 0;try{for(var P,U=h.keys()[Symbol.iterator]();!(S=(P=U.next()).done);S=!0)(t=>{var i=l.get(t),n=void 0;h.get(t).forEach(function(r){n=e.getElementById(r).isParent()?d.get(r):r,g[i].push(n),g[l.get(n)].push(t)})})(P.value)}catch(t){O=!0,D=t}finally{try{!S&&U.return&&U.return()}finally{if(O)throw D}}if(2<(E=l.size)){I=E<t.sampleSize?E:t.sampleSize;for(var Y=0;Y<E;Y++)m[Y]=[];for(var k=0;k<I;k++)v[k]=[];if("draft"==t.quality||"all"==t.step){L(A);for(var H=(s=o.svd(y)).S,X=(O=s.U,s=s.V,H[0]*H[0]*H[0]),z=[],B=0;B<I;B++){z[B]=[];for(var V=0;V<I;V++)z[B][V]=0,B==V&&(z[B][V]=H[B]/(H[B]*H[B]+X/(H[B]*H[B])))}v=r.multMat(r.multMat(s,z),r.transpose(O));for(var W=void 0,j=void 0,q=[],$=[],Z=[],Q=[],J=0;J<E;J++)q[J]=Math.random(),$[J]=Math.random();q=r.normalize(q),$=r.normalize($);for(var K=1e-9,tt=1e-9,et=void 0;;){for(var it=0;it<E;it++)Z[it]=q[it];if(q=r.multGamma(r.multL(r.multGamma(Z),m,v)),W=r.dotProduct(Z,q),q=r.normalize(q),K=r.dotProduct(Z,q),(et=Math.abs(K/tt))<=1+T&&1<=et)break;tt=K}for(var nt=0;nt<E;nt++)Z[nt]=q[nt];for(tt=1e-9;;){for(var rt=0;rt<E;rt++)Q[rt]=$[rt];if(Q=r.minusOp(Q,r.multCons(Z,r.dotProduct(Z,Q))),$=r.multGamma(r.multL(r.multGamma(Q),m,v)),j=r.dotProduct(Q,$),$=r.normalize($),K=r.dotProduct(Q,$),(et=Math.abs(K/tt))<=1+T&&1<=et)break;tt=K}for(var ot=0;ot<E;ot++)Q[ot]=$[ot];c=r.multCons(Z,Math.sqrt(Math.abs(W))),u=r.multCons(Q,Math.sqrt(Math.abs(j)))}else l.forEach(function(t,i){c.push(e.getElementById(i).position("x")),u.push(e.getElementById(i).position("y"))});return{nodeIndexes:l,xCoords:c,yCoords:u}}return D=l.keys(),A=(L=e.getElementById(D.next().value)).position(),s=L.outerWidth(),c.push(A.x),u.push(A.y),2==E&&(O=e.getElementById(D.next().value).outerWidth(),c.push(A.x+s/2+O/2+t.idealEdgeLength),u.push(A.y)),{nodeIndexes:l,xCoords:c,yCoords:u}}}},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},D.exports=t(F())})();var G=M(D.exports),S={L:"left",R:"right",T:"top",B:"bottom"},P={L:d(t=>t+`,${t/2} 0,${t} 0,0`,"L"),R:d(t=>`0,${t/2} ${t},0 ${t},`+t,"R"),T:d(t=>`0,0 ${t},0 ${t/2},`+t,"T"),B:d(t=>t/2+`,0 ${t},${t} 0,`+t,"B")},U={L:d((t,e)=>t-e+2,"L"),R:d((t,e)=>t-2,"R"),T:d((t,e)=>t-e+2,"T"),B:d((t,e)=>t-2,"B")},Y=d(function(t){return H(t)?"L"===t?"R":"L":"T"===t?"B":"T"},"getOppositeArchitectureDirection"),k=d(function(t){return"L"===t||"R"===t||"T"===t||"B"===t},"isArchitectureDirection"),H=d(function(t){return"L"===t||"R"===t},"isArchitectureDirectionX"),X=d(function(t){return"T"===t||"B"===t},"isArchitectureDirectionY"),z=d(function(t,e){var i=H(t)&&X(e);t=X(t)&&H(e);return i||t},"isArchitectureDirectionXY"),B=d(function(t){var e=t[0],i=(t=t[1],H(e)&&X(t));e=X(e)&&H(t);return i||e},"isArchitecturePairXY"),V=d(function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t},"isValidArchitectureDirectionPair"),W=d(function(t,e){return V(t=""+t+e)?t:void 0},"getArchitectureDirectionPair"),j=d(function([t,e],i){var n=i[0];i=i[1];return H(n)?X(i)?[t+("L"===n?-1:1),e+("T"===i?1:-1)]:[t+("L"===n?-1:1),e]:H(i)?[t+("L"===i?1:-1),e+("T"===n?1:-1)]:[t,e+("T"===n?1:-1)]},"shiftPositionByArchitectureDirectionPair"),q=d(function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),$=d(function(t,e){return z(t,e)?"bend":H(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Z=d(function(t){return"service"===t.type},"isArchitectureService"),Q=d(function(t){return"junction"===t.type},"isArchitectureJunction"),J=d(t=>t.data(),"edgeData"),K=d(t=>t.data(),"nodeData"),tt=n.architecture,et=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=r,this.getAccTitle=o,this.setDiagramTitle=a,this.getDiagramTitle=s,this.getAccDescription=h,this.setAccDescription=l,this.clear()}static{d(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="",g()}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(Z)}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(Q)}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:a,rhsGroup:s,title:h}){if(!k(i))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got `+String(i));if(!k(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(a&&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(s&&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:a,rhsId:e,rhsDir:n,rhsInto:o,rhsGroup:s,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);let 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){let 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,a=this.getNode(n.rhsId)?.in;return o&&a&&o!==a&&"bend"!==(r=$(n.lhsDir,n.rhsDir))&&(i[o]??={},i[o][a]=r,i[a]??={},i[a][o]=r),n.lhsId===e?(a=W(n.lhsDir,n.rhsDir))&&(t[a]=n.rhsId):(o=W(n.rhsDir,n.lhsDir))&&(t[o]=n.lhsId),t},{}),t),{}),r=Object.keys(n)[0],o={[r]:1},a=Object.keys(n).reduce((t,e)=>e===r?t:{...t,[e]:1},{});for(var t=d(t=>{let e={[t]:[0,0]},i=[t];for(;0<i.length;){var r=i.shift();if(r){o[r]=1,delete a[r];var s=n[r];let[t,h]=e[r];Object.entries(s).forEach(([n,r])=>{o[r]||(e[r]=j([t,h],n),i.push(r))})}}return e},"BFS"),e=[t(r)];0<Object.keys(a).length;)e.push(t(Object.keys(a)[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 c({...tt,...u().architecture})}getConfigField(t){return this.getConfig()[t]}},it=d((t,e)=>{i(t,e),t.groups.map(t=>e.addGroup(t)),t.services.map(t=>e.addService({...t,type:"service"})),t.junctions.map(t=>e.addJunction({...t,type:"junction"})),t.edges.map(t=>e.addEdge(t)),t.alignments?.map(t=>e.addLayoutHint({direction:t.direction,members:[...t.members]}))},"populateDb"),nt={parser:{yy:void 0},parse:d(async t=>{t=await C("architecture",t);var e=(m.debug(t),nt.parser?.yy);if(!(e instanceof et))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.");it(t,e)},"parse")},rt=d(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"),ot=rt;function at(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}}d(at,"withSeededRandom");var st=d(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),ht={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:p,blank:{body:st("")}}},lt=d(async function(t,e,i,n){let r=i.getConfigField("padding");var o=i.getConfigField("iconSize");let a=o/2,s=o/6,h=s/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}=J(e);let{x:y,y:v}=e[0].sourceEndpoint();var{x:E,y:w}=e[0].midpoint();let{x:I,y:C}=e[0].targetEndpoint();var L=r+4;if(g&&(H(l)?y+="L"===l?-L:L:v+="T"===l?-L:L+18),f&&(H(u)?I+="L"===u?-L:L:C+="T"===u?-L:L+18),g||"junction"!==i.getNode(o)?.type||(H(l)?y+="L"===l?a:-a:v+="T"===l?a:-a),f||"junction"!==i.getNode(c)?.type||(H(u)?I+="L"===u?a:-a:C+="T"===u?a:-a),e[0]._private.rscratch&&((L=t.insert("g")).insert("path").attr("d",`M ${y},${v} L ${E},${w} L${I},${C} `).attr("class","edge").attr("id",n+"-"+N(o,c,{prefix:"L"})),d&&(g=H(l)?U[l](y,s):y-h,f=X(l)?U[l](v,s):v-h,L.insert("polygon").attr("points",P[l](s)).attr("transform",`translate(${g},${f})`).attr("class","arrow")),p&&(e=H(u)?U[u](I,s):I-h,o=X(u)?U[u](C,s):C-h,L.insert("polygon").attr("points",P[u](s)).attr("transform",`translate(${e},${o})`).attr("class","arrow")),m)){let t=0;t="X"==(c=z(l,u)?"XY":H(l)?"X":"Y")?Math.abs(y-I):"Y"==c?Math.abs(v-C)/1.5:Math.abs(y-I)/2,d=L.append("g"),await T(d,m,{useHtmlLabels:!1,width:t,classes:"architecture-service-label"},A()),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"==c?d.attr("transform","translate("+E+", "+w+")"):"Y"==c?d.attr("transform","translate("+E+", "+w+") rotate(-90)"):"XY"==c&&(g=W(l,u))&&B(g)&&(f=d.node().getBoundingClientRect(),[p,e]=q(g),d.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*e*45})`),o=d.node().getBoundingClientRect(),d.attr("transform",`\n translate(${E}, ${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"),dt=d(async function(t,e,i,n){let r=.75*i.getConfigField("padding"),o=i.getConfigField("fontSize"),a=i.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async e=>{var s=K(e);if("group"===s.type){var{h:e,w:h,x1:l,y1:d}=e.boundingBox(),g=t.append("rect");e=(g.attr("id",n+"-group-"+s.id).attr("x",l+a).attr("y",d+a).attr("width",h).attr("height",e).attr("class","node-bkg"),t.append("g"));let c=l,u=d;s.icon&&((l=e.append("g")).html(`<g>${await w(s.icon,{height:r,width:r,fallbackPrefix:ht.prefix})}</g>`),l.attr("transform","translate("+(c+a+1)+", "+(u+a+1)+")"),c+=r,u+=o/2-1-2),s.label&&(d=e.append("g"),await T(d,s.label,{useHtmlLabels:!1,width:h,classes:"architecture-service-label"},A()),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),d.attr("transform","translate("+(c+a+4)+", "+(u+a+2)+")")),i.setElementForId(s.id,g)}}))},"drawGroups"),gt=d(async function(t,e,i,n){var r,o=A();for(r of i){var a=e.append("g"),s=t.getConfigField("iconSize"),h=(r.title&&(h=a.append("g"),await T(h,r.title,{useHtmlLabels:!1,width:1.5*s,classes:"architecture-service-label"},o),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),h.attr("transform","translate("+s/2+", "+s+")")),a.append("g")),{width:l,height:d}=(r.icon?h.html(`<g>${await w(r.icon,{height:s,width:s,fallbackPrefix:ht.prefix})}</g>`):r.iconText?(h.html(`<g>${await w("blank",{height:s,width:s,fallbackPrefix:ht.prefix})}</g>`),l=h.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(I(r.iconText,o)),d=parseInt(window.getComputedStyle(l.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16,l.attr("style",`-webkit-line-clamp: ${Math.floor((s-2)/d)};`)):h.append("path").attr("class","node-bkg").attr("id",n+"-node-"+r.id).attr("d",`M0,${s} V5 Q0,0 5,0 H${s-5} Q${s},0 ${s},5 V${s} Z`),a.attr("id",n+"-service-"+r.id).attr("class","architecture-service"),a.node().getBBox());r.width=l,r.height=d,t.setElementForId(r.id,a)}return 0},"drawServices"),ct=d(function(t,e,i,n){i.forEach(i=>{var r=e.append("g"),o=t.getConfigField("iconSize"),{width:o,height:a}=(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=a,t.setElementForId(i.id,r)})},"drawJunctions");function ut(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 pt(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 ft(t,e){e.nodes().map(e=>{var i=K(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 mt(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 yt(t,e){t.forEach(t=>{var{lhsId:i,rhsId:n,lhsInto:r,lhsGroup:o,rhsInto:a,lhsDir:s,rhsDir:h,rhsGroup:l,title:d}=t;t=z(t.lhsDir,t.rhsDir)?"segments":"straight";e.add({group:"edges",data:{id:i+"-"+n,label:d,source:i,sourceDir:s,sourceArrow:r,sourceGroup:o,sourceEndpoint:"L"===s?"0 50%":"R"===s?"100% 50%":"T"===s?"50% 0":"50% 100%",target:n,targetDir:h,targetArrow:a,targetGroup:l,targetEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%"},classes:t})})}function vt(t,e,i,n=[]){let r=d((t,e)=>Object.entries(t).reduce((t,[n,r])=>{let o=0;var a=Object.entries(r);if(1===a.length)t[n]=a[0][1];else for(let r=0;r<a.length-1;r++)for(let g=r+1;g<a.length;g++){var[s,h]=a[r],[l,d]=a[g];i[s]?.[l]===e||"default"===s||"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=>{let i={},n={};return Object.entries(e).forEach(([e,[r,o]])=>{var a=t.getNode(e)?.in??"default";i[o]??={},i[o][a]??=[],i[o][a].push(e),n[r]??={},n[r][a]??=[],n[r][a].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]],[[],[]]);let a=new Set;n.forEach(t=>t.members.forEach(t=>a.add(t)));var s=d(t=>t.filter(t=>!t.some(t=>a.has(t))),"dropOverlapping");let h=s(e),l=s(o);return n.forEach(t=>{t.members.length<2||("row"===t.direction?h:l).push([...t.members])}),{horizontal:h,vertical:l}}function Et(t,e,i=[]){let n=[],r=e.getConfigField("iconSize"),o=e.getConfigField("idealEdgeLengthMultiplier"),a=o*r,s=new Set,h=(i.forEach(t=>{for(let r=0;r<t.members.length-1;r++){var e=t.members[r],i=t.members[r+1];s.add(e+"|"+i),s.add(i+"|"+e),"row"===t.direction?n.push({left:e,right:i,gap:a}):n.push({top:e,bottom:i,gap:a})}}),d(t=>t[0]+","+t[1],"posToStr")),l=d(t=>t.split(",").map(t=>parseInt(t)),"strToPos");return t.forEach(t=>{let e=Object.fromEntries(Object.entries(t).map(([t,e])=>[h(e),t])),i=[h([0,0])],a={};for(var d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};0<i.length;){var g=i.shift();if(g){a[g]=1;let t=e[g];if(t){let c=l(g);Object.entries(d).forEach(([l,d])=>{d=h([c[0]+d[0],c[1]+d[1]]);var g=e[d];g&&!a[d]&&(i.push(d),s.has(t+"|"+g)||n.push({[S[l]]:g,[S[Y(l)]]:t,gap:o*r}))})}}}}),n}function Nt(t,e,i,n,r,{spatialMaps:o,groupAlignments:a}){return new Promise(s=>{var h=y("body").append("div").attr("id","cy").attr("style","display:none");let l=L({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}}});h.remove(),mt(i,l),ut(t,l,r),pt(e,l,r),yt(n,l);h=r.getLayoutHints();var g=vt(r,o,a,h),c=(h=Et(o,r,h),r.getConfigField("iconSize"));let u=r.getConfigField("idealEdgeLengthMultiplier")*c,p=.5*c,f=r.getConfigField("edgeElasticity"),v=r.getConfigField("seed"),E=l.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=K(t).parent)===(e=K(e).parent)?u:p},edgeElasticity(t){var e,[t,e]=t.connectedNodes();return(t=K(t).parent)===(e=K(e).parent)?f:.001},alignmentConstraint:g,relativePlacementConstraint:h});E.one("layoutstop",()=>{function t(t,e,i,n){var{x:t,y:r}=t,{x:e,y:o}=e,a=(n-r+(t-i)*(r-o)/(t-e))/Math.sqrt(1+Math.pow((r-o)/(t-e),2)),s=Math.sqrt(Math.pow(n-r,2)+Math.pow(i-t,2)-Math.pow(a,2));s/=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(a)*h,weights:s*=l}}for(var e of(d(t,"getSegmentWeights"),l.startBatch(),Object.values(l.edges()))){var i,n,r,o;e.data?.()&&(({x:r,y:n}=e.source().position()),({x:o,y:i}=e.target().position()),r!==o)&&n!==i&&(r=e.sourceEndpoint(),o=e.targetEndpoint(),n=J(e).sourceDir,[i,n]=X(n)?[r.x,o.y]:[o.x,r.y],({weights:r,distances:o}=t(r,o,i,n)),e.style("segment-distances",o),e.style("segment-weights",r))}l.endBatch(),at(v,()=>E.run())});try{at(v,()=>E.run())}catch(h){if(h instanceof RangeError&&h.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 h}l.ready(t=>{m.info("Ready",t),s(l)})})}f([{name:ht.prefix,icons:ht}]),L.use(G),d(ut,"addServices"),d(pt,"addJunctions"),d(ft,"positionNodes"),d(mt,"addGroups"),d(yt,"addEdges"),d(vt,"getAlignments"),d(Et,"getRelativeConstraints"),d(Nt,"layoutArchitecture");var Tt=d(async(t,e,i,n)=>{var r=((n=n.db).setDiagramId(e),n.getServices()),o=n.getJunctions(),a=n.getGroups(),s=n.getEdges(),h=n.getDataStructures(),l=v(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 gt(n,c,r,e),ct(n,c,o,e),await Nt(r,o,a,s,n,h));await lt(d,c,n,e),await dt(g,c,n,e),ft(n,c),E(void 0,l,n.getConfigField("padding"),n.getConfigField("useMaxWidth"))},"draw"),At={draw:Tt},wt={parser:nt,get db(){return new et},renderer:At,styles:ot};export{wt as diagram};
@@ -0,0 +1 @@
1
+ var t,e;(t=self.document)&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e));import{g as r}from"./chunk-5VM5RSS4-5fc85a49.js";import{aD as a,aE as i,aF as s,aG as n,aH as o,aI as l,aJ as c,aK as d,aL as h,aM as g,aN as y,aO as u,aP as p,aQ as x,aR as b,aS as f,aT as m,aU as w,aV as k,aW as S,aX as L,aY as _,aZ as v,a_ as E,a$ as T,_ as D,l as I,d as N,b0 as $,b1 as C,G as B,b2 as O,j as R,b3 as z,av as A,u as M,b4 as P,S as Y,O as j,k as F,v as W,C as X,T as H,e as U,i as K,b5 as Z,b6 as q}from"./mermaid.core-70d5aead.js";import{G as V}from"./graph-0df36b9d.js";import{c as G}from"./channel-534c2e17.js";import"./web-25bb78b9.js";function J(t){if(a(t))return t;var e,r,D,I=i(t);if(!function(t){switch(i(t)){case T:case E:case v:case _:case L:case S:case k:case w:case m:case f:case b:case x:case p:case u:case y:case g:case h:case d:case c:case l:case o:case n:return!0;default:return!1}}(t))return{};if(function(t){return Array.isArray(t)}(t)){let e=Array.from(t);return 0<t.length&&"string"==typeof t[0]&&Object.hasOwn(t,"index")&&(e.index=t.index,e.input=t.input),e}if(s(t))return new t.constructor(t.buffer,t.byteOffset,t.length);if("[object ArrayBuffer]"===I)return new ArrayBuffer(t.byteLength);if("[object DataView]"===I)return D=t.buffer,e=t.byteOffset,r=t.byteLength,N=new ArrayBuffer(r),D=new Uint8Array(D,e,r),new Uint8Array(N).set(D),new DataView(N);if("[object Boolean]"===I||"[object Number]"===I||"[object String]"===I)return("[object String]"===I?tt:Q)(e=new t.constructor(t.valueOf()),t),e;if("[object Date]"===I)return new Date(Number(t));if("[object RegExp]"===I)return r=t,(D=new RegExp(r.source,r.flags)).lastIndex=r.lastIndex,D;if("[object Symbol]"===I)return Object(Symbol.prototype.valueOf.call(t));if("[object Map]"===I){let e=new Map;return t.forEach((t,r)=>{e.set(r,t)}),e}if("[object Set]"===I){let e=new Set;return t.forEach(t=>{e.add(t)}),e}if("[object Arguments]"===I){var N=t;let e={};return Q(e,N),e.length=N.length,e[Symbol.iterator]=N[Symbol.iterator],e}let $={};return function(t,e){var r=Object.getPrototypeOf(e);null!==r&&"function"==typeof e.constructor&&Object.setPrototypeOf(t,r)}($,t),Q($,t),function(t,e){var r=Object.getOwnPropertySymbols(e);for(let i=0;i<r.length;i++){var a=r[i];Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}}($,t),$}function Q(t,e){for(var r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function tt(t,e){var r,a=e.valueOf().length;for(r in e)Object.hasOwn(e,r)&&(Number.isNaN(Number(r))||Number(r)>=a)&&(t[r]=e[r])}var et=(()=>{var t=D(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,7],r=[1,13],a=[1,14],i=[1,19],s=[1,16],n=[1,17],o=[1,18],l=[8,10,21,28,29,30,31,39,43,46],c=[1,23],d=[1,24],h=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],y=[1,49],u={trace:D(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:D(function(t,e,r,a,i,s,n){var o=s.length-1;switch(i){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",s[o-1]),a.setHierarchy(s[o-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",s[o]),"number"==typeof s[o].length?this.$=s[o]:this.$=[s[o]];break;case 13:a.getLogger().debug("Rule: statement #2: ",s[o-1]),this.$=[s[o-1]].concat(s[o]);break;case 14:a.getLogger().debug("Rule: link: ",s[o],t),this.$={edgeTypeStr:s[o],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",s[o-3],s[o-1],s[o]),this.$={edgeTypeStr:s[o],label:s[o-1]};break;case 18:var l=parseInt(s[o]),c=a.generateId();this.$={id:c,type:"space",label:"",width:l,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",s[o-2],s[o-1],s[o]," typestr: ",s[o-1].edgeTypeStr);c=a.edgeStrToEdgeData(s[o-1].edgeTypeStr),l=a.edgeStrToEdgeStartData(s[o-1].edgeTypeStr);var d=a.edgeStrToThickness(s[o-1].edgeTypeStr),h=a.edgeStrToPattern(s[o-1].edgeTypeStr);this.$=[{id:s[o-2].id,label:s[o-2].label,type:s[o-2].type,directions:s[o-2].directions},{id:s[o-2].id+"-"+s[o].id,start:s[o-2].id,end:s[o].id,label:s[o-1].label,type:"edge",thickness:d,pattern:h,directions:s[o].directions,arrowTypeEnd:c,arrowTypeStart:l},{id:s[o].id,label:s[o].label,type:a.typeStr2Type(s[o].typeStr),directions:s[o].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",s[o-1],s[o]),this.$={id:s[o-1].id,label:s[o-1].label,type:a.typeStr2Type(s[o-1].typeStr),directions:s[o-1].directions,widthInColumns:parseInt(s[o],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",s[o]),this.$={id:s[o].id,label:s[o].label,type:a.typeStr2Type(s[o].typeStr),directions:s[o].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this||"na"),a.getLogger().debug("COLUMNS: ",s[o]),this.$={type:"column-setting",columns:"auto"===s[o]?-1:parseInt(s[o])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",s[o-2],s[o-1]),a.generateId(),this.$={...s[o-2],type:"composite",children:s[o-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",s[o-2],s[o-1],s[o]),d=a.generateId(),this.$={id:d,type:"composite",label:"",children:s[o-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",s[o]),this.$={id:s[o]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",s[o-1],s[o]),this.$={id:s[o-1],label:s[o].label,typeStr:s[o].typeStr,directions:s[o].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",s[o]),this.$=[s[o]];break;case 32:a.getLogger().debug("Rule: dirList: ",s[o-1],s[o]),this.$=[s[o-1]].concat(s[o]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",s[o-2],s[o-1],s[o]),this.$={typeStr:s[o-2]+s[o],label:s[o-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",s[o-3],s[o-2]," #3:",s[o-1],s[o]),this.$={typeStr:s[o-3]+s[o],label:s[o-2],directions:s[o-1]};break;case 35:case 36:this.$={type:"classDef",id:s[o-1].trim(),css:s[o].trim()};break;case 37:this.$={type:"applyClass",id:s[o-1].trim(),styleClass:s[o].trim()};break;case 38:this.$={type:"applyStyles",id:s[o-1].trim(),stylesStr:s[o].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:p=[1,15],11:3,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:a,31:i,39:s,43:n,46:o},{8:[1,20]},t(u=[8,30],[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:p,21:e,28:r,29:a,31:i,39:s,43:n,46:o}),t(l,[2,16],{14:22,15:c,16:d}),t(l,[2,17]),t(l,[2,18]),t(l,[2,19]),t(l,[2,20]),t(l,[2,21]),t(l,[2,22]),t(h,[2,25],{27:[1,25]}),t(l,[2,26]),{19:26,26:12,31:i},{10:p,11:27,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:a,31:i,39:s,43:n,46:o},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:i},{31:[2,14]},{17:[1,36]},t(h,[2,24]),{10:p,11:37,13:4,14:22,15:c,16:d,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:a,31:i,39:s,43:n,46:o},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(h,[2,23]),{18:[1,45]},{30:[1,46]},t(l,[2,28]),t(l,[2,35]),t(l,[2,36]),t(l,[2,37]),t(l,[2,38]),{36:[1,47]},{33:48,34:y},{15:[1,50]},t(l,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:y,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:D(function(t,e){var r;if(!e.recoverable)throw(r=new Error(t)).hash=e,r;this.trace(t)},"parseError"),parse:D(function(t){var e,r=this,a=[0],i=[],s=[null],n=[],o=this.table,l="",c=0,d=0,h=n.slice.call(arguments,1),g=Object.create(this.lexer),y={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(y.yy[e]=this.yy[e]);g.setInput(t,y.yy),y.yy.lexer=g,y.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var u=g.yylloc,p=(n.push(u),g.options&&g.options.ranges);function x(){var t=i.pop()||g.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(i=t).pop()),t=r.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,D(function(t){a.length=a.length-2*t,s.length=s.length-t,n.length=n.length-t},"popStack"),D(x,"lex");for(var b,f,m,w,k,S,L={};;){if(f=a[a.length-1],void 0===(m=this.defaultActions[f]||(null==b&&(b=x()),o[f]&&o[f][b]))||!m.length||!m[0]){var _,v=[];for(w in o[f])this.terminals_[w]&&2<w&&v.push("'"+this.terminals_[w]+"'");_=g.showPosition?"Parse error on line "+(c+1)+":\n"+g.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(_,{text:g.match,token:this.terminals_[b]||b,line:g.yylineno,loc:u,expected:v})}if(m[0]instanceof Array&&1<m.length)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+b);switch(m[0]){case 1:a.push(b),s.push(g.yytext),n.push(g.yylloc),a.push(m[1]),b=null,d=g.yyleng,l=g.yytext,c=g.yylineno,u=g.yylloc;break;case 2:if(k=this.productions_[m[1]][1],L.$=s[s.length-k],L._$={first_line:n[n.length-(k||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(k||1)].first_column,last_column:n[n.length-1].last_column},p&&(L._$.range=[n[n.length-(k||1)].range[0],n[n.length-1].range[1]]),void 0!==(S=this.performAction.apply(L,[l,d,c,y.yy,m[1],s,n].concat(h))))return S;k&&(a=a.slice(0,-1*k*2),s=s.slice(0,-1*k),n=n.slice(0,-1*k)),a.push(this.productions_[m[1]][0]),s.push(L.$),n.push(L._$),S=o[a[a.length-2]][a[a.length-1]],a.push(S);break;case 3:return!0}}return!0},"parse")},p={EOF:1,parseError:D(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:D(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:D(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:D(function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g),a=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e,t=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1),this.yylloc.range);return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===t.length?this.yylloc.first_column:0)+t[t.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:D(function(){return this._more=!0,this},"more"),reject:D(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:D(function(t){this.unput(this.match.slice(t))},"less"),pastInput:D(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:D(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:D(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:D(function(t,e){var r,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)&&(a.yylloc.range=this.yylloc.range.slice(0)),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack)for(var i in a)this[i]=a[i];return!1},"test_match"),next:D(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,r,a,i=this._currentRules(),s=0;s<i.length;s++)if((r=this._input.match(this.rules[i[s]]))&&(!e||r[0].length>e[0].length))if(e=r,a=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[s])))return t;if(!this._backtrack)return!1;e=!1}else if(!this.options.flex)break;return e?!1!==(t=this.test_match(e,i[a]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:D(function(){return this.next()||this.lex()},"lex"),begin:D(function(t){this.conditionStack.push(t)},"begin"),popState:D(function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:D(function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules},"_currentRules"),topState:D(function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"},"topState"),pushState:D(function(t){this.begin(t)},"pushState"),stateStackSize:D(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:D(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};function x(){this.yy={}}return u.lexer=p,D(x,"Parser"),new((x.prototype=u).Parser=x)})(),rt=et.parser=et,at=new Map,it=[],st=new Map,nt="color",ot="fill",lt=new Map,ct="",dt=D(t=>U.sanitizeText(t,N()),"sanitizeText"),ht=D(function(t,e=""){let r=lt.get(t);r||(r={id:t,styles:[],textStyles:[]},lt.set(t,r)),null!=e&&e.split(",").forEach(t=>{var e=t.replace(/([^;]*);/,"$1").trim();RegExp(nt).exec(t)&&(t=e.replace(ot,"bgFill").replace(nt,ot),r.textStyles.push(t)),r.styles.push(e)})},"addStyleClass"),gt=D(function(t,e=""){t=at.get(t),null!=e&&(t.styles=e.split(","))},"addStyle2Node"),yt=D(function(t,e){t.split(",").forEach(function(t){let r=at.get(t);void 0===r&&(r={id:t=t.trim(),type:"na",children:[]},at.set(t,r)),r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),ut=D((t,e)=>{t=t.flat();var r,a=[],i=t.find(t=>"column-setting"===t?.type)?.columns??-1;for(r of t)if("number"==typeof i&&0<i&&"column-setting"!==r.type&&"number"==typeof r.widthInColumns&&r.widthInColumns>i&&I.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width `+i),r.label&&(r.label=dt(r.label)),"classDef"===r.type)ht(r.id,r.css);else if("applyClass"===r.type)yt(r.id,r?.styleClass??"");else if("applyStyles"===r.type)r?.stylesStr&&gt(r.id,r?.stylesStr);else if("column-setting"===r.type)e.columns=r.columns??-1;else if("edge"===r.type){var s=(st.get(r.id)??0)+1;st.set(r.id,s),r.id=s+"-"+r.id,it.push(r)}else if(r.label||("composite"===r.type?r.label="":r.label=r.id),void 0===(s=at.get(r.id))?at.set(r.id,r):("na"!==r.type&&(s.type=r.type),r.label!==r.id&&(s.label=r.label)),r.children&&ut(r.children,r),"space"===r.type){var n=r.width??1;for(let t=0;t<n;t++){var o=J(r);o.id=o.id+"-"+t,at.set(o.id,o),a.push(o)}}else void 0===s&&a.push(r);e.children=a},"populateBlockDatabase"),pt=[],xt={id:"root",type:"composite",children:[],columns:-1},bt=D(()=>{I.debug("Clear called"),W(),xt={id:"root",type:"composite",children:[],columns:-1},at=new Map([["root",xt]]),pt=[],lt=new Map,it=[],st=new Map,ct=""},"clear");function ft(t){switch(I.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return I.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function mt(t){return I.debug("typeStr2Type",t),"=="!==t?"normal":"thick"}function wt(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function kt(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function St(t){return t.includes("==")?"thick":"normal"}function Lt(t){return t.includes(".-")?"dotted":"solid"}D(ft,"typeStr2Type"),D(mt,"edgeTypeStr2Type"),D(wt,"edgeStrToEdgeData"),D(kt,"edgeStrToEdgeStartData"),D(St,"edgeStrToThickness"),D(Lt,"edgeStrToPattern");var _t=0,vt=D(()=>(_t++,"id-"+Math.random().toString(36).substr(2,12)+"-"+_t),"generateId"),Et=D(t=>{xt.children=t,ut(t,xt),pt=xt.children},"setHierarchy"),Tt=D(t=>(t=at.get(t))?t.columns||(t.children?t.children.length:-1):-1,"getColumns"),Dt=D(()=>[...at.values()],"getBlocksFlat"),It=D(()=>pt||[],"getBlocks"),Nt=D(()=>it,"getEdges"),$t=D(t=>at.get(t),"getBlock"),Ct=D(t=>{at.set(t.id,t)},"setBlock"),Bt=D(t=>{ct=t},"setDiagramId"),Ot=D(()=>ct,"getDiagramId"),Rt=D(()=>I,"getLogger"),zt=D(function(){return lt},"getClasses"),At={getConfig:D(()=>B().block,"getConfig"),typeStr2Type:ft,edgeTypeStr2Type:mt,edgeStrToEdgeData:wt,edgeStrToEdgeStartData:kt,edgeStrToThickness:St,edgeStrToPattern:Lt,getLogger:Rt,getBlocksFlat:Dt,getBlocks:It,getEdges:Nt,setHierarchy:Et,getBlock:$t,setBlock:Ct,getColumns:Tt,getClasses:zt,clear:bt,generateId:vt,setDiagramId:Bt,getDiagramId:Ot},Mt=D((t,e)=>{var r=(i=G)(t,"r"),a=i(t,"g"),i=i(t,"b");return X(r,a,i,e)},"fade"),Pt=D(t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span,p {\n color: ${t.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${t.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${Mt(t.mainBkg,.5)};\n fill: ${Mt(t.clusterBkg,.5)};\n stroke: ${Mt(t.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span,p {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n ${r()}\n`,"getStyles"),Yt=Pt,jt=D((t,e,r,a)=>{e.forEach(e=>{Gt[e](t,r,a)})},"insertMarkers"),Ft=D((t,e,r)=>{I.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Wt=D((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Xt=D((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Ht=D((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Ut=D((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Kt=D((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Zt=D((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),qt=D((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Vt=D((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Gt={extension:Ft,composition:Wt,aggregation:Xt,dependency:Ht,lollipop:Ut,point:Kt,circle:Zt,cross:qt,barb:Vt},Jt=jt;function Qt(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);return t<0?{px:e,py:0}:1===t?{px:0,py:e}:{px:e%t,py:Math.floor(e/t)}}D(Qt,"calculateBlockPosition");var te=D(t=>{let e=0,r=0;for(var a of t.children){var{width:i,height:s,x:n,y:o}=a.size??{width:0,height:0,x:0,y:0};I.debug("getMaxChildSize abc95 child:",a.id,"width:",i,"height:",s,"x:",n,"y:",o,a.type),"space"!==a.type&&((n=i/(a.widthInColumns??1))>e&&(e=n),s>r)&&(r=s)}return{width:e,height:r}},"getMaxChildSize");function ee(t,e,r=0,a=0,i=8){if(I.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"siblingWidth",r),t?.size?.width||(t.size={width:r,height:a,x:0,y:0}),0<t.children?.length){for(var s of t.children)ee(s,e,0,0,i);var n,o,l,c=(h=te(t)).width;for(o of(I.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",c,n=h.height),t.children))o.size&&(I.debug(`abc95 Setting size of children of ${t.id} id=${o.id} ${c} ${n} `+JSON.stringify(o.size)),o.size.width=c*(o.widthInColumns??1)+i*((o.widthInColumns??1)-1),o.size.height=n,o.size.x=0,o.size.y=0,I.debug(`abc95 updating size of ${t.id} children child:${o.id} maxWidth:${c} maxHeight:`+n));for(l of t.children)ee(l,e,c,n,i);var d,h=t.columns??-1;let f=0;for(d of t.children)f+=d.widthInColumns??1;let m=t.children.length;0<h&&h<f&&(m=h);var g=Math.ceil(f/m);let w=m*(c+i)+i,k=g*(n+i)+i;if(w<r){I.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${a} width `+w),w=r,k=a;var y,u=(r-m*i-i)/m,p=(a-g*i-i)/g;for(y of(I.debug("Size indata abc88",t.id,"childWidth",u,"maxWidth",c),I.debug("Size indata abc88",t.id,"childHeight",p,"maxHeight",n),I.debug("Size indata abc88 xSize",m,"padding",i),t.children))y.size&&(y.size.width=u,y.size.height=p,y.size.x=0,y.size.y=0)}if(I.debug(`abc95 (finale calc) ${t.id} xSize ${m} ySize ${g} columns ${h}${t.children.length} width=`+Math.max(w,t.size?.width||0)),w<(t?.size?.width||0)&&(w=t?.size?.width||0,0<(r=0<h?Math.min(t.children.length,h):t.children.length))){var x,b=(w-r*i-i)/r;for(x of(I.debug("abc95 (growing to fit) width",t.id,w,t.size?.width,b),t.children))x.size&&(x.size.width=b)}t.size={width:w,height:k,x:0,y:0}}I.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function re(t,e,r=8){I.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: `+t?.size?.width);var a=t.columns??-1;if(I.debug("layoutBlocks columns abc95",t.id,"=>",a,t),t.children&&0<t.children.length){var i=t?.children[0]?.size?.width??0,s=(i=t.children.length*i+(t.children.length-1)*r,I.debug("widthOfChildren 88",i,"posX"),new Map);{let e=0;for(var n of t.children)if(n.size){var o=Qt(a,e).py,l=s.get(o)??0;n.size.height>l&&s.set(o,n.size.height);let t=n?.widthInColumns??1;0<a&&(t=Math.min(t,a-e%a)),e+=t}}var c,d,h=new Map;{let t=0;for(c of[...s.keys()].sort((t,e)=>t-e))h.set(c,t),t+=(s.get(c)??0)+r}let f=0,m=(I.debug("abc91 block?.size?.x",t.id,t?.size?.x),t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-r),w=0;for(d of t.children){var g=t;if(d.size){var y,{width:u,height:p}=d.size,{px:x,py:b}=Qt(a,f);b!=w&&(w=b,m=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-r,I.debug("New row in layout for block",t.id," and child ",d.id,w)),I.debug(`abc89 layout blocks (child) id: ${d.id} Pos: ${f} (px, py) ${x},${b} (${g?.size?.x},${g?.size?.y}) parent: ${g.id} width: `+u+r),g.size&&(x=u/2,d.size.x=m+r+x,I.debug(`abc91 layout blocks (calc) px, pyid:${d.id} startingPos=X${m} new startingPosX${d.size.x} ${x} padding=${r} width=${u} halfWidth=${x} => x:${d.size.x} y:${d.size.y} ${d.widthInColumns} (width * (child?.w || 1)) / 2 `+u*(d?.widthInColumns??1)/2),m=d.size.x+x,y=h.get(b)??0,b=s.get(b)??p,d.size.y=g.size.y-g.size.height/2+y+b/2+r,I.debug(`abc88 layout blocks (calc) px, pyid:${d.id}startingPosX${m}${r}${x}=>x:${d.size.x}y:${d.size.y}${d.widthInColumns}(width * (child?.w || 1)) / 2`+u*(d?.widthInColumns??1)/2)),d.children&&re(d,e,r);let i=d?.widthInColumns??1;0<a&&(i=Math.min(i,a-f%a)),f+=i,I.debug("abc88 columnsPos",d,f)}}}I.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: `+t?.size?.width)}function ae(t,{minX:e,minY:r,maxX:a,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){var s,n,o,l;if(t.size&&"root"!==t.id&&(({x:s,y:n,width:o,height:l}=t.size),s-o/2<e&&(e=s-o/2),n-l/2<r&&(r=n-l/2),a<s+o/2&&(a=s+o/2),i<n+l/2)&&(i=n+l/2),t.children)for(var c of t.children)({minX:e,minY:r,maxX:a,maxY:i}=ae(c,{minX:e,minY:r,maxX:a,maxY:i}));return{minX:e,minY:r,maxX:a,maxY:i}}function ie(t){var e,r,a=t.getBlock("root");if(a)return({minX:t,minY:e,maxX:a,maxY:r}=(ee(a,t,0,0,e=N()?.block?.padding??8),re(a,t,e),I.debug("getBlocks",JSON.stringify(a,null,2)),ae(a))),{x:t,y:e,width:a-t,height:r-e}}D(ee,"setBlockSizes"),D(re,"layoutBlocks"),D(ae,"findBounds"),D(ie,"layout");var se=D(async(t,e,r,a=!1,i=!1)=>{let s=e||"";"object"==typeof s&&(s=s[0]);e=N();var n=$(e);return O(t,s,{style:r,isTitle:a,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},e)},"createLabel"),ne=se,oe=D((t,e,r,a,i)=>{e.arrowTypeStart&&ce(t,"start",e.arrowTypeStart,r,a,i),e.arrowTypeEnd&&ce(t,"end",e.arrowTypeEnd,r,a,i)},"addEdgeMarkers"),le={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},ce=D((t,e,r,a,i,s)=>{var n=le[r];n?t.attr("marker-"+e,`url(${a}#${i}_${s}-${n}${"start"===e?"Start":"End"})`):I.warn("Unknown arrow type: "+r)},"addEdgeMarker"),de={},he={},ge=D(async(t,e)=>{var r=N(),a=$(r),i=t.insert("g").attr("class","edgeLabel"),s=i.insert("g").attr("class","label"),n="markdown"===e.labelType;n=await O(t,e.label,{style:e.labelStyle,useHtmlLabels:a,addSvgBackground:n,isNode:!1,markdown:n,width:n?void 0:Number.POSITIVE_INFINITY},r);s.node().appendChild(n);let o,l=n.getBBox(),c=l;if(a?(r=n.children[0],d=R(n),l=r.getBoundingClientRect(),c=l,d.attr("width",l.width),d.attr("height",l.height)):(r=R(n).select("text").node())&&"function"==typeof r.getBBox&&(c=r.getBBox()),s.attr("transform",z(c,a)),de[e.id]=i,e.width=l.width,e.height=l.height,e.startLabelLeft){var d=t.insert("g").attr("class","edgeTerminals");r=d.insert("g").attr("class","inner");let n=(o=s=await ne(r,e.startLabelLeft,e.labelStyle)).getBBox();a&&(i=s.children[0],s=R(s),n=i.getBoundingClientRect(),s.attr("width",n.width),s.attr("height",n.height)),r.attr("transform",z(n,a)),he[e.id]||(he[e.id]={}),he[e.id].startLeft=d,ye(o,e.startLabelLeft)}if(e.startLabelRight){s=(i=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner");let n=(o=r=await ne(s,e.startLabelRight,e.labelStyle)).getBBox();a&&(d=r.children[0],r=R(r),n=d.getBoundingClientRect(),r.attr("width",n.width),r.attr("height",n.height)),s.attr("transform",z(n,a)),he[e.id]||(he[e.id]={}),he[e.id].startRight=i,ye(o,e.startLabelRight)}if(e.endLabelLeft){r=(d=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner");let n=(o=s=await ne(d,e.endLabelLeft,e.labelStyle)).getBBox();a&&(i=s.children[0],s=R(s),n=i.getBoundingClientRect(),s.attr("width",n.width),s.attr("height",n.height)),r.attr("transform",z(n,a)),he[e.id]||(he[e.id]={}),he[e.id].endLeft=d,ye(o,e.endLabelLeft)}if(e.endLabelRight){s=(i=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner");let n=(o=r=await ne(i,e.endLabelRight,e.labelStyle)).getBBox();a&&(d=r.children[0],t=R(r),n=d.getBoundingClientRect(),t.attr("width",n.width),t.attr("height",n.height)),s.attr("transform",z(n,a)),he[e.id]||(he[e.id]={}),he[e.id].endRight=i,ye(o,e.endLabelRight)}return n},"insertEdgeLabel");function ye(t,e){$(N())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}D(ye,"setTerminalWidth");var ue=D((t,e)=>{I.debug("Moving label abc88 ",t.id,t.label,de[t.id],e);var r=e.updatedPath||e.originalPath,a=N();a=A(a).subGraphTitleTotalMargin;if(t.label){var i=de[t.id];let n=t.x,o=t.y;r&&(s=M.calcLabelPosition(r),I.debug("Moving label "+t.label+" from (",n,",",o,") to (",s.x,",",s.y,") abc88"),e.updatedPath)&&(n=s.x,o=s.y),i.attr("transform",`translate(${n}, ${o+a/2})`)}if(t.startLabelLeft){e=he[t.id].startLeft;let a=t.x,i=t.y;r&&(a=(s=M.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r)).x,i=s.y),e.attr("transform",`translate(${a}, ${i})`)}if(t.startLabelRight){i=he[t.id].startRight;let e=t.x,s=t.y;r&&(e=(a=M.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r)).x,s=a.y),i.attr("transform",`translate(${e}, ${s})`)}if(t.endLabelLeft){var s=he[t.id].endLeft;let a=t.x,i=t.y;r&&(a=(e=M.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r)).x,i=e.y),s.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelRight){a=he[t.id].endRight;let e=t.x,s=t.y;r&&(e=(i=M.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r)).x,s=i.y),a.attr("transform",`translate(${e}, ${s})`)}},"positionEdgeLabel"),pe=D((t,e)=>{var r=t.x,a=t.y;r=Math.abs(e.x-r),e=Math.abs(e.y-a);return t.width/2<=r||t.height/2<=e},"outsideNode"),xe=D((t,e,r)=>{I.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:`+t.height);var a=t.x,i=t.y,s=Math.abs(a-r.x),n=t.width/2;let o=r.x<e.x?n-s:n+s;s=t.height/2,t=Math.abs(e.y-r.y);var l=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*n>Math.abs(a-e.x)*s)return o=l*(i=r.y<e.y?e.y-s-i:i-s-e.y)/t,s={x:r.x<e.x?r.x+o:r.x-l+o,y:r.y<e.y?r.y+t-i:r.y-t+i},0===o&&(s.x=e.x,s.y=e.y),0===l&&(s.x=e.x),0===t&&(s.y=e.y),I.debug(`abc89 topp/bott calc, Q ${t}, q ${i}, R ${l}, r `+o,s),s;{i=t*(o=r.x<e.x?e.x-n-a:a-n-e.x)/l;let s=r.x<e.x?r.x+l-o:r.x-l+o,c=r.y<e.y?r.y+i:r.y-i;return I.debug(`sides calc abc89, Q ${t}, q ${i}, R ${l}, r `+o,{_x:s,_y:c}),0===o&&(s=e.x,c=e.y),0===l&&(s=e.x),0===t&&(c=e.y),{x:s,y:c}}},"intersection"),be=D((t,e)=>{I.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],i=!1;return t.forEach(t=>{if(pe(e,t)||i)a=t,i||r.push(t);else{let s=xe(e,a,t),n=!1;r.forEach(t=>{n=n||t.x===s.x&&t.y===s.y}),r.some(t=>t.x===s.x&&t.y===s.y)||r.push(s),i=!0}}),r},"cutPathAtIntersect"),fe=D(function(t,e,r,a,i,s,n){let o=r.points,l=(I.debug("abc88 InsertEdge: edge=",r,"e=",e),!1);var c=s.node(e.v);s=s.node(e.w),s?.intersect&&c?.intersect&&((o=o.slice(1,r.points.length-1)).unshift(c.intersect(o[0])),o.push(s.intersect(o[o.length-1]))),r.toCluster&&(I.debug("to cluster abc88",a[r.toCluster]),o=be(r.points,a[r.toCluster].node),l=!0),r.fromCluster&&(I.debug("from cluster abc88",a[r.fromCluster]),o=be(o.reverse(),a[r.fromCluster].node).reverse(),l=!0),e=o.filter(t=>!Number.isNaN(t.y));let d=H;!r.curve||"graph"!==i&&"flowchart"!==i||(d=r.curve);var{x:c,y:s}=P(r);a=Y().x(c).y(s).curve(d);let h;switch(r.thickness){case"normal":h="edge-thickness-normal";break;case"thick":case"invisible":h="edge-thickness-thick";break;default:h=""}switch(r.pattern){case"solid":h+=" edge-pattern-solid";break;case"dotted":h+=" edge-pattern-dotted";break;case"dashed":h+=" edge-pattern-dashed"}c=t.append("path").attr("d",a(e)).attr("id",r.id).attr("class"," "+h+(r.classes?" "+r.classes:"")).attr("style",r.style);let g="";return(N().flowchart.arrowMarkerAbsolute||N().state.arrowMarkerAbsolute)&&(g=j(!0)),oe(c,r,g,n,i),s={},l&&(s.updatedPath=o),s.originalPath=r.points,s},"insertEdge"),me=D(t=>{var e,r=new Set;for(e of t)switch(e){case"x":r.add("right"),r.add("left");break;case"y":r.add("up"),r.add("down");break;default:r.add(e)}return r},"expandAndDeduplicateDirections"),we=D((t,e,r,a)=>{t=me(t);var i=e.height+2*r.padding,s=i/2;a=a??e.width+2*s+r.padding,e=r.padding/2;return t.has("right")&&t.has("left")&&t.has("up")&&t.has("down")?[{x:0,y:0},{x:s,y:0},{x:a/2,y:2*e},{x:a-s,y:0},{x:a,y:0},{x:a,y:-i/3},{x:a+2*e,y:-i/2},{x:a,y:-2*i/3},{x:a,y:-i},{x:a-s,y:-i},{x:a/2,y:-i-2*e},{x:s,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*e,y:-i/2},{x:0,y:-i/3}]:t.has("right")&&t.has("left")&&t.has("up")?[{x:s,y:0},{x:a-s,y:0},{x:a,y:-i/2},{x:a-s,y:-i},{x:s,y:-i},{x:0,y:-i/2}]:t.has("right")&&t.has("left")&&t.has("down")?[{x:0,y:0},{x:s,y:-i},{x:a-s,y:-i},{x:a,y:0}]:t.has("right")&&t.has("up")&&t.has("down")?[{x:0,y:0},{x:a,y:-s},{x:a,y:s-i},{x:0,y:-i}]:t.has("left")&&t.has("up")&&t.has("down")?[{x:a,y:0},{x:0,y:-s},{x:0,y:s-i},{x:a,y:-i}]:t.has("right")&&t.has("left")?[{x:s,y:0},{x:s,y:-e},{x:a-s,y:-e},{x:a-s,y:0},{x:a,y:-i/2},{x:a-s,y:-i},{x:a-s,y:e-i},{x:s,y:e-i},{x:s,y:-i},{x:0,y:-i/2}]:t.has("up")&&t.has("down")?[{x:a/2,y:0},{x:0,y:-e},{x:s,y:-e},{x:s,y:e-i},{x:0,y:e-i},{x:a/2,y:-i},{x:a,y:e-i},{x:a-s,y:e-i},{x:a-s,y:-e},{x:a,y:-e}]:t.has("right")&&t.has("up")?[{x:0,y:0},{x:a,y:-s},{x:0,y:-i}]:t.has("right")&&t.has("down")?[{x:0,y:0},{x:a,y:0},{x:0,y:-i}]:t.has("left")&&t.has("up")?[{x:a,y:0},{x:0,y:-s},{x:a,y:-i}]:t.has("left")&&t.has("down")?[{x:a,y:0},{x:0,y:0},{x:a,y:-i}]:t.has("right")?[{x:s,y:-e},{x:s,y:-e},{x:a-s,y:-e},{x:a-s,y:0},{x:a,y:-i/2},{x:a-s,y:-i},{x:a-s,y:e-i},{x:s,y:e-i},{x:s,y:e-i}]:t.has("left")?[{x:s,y:0},{x:s,y:-e},{x:a-s,y:-e},{x:a-s,y:e-i},{x:s,y:e-i},{x:s,y:-i},{x:0,y:-i/2}]:t.has("up")?[{x:s,y:-e},{x:s,y:e-i},{x:0,y:e-i},{x:a/2,y:-i},{x:a,y:e-i},{x:a-s,y:e-i},{x:a-s,y:-e}]:t.has("down")?[{x:a/2,y:0},{x:0,y:-e},{x:s,y:-e},{x:s,y:e-i},{x:a-s,y:e-i},{x:a-s,y:-e},{x:a,y:-e}]:[{x:0,y:0}]},"getArrowPoints");function ke(t,e){return t.intersect(e)}D(ke,"intersectNode");var Se=ke;function Le(t,e,r,a){var i=t.x,s=(t=t.y,i-a.x),n=t-a.y,o=Math.sqrt(e*e*n*n+r*r*s*s);s=Math.abs(e*r*s/o),a.x<i&&(s=-s),e=Math.abs(e*r*n/o);return{x:i+s,y:t+(e=a.y<t?-e:e)}}D(Le,"intersectEllipse");var _e=Le;function ve(t,e,r){return _e(t,e,e,r)}D(ve,"intersectCircle");var Ee=ve;function Te(t,e,r,a){var i,s=e.y-t.y,n=t.x-e.x,o=e.x*t.y-t.x*e.y,l=s*r.x+n*r.y+o,c=s*a.x+n*a.y+o;if(!(0!=l&&0!=c&&De(l,c)||(r=(l=a.y-r.y)*e.x+(c=r.x-a.x)*e.y+(e=a.x*r.y-r.x*a.y),0!=(a=l*t.x+c*t.y+e)&&0!=r&&De(a,r))||0==(i=s*c-l*n)))return t=Math.abs(i/2),{x:(a=n*e-c*o)<0?(a-t)/i:(a+t)/i,y:(a=l*o-s*e)<0?(a-t)/i:(a+t)/i}}function De(t,e){return 0<t*e}D(Te,"intersectLine"),D(De,"sameSign");var Ie=Te,Ne=$e;function $e(t,e,r){for(var a=t.x,i=t.y,s=[],n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,l=("function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),o=Math.min(o,t.y)}):(n=Math.min(n,e.x),o=Math.min(o,e.y)),a-t.width/2-n),c=i-t.height/2-o,d=0;d<e.length;d++){var h=e[d],g=e[d<e.length-1?d+1:0];(h=Ie(t,r,{x:l+h.x,y:c+h.y},{x:l+g.x,y:c+g.y}))&&s.push(h)}return s.length?(1<s.length&&s.sort(function(t,e){var a=t.x-r.x;t=t.y-r.y,a=Math.sqrt(a*a+t*t),t=e.x-r.x,e=e.y-r.y;return a<(t=Math.sqrt(t*t+e*e))?-1:a===t?0:1}),s[0]):t}D($e,"intersectPolygon");var Ce=D((t,e)=>{var r,a=t.x,i=t.y,s=e.x-a,n=(e=e.y-i,t.width/2);t=t.height/2,t=Math.abs(e)*n>Math.abs(s)*t?(e<0&&(t=-t),r=0==e?0:t*s/e,t):(r=n=s<0?-n:n,0==s?0:n*e/s);return{x:a+r,y:i+t}},"intersectRect"),Be={node:Se,circle:Ee,ellipse:_e,polygon:Ne,rect:Ce},Oe=D(async(t,e,r,a)=>{var i=N();let s;var n=e.useHtmlLabels||$(i);t=(r=(s=r||"node default",t.insert("g").attr("class",s).attr("id",e.domId||e.id))).insert("g").attr("class","label").attr("style",e.labelStyle);let o;o=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];let l,c=(l="markdown"===e.labelType?O(t,K(Z(o),i),{useHtmlLabels:n,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):await ne(t,K(Z(o),i),e.labelStyle,!1,a)).getBBox();var d;a=e.padding/2;return $(i)&&(i=l.children[0],d=R(l),await q(i,o),c=i.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)),n?t.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):t.attr("transform","translate(0, "+-c.height/2+")"),e.centerLabel&&t.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),t.insert("rect",":first-child"),{shapeSvg:r,bbox:c,halfPadding:a,label:t}},"labelHelper"),Re=D((t,e)=>{e=e.node().getBBox(),t.width=e.width,t.height=e.height},"updateNodeBounds");function ze(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}D(ze,"insertPolygonShape");var Ae=D(async(t,e)=>{e.useHtmlLabels||$(N())||(e.centerLabel=!0);var{shapeSvg:t,bbox:r,halfPadding:a}=await Oe(t,e,"node "+e.classes,!0),i=(I.info("Classes = ",e.classes),t.insert("rect",":first-child"));return i.attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-a).attr("y",-r.height/2-a).attr("width",r.width+e.padding).attr("height",r.height+e.padding),Re(e,i),e.intersect=function(t){return Be.rect(e,t)},t},"note"),Me=Ae,Pe=D(t=>t?" "+t:"","formatClass"),Ye=D((t,e)=>`${e||"node default"}${Pe(t.classes)} `+Pe(t.class),"getClassesFromNode"),je=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0);let a=[{x:(r=r.width+e.padding+(r.height+e.padding))/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];return I.info("Question main (Circle)"),(r=ze(t,r,r,a)).attr("style",e.style),Re(e,r),e.intersect=function(t){return I.warn("Intersect called"),Be.polygon(e,a,t)},t},"question"),Fe=D((t,e)=>((t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("polygon",":first-child").attr("points",[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}].map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return Be.circle(e,14,t)},t),"choice"),We=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=e.positioned?e.height:r.height+e.padding,i=a/4;let s=[{x:i,y:0},{x:(r=e.positioned?e.width:r.width+2*i+e.padding)-i,y:0},{x:r,y:-a/2},{x:r-i,y:-a},{x:i,y:-a},{x:0,y:-a/2}];return(i=ze(t,r,a,s)).attr("style",e.style),Re(e,i),e.intersect=function(t){return Be.polygon(e,s,t)},t},"hexagon"),Xe=D(async(t,e)=>{var{shapeSvg:t,bbox:r}=await Oe(t,e,void 0,!0),a=r.height+2*e.padding,i=r.width+a/2*2+e.padding;i=e.positioned&&1<(e.widthInColumns??1)&&e.width>i?e.width:i;let s=we(e.directions,r,e,i);return(r=ze(t,i,a,s)).attr("style",e.style),Re(e,r),e.intersect=function(t){return Be.polygon(e,s,t)},t},"block_arrow"),He=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.width+e.padding;let i=[{x:-(r=r.height+e.padding)/2,y:0},{x:a,y:0},{x:a,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return ze(t,a,r,i).attr("style",e.style),e.width=a+r,e.height=r,e.intersect=function(t){return Be.polygon(e,i,t)},t},"rect_left_inv_arrow"),Ue=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e),!0),a=r.width+e.padding;let i=[{x:-2*(r=r.height+e.padding)/6,y:0},{x:a-r/6,y:0},{x:a+2*r/6,y:-r},{x:r/6,y:-r}];return(a=ze(t,a,r,i)).attr("style",e.style),Re(e,a),e.intersect=function(t){return Be.polygon(e,i,t)},t},"lean_right"),Ke=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.width+e.padding;let i=[{x:2*(r=r.height+e.padding)/6,y:0},{x:a+r/6,y:0},{x:a-2*r/6,y:-r},{x:-r/6,y:-r}];return(a=ze(t,a,r,i)).attr("style",e.style),Re(e,a),e.intersect=function(t){return Be.polygon(e,i,t)},t},"lean_left"),Ze=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.width+e.padding;let i=[{x:-2*(r=r.height+e.padding)/6,y:0},{x:a+2*r/6,y:0},{x:a-r/6,y:-r},{x:r/6,y:-r}];return(a=ze(t,a,r,i)).attr("style",e.style),Re(e,a),e.intersect=function(t){return Be.polygon(e,i,t)},t},"trapezoid"),qe=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.width+e.padding;let i=[{x:(r=r.height+e.padding)/6,y:0},{x:a-r/6,y:0},{x:a+2*r/6,y:-r},{x:-2*r/6,y:-r}];return(a=ze(t,a,r,i)).attr("style",e.style),Re(e,a),e.intersect=function(t){return Be.polygon(e,i,t)},t},"inv_trapezoid"),Ve=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.width+e.padding;let i=[{x:0,y:0},{x:a+(r=r.height+e.padding)/2,y:0},{x:a,y:-r/2},{x:a+r/2,y:-r},{x:0,y:-r}];return(a=ze(t,a,r,i)).attr("style",e.style),Re(e,a),e.intersect=function(t){return Be.polygon(e,i,t)},t},"rect_right_inv_arrow"),Ge=D(async(t,e)=>{var{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.width+e.padding;let i=a/2,s=i/(2.5+a/50);var r=r.height+s+e.padding,n="M 0,"+s+" a "+i+","+s+" 0,0,0 "+a+" 0 a "+i+","+s+" 0,0,0 "+-a+" 0 l 0,"+r+" a "+i+","+s+" 0,0,0 "+a+" 0 l 0,"+-r;n=t.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",n).attr("transform","translate("+-a/2+","+-(r/2+s)+")");return Re(e,n),e.intersect=function(t){var r=Be.rect(e,t),a=r.x-e.x;if(0!=i&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-s)){let n=s*s*(1-a*a/(i*i));0!=n&&(n=Math.sqrt(n)),n=s-n,0<t.y-e.y&&(n=-n),r.y+=n}return r},t},"cylinder"),Je=D(async(t,e)=>{var{shapeSvg:t,bbox:r,halfPadding:a}=await Oe(t,e,"node "+e.classes+" "+e.class,!0),i=t.insert("rect",":first-child"),s=e.positioned?e.width:r.width+e.padding,n=e.positioned?e.height:r.height+e.padding,o=e.positioned?-s/2:-r.width/2-a,r=e.positioned?-n/2:-r.height/2-a;return i.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",o).attr("y",r).attr("width",s).attr("height",n),e.props&&(a=new Set(Object.keys(e.props)),e.props.borders&&(er(i,e.props.borders,s,n),a.delete("borders")),a.forEach(t=>{I.warn("Unknown node property "+t)})),Re(e,i),e.intersect=function(t){return Be.rect(e,t)},t},"rect"),Qe=D(async(t,e)=>{var{shapeSvg:t,bbox:r,halfPadding:a}=await Oe(t,e,"node "+e.classes,!0),i=t.insert("rect",":first-child"),s=e.positioned?e.width:r.width+e.padding,n=e.positioned?e.height:r.height+e.padding,o=e.positioned?-s/2:-r.width/2-a,r=e.positioned?-n/2:-r.height/2-a;return i.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",o).attr("y",r).attr("width",s).attr("height",n),e.props&&(a=new Set(Object.keys(e.props)),e.props.borders&&(er(i,e.props.borders,s,n),a.delete("borders")),a.forEach(t=>{I.warn("Unknown node property "+t)})),Re(e,i),e.intersect=function(t){return Be.rect(e,t)},t},"composite"),tr=D(async(t,e)=>{t=(await Oe(t,e,"label",!0)).shapeSvg;var r,a=(I.trace("Classes = ",e.class),t.insert("rect",":first-child"));return a.attr("width",0).attr("height",0),t.attr("class","label edgeLabel"),e.props&&(r=new Set(Object.keys(e.props)),e.props.borders&&(er(a,e.props.borders,0,0),r.delete("borders")),r.forEach(t=>{I.warn("Unknown node property "+t)})),Re(e,a),e.intersect=function(t){return Be.rect(e,t)},t},"labelRect");function er(t,e,r,a){let i=[];var s=D(t=>{i.push(t,0)},"addBorder"),n=D(t=>{i.push(0,t)},"skipBorder");(e.includes("t")?(I.debug("add top border"),s):n)(r),(e.includes("r")?(I.debug("add right border"),s):n)(a),(e.includes("b")?(I.debug("add bottom border"),s):n)(r),(e.includes("l")?(I.debug("add left border"),s):n)(a),t.attr("stroke-dasharray",i.join(" "))}D(er,"applyNodePropertyBorders");var rr=D(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";var a=(t=t.insert("g").attr("class",r).attr("id",e.domId||e.id)).insert("rect",":first-child"),i=t.insert("line"),s=t.insert("g").attr("class","label");let n="";n="object"==typeof(g=e.labelText.flat?e.labelText.flat():e.labelText)?g[0]:g,I.info("Label text abc79",n,g,"object"==typeof g);var o=await ne(s,n,e.labelStyle,!0,!0);let l={width:0,height:0};$(N())&&(d=o.children[0],h=R(o),l=d.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)),I.info("Text 2",g);var c,d=g.slice(1,g.length),h=o.getBBox(),g=await ne(s,d.join?d.join("<br/>"):d,e.labelStyle,!0,!0);$(N())&&(d=g.children[0],c=R(g),l=d.getBoundingClientRect(),c.attr("width",l.width),c.attr("height",l.height)),d=e.padding/2;return R(g).attr("transform","translate( "+(l.width>h.width?0:(h.width-l.width)/2)+", "+(h.height+d+5)+")"),R(o).attr("transform","translate( "+(l.width<h.width?0:-(h.width-l.width)/2)+", 0)"),l=s.node().getBBox(),s.attr("transform","translate("+-l.width/2+", "+(-l.height/2-d+3)+")"),a.attr("class","outer title-state").attr("x",-l.width/2-d).attr("y",-l.height/2-d).attr("width",l.width+e.padding).attr("height",l.height+e.padding),i.attr("class","divider").attr("x1",-l.width/2-d).attr("x2",l.width/2+d).attr("y1",-l.height/2-d+h.height+d).attr("y2",-l.height/2-d+h.height+d),Re(e,a),e.intersect=function(t){return Be.rect(e,t)},t},"rectWithTitle"),ar=D(async(t,e)=>{var{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.height+e.padding,r=(r=r.width+a/4+e.padding,t.insert("rect",":first-child").attr("style",e.style).attr("rx",a/2).attr("ry",a/2).attr("x",-r/2).attr("y",-a/2).attr("width",r).attr("height",a));return Re(e,r),e.intersect=function(t){return Be.rect(e,t)},t},"stadium"),ir=D(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await Oe(t,e,Ye(e,void 0),!0);return(t=r.insert("circle",":first-child")).attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("Circle main"),Re(e,t),e.intersect=function(t){return I.info("Circle intersect",e,a.width/2+i,t),Be.circle(e,a.width/2+i,t)},r},"circle"),sr=D(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await Oe(t,e,Ye(e,void 0),!0);var s=(t=r.insert("g",":first-child")).insert("circle"),n=t.insert("circle");return t.attr("class",e.class),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("DoubleCircle main"),Re(e,s),e.intersect=function(t){return I.info("DoubleCircle intersect",e,a.width/2+i+5,t),Be.circle(e,a.width/2+i+5,t)},r},"doublecircle"),nr=D(async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Oe(t,e,Ye(e,void 0),!0),a=r.width+e.padding;let i=[{x:0,y:0},{x:a,y:0},{x:a,y:-(r=r.height+e.padding)},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-r},{x:-8,y:-r},{x:-8,y:0}];return(a=ze(t,a,r,i)).attr("style",e.style),Re(e,a),e.intersect=function(t){return Be.polygon(e,i,t)},t},"subroutine"),or=D((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Re(e,r),e.intersect=function(t){return Be.circle(e,7,t)},t},"start"),lr=D((t,e,r)=>{let a=70,i=10;return"LR"===r&&(a=10,i=70),r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).append("rect").attr("x",-1*a/2).attr("y",-1*i/2).attr("width",a).attr("height",i).attr("class","fork-join"),Re(e,r),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return Be.rect(e,t)},t},"forkJoin"),cr=D((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child"),a=t.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Re(e,a),e.intersect=function(t){return Be.circle(e,7,t)},t},"end"),dr=D(async(t,e)=>{var r=e.padding/2;let a;a=e.classes?"node "+e.classes:"node default";var i=(t=t.insert("g").attr("class",a).attr("id",e.domId||e.id)).insert("rect",":first-child"),s=t.insert("line"),n=t.insert("line");let o=0,l=4,c=t.insert("g").attr("class","label"),d=0;var h=e.classData.annotations?.[0],g=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"";let y=(g=await ne(c,g,e.labelStyle,!0,!0)).getBBox(),u=($(N())&&(x=g.children[0],p=R(g),y=x.getBoundingClientRect(),p.attr("width",y.width),p.attr("height",y.height)),e.classData.annotations[0]&&(l+=y.height+4,o+=y.width),e.classData.label);void 0!==e.classData.type&&""!==e.classData.type&&($(N())?u+="&lt;"+e.classData.type+"&gt;":u+="<"+e.classData.type+">");var p,x=await ne(c,u,e.labelStyle,!0,!0);R(x).attr("class","classTitle");let b=x.getBBox(),f=($(N())&&(p=x.children[0],w=R(x),b=p.getBoundingClientRect(),w.attr("width",b.width),w.attr("height",b.height)),l+=b.height+4,b.width>o&&(o=b.width),[]),m=(e.classData.members.forEach(async t=>{let r=(t=t.getDisplayDetails()).displayText;var a,i;$(N())&&(r=r.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let s=(t=await ne(c,r,t.cssStyle||e.labelStyle,!0,!0)).getBBox();$(N())&&(a=t.children[0],i=R(t),s=a.getBoundingClientRect(),i.attr("width",s.width),i.attr("height",s.height)),s.width>o&&(o=s.width),l+=s.height+4,f.push(t)}),l+=8,[]);e.classData.methods.forEach(async t=>{let r=(t=t.getDisplayDetails()).displayText;var a,i;$(N())&&(r=r.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let s=(t=await ne(c,r,t.cssStyle||e.labelStyle,!0,!0)).getBBox();$(N())&&(a=t.children[0],i=R(t),s=a.getBoundingClientRect(),i.attr("width",s.width),i.attr("height",s.height)),s.width>o&&(o=s.width),l+=s.height+4,m.push(t)}),l+=8,h&&(p=(o-y.width)/2,R(g).attr("transform","translate( "+(-1*o/2+p)+", "+-1*l/2+")"),d=y.height+4);var w=(o-b.width)/2;return R(x).attr("transform","translate( "+(-1*o/2+w)+", "+(-1*l/2+d)+")"),d+=b.height+4,s.attr("class","divider").attr("x1",-o/2-r).attr("x2",o/2+r).attr("y1",-l/2-r+8+d).attr("y2",-l/2-r+8+d),d+=8,f.forEach(t=>{R(t).attr("transform","translate( "+-o/2+", "+(-1*l/2+d+4)+")"),t=t?.getBBox(),d+=(t?.height??0)+4}),d+=8,n.attr("class","divider").attr("x1",-o/2-r).attr("x2",o/2+r).attr("y1",-l/2-r+8+d).attr("y2",-l/2-r+8+d),d+=8,m.forEach(t=>{R(t).attr("transform","translate( "+-o/2+", "+(-1*l/2+d)+")"),t=t?.getBBox(),d+=(t?.height??0)+4}),i.attr("style",e.style).attr("class","outer title-state").attr("x",-o/2-r).attr("y",-l/2-r).attr("width",o+e.padding).attr("height",l+e.padding),Re(e,i),e.intersect=function(t){return Be.rect(e,t)},t},"class_box"),hr={rhombus:je,composite:Qe,question:je,rect:Je,labelRect:tr,rectWithTitle:rr,choice:Fe,circle:ir,doublecircle:sr,stadium:ar,hexagon:We,block_arrow:Xe,rect_left_inv_arrow:He,lean_right:Ue,lean_left:Ke,trapezoid:Ze,inv_trapezoid:qe,rect_right_inv_arrow:Ve,cylinder:Ge,start:or,end:cr,note:Me,subroutine:nr,fork:lr,join:lr,class_box:dr},gr={},yr=D(async(t,e,r)=>{let a,i;if(e.link){let s;"sandbox"===N().securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),i=await hr[e.shape](a,e,r)}else i=await hr[e.shape](t,e,r),a=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),gr[e.id]=a,e.haveCallback&&gr[e.id].attr("class",gr[e.id].attr("class")+" clickable"),a},"insertNode"),ur=D(t=>{var e=gr[t.id],r=(I.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")"),t.diff||0);return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function pr(t,e,r=!1){let a,i="default",s=(0<(t?.classes?.length||0)&&(i=(t?.classes??[]).join(" ")),i+=" flowchart-label",0),n="";switch(t.type){case"round":s=5,n="rect";break;case"composite":s=0,n="composite",a=0;break;case"square":case"group":default:n="rect";break;case"diamond":n="question";break;case"hexagon":n="hexagon";break;case"block_arrow":n="block_arrow";break;case"odd":case"rect_left_inv_arrow":n="rect_left_inv_arrow";break;case"lean_right":n="lean_right";break;case"lean_left":n="lean_left";break;case"trapezoid":n="trapezoid";break;case"inv_trapezoid":n="inv_trapezoid";break;case"circle":n="circle";break;case"ellipse":n="ellipse";break;case"stadium":n="stadium";break;case"subroutine":n="subroutine";break;case"cylinder":n="cylinder";break;case"doublecircle":n="doublecircle"}var o=C(t?.styles??[]),l=t.label,c=t.size??{width:0,height:0,x:0,y:0};e=e.getDiagramId();return{labelStyle:o.labelStyle,shape:n,labelText:l,rx:s,ry:s,class:i,style:o.style,id:t.id,domId:e?e+"-"+t.id:t.id,directions:t.directions,width:c.width,height:c.height,x:c.x,y:c.y,positioned:r,intersect:void 0,type:t.type,padding:a??B()?.block?.padding??0,widthInColumns:t.widthInColumns??1}}async function xr(t,e,r){var a;"group"!==(e=pr(e,r,!1)).type&&(a=B(),a=(t=await yr(t,e,{config:a})).node().getBBox(),(e=r.getBlock(e.id)).size={width:a.width,height:a.height,x:0,y:0,node:t},r.setBlock(e),t.remove())}async function br(t,e,r){var a=pr(e,r,!0);"space"!==r.getBlock(a.id).type&&(r=B(),await yr(t,a,{config:r}),e.intersect=a?.intersect,ur(a))}async function fr(t,e,r,a){for(var i of e)await a(t,i,r),i.children&&await fr(t,i.children,r,a)}async function mr(t,e,r){await fr(t,e,r,xr)}async function wr(t,e,r){await fr(t,e,r,br)}async function kr(t,e,r,a,i){var s,n,o,l,c,d=new V({multigraph:!0,compound:!0});for(s of(d.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8}),r))s.size&&d.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(n of e)n.start&&n.end&&(o=a.getBlock(n.start),l=a.getBlock(n.end),o?.size)&&l?.size&&(o=o.size,l=l.size,o=[{x:o.x,y:o.y},{x:o.x+(l.x-o.x)/2,y:o.y+(l.y-o.y)/2},{x:l.x,y:l.y}],l=i?i+"-"+n.id:n.id,c=("thick"===n.thickness?"edge-thickness-thick":"edge-thickness-normal")+` ${"dotted"===n.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`,fe(t,{v:n.start,w:n.end,name:l},{...n,id:l,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:o,classes:c},void 0,"block",d,i),n.label)&&(await ge(t,{...n,label:n.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:o,classes:c}),ue({...n,x:o[1].x,y:o[1].y},{originalPath:o}))}D(pr,"getNodeFromBlock"),D(xr,"calculateBlockSize"),D(br,"insertBlockPositioned"),D(fr,"performOperations"),D(mr,"calculateBlockSizes"),D(wr,"insertBlocks"),D(kr,"insertEdges");var Sr=D(function(t,e){return e.db.getClasses()},"getClasses"),Lr=D(async function(t,e,r,a){var{securityLevel:i,block:s}=B(),n=a.db;let o;n.setDiagramId(e),"sandbox"===i&&(o=R("#i"+e));var l=R("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),i="sandbox"===i?l.select(`[id="${e}"]`):R(`[id="${e}"]`),c=(l=(Jt(i,["point","circle","cross"],a.type,e),n.getBlocks()),a=n.getBlocksFlat(),n.getEdges()),d=i.insert("g").attr("class","block"),h=(await mr(d,l,n),ie(n));await wr(d,l,n),await kr(d,c,a,n,e),h&&(l=h,d=Math.max(1,Math.round(l.width/l.height*.125)),c=l.height+d+10,a=l.width+10,n=s.useMaxWidth,F(i,c,a,!!n),I.debug("Here Bounds",h,l),i.attr("viewBox",`${l.x-5} ${l.y-5} ${l.width+10} `+(l.height+10)))},"draw"),_r={parser:rt,db:At,renderer:{draw:Lr,getClasses:Sr},styles:Yt};export{_r as diagram};