@dwelle/excalidraw 0.5.0-bb58eff → 0.5.0-bcfbd91

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 (235) hide show
  1. package/dist/browser/dev/excalidraw-assets-dev/{c4Diagram-9cddb37f-5K5MMBTZ.js → c4Diagram-9cddb37f-Z2BVR4KG.js} +4 -4
  2. package/dist/browser/dev/excalidraw-assets-dev/{chunk-YLFK45LY.js → chunk-2R746FJ3.js} +21 -21
  3. package/dist/browser/dev/excalidraw-assets-dev/{chunk-HPE2QM6Z.js → chunk-4YGSGIMJ.js} +3 -3
  4. package/dist/browser/dev/excalidraw-assets-dev/{chunk-FG5PX37Z.js → chunk-7ZK24NYG.js} +398 -930
  5. package/dist/browser/dev/excalidraw-assets-dev/chunk-7ZK24NYG.js.map +7 -0
  6. package/dist/browser/dev/excalidraw-assets-dev/{chunk-VJWYXZRD.js → chunk-A4L3DQO2.js} +3 -3
  7. package/dist/browser/dev/excalidraw-assets-dev/{chunk-LARCHXKL.js → chunk-CWUUGB6C.js} +3 -3
  8. package/dist/browser/dev/excalidraw-assets-dev/{chunk-PTRCE3YZ.js → chunk-DLCKQH3C.js} +4 -4
  9. package/dist/browser/dev/excalidraw-assets-dev/{chunk-ABU3Y4P6.js → chunk-IVZGHBP3.js} +5 -5
  10. package/dist/browser/dev/excalidraw-assets-dev/{chunk-VVJS3CBB.js → chunk-J3RT3AEL.js} +3 -3
  11. package/dist/browser/dev/excalidraw-assets-dev/{chunk-AQ5OI7FF.js → chunk-KN673SBB.js} +3 -3
  12. package/dist/browser/dev/excalidraw-assets-dev/{chunk-OBKV4VWD.js → chunk-OGN4DE2Q.js} +2 -2
  13. package/dist/browser/dev/excalidraw-assets-dev/{chunk-JRHEG4KR.js → chunk-P3NJMBHG.js} +3 -3
  14. package/dist/browser/dev/excalidraw-assets-dev/{chunk-UN4RKPVH.js → chunk-QP4L67PY.js} +3 -3
  15. package/dist/browser/dev/excalidraw-assets-dev/{chunk-AU5UG6FO.js → chunk-U7QYLFAH.js} +6 -6
  16. package/dist/browser/dev/excalidraw-assets-dev/{chunk-FSI24XHB.js → chunk-ULL4JVA4.js} +7 -7
  17. package/dist/browser/dev/excalidraw-assets-dev/{chunk-2WPXONHI.js → chunk-WFIY45QO.js} +2 -5
  18. package/dist/browser/dev/excalidraw-assets-dev/{chunk-2WPXONHI.js.map → chunk-WFIY45QO.js.map} +2 -2
  19. package/dist/browser/dev/excalidraw-assets-dev/{chunk-RMILGNZX.js → chunk-WWRYLVJC.js} +4 -4
  20. package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-bc733c3b-NWRL2CDH.js → classDiagram-bc733c3b-K5SPPM5G.js} +7 -7
  21. package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-v2-8931bdaf-Y5FPX4CT.js → classDiagram-v2-8931bdaf-LMQ4MBCJ.js} +10 -10
  22. package/dist/browser/dev/excalidraw-assets-dev/{directory-open-01563666-VWSBJ543.js → directory-open-01563666-HET5VGVW.js} +2 -2
  23. package/dist/browser/dev/excalidraw-assets-dev/{directory-open-4ed118d0-FYNYOZXP.js → directory-open-4ed118d0-EEZTUAOR.js} +2 -2
  24. package/dist/browser/dev/excalidraw-assets-dev/dist-MMLCHBGE.js +10 -0
  25. package/dist/browser/dev/excalidraw-assets-dev/{en-OFPNSLTO.js → en-CJBKYSM5.js} +2 -2
  26. package/dist/browser/dev/excalidraw-assets-dev/{erDiagram-f6946109-URHWBVQF.js → erDiagram-f6946109-T5ZYWW62.js} +5 -5
  27. package/dist/browser/dev/excalidraw-assets-dev/{file-open-002ab408-K7UWK3UX.js → file-open-002ab408-2OQEKDVS.js} +2 -2
  28. package/dist/browser/dev/excalidraw-assets-dev/{file-open-7c801643-PUS6AQBV.js → file-open-7c801643-7IDWBVQC.js} +2 -2
  29. package/dist/browser/dev/excalidraw-assets-dev/{file-save-3189631c-AVBJT4K7.js → file-save-3189631c-D66DZOSK.js} +2 -2
  30. package/dist/browser/dev/excalidraw-assets-dev/{file-save-745eba88-FCWOWXVA.js → file-save-745eba88-3NARDH2Z.js} +2 -2
  31. package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-93327f21-ARY24FIN.js → flowDiagram-93327f21-OFTBRZYD.js} +11 -11
  32. package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-v2-476db779-Y3LYCDLM.js → flowDiagram-v2-476db779-VVUICW5U.js} +11 -11
  33. package/dist/browser/dev/excalidraw-assets-dev/{flowchart-elk-definition-5082a990-DTGYPOS7.js → flowchart-elk-definition-5082a990-KDDK5LFE.js} +8 -8
  34. package/dist/browser/dev/excalidraw-assets-dev/{ganttDiagram-7ce12d6b-GWKDCJYX.js → ganttDiagram-7ce12d6b-XW6BLNYB.js} +3 -3
  35. package/dist/browser/dev/excalidraw-assets-dev/{gitGraphDiagram-1e960c50-A4SIEE63.js → gitGraphDiagram-1e960c50-WAVVX7YE.js} +3 -3
  36. package/dist/browser/dev/excalidraw-assets-dev/{image-ZQHNSB7P.css → image-BMBZMPAN.css} +20 -99
  37. package/dist/browser/dev/excalidraw-assets-dev/image-BMBZMPAN.css.map +7 -0
  38. package/dist/browser/dev/excalidraw-assets-dev/{image-J27XZPQC.js → image-DG6G3CCZ.js} +6 -6
  39. package/dist/browser/dev/excalidraw-assets-dev/{image-blob-reduce.esm-BDWVJKFQ.js → image-blob-reduce.esm-OJYOZNL4.js} +2 -2
  40. package/dist/browser/dev/excalidraw-assets-dev/{infoDiagram-264bed3e-AUF35UHX.js → infoDiagram-264bed3e-SMYVWNAJ.js} +3 -3
  41. package/dist/browser/dev/excalidraw-assets-dev/{journeyDiagram-31be0096-ADAT3O42.js → journeyDiagram-31be0096-IXIWAKJV.js} +4 -4
  42. package/dist/browser/dev/excalidraw-assets-dev/{mindmap-definition-4fc2557c-YC2LM75P.js → mindmap-definition-4fc2557c-H5WTPEBY.js} +4 -4
  43. package/dist/browser/dev/excalidraw-assets-dev/{pica-GXUQBC7B.js → pica-RRHXYZO2.js} +2 -2
  44. package/dist/browser/dev/excalidraw-assets-dev/{pieDiagram-157505fe-4XR6DLIZ.js → pieDiagram-157505fe-3LXENDEP.js} +3 -3
  45. package/dist/browser/dev/excalidraw-assets-dev/{quadrantDiagram-fd70f2d0-LIR55Z6M.js → quadrantDiagram-fd70f2d0-CBA7LD4X.js} +3 -3
  46. package/dist/browser/dev/excalidraw-assets-dev/{requirementDiagram-19c99588-NKRCRRBM.js → requirementDiagram-19c99588-53JLZTYM.js} +5 -5
  47. package/dist/browser/dev/excalidraw-assets-dev/{roundRect-ZNZYUVWJ.js → roundRect-5HI6M3OA.js} +2 -2
  48. package/dist/browser/dev/excalidraw-assets-dev/{sequenceDiagram-5dfd0049-VUKNRO5G.js → sequenceDiagram-5dfd0049-XJRLBGS7.js} +4 -4
  49. package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-133e3642-3NYPG4IW.js → stateDiagram-133e3642-ZVPN2MPZ.js} +6 -6
  50. package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-v2-6371a76b-YINZI7AG.js → stateDiagram-v2-6371a76b-QIW3VCSC.js} +10 -10
  51. package/dist/browser/dev/excalidraw-assets-dev/{timeline-definition-5ed366f4-KWC42LPI.js → timeline-definition-5ed366f4-LGCWVNZT.js} +3 -3
  52. package/dist/browser/dev/index.css +19 -98
  53. package/dist/browser/dev/index.css.map +2 -2
  54. package/dist/browser/dev/index.js +5 -5
  55. package/dist/browser/prod/excalidraw-assets/{c4Diagram-9cddb37f-UIUBGLLC.js → c4Diagram-9cddb37f-CSAXQUMT.js} +1 -1
  56. package/dist/browser/prod/excalidraw-assets/{chunk-I32TF3FD.js → chunk-56HIV6N6.js} +1 -1
  57. package/dist/browser/prod/excalidraw-assets/{chunk-X3V4W6Y3.js → chunk-5PG4MN6E.js} +1 -1
  58. package/dist/browser/prod/excalidraw-assets/{chunk-XXT5RS66.js → chunk-5PXNTGLF.js} +1 -1
  59. package/dist/browser/prod/excalidraw-assets/{chunk-EQDCUI7P.js → chunk-6LDES2GZ.js} +1 -1
  60. package/dist/browser/prod/excalidraw-assets/{chunk-4C6GEPVI.js → chunk-BWJEY7EX.js} +1 -1
  61. package/dist/browser/prod/excalidraw-assets/{chunk-LOWTGNCV.js → chunk-CP5W5ACF.js} +1 -1
  62. package/dist/browser/prod/excalidraw-assets/chunk-DBUEOZT5.js +269 -0
  63. package/dist/browser/prod/excalidraw-assets/{chunk-MJ2YKZ3B.js → chunk-DF24HG3F.js} +1 -1
  64. package/dist/browser/prod/excalidraw-assets/{chunk-FVDUD6XA.js → chunk-DVVGVVYL.js} +1 -1
  65. package/dist/browser/prod/excalidraw-assets/{chunk-7CLKPETF.js → chunk-GTO2REC5.js} +1 -1
  66. package/dist/browser/prod/excalidraw-assets/{chunk-YGSQT3TE.js → chunk-KQZZ435A.js} +2 -2
  67. package/dist/browser/prod/excalidraw-assets/{chunk-RVQN2TTU.js → chunk-ONH2E3HD.js} +3 -3
  68. package/dist/browser/prod/excalidraw-assets/{chunk-FGOIQKRL.js → chunk-QK2I4STK.js} +1 -1
  69. package/dist/browser/prod/excalidraw-assets/{chunk-VZ5ZGWAN.js → chunk-TGFMJVS6.js} +1 -1
  70. package/dist/browser/prod/excalidraw-assets/{chunk-5EY4KGYU.js → chunk-V6GEKVIM.js} +1 -1
  71. package/dist/browser/prod/excalidraw-assets/{chunk-VI6ARPX6.js → chunk-W7OUYNQP.js} +1 -1
  72. package/dist/browser/prod/excalidraw-assets/{classDiagram-bc733c3b-6BX33ZTH.js → classDiagram-bc733c3b-FZUH7HPQ.js} +1 -1
  73. package/dist/browser/prod/excalidraw-assets/{classDiagram-v2-8931bdaf-ACBVEHQO.js → classDiagram-v2-8931bdaf-LRVGH5BD.js} +1 -1
  74. package/dist/browser/prod/excalidraw-assets/{directory-open-01563666-C2PFQBKL.js → directory-open-01563666-WBDEPWFN.js} +1 -1
  75. package/dist/browser/prod/excalidraw-assets/{directory-open-4ed118d0-E55HNHTS.js → directory-open-4ed118d0-SHTOCZXQ.js} +1 -1
  76. package/dist/browser/prod/excalidraw-assets/dist-JMLVFQ4W.js +1 -0
  77. package/dist/browser/prod/excalidraw-assets/{en-46OXMRU6.js → en-6EOGX47W.js} +1 -1
  78. package/dist/browser/prod/excalidraw-assets/{erDiagram-f6946109-TYWREFGK.js → erDiagram-f6946109-IIBR3HHT.js} +1 -1
  79. package/dist/browser/prod/excalidraw-assets/{file-open-002ab408-FQU3HANB.js → file-open-002ab408-7YMAGCE3.js} +1 -1
  80. package/dist/browser/prod/excalidraw-assets/{file-open-7c801643-BCD55L36.js → file-open-7c801643-2UIR6WEW.js} +1 -1
  81. package/dist/browser/prod/excalidraw-assets/{file-save-3189631c-TAXV2OAM.js → file-save-3189631c-UAJTEO5I.js} +1 -1
  82. package/dist/browser/prod/excalidraw-assets/{file-save-745eba88-DPWZ3VE6.js → file-save-745eba88-TOUSYUTX.js} +1 -1
  83. package/dist/browser/prod/excalidraw-assets/{flowDiagram-93327f21-4VGGLTSV.js → flowDiagram-93327f21-XIY3FFTU.js} +1 -1
  84. package/dist/browser/prod/excalidraw-assets/flowDiagram-v2-476db779-EQMWJJEV.js +1 -0
  85. package/dist/browser/prod/excalidraw-assets/{flowchart-elk-definition-5082a990-DWI3JPDY.js → flowchart-elk-definition-5082a990-LJBHN7JH.js} +1 -1
  86. package/dist/browser/prod/excalidraw-assets/{ganttDiagram-7ce12d6b-FGLMWLXT.js → ganttDiagram-7ce12d6b-CBM3PKRU.js} +1 -1
  87. package/dist/browser/prod/excalidraw-assets/{gitGraphDiagram-1e960c50-6PYRBTDK.js → gitGraphDiagram-1e960c50-TZDQTV4Y.js} +1 -1
  88. package/dist/browser/prod/excalidraw-assets/image-NFLQBKBU.js +1 -0
  89. package/dist/browser/prod/excalidraw-assets/image-TGGHFJHC.css +1 -0
  90. package/dist/browser/prod/excalidraw-assets/{image-blob-reduce.esm-7C326NDW.js → image-blob-reduce.esm-NOK55Z4R.js} +1 -1
  91. package/dist/browser/prod/excalidraw-assets/{infoDiagram-264bed3e-B3RQYU4J.js → infoDiagram-264bed3e-VTVTW2PT.js} +1 -1
  92. package/dist/browser/prod/excalidraw-assets/{journeyDiagram-31be0096-SPHJ2Z6S.js → journeyDiagram-31be0096-3RXCXFNL.js} +1 -1
  93. package/dist/browser/prod/excalidraw-assets/{mindmap-definition-4fc2557c-EKE5IPT5.js → mindmap-definition-4fc2557c-U2MTITUZ.js} +1 -1
  94. package/dist/browser/prod/excalidraw-assets/{pica-WBNTBMON.js → pica-FN4U5BBA.js} +1 -1
  95. package/dist/browser/prod/excalidraw-assets/{pieDiagram-157505fe-R3GPKUOS.js → pieDiagram-157505fe-UPOKDCDE.js} +1 -1
  96. package/dist/browser/prod/excalidraw-assets/{quadrantDiagram-fd70f2d0-E6DDN2FC.js → quadrantDiagram-fd70f2d0-G6SC76BN.js} +1 -1
  97. package/dist/browser/prod/excalidraw-assets/{requirementDiagram-19c99588-EDK37RW4.js → requirementDiagram-19c99588-OPA5Q2CG.js} +1 -1
  98. package/dist/browser/prod/excalidraw-assets/{roundRect-P4IDSYXR.js → roundRect-YDYZGRTK.js} +1 -1
  99. package/dist/browser/prod/excalidraw-assets/{sequenceDiagram-5dfd0049-SDPAZI6N.js → sequenceDiagram-5dfd0049-RLLGIVI3.js} +1 -1
  100. package/dist/browser/prod/excalidraw-assets/{stateDiagram-133e3642-2GOIU2WH.js → stateDiagram-133e3642-POU4VV6D.js} +1 -1
  101. package/dist/browser/prod/excalidraw-assets/{stateDiagram-v2-6371a76b-HIFSCSY4.js → stateDiagram-v2-6371a76b-TI5DGF27.js} +1 -1
  102. package/dist/browser/prod/excalidraw-assets/{timeline-definition-5ed366f4-KTXR6TKT.js → timeline-definition-5ed366f4-RRRA7YP4.js} +1 -1
  103. package/dist/browser/prod/index.css +1 -1
  104. package/dist/browser/prod/index.js +1 -1
  105. package/dist/{prod/en-54AU74IP.json → dev/en-JBWHKG2R.json} +1 -4
  106. package/dist/dev/index.css +19 -98
  107. package/dist/dev/index.css.map +2 -2
  108. package/dist/dev/index.js +524 -863
  109. package/dist/dev/index.js.map +4 -4
  110. package/dist/excalidraw/actions/actionAddToLibrary.d.ts +0 -9
  111. package/dist/excalidraw/actions/actionBoundText.d.ts +0 -6
  112. package/dist/excalidraw/actions/actionBoundText.js +1 -4
  113. package/dist/excalidraw/actions/actionCanvas.d.ts +0 -36
  114. package/dist/excalidraw/actions/actionClipboard.d.ts +0 -21
  115. package/dist/excalidraw/actions/actionDeleteSelected.d.ts +0 -9
  116. package/dist/excalidraw/actions/actionDuplicateSelection.js +0 -4
  117. package/dist/excalidraw/actions/actionElementLock.d.ts +0 -6
  118. package/dist/excalidraw/actions/actionExport.d.ts +1 -28
  119. package/dist/excalidraw/actions/actionFinalize.d.ts +0 -6
  120. package/dist/excalidraw/actions/actionFrame.d.ts +0 -9
  121. package/dist/excalidraw/actions/actionGroup.d.ts +0 -6
  122. package/dist/excalidraw/actions/actionGroup.js +2 -4
  123. package/dist/excalidraw/actions/actionHistory.js +0 -3
  124. package/dist/excalidraw/actions/actionLinearEditor.d.ts +0 -3
  125. package/dist/excalidraw/actions/actionLink.d.ts +0 -3
  126. package/dist/excalidraw/actions/actionMenu.d.ts +0 -9
  127. package/dist/excalidraw/actions/actionNavigate.d.ts +0 -6
  128. package/dist/excalidraw/actions/actionNavigate.js +6 -15
  129. package/dist/excalidraw/actions/actionProperties.d.ts +0 -39
  130. package/dist/excalidraw/actions/actionSelectAll.d.ts +0 -3
  131. package/dist/excalidraw/actions/actionStyles.d.ts +0 -3
  132. package/dist/excalidraw/actions/actionToggleGridMode.d.ts +0 -3
  133. package/dist/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -3
  134. package/dist/excalidraw/actions/actionToggleStats.d.ts +0 -3
  135. package/dist/excalidraw/actions/actionToggleViewMode.d.ts +0 -3
  136. package/dist/excalidraw/actions/actionToggleZenMode.d.ts +0 -3
  137. package/dist/excalidraw/actions/actionZindex.d.ts +11 -11
  138. package/dist/excalidraw/clients.d.ts +1 -10
  139. package/dist/excalidraw/clients.js +6 -153
  140. package/dist/excalidraw/components/App.d.ts +3 -3
  141. package/dist/excalidraw/components/App.js +38 -20
  142. package/dist/excalidraw/components/Avatar.d.ts +3 -2
  143. package/dist/excalidraw/components/Avatar.js +5 -2
  144. package/dist/excalidraw/components/UserList.d.ts +7 -3
  145. package/dist/excalidraw/components/UserList.js +34 -63
  146. package/dist/excalidraw/components/canvases/InteractiveCanvas.js +22 -19
  147. package/dist/excalidraw/components/icons.d.ts +0 -2
  148. package/dist/excalidraw/components/icons.js +1 -3
  149. package/dist/excalidraw/constants.d.ts +3 -2
  150. package/dist/excalidraw/constants.js +3 -3
  151. package/dist/excalidraw/data/restore.d.ts +3 -3
  152. package/dist/excalidraw/data/restore.js +6 -5
  153. package/dist/excalidraw/data/transform.d.ts +1 -1
  154. package/dist/excalidraw/data/transform.js +3 -4
  155. package/dist/excalidraw/element/embeddable.d.ts +0 -3
  156. package/dist/excalidraw/element/linearElementEditor.d.ts +1 -5
  157. package/dist/excalidraw/element/newElement.d.ts +1 -1
  158. package/dist/excalidraw/element/newElement.js +1 -2
  159. package/dist/excalidraw/element/types.d.ts +2 -14
  160. package/dist/excalidraw/errors.d.ts +0 -3
  161. package/dist/excalidraw/errors.js +0 -3
  162. package/dist/excalidraw/frame.d.ts +1 -1
  163. package/dist/excalidraw/laser-trails.js +1 -1
  164. package/dist/excalidraw/locales/en.json +1 -4
  165. package/dist/excalidraw/renderer/interactiveScene.js +119 -13
  166. package/dist/excalidraw/renderer/staticScene.js +4 -5
  167. package/dist/excalidraw/scene/Scene.d.ts +6 -7
  168. package/dist/excalidraw/scene/Scene.js +13 -28
  169. package/dist/excalidraw/scene/export.js +1 -2
  170. package/dist/excalidraw/scene/types.d.ts +21 -10
  171. package/dist/excalidraw/types.d.ts +4 -7
  172. package/dist/excalidraw/utils.js +0 -3
  173. package/dist/excalidraw/zindex.d.ts +2 -2
  174. package/dist/excalidraw/zindex.js +13 -9
  175. package/dist/{dev/en-54AU74IP.json → prod/en-JBWHKG2R.json} +1 -4
  176. package/dist/prod/index.css +1 -1
  177. package/dist/prod/index.js +39 -39
  178. package/package.json +3 -4
  179. package/dist/browser/dev/excalidraw-assets-dev/chunk-FG5PX37Z.js.map +0 -7
  180. package/dist/browser/dev/excalidraw-assets-dev/dist-HOOQ44NM.js +0 -10
  181. package/dist/browser/dev/excalidraw-assets-dev/image-ZQHNSB7P.css.map +0 -7
  182. package/dist/browser/prod/excalidraw-assets/chunk-D2I3QE7U.js +0 -269
  183. package/dist/browser/prod/excalidraw-assets/dist-XTBKPFET.js +0 -1
  184. package/dist/browser/prod/excalidraw-assets/flowDiagram-v2-476db779-KLWICWG3.js +0 -1
  185. package/dist/browser/prod/excalidraw-assets/image-M662KTMJ.css +0 -1
  186. package/dist/browser/prod/excalidraw-assets/image-XP52XYUU.js +0 -1
  187. package/dist/excalidraw/data/reconcile.d.ts +0 -6
  188. package/dist/excalidraw/data/reconcile.js +0 -49
  189. package/dist/excalidraw/fractionalIndex.d.ts +0 -40
  190. package/dist/excalidraw/fractionalIndex.js +0 -241
  191. /package/dist/browser/dev/excalidraw-assets-dev/{c4Diagram-9cddb37f-5K5MMBTZ.js.map → c4Diagram-9cddb37f-Z2BVR4KG.js.map} +0 -0
  192. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-YLFK45LY.js.map → chunk-2R746FJ3.js.map} +0 -0
  193. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-HPE2QM6Z.js.map → chunk-4YGSGIMJ.js.map} +0 -0
  194. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-VJWYXZRD.js.map → chunk-A4L3DQO2.js.map} +0 -0
  195. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-LARCHXKL.js.map → chunk-CWUUGB6C.js.map} +0 -0
  196. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-PTRCE3YZ.js.map → chunk-DLCKQH3C.js.map} +0 -0
  197. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-ABU3Y4P6.js.map → chunk-IVZGHBP3.js.map} +0 -0
  198. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-VVJS3CBB.js.map → chunk-J3RT3AEL.js.map} +0 -0
  199. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-AQ5OI7FF.js.map → chunk-KN673SBB.js.map} +0 -0
  200. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-OBKV4VWD.js.map → chunk-OGN4DE2Q.js.map} +0 -0
  201. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-JRHEG4KR.js.map → chunk-P3NJMBHG.js.map} +0 -0
  202. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-UN4RKPVH.js.map → chunk-QP4L67PY.js.map} +0 -0
  203. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-AU5UG6FO.js.map → chunk-U7QYLFAH.js.map} +0 -0
  204. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-FSI24XHB.js.map → chunk-ULL4JVA4.js.map} +0 -0
  205. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-RMILGNZX.js.map → chunk-WWRYLVJC.js.map} +0 -0
  206. /package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-bc733c3b-NWRL2CDH.js.map → classDiagram-bc733c3b-K5SPPM5G.js.map} +0 -0
  207. /package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-v2-8931bdaf-Y5FPX4CT.js.map → classDiagram-v2-8931bdaf-LMQ4MBCJ.js.map} +0 -0
  208. /package/dist/browser/dev/excalidraw-assets-dev/{directory-open-01563666-VWSBJ543.js.map → directory-open-01563666-HET5VGVW.js.map} +0 -0
  209. /package/dist/browser/dev/excalidraw-assets-dev/{directory-open-4ed118d0-FYNYOZXP.js.map → directory-open-4ed118d0-EEZTUAOR.js.map} +0 -0
  210. /package/dist/browser/dev/excalidraw-assets-dev/{dist-HOOQ44NM.js.map → dist-MMLCHBGE.js.map} +0 -0
  211. /package/dist/browser/dev/excalidraw-assets-dev/{en-OFPNSLTO.js.map → en-CJBKYSM5.js.map} +0 -0
  212. /package/dist/browser/dev/excalidraw-assets-dev/{erDiagram-f6946109-URHWBVQF.js.map → erDiagram-f6946109-T5ZYWW62.js.map} +0 -0
  213. /package/dist/browser/dev/excalidraw-assets-dev/{file-open-002ab408-K7UWK3UX.js.map → file-open-002ab408-2OQEKDVS.js.map} +0 -0
  214. /package/dist/browser/dev/excalidraw-assets-dev/{file-open-7c801643-PUS6AQBV.js.map → file-open-7c801643-7IDWBVQC.js.map} +0 -0
  215. /package/dist/browser/dev/excalidraw-assets-dev/{file-save-3189631c-AVBJT4K7.js.map → file-save-3189631c-D66DZOSK.js.map} +0 -0
  216. /package/dist/browser/dev/excalidraw-assets-dev/{file-save-745eba88-FCWOWXVA.js.map → file-save-745eba88-3NARDH2Z.js.map} +0 -0
  217. /package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-93327f21-ARY24FIN.js.map → flowDiagram-93327f21-OFTBRZYD.js.map} +0 -0
  218. /package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-v2-476db779-Y3LYCDLM.js.map → flowDiagram-v2-476db779-VVUICW5U.js.map} +0 -0
  219. /package/dist/browser/dev/excalidraw-assets-dev/{flowchart-elk-definition-5082a990-DTGYPOS7.js.map → flowchart-elk-definition-5082a990-KDDK5LFE.js.map} +0 -0
  220. /package/dist/browser/dev/excalidraw-assets-dev/{ganttDiagram-7ce12d6b-GWKDCJYX.js.map → ganttDiagram-7ce12d6b-XW6BLNYB.js.map} +0 -0
  221. /package/dist/browser/dev/excalidraw-assets-dev/{gitGraphDiagram-1e960c50-A4SIEE63.js.map → gitGraphDiagram-1e960c50-WAVVX7YE.js.map} +0 -0
  222. /package/dist/browser/dev/excalidraw-assets-dev/{image-J27XZPQC.js.map → image-DG6G3CCZ.js.map} +0 -0
  223. /package/dist/browser/dev/excalidraw-assets-dev/{image-blob-reduce.esm-BDWVJKFQ.js.map → image-blob-reduce.esm-OJYOZNL4.js.map} +0 -0
  224. /package/dist/browser/dev/excalidraw-assets-dev/{infoDiagram-264bed3e-AUF35UHX.js.map → infoDiagram-264bed3e-SMYVWNAJ.js.map} +0 -0
  225. /package/dist/browser/dev/excalidraw-assets-dev/{journeyDiagram-31be0096-ADAT3O42.js.map → journeyDiagram-31be0096-IXIWAKJV.js.map} +0 -0
  226. /package/dist/browser/dev/excalidraw-assets-dev/{mindmap-definition-4fc2557c-YC2LM75P.js.map → mindmap-definition-4fc2557c-H5WTPEBY.js.map} +0 -0
  227. /package/dist/browser/dev/excalidraw-assets-dev/{pica-GXUQBC7B.js.map → pica-RRHXYZO2.js.map} +0 -0
  228. /package/dist/browser/dev/excalidraw-assets-dev/{pieDiagram-157505fe-4XR6DLIZ.js.map → pieDiagram-157505fe-3LXENDEP.js.map} +0 -0
  229. /package/dist/browser/dev/excalidraw-assets-dev/{quadrantDiagram-fd70f2d0-LIR55Z6M.js.map → quadrantDiagram-fd70f2d0-CBA7LD4X.js.map} +0 -0
  230. /package/dist/browser/dev/excalidraw-assets-dev/{requirementDiagram-19c99588-NKRCRRBM.js.map → requirementDiagram-19c99588-53JLZTYM.js.map} +0 -0
  231. /package/dist/browser/dev/excalidraw-assets-dev/{roundRect-ZNZYUVWJ.js.map → roundRect-5HI6M3OA.js.map} +0 -0
  232. /package/dist/browser/dev/excalidraw-assets-dev/{sequenceDiagram-5dfd0049-VUKNRO5G.js.map → sequenceDiagram-5dfd0049-XJRLBGS7.js.map} +0 -0
  233. /package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-133e3642-3NYPG4IW.js.map → stateDiagram-133e3642-ZVPN2MPZ.js.map} +0 -0
  234. /package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-v2-6371a76b-YINZI7AG.js.map → stateDiagram-v2-6371a76b-QIW3VCSC.js.map} +0 -0
  235. /package/dist/browser/dev/excalidraw-assets-dev/{timeline-definition-5ed366f4-KWC42LPI.js.map → timeline-definition-5ed366f4-LGCWVNZT.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as el}from"./chunk-MJ2YKZ3B.js";import{C as Qu,D as Ju,E as ju,b as Rp,c as kp,da as Pr,ea as tl,h as un,na as La,pa as rl,z as Pp}from"./chunk-RVQN2TTU.js";import{a as vr}from"./chunk-7CLKPETF.js";import{d as si,f as on}from"./chunk-SXMPUQ6M.js";var al=si((es,ts)=>{vr();(function(W,q){typeof es=="object"&&typeof ts<"u"?ts.exports=q():typeof define=="function"&&define.amd?define(q):(W=typeof globalThis<"u"?globalThis:W||self,W.cytoscape=q())})(es,function(){"use strict";function W(t){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(t)}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function S(t,e,r){return e&&_(t.prototype,e),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t,e){return A(t)||V(t,e)||U(t,e)||J()}function A(t){if(Array.isArray(t))return t}function V(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,i=!1,s,o;try{for(r=r.call(t);!(n=(s=r.next()).done)&&(a.push(s.value),!(e&&a.length===e));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw o}}return a}}function U(t,e){if(t){if(typeof t=="string")return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}}function R(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function J(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{a as el}from"./chunk-DF24HG3F.js";import{C as Qu,D as Ju,E as ju,b as Rp,c as kp,da as Pr,ea as tl,h as un,na as La,pa as rl,z as Pp}from"./chunk-ONH2E3HD.js";import{a as vr}from"./chunk-GTO2REC5.js";import{d as si,f as on}from"./chunk-SXMPUQ6M.js";var al=si((es,ts)=>{vr();(function(W,q){typeof es=="object"&&typeof ts<"u"?ts.exports=q():typeof define=="function"&&define.amd?define(q):(W=typeof globalThis<"u"?globalThis:W||self,W.cytoscape=q())})(es,function(){"use strict";function W(t){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(t)}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function S(t,e,r){return e&&_(t.prototype,e),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t,e){return A(t)||V(t,e)||U(t,e)||J()}function A(t){if(Array.isArray(t))return t}function V(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,i=!1,s,o;try{for(r=r.call(t);!(n=(s=r.next()).done)&&(a.push(s.value),!(e&&a.length===e));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw o}}return a}}function U(t,e){if(t){if(typeof t=="string")return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}}function R(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function J(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=typeof window>"u"?null:window,$=L?L.navigator:null;L&&L.document;var Y=W(""),j=W({}),te=W(function(){}),le=typeof HTMLElement>"u"?"undefined":W(HTMLElement),Q=function(e){return e&&e.instanceString&&ne(e.instanceString)?e.instanceString():null},ee=function(e){return e!=null&&W(e)==Y},ne=function(e){return e!=null&&W(e)===te},be=function(e){return!se(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},C=function(e){return e!=null&&W(e)===j&&!be(e)&&e.constructor===Object},B=function(e){return e!=null&&W(e)===j},N=function(e){return e!=null&&W(e)===W(1)&&!isNaN(e)},Z=function(e){return N(e)&&Math.floor(e)===e},ue=function(e){if(le!=="undefined")return e!=null&&e instanceof HTMLElement},se=function(e){return Le(e)||Ee(e)},Le=function(e){return Q(e)==="collection"&&e._private.single},Ee=function(e){return Q(e)==="collection"&&!e._private.single},Ge=function(e){return Q(e)==="core"},et=function(e){return Q(e)==="stylesheet"},vt=function(e){return Q(e)==="event"},Ue=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Fe=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},ze=function(e){return C(e)&&N(e.x1)&&N(e.x2)&&N(e.y1)&&N(e.y2)},Je=function(e){return B(e)&&ne(e.then)},rt=function(){return $&&$.userAgent.match(/msie|trident|edge/i)},lt=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var a=function n(){var i=this,s=arguments,o,l=r.apply(i,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(i,s)),o};return a.cache={},a},tt=lt(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Ct=lt(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),bt=lt(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Tt=function(e){return Ue(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},qe="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Er="rgb[a]?\\(("+qe+"[%]?)\\s*,\\s*("+qe+"[%]?)\\s*,\\s*("+qe+"[%]?)(?:\\s*,\\s*("+qe+"))?\\)",Qt="rgb[a]?\\((?:"+qe+"[%]?)\\s*,\\s*(?:"+qe+"[%]?)\\s*,\\s*(?:"+qe+"[%]?)(?:\\s*,\\s*(?:"+qe+"))?\\)",wr="hsl[a]?\\(("+qe+")\\s*,\\s*("+qe+"[%])\\s*,\\s*("+qe+"[%])(?:\\s*,\\s*("+qe+"))?\\)",Jt="hsl[a]?\\((?:"+qe+")\\s*,\\s*(?:"+qe+"[%])\\s*,\\s*(?:"+qe+"[%])(?:\\s*,\\s*(?:"+qe+"))?\\)",vn="\\#[0-9a-fA-F]{3}",Qr="\\#[0-9a-fA-F]{6}",Jr=function(e,r){return e<r?-1:e>r?1:0},jt=function(e,r){return-1*Jr(e,r)},$e=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var s=n[i];t[s]=a[s]}}return t},vl=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,s=16;return r?(a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[a,n,i]}},dl=function(e){var r,a,n,i,s,o,l,u;function f(v,p,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?v+(p-v)*6*y:y<1/2?p:y<2/3?v+(p-v)*(2/3-y)*6:v}var h=new RegExp("^"+wr+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,s=h[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,d=2*i-c;o=Math.round(255*f(d,c,a+1/3)),l=Math.round(255*f(d,c,a)),u=Math.round(255*f(d,c,a-1/3))}r=[o,l,u,s]}return r},gl=function(e){var r,a=new RegExp("^"+Er+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},pl=function(e){return ml[e.toLowerCase()]},yl=function(e){return(be(e)?e:null)||pl(e)||vl(e)||gl(e)||dl(e)},ml={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},hs=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(C(s))throw Error("Tried to set map with object key");i<a.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},cs=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(C(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r};function bl(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Br=bl,Aa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function El(t,e){return e={exports:{}},t(e,e.exports),e.exports}var wl=typeof Aa=="object"&&Aa&&Aa.Object===Object&&Aa,xl=wl,Tl=typeof self=="object"&&self&&self.Object===Object&&self,Cl=xl||Tl||Function("return this")(),dn=Cl,Dl=function(){return dn.Date.now()},ui=Dl,Sl=/\s/;function Ll(t){for(var e=t.length;e--&&Sl.test(t.charAt(e)););return e}var Al=Ll,Ol=/^\s+/;function Nl(t){return t&&t.slice(0,Al(t)+1).replace(Ol,"")}var Ml=Nl,Il=dn.Symbol,jr=Il,vs=Object.prototype,Rl=vs.hasOwnProperty,kl=vs.toString,Oa=jr?jr.toStringTag:void 0;function Pl(t){var e=Rl.call(t,Oa),r=t[Oa];try{t[Oa]=void 0;var a=!0}catch{}var n=kl.call(t);return a&&(e?t[Oa]=r:delete t[Oa]),n}var Bl=Pl,Fl=Object.prototype,zl=Fl.toString;function Gl(t){return zl.call(t)}var Vl=Gl,$l="[object Null]",_l="[object Undefined]",ds=jr?jr.toStringTag:void 0;function Ul(t){return t==null?t===void 0?_l:$l:ds&&ds in Object(t)?Bl(t):Vl(t)}var gs=Ul;function Yl(t){return t!=null&&typeof t=="object"}var Hl=Yl,Xl="[object Symbol]";function Wl(t){return typeof t=="symbol"||Hl(t)&&gs(t)==Xl}var Na=Wl,ps=NaN,ql=/^[-+]0x[0-9a-f]+$/i,Kl=/^0b[01]+$/i,Zl=/^0o[0-7]+$/i,Ql=parseInt;function Jl(t){if(typeof t=="number")return t;if(Na(t))return ps;if(Br(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Br(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ml(t);var r=Kl.test(t);return r||Zl.test(t)?Ql(t.slice(2),r?2:8):ql.test(t)?ps:+t}var ys=Jl,jl="Expected a function",ef=Math.max,tf=Math.min;function rf(t,e,r){var a,n,i,s,o,l,u=0,f=!1,h=!1,c=!0;if(typeof t!="function")throw new TypeError(jl);e=ys(e)||0,Br(r)&&(f=!!r.leading,h="maxWait"in r,i=h?ef(ys(r.maxWait)||0,e):i,c="trailing"in r?!!r.trailing:c);function d(O){var T=a,k=n;return a=n=void 0,u=O,s=t.apply(k,T),s}function v(O){return u=O,o=setTimeout(g,e),f?d(O):s}function p(O){var T=O-l,k=O-u,D=e-T;return h?tf(D,i-k):D}function y(O){var T=O-l,k=O-u;return l===void 0||T>=e||T<0||h&&k>=i}function g(){var O=ui();if(y(O))return m(O);o=setTimeout(g,p(O))}function m(O){return o=void 0,c&&a?d(O):(a=n=void 0,s)}function b(){o!==void 0&&clearTimeout(o),u=0,a=l=n=o=void 0}function x(){return o===void 0?s:m(ui())}function M(){var O=ui(),T=y(O);if(a=arguments,n=this,l=O,T){if(o===void 0)return v(l);if(h)return clearTimeout(o),o=setTimeout(g,e),d(l)}return o===void 0&&(o=setTimeout(g,e)),s}return M.cancel=b,M.flush=x,M}var gn=rf,li=L?L.performance:null,ms=li&&li.now?function(){return li.now()}:function(){return Date.now()},af=function(){if(L){if(L.requestAnimationFrame)return function(t){L.requestAnimationFrame(t)};if(L.mozRequestAnimationFrame)return function(t){L.mozRequestAnimationFrame(t)};if(L.webkitRequestAnimationFrame)return function(t){L.webkitRequestAnimationFrame(t)};if(L.msRequestAnimationFrame)return function(t){L.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ms())},1e3/60)}}(),pn=function(e){return af(e)},dr=ms,ea=9261,bs=65599,Ma=5381,Es=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ea,a=r,n;n=e.next(),!n.done;)a=a*bs+n.value|0;return a},Ia=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ea;return r*bs+e|0},Ra=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ma;return(r<<5)+r+e|0},nf=function(e,r){return e*2097152+r},xr=function(e){return e[0]*2097152+e[1]},yn=function(e,r){return[Ia(e[0],r[0]),Ra(e[1],r[1])]},sf=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return Es(s,r)},Fr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return Es(s,r)},ws=function(){return of(arguments)},of=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Fr(n):r=Fr(n,r)}return r},xs=!0,uf=console.warn!=null,lf=console.trace!=null,fi=Number.MAX_SAFE_INTEGER||9007199254740991,Ts=function(){return!0},mn=function(){return!1},Cs=function(){return 0},hi=function(){},Et=function(e){throw new Error(e)},Ds=function(e){if(e!==void 0)xs=!!e;else return xs},ot=function(e){Ds()&&(uf?console.warn(e):(console.log(e),lf&&console.trace()))},ff=function(e){return $e({},e)},or=function(e){return e==null?e:be(e)?e.slice():C(e)?ff(e):e},hf=function(e){return e.slice()},Ss=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},cf={},Ls=function(){return cf},Lt=function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var s=r[i],o=a?.[s];n[s]=o===void 0?e[s]:o}return n}},Tr=function(e,r,a){for(var n=e.length-1;n>=0&&!(e[n]===r&&(e.splice(n,1),a));n--);},ci=function(e){e.splice(0,e.length)},vf=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},er=function(e,r,a){return a&&(r=bt(a,r)),e[r]},Cr=function(e,r,a,n){a&&(r=bt(a,r)),e[r]=n},df=function(){function t(){q(this,t),this._obj={}}return S(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),ur=typeof Map<"u"?Map:df,gf="undefined",pf=function(){function t(e){if(q(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return S(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}]),t}(),ta=(typeof Set>"u"?"undefined":W(Set))!==gf?Set:pf,bn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ge(e)){Et("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Et("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new ta,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];be(r.classes)?u=r.classes:ee(r.classes)&&(u=r.classes.split(/\s+/));for(var f=0,h=u.length;f<h;f++){var c=u[f];!c||c===""||i.classes.add(c)}this.createEmitter();var d=r.style||r.css;d&&(ot("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d)),(a===void 0||a)&&this.restore()},As=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var s;C(a)&&!se(a)&&(s=a,a=s.roots||s.root,n=s.visit,i=s.directed),i=arguments.length===2&&!ne(n)?n:i,n=ne(n)?n:function(){};for(var o=this._private.cy,l=a=ee(a)?this.filter(a):a,u=[],f=[],h={},c={},d={},v=0,p,y=this.byGroup(),g=y.nodes,m=y.edges,b=0;b<l.length;b++){var x=l[b],M=x.id();x.isNode()&&(u.unshift(x),e.bfs&&(d[M]=!0,f.push(x)),c[M]=0)}for(var O=function(){var H=e.bfs?u.shift():u.pop(),z=H.id();if(e.dfs){if(d[z])return"continue";d[z]=!0,f.push(H)}var re=c[z],X=h[z],K=X!=null?X.source():null,ie=X!=null?X.target():null,fe=X==null?void 0:H.same(K)?ie[0]:K[0],ve=void 0;if(ve=n(H,X,fe,v++,re),ve===!0)return p=H,"break";if(ve===!1)return"break";for(var oe=H.connectedEdges().filter(function(ge){return(!i||ge.source().same(H))&&m.has(ge)}),ce=0;ce<oe.length;ce++){var de=oe[ce],xe=de.connectedNodes().filter(function(ge){return!ge.same(H)&&g.has(ge)}),pe=xe.id();xe.length!==0&&!d[pe]&&(xe=xe[0],u.push(xe),e.bfs&&(d[pe]=!0,f.push(xe)),h[pe]=de,c[pe]=c[z]+1)}};u.length!==0;){var T=O();if(T!=="continue"&&T==="break")break}for(var k=o.collection(),D=0;D<f.length;D++){var F=f[D],G=h[F.id()];G!=null&&k.push(G),k.push(F)}return{path:o.collection(k),found:o.collection(p)}}},ka={breadthFirstSearch:As({bfs:!0}),depthFirstSearch:As({dfs:!0})};ka.bfs=ka.breadthFirstSearch,ka.dfs=ka.depthFirstSearch;var yf=El(function(t,e){(function(){var r,a,n,i,s,o,l,u,f,h,c,d,v,p,y;n=Math.floor,h=Math.min,a=function(g,m){return g<m?-1:g>m?1:0},f=function(g,m,b,x,M){var O;if(b==null&&(b=0),M==null&&(M=a),b<0)throw new Error("lo must be non-negative");for(x==null&&(x=g.length);b<x;)O=n((b+x)/2),M(m,g[O])<0?x=O:b=O+1;return[].splice.apply(g,[b,b-b].concat(m)),m},o=function(g,m,b){return b==null&&(b=a),g.push(m),p(g,0,g.length-1,b)},s=function(g,m){var b,x;return m==null&&(m=a),b=g.pop(),g.length?(x=g[0],g[0]=b,y(g,0,m)):x=b,x},u=function(g,m,b){var x;return b==null&&(b=a),x=g[0],g[0]=m,y(g,0,b),x},l=function(g,m,b){var x;return b==null&&(b=a),g.length&&b(g[0],m)<0&&(x=[g[0],m],m=x[0],g[0]=x[1],y(g,0,b)),m},i=function(g,m){var b,x,M,O,T,k;for(m==null&&(m=a),O=function(){k=[];for(var D=0,F=n(g.length/2);0<=F?D<F:D>F;0<=F?D++:D--)k.push(D);return k}.apply(this).reverse(),T=[],x=0,M=O.length;x<M;x++)b=O[x],T.push(y(g,b,m));return T},v=function(g,m,b){var x;if(b==null&&(b=a),x=g.indexOf(m),x!==-1)return p(g,0,x,b),y(g,x,b)},c=function(g,m,b){var x,M,O,T,k;if(b==null&&(b=a),M=g.slice(0,m),!M.length)return M;for(i(M,b),k=g.slice(m),O=0,T=k.length;O<T;O++)x=k[O],l(M,x,b);return M.sort(b).reverse()},d=function(g,m,b){var x,M,O,T,k,D,F,G,I;if(b==null&&(b=a),m*10<=g.length){if(O=g.slice(0,m).sort(b),!O.length)return O;for(M=O[O.length-1],F=g.slice(m),T=0,D=F.length;T<D;T++)x=F[T],b(x,M)<0&&(f(O,x,0,null,b),O.pop(),M=O[O.length-1]);return O}for(i(g,b),I=[],k=0,G=h(m,g.length);0<=G?k<G:k>G;0<=G?++k:--k)I.push(s(g,b));return I},p=function(g,m,b,x){var M,O,T;for(x==null&&(x=a),M=g[b];b>m;){if(T=b-1>>1,O=g[T],x(M,O)<0){g[b]=O,b=T;continue}break}return g[b]=M},y=function(g,m,b){var x,M,O,T,k;for(b==null&&(b=a),M=g.length,k=m,O=g[m],x=2*m+1;x<M;)T=x+1,T<M&&!(b(g[x],g[T])<0)&&(x=T),g[m]=g[x],m=x,x=2*m+1;return g[m]=O,p(g,k,m,b)},r=function(){g.push=o,g.pop=s,g.replace=u,g.pushpop=l,g.heapify=i,g.updateItem=v,g.nlargest=c,g.nsmallest=d;function g(m){this.cmp=m??a,this.nodes=[]}return g.prototype.push=function(m){return o(this.nodes,m,this.cmp)},g.prototype.pop=function(){return s(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(m){return this.nodes.indexOf(m)!==-1},g.prototype.replace=function(m){return u(this.nodes,m,this.cmp)},g.prototype.pushpop=function(m){return l(this.nodes,m,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(m){return v(this.nodes,m,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var m;return m=new g,m.nodes=this.nodes.slice(0),m},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),function(g,m){return t.exports=m()}(this,function(){return r})}).call(Aa)}),Pa=yf,mf=Lt({root:null,weight:function(e){return 1},directed:!1}),bf={dijkstra:function(e){if(!C(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=mf(e),n=a.root,i=a.weight,s=a.directed,o=this,l=i,u=ee(n)?this.filter(n)[0]:n[0],f={},h={},c={},d=this.byGroup(),v=d.nodes,p=d.edges;p.unmergeBy(function(re){return re.isLoop()});for(var y=function(X){return f[X.id()]},g=function(X,K){f[X.id()]=K,m.updateItem(X)},m=new Pa(function(re,X){return y(re)-y(X)}),b=0;b<v.length;b++){var x=v[b];f[x.id()]=x.same(u)?0:1/0,m.push(x)}for(var M=function(X,K){for(var ie=(s?X.edgesTo(K):X.edgesWith(K)).intersect(p),fe=1/0,ve,oe=0;oe<ie.length;oe++){var ce=ie[oe],de=l(ce);(de<fe||!ve)&&(fe=de,ve=ce)}return{edge:ve,dist:fe}};m.size()>0;){var O=m.pop(),T=y(O),k=O.id();if(c[k]=T,T!==1/0)for(var D=O.neighborhood().intersect(v),F=0;F<D.length;F++){var G=D[F],I=G.id(),H=M(O,G),z=T+H.dist;z<y(G)&&(g(G,z),h[I]={node:O,edge:H.edge})}}return{distanceTo:function(X){var K=ee(X)?v.filter(X)[0]:X[0];return c[K.id()]},pathTo:function(X){var K=ee(X)?v.filter(X)[0]:X[0],ie=[],fe=K,ve=fe.id();if(K.length>0)for(ie.unshift(K);h[ve];){var oe=h[ve];ie.unshift(oe.edge),ie.unshift(oe.node),fe=oe.node,ve=fe.id()}return o.spawn(ie)}}}},Ef={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,s=new Array(i),o=a,l=function(x){for(var M=0;M<s.length;M++){var O=s[M];if(O.has(x))return M}},u=0;u<i;u++)s[u]=this.spawn(a[u]);for(var f=n.sort(function(b,x){return e(b)-e(x)}),h=0;h<f.length;h++){var c=f[h],d=c.source()[0],v=c.target()[0],p=l(d),y=l(v),g=s[p],m=s[y];p!==y&&(o.merge(c),g.merge(m),s.splice(y,1))}return o}},wf=Lt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),xf={aStar:function(e){var r=this.cy(),a=wf(e),n=a.root,i=a.goal,s=a.heuristic,o=a.directed,l=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var u=n.id(),f=i.id(),h={},c={},d={},v=new Pa(function(ve,oe){return c[ve.id()]-c[oe.id()]}),p=new ta,y={},g={},m=function(oe,ce){v.push(oe),p.add(ce)},b,x,M=function(){b=v.pop(),x=b.id(),p.delete(x)},O=function(oe){return p.has(oe)};m(n,u),h[u]=0,c[u]=s(n);for(var T=0;v.size()>0;){if(M(),T++,x===f){for(var k=[],D=i,F=f,G=g[F];k.unshift(D),G!=null&&k.unshift(G),D=y[F],D!=null;)F=D.id(),G=g[F];return{found:!0,distance:h[x],path:this.spawn(k),steps:T}}d[x]=!0;for(var I=b._private.edges,H=0;H<I.length;H++){var z=I[H];if(this.hasElementWithId(z.id())&&!(o&&z.data("source")!==x)){var re=z.source(),X=z.target(),K=re.id()!==x?re:X,ie=K.id();if(this.hasElementWithId(ie)&&!d[ie]){var fe=h[x]+l(z);if(!O(ie)){h[ie]=fe,c[ie]=fe+s(K),m(K,ie),y[ie]=b,g[ie]=z;continue}fe<h[ie]&&(h[ie]=fe,c[ie]=fe+s(K),y[ie]=b,g[ie]=z)}}}}return{found:!1,distance:void 0,path:void 0,steps:T}}},Tf=Lt({weight:function(e){return 1},directed:!1}),Cf={floydWarshall:function(e){for(var r=this.cy(),a=Tf(e),n=a.weight,i=a.directed,s=n,o=this.byGroup(),l=o.nodes,u=o.edges,f=l.length,h=f*f,c=function(de){return l.indexOf(de)},d=function(de){return l[de]},v=new Array(h),p=0;p<h;p++){var y=p%f,g=(p-y)/f;g===y?v[p]=0:v[p]=1/0}for(var m=new Array(h),b=new Array(h),x=0;x<u.length;x++){var M=u[x],O=M.source()[0],T=M.target()[0];if(O!==T){var k=c(O),D=c(T),F=k*f+D,G=s(M);if(v[F]>G&&(v[F]=G,m[F]=D,b[F]=M),!i){var I=D*f+k;!i&&v[I]>G&&(v[I]=G,m[I]=k,b[I]=M)}}}for(var H=0;H<f;H++)for(var z=0;z<f;z++)for(var re=z*f+H,X=0;X<f;X++){var K=z*f+X,ie=H*f+X;v[re]+v[ie]<v[K]&&(v[K]=v[re]+v[ie],m[K]=m[re])}var fe=function(de){return(ee(de)?r.filter(de):de)[0]},ve=function(de){return c(fe(de))},oe={distance:function(de,xe){var pe=ve(de),ge=ve(xe);return v[pe*f+ge]},path:function(de,xe){var pe=ve(de),ge=ve(xe),ae=d(pe);if(pe===ge)return ae.collection();if(m[pe*f+ge]==null)return r.collection();var we=r.collection(),Te=pe,Ae;for(we.merge(ae);pe!==ge;)Te=pe,pe=m[pe*f+ge],Ae=b[Te*f+pe],we.merge(Ae),we.merge(d(pe));return we}};return oe}},Df=Lt({weight:function(e){return 1},directed:!1,root:null}),Sf={bellmanFord:function(e){var r=this,a=Df(e),n=a.weight,i=a.directed,s=a.root,o=n,l=this,u=this.cy(),f=this.byGroup(),h=f.edges,c=f.nodes,d=c.length,v=new ur,p=!1,y=[];s=u.collection(s)[0],h.unmergeBy(function(ke){return ke.isLoop()});for(var g=h.length,m=function(Ie){var Pe=v.get(Ie.id());return Pe||(Pe={},v.set(Ie.id(),Pe)),Pe},b=function(Ie){return(ee(Ie)?u.$(Ie):Ie)[0]},x=function(Ie){return m(b(Ie)).dist},M=function(Ie){for(var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,je=b(Ie),Ke=[],_e=je;;){if(_e==null)return r.spawn();var ht=m(_e),Ce=ht.edge,P=ht.pred;if(Ke.unshift(_e[0]),_e.same(Pe)&&Ke.length>0)break;Ce!=null&&Ke.unshift(Ce),_e=P}return l.spawn(Ke)},O=0;O<d;O++){var T=c[O],k=m(T);T.same(s)?k.dist=0:k.dist=1/0,k.pred=null,k.edge=null}for(var D=!1,F=function(Ie,Pe,je,Ke,_e,ht){var Ce=Ke.dist+ht;Ce<_e.dist&&!je.same(Ke.edge)&&(_e.dist=Ce,_e.pred=Ie,_e.edge=je,D=!0)},G=1;G<d;G++){D=!1;for(var I=0;I<g;I++){var H=h[I],z=H.source(),re=H.target(),X=o(H),K=m(z),ie=m(re);F(z,re,H,K,ie,X),i||F(re,z,H,ie,K,X)}if(!D)break}if(D)for(var fe=[],ve=0;ve<g;ve++){var oe=h[ve],ce=oe.source(),de=oe.target(),xe=o(oe),pe=m(ce).dist,ge=m(de).dist;if(pe+xe<ge||!i&&ge+xe<pe)if(p||(ot("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var ae=[];pe+xe<ge&&ae.push(ce),!i&&ge+xe<pe&&ae.push(de);for(var we=ae.length,Te=0;Te<we;Te++){var Ae=ae[Te],Oe=[Ae];Oe.push(m(Ae).edge);for(var Ye=m(Ae).pred;Oe.indexOf(Ye)===-1;)Oe.push(Ye),Oe.push(m(Ye).edge),Ye=m(Ye).pred;Oe=Oe.slice(Oe.indexOf(Ye));for(var He=Oe[0].id(),Me=0,Ne=2;Ne<Oe.length;Ne+=2)Oe[Ne].id()<He&&(He=Oe[Ne].id(),Me=Ne);Oe=Oe.slice(Me).concat(Oe.slice(0,Me)),Oe.push(Oe[0]);var Be=Oe.map(function(ke){return ke.id()}).join(",");fe.indexOf(Be)===-1&&(y.push(l.spawn(Oe)),fe.push(Be))}}else break}return{distanceTo:x,pathTo:M,hasNegativeWeightCycle:p,negativeWeightCycles:y}}},Lf=Math.sqrt(2),Af=function(e,r,a){a.length===0&&Et("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],s=n[2],o=r[i],l=r[s],u=a,f=u.length-1;f>=0;f--){var h=u[f],c=h[1],d=h[2];(r[c]===o&&r[d]===l||r[c]===l&&r[d]===o)&&u.splice(f,1)}for(var v=0;v<u.length;v++){var p=u[v];p[1]===l?(u[v]=p.slice(),u[v][1]=o):p[2]===l&&(u[v]=p.slice(),u[v][2]=o)}for(var y=0;y<r.length;y++)r[y]===l&&(r[y]=o);return u},vi=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=Af(i,e,r),a--}return r},Of={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(ie){return ie.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/Lf);if(i<2){Et("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],f=0;f<s;f++){var h=n[f];u.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var c=1/0,d=[],v=new Array(i),p=new Array(i),y=new Array(i),g=function(fe,ve){for(var oe=0;oe<i;oe++)ve[oe]=fe[oe]},m=0;m<=o;m++){for(var b=0;b<i;b++)p[b]=b;var x=vi(p,u.slice(),i,l),M=x.slice();g(p,y);var O=vi(p,x,l,2),T=vi(y,M,l,2);O.length<=T.length&&O.length<c?(c=O.length,d=O,g(p,v)):T.length<=O.length&&T.length<c&&(c=T.length,d=T,g(y,v))}for(var k=this.spawn(d.map(function(ie){return n[ie[0]]})),D=this.spawn(),F=this.spawn(),G=v[0],I=0;I<v.length;I++){var H=v[I],z=a[I];H===G?D.merge(z):F.merge(z)}var re=function(fe){var ve=e.spawn();return fe.forEach(function(oe){ve.merge(oe),oe.connectedEdges().forEach(function(ce){e.contains(ce)&&!k.contains(ce)&&ve.merge(ce)})}),ve},X=[re(D),re(F)],K={cut:k,components:X,partition1:D,partition2:F};return K}},Nf=function(e){return{x:e.x,y:e.y}},En=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},Os=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},ra=function(e){return{x:e[0],y:e[1]}},Mf=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.min(s,n))}return n},If=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.max(s,n))}return n},Rf=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=r;s<a;s++){var o=e[s];isFinite(o)&&(n+=o,i++)}return n/i},kf=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(c,d){return c-d});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+o]:(e[h-1+o]+e[h+o])/2},Pf=function(e){return Math.PI*e/180},wn=function(e,r){return Math.atan2(r,e)-Math.PI/2},di=Math.log2||function(t){return Math.log(t)/Math.log(2)},Ns=function(e){return e>0?1:e<0?-1:0},zr=function(e,r){return Math.sqrt(Gr(e,r))},Gr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},Bf=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},St=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},aa=function(e,r,a,n){return{x:St(e.x,r.x,a.x,n),y:St(e.y,r.y,a.y,n)}},Ff=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},s=zr(e,r),o={x:i.x/s,y:i.y/s};return a=a??0,n=n??a*s,{x:e.x+o.x*n,y:e.y+o.y*n}},Ba=function(e,r,a){return Math.max(e,Math.min(a,r))},_t=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},zf=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Gf=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Vf=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},$f=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},xn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},gi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(r.length===1)a=n=i=s=r[0];else if(r.length===2)a=i=r[0],s=n=r[1];else if(r.length===4){var o=w(r,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ms=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},pi=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},na=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},_f=function(e,r){return na(e,r.x,r.y)},Is=function(e,r){return na(e,r.x1,r.y1)&&na(e,r.x2,r.y2)},Rs=function(e,r,a,n,i,s,o){var l=Ga(i,s),u=i/2,f=s/2,h;{var c=a-u+l-o,d=n-f-o,v=a+u-l+o,p=d;if(h=Dr(e,r,a,n,c,d,v,p,!1),h.length>0)return h}{var y=a+u+o,g=n-f+l-o,m=y,b=n+f-l+o;if(h=Dr(e,r,a,n,y,g,m,b,!1),h.length>0)return h}{var x=a-u+l-o,M=n+f+o,O=a+u-l+o,T=M;if(h=Dr(e,r,a,n,x,M,O,T,!1),h.length>0)return h}{var k=a-u-o,D=n-f+l-o,F=k,G=n+f-l+o;if(h=Dr(e,r,a,n,k,D,F,G,!1),h.length>0)return h}var I;{var H=a-u+l,z=n-f+l;if(I=Fa(e,r,a,n,H,z,l+o),I.length>0&&I[0]<=H&&I[1]<=z)return[I[0],I[1]]}{var re=a+u-l,X=n-f+l;if(I=Fa(e,r,a,n,re,X,l+o),I.length>0&&I[0]>=re&&I[1]<=X)return[I[0],I[1]]}{var K=a+u-l,ie=n+f-l;if(I=Fa(e,r,a,n,K,ie,l+o),I.length>0&&I[0]>=K&&I[1]>=ie)return[I[0],I[1]]}{var fe=a-u+l,ve=n+f-l;if(I=Fa(e,r,a,n,fe,ve,l+o),I.length>0&&I[0]<=fe&&I[1]>=ve)return[I[0],I[1]]}return[]},Uf=function(e,r,a,n,i,s,o){var l=o,u=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,s),c=Math.max(n,s);return u-l<=e&&e<=f+l&&h-l<=r&&r<=c+l},Yf=function(e,r,a,n,i,s,o,l,u){var f={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},Hf=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},Xf=function(e,r,a,n,i){var s=1e-5;e===0&&(e=s),r/=e,a/=e,n/=e;var o,l,u,f,h,c,d,v;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,d=r/3,o>0){h=u+Math.sqrt(o),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),c=u-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+h+c,d+=(h+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+h)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,o===0){v=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-d+2*v,i[4]=i[2]=-(v+d);return}l=-l,f=l*l*l,f=Math.acos(u/Math.sqrt(f)),v=2*Math.sqrt(l),i[0]=-d+v*Math.cos(f/3),i[2]=-d+v*Math.cos((f+2*Math.PI)/3),i[4]=-d+v*Math.cos((f+4*Math.PI)/3)},Wf=function(e,r,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,f=1*9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,h=1*3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*r+2*s*s+2*s*r-l*r,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*r-s*r,d=[];Xf(u,f,h,c,d);for(var v=1e-7,p=[],y=0;y<6;y+=2)Math.abs(d[y+1])<v&&d[y]>=0&&d[y]<=1&&p.push(d[y]);p.push(1),p.push(0);for(var g=-1,m,b,x,M=0;M<p.length;M++)m=Math.pow(1-p[M],2)*a+2*(1-p[M])*p[M]*i+p[M]*p[M]*o,b=Math.pow(1-p[M],2)*n+2*(1-p[M])*p[M]*s+p[M]*p[M]*l,x=Math.pow(m-e,2)+Math.pow(b-r,2),g>=0?x<g&&(g=x):g=x;return g},qf=function(e,r,a,n,i,s){var o=[e-a,r-n],l=[i-a,s-n],u=l[0]*l[0]+l[1]*l[1],f=o[0]*o[0]+o[1]*o[1],h=o[0]*l[0]+o[1]*l[1],c=h*h/u;return h<0?f:c>u?(e-i)*(e-i)+(r-s)*(r-s):f-c},Ut=function(e,r,a){for(var n,i,s,o,l,u=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(s=a[(f+1)*2],o=a[(f+1)*2+1]):(s=a[(f+1-a.length/2)*2],o=a[(f+1-a.length/2)*2+1]),!(n==e&&s==e))if(n>=e&&e>=s||n<=e&&e<=s)l=(e-n)/(s-n)*(o-i)+i,l>r&&u++;else continue;return u%2!==0},gr=function(e,r,a,n,i,s,o,l,u){var f=new Array(a.length),h;l[0]!=null?(h=Math.atan(l[1]/l[0]),l[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=l;for(var c=Math.cos(-h),d=Math.sin(-h),v=0;v<f.length/2;v++)f[v*2]=s/2*(a[v*2]*c-a[v*2+1]*d),f[v*2+1]=o/2*(a[v*2+1]*c+a[v*2]*d),f[v*2]+=n,f[v*2+1]+=i;var p;if(u>0){var y=Ps(f,-u);p=ks(y)}else p=f;return Ut(e,r,p)},Kf=function(e,r,a,n,i,s,o){for(var l=new Array(a.length),u=s/2,f=o/2,h=bi(s,o),c=h*h,d=0;d<a.length/4;d++){var v=void 0,p=void 0;d===0?v=a.length-2:v=d*4-2,p=d*4+2;var y=n+u*a[d*4],g=i+f*a[d*4+1],m=-a[v]*a[p]-a[v+1]*a[p+1],b=h/Math.tan(Math.acos(m)/2),x=y-b*a[v],M=g-b*a[v+1],O=y+b*a[p],T=g+b*a[p+1];l[d*4]=x,l[d*4+1]=M,l[d*4+2]=O,l[d*4+3]=T;var k=a[v+1],D=-a[v],F=k*a[p]+D*a[p+1];F<0&&(k*=-1,D*=-1);var G=x+k*h,I=M+D*h,H=Math.pow(G-e,2)+Math.pow(I-r,2);if(H<=c)return!0}return Ut(e,r,l)},ks=function(e){for(var r=new Array(e.length/2),a,n,i,s,o,l,u,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],i=e[h*4+2],s=e[h*4+3],h<e.length/4-1?(o=e[(h+1)*4],l=e[(h+1)*4+1],u=e[(h+1)*4+2],f=e[(h+1)*4+3]):(o=e[0],l=e[1],u=e[2],f=e[3]);var c=Dr(a,n,i,s,o,l,u,f,!0);r[h*2]=c[0],r[h*2+1]=c[1]}return r},Ps=function(e,r){for(var a=new Array(e.length*2),n,i,s,o,l=0;l<e.length/2;l++){n=e[l*2],i=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var u=o-i,f=-(s-n),h=Math.sqrt(u*u+f*f),c=u/h,d=f/h;a[l*4]=n+c*r,a[l*4+1]=i+d*r,a[l*4+2]=s+c*r,a[l*4+3]=o+d*r}return a},Zf=function(e,r,a,n,i,s){var o=a-e,l=n-r;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),f=u-1;if(f<0)return[];var h=f/u;return[(a-e)*h+e,(n-r)*h+r]},Vr=function(e,r,a,n,i,s,o){return e-=i,r-=s,e/=a/2+o,r/=n/2+o,e*e+r*r<=1},Fa=function(e,r,a,n,i,s,o){var l=[a-e,n-r],u=[e-i,r-s],f=l[0]*l[0]+l[1]*l[1],h=2*(u[0]*l[0]+u[1]*l[1]),c=u[0]*u[0]+u[1]*u[1]-o*o,d=h*h-4*f*c;if(d<0)return[];var v=(-h+Math.sqrt(d))/(2*f),p=(-h-Math.sqrt(d))/(2*f),y=Math.min(v,p),g=Math.max(v,p),m=[];if(y>=0&&y<=1&&m.push(y),g>=0&&g<=1&&m.push(g),m.length===0)return[];var b=m[0]*l[0]+e,x=m[0]*l[1]+r;if(m.length>1){if(m[0]==m[1])return[b,x];var M=m[1]*l[0]+e,O=m[1]*l[1]+r;return[b,x,M,O]}else return[b,x]},yi=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},Dr=function(e,r,a,n,i,s,o,l,u){var f=e-i,h=a-e,c=o-i,d=r-s,v=n-r,p=l-s,y=c*d-p*f,g=h*d-v*f,m=p*h-c*v;if(m!==0){var b=y/m,x=g/m,M=.001,O=0-M,T=1+M;return O<=b&&b<=T&&O<=x&&x<=T?[e+b*h,r+b*v]:u?[e+b*h,r+b*v]:[]}else return y===0||g===0?yi(e,a,o)===o?[o,l]:yi(e,a,i)===i?[i,s]:yi(i,o,a)===a?[a,n]:[]:[]},za=function(e,r,a,n,i,s,o,l){var u=[],f,h=new Array(a.length),c=!0;s==null&&(c=!1);var d;if(c){for(var v=0;v<h.length/2;v++)h[v*2]=a[v*2]*s+n,h[v*2+1]=a[v*2+1]*o+i;if(l>0){var p=Ps(h,-l);d=ks(p)}else d=h}else d=a;for(var y,g,m,b,x=0;x<d.length/2;x++)y=d[x*2],g=d[x*2+1],x<d.length/2-1?(m=d[(x+1)*2],b=d[(x+1)*2+1]):(m=d[0],b=d[1]),f=Dr(e,r,n,i,y,g,m,b),f.length!==0&&u.push(f[0],f[1]);return u},Qf=function(e,r,a,n,i,s,o,l){for(var u=[],f,h=new Array(a.length),c=s/2,d=o/2,v=bi(s,o),p=0;p<a.length/4;p++){var y=void 0,g=void 0;p===0?y=a.length-2:y=p*4-2,g=p*4+2;var m=n+c*a[p*4],b=i+d*a[p*4+1],x=-a[y]*a[g]-a[y+1]*a[g+1],M=v/Math.tan(Math.acos(x)/2),O=m-M*a[y],T=b-M*a[y+1],k=m+M*a[g],D=b+M*a[g+1];p===0?(h[a.length-2]=O,h[a.length-1]=T):(h[p*4-2]=O,h[p*4-1]=T),h[p*4]=k,h[p*4+1]=D;var F=a[y+1],G=-a[y],I=F*a[g]+G*a[g+1];I<0&&(F*=-1,G*=-1);var H=O+F*v,z=T+G*v;f=Fa(e,r,n,i,H,z,v),f.length!==0&&u.push(f[0],f[1])}for(var re=0;re<h.length/4;re++)f=Dr(e,r,n,i,h[re*4],h[re*4+1],h[re*4+2],h[re*4+3],!1),f.length!==0&&u.push(f[0],f[1]);if(u.length>2){for(var X=[u[0],u[1]],K=Math.pow(X[0]-e,2)+Math.pow(X[1]-r,2),ie=1;ie<u.length/2;ie++){var fe=Math.pow(u[ie*2]-e,2)+Math.pow(u[ie*2+1]-r,2);fe<=K&&(X[0]=u[ie*2],X[1]=u[ie*2+1],K=fe)}return X}return u},Tn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(i-a)/i;return s<0&&(s=1e-5),[r[0]+s*n[0],r[1]+s*n[1]]},Vt=function(e,r){var a=mi(e,r);return a=Bs(a),a},Bs=function(e){for(var r,a,n=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<n;u++)r=e[2*u],a=e[2*u+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);for(var f=2/(o-i),h=2/(l-s),c=0;c<n;c++)r=e[2*c]=e[2*c]*f,a=e[2*c+1]=e[2*c+1]*h,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);if(s<-1)for(var d=0;d<n;d++)a=e[2*d+1]=e[2*d+1]+(-1-s);return e},mi=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),s,o=0;o<e;o++)s=o*a+n,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},Ga=function(e,r){return Math.min(e/4,r/4,8)},bi=function(e,r){return Math.min(e/10,r/10,8)},Fs=function(){return 8},Jf=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Ei=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},jf=Lt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),eh={pageRank:function(e){for(var r=jf(e),a=r.dampingFactor,n=r.precision,i=r.iterations,s=r.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,f=l.edges,h=u.length,c=h*h,d=f.length,v=new Array(c),p=new Array(h),y=(1-a)/h,g=0;g<h;g++){for(var m=0;m<h;m++){var b=g*h+m;v[b]=0}p[g]=0}for(var x=0;x<d;x++){var M=f[x],O=M.data("source"),T=M.data("target");if(O!==T){var k=u.indexOfId(O),D=u.indexOfId(T),F=s(M),G=D*h+k;v[G]+=F,p[k]+=F}}for(var I=1/h+y,H=0;H<h;H++)if(p[H]===0)for(var z=0;z<h;z++){var re=z*h+H;v[re]=I}else for(var X=0;X<h;X++){var K=X*h+H;v[K]=v[K]/p[H]+y}for(var ie=new Array(h),fe=new Array(h),ve,oe=0;oe<h;oe++)ie[oe]=1;for(var ce=0;ce<i;ce++){for(var de=0;de<h;de++)fe[de]=0;for(var xe=0;xe<h;xe++)for(var pe=0;pe<h;pe++){var ge=xe*h+pe;fe[xe]+=v[ge]*ie[pe]}Bf(fe),ve=ie,ie=fe,fe=ve;for(var ae=0,we=0;we<h;we++){var Te=ve[we]-ie[we];ae+=Te*Te}if(ae<n)break}var Ae={rank:function(Ye){return Ye=o.collection(Ye)[0],ie[u.indexOf(Ye)]}};return Ae}},zs=Lt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ia={degreeCentralityNormalized:function(e){e=zs(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},c=0,d=0,v=0;v<n;v++){var p=a[v],y=p.id();e.root=p;var g=this.degreeCentrality(e);c<g.indegree&&(c=g.indegree),d<g.outdegree&&(d=g.outdegree),f[y]=g.indegree,h[y]=g.outdegree}return{indegree:function(b){return c==0?0:(ee(b)&&(b=r.filter(b)),f[b.id()]/c)},outdegree:function(b){return d===0?0:(ee(b)&&(b=r.filter(b)),h[b.id()]/d)}}}else{for(var i={},s=0,o=0;o<n;o++){var l=a[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[l.id()]=u.degree}return{degree:function(b){return s===0?0:(ee(b)&&(b=r.filter(b)),i[b.id()]/s)}}}},degreeCentrality:function(e){e=zs(e);var r=this.cy(),a=this,n=e,i=n.root,s=n.weight,o=n.directed,l=n.alpha;if(i=r.collection(i)[0],o){for(var d=i.connectedEdges(),v=d.filter(function(O){return O.target().same(i)&&a.has(O)}),p=d.filter(function(O){return O.source().same(i)&&a.has(O)}),y=v.length,g=p.length,m=0,b=0,x=0;x<v.length;x++)m+=s(v[x]);for(var M=0;M<p.length;M++)b+=s(p[M]);return{indegree:Math.pow(y,1-l)*Math.pow(m,l),outdegree:Math.pow(g,1-l)*Math.pow(b,l)}}else{for(var u=i.connectedEdges().intersection(a),f=u.length,h=0,c=0;c<u.length;c++)h+=s(u[c]);return{degree:Math.pow(f,1-l)*Math.pow(h,l)}}}};ia.dc=ia.degreeCentrality,ia.dcn=ia.degreeCentralityNormalised=ia.degreeCentralityNormalized;var Gs=Lt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),sa={closenessCentralityNormalized:function(e){for(var r=Gs(e),a=r.harmonic,n=r.weight,i=r.directed,s=this.cy(),o={},l=0,u=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),h=0;h<u.length;h++){for(var c=0,d=u[h],v=0;v<u.length;v++)if(h!==v){var p=f.distance(d,u[v]);a?c+=1/p:c+=p}a||(c=1/c),l<c&&(l=c),o[d.id()]=c}return{closeness:function(g){return l==0?0:(ee(g)?g=s.filter(g)[0].id():g=g.id(),o[g]/l)}}},closenessCentrality:function(e){var r=Gs(e),a=r.root,n=r.weight,i=r.directed,s=r.harmonic;a=this.filter(a)[0];for(var o=this.dijkstra({root:a,weight:n,directed:i}),l=0,u=this.nodes(),f=0;f<u.length;f++){var h=u[f];if(!h.same(a)){var c=o.distanceTo(h);s?l+=1/c:l+=c}}return s?l:1/l}};sa.cc=sa.closenessCentrality,sa.ccn=sa.closenessCentralityNormalised=sa.closenessCentralityNormalized;var th=Lt({weight:null,directed:!1}),wi={betweennessCentrality:function(e){for(var r=th(e),a=r.directed,n=r.weight,i=n!=null,s=this.cy(),o=this.nodes(),l={},u={},f=0,h={set:function(b,x){u[b]=x,x>f&&(f=x)},get:function(b){return u[b]}},c=0;c<o.length;c++){var d=o[c],v=d.id();a?l[v]=d.outgoers().nodes():l[v]=d.openNeighborhood().nodes(),h.set(v,0)}for(var p=function(b){for(var x=o[b].id(),M=[],O={},T={},k={},D=new Pa(function(pe,ge){return k[pe]-k[ge]}),F=0;F<o.length;F++){var G=o[F].id();O[G]=[],T[G]=0,k[G]=1/0}for(T[x]=1,k[x]=0,D.push(x);!D.empty();){var I=D.pop();if(M.push(I),i)for(var H=0;H<l[I].length;H++){var z=l[I][H],re=s.getElementById(I),X=void 0;re.edgesTo(z).length>0?X=re.edgesTo(z)[0]:X=z.edgesTo(re)[0];var K=n(X);z=z.id(),k[z]>k[I]+K&&(k[z]=k[I]+K,D.nodes.indexOf(z)<0?D.push(z):D.updateItem(z),T[z]=0,O[z]=[]),k[z]==k[I]+K&&(T[z]=T[z]+T[I],O[z].push(I))}else for(var ie=0;ie<l[I].length;ie++){var fe=l[I][ie].id();k[fe]==1/0&&(D.push(fe),k[fe]=k[I]+1),k[fe]==k[I]+1&&(T[fe]=T[fe]+T[I],O[fe].push(I))}}for(var ve={},oe=0;oe<o.length;oe++)ve[o[oe].id()]=0;for(;M.length>0;){for(var ce=M.pop(),de=0;de<O[ce].length;de++){var xe=O[ce][de];ve[xe]=ve[xe]+T[xe]/T[ce]*(1+ve[ce])}ce!=o[b].id()&&h.set(ce,h.get(ce)+ve[ce])}},y=0;y<o.length;y++)p(y);var g={betweenness:function(b){var x=s.collection(b).id();return h.get(x)},betweennessNormalized:function(b){if(f==0)return 0;var x=s.collection(b).id();return h.get(x)/f}};return g.betweennessNormalised=g.betweennessNormalized,g}};wi.bc=wi.betweennessCentrality;var rh=Lt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),ah=function(e){return rh(e)},nh=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},ih=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},Vs=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var s=0;s<r;s++)e[s*r+n]=e[s*r+n]/a}},sh=function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var s=0;s<a;s++)n[i*a+s]=0;for(var o=0;o<a;o++)for(var l=0;l<a;l++)n[i*a+l]+=e[i*a+o]*r[o*a+l]}return n},oh=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=sh(e,n,r);return e},uh=function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return Vs(n,r),n},lh=function(e,r,a,n){for(var i=0;i<a;i++){var s=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),o=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(s!==o)return!1}return!0},fh=function(e,r,a,n){for(var i=[],s=0;s<r;s++){for(var o=[],l=0;l<r;l++)Math.round(e[s*r+l]*1e3)/1e3>0&&o.push(a[l]);o.length!==0&&i.push(n.collection(o))}return i},hh=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},ch=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&hh(e[r],e[a])&&e.splice(a,1);return e},$s=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=ah(e),s={},o=0;o<r.length;o++)s[r[o].id()]=o;for(var l=r.length,u=l*l,f=new Array(u),h,c=0;c<u;c++)f[c]=0;for(var d=0;d<a.length;d++){var v=a[d],p=s[v.source().id()],y=s[v.target().id()],g=nh(v,i.attributes);f[p*l+y]+=g,f[y*l+p]+=g}ih(f,l,i.multFactor),Vs(f,l);for(var m=!0,b=0;m&&b<i.maxIterations;)m=!1,h=oh(f,l,i.expandFactor),f=uh(h,l,i.inflateFactor),lh(f,h,u,4)||(m=!0),b++;var x=fh(f,l,r,n);return x=ch(x),x},vh={markovClustering:$s,mcl:$s},dh=function(e){return e},_s=function(e,r){return Math.abs(r-e)},Us=function(e,r,a){return e+_s(r,a)},Ys=function(e,r,a){return e+Math.pow(a-r,2)},gh=function(e){return Math.sqrt(e)},ph=function(e,r,a){return Math.max(e,_s(r,a))},Va=function(e,r,a,n,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:dh,o=n,l,u,f=0;f<e;f++)l=r(f),u=a(f),o=i(o,l,u);return s(o)},oa={euclidean:function(e,r,a){return e>=2?Va(e,r,a,0,Ys,gh):Va(e,r,a,0,Us)},squaredEuclidean:function(e,r,a){return Va(e,r,a,0,Ys)},manhattan:function(e,r,a){return Va(e,r,a,0,Us)},max:function(e,r,a){return Va(e,r,a,-1/0,ph)}};oa["squared-euclidean"]=oa.squaredEuclidean,oa.squaredeuclidean=oa.squaredEuclidean;function Cn(t,e,r,a,n,i){var s;return ne(t)?s=t:s=oa[t]||oa.euclidean,e===0&&ne(t)?s(n,i):s(e,r,a,n,i)}var yh=Lt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),xi=function(e){return yh(e)},Dn=function(e,r,a,n,i){var s=i!=="kMedoids",o=s?function(h){return a[h]}:function(h){return n[h](a)},l=function(c){return n[c](r)},u=a,f=r;return Cn(e,n.length,o,l,u,f)},Ti=function(e,r,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(r),l=null,u=0;u<n;u++)i[u]=e.min(a[u]).value,s[u]=e.max(a[u]).value;for(var f=0;f<r;f++){l=[];for(var h=0;h<n;h++)l[h]=Math.random()*(s[h]-i[h])+i[h];o[f]=l}return o},Hs=function(e,r,a,n,i){for(var s=1/0,o=0,l=0;l<r.length;l++){var u=Dn(a,e,r[l],n,i);u<s&&(s=u,o=l)}return o},Xs=function(e,r,a){for(var n=[],i=null,s=0;s<r.length;s++)i=r[s],a[i.id()]===e&&n.push(i);return n},mh=function(e,r,a){return Math.abs(r-e)<=a},bh=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var s=Math.abs(e[n][i]-r[n][i]);if(s>a)return!1}return!0},Eh=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},Ws=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];Eh(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var s=0;s<r;s++)a[s]=e[Math.floor(Math.random()*e.length)];return a},qs=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=Dn("manhattan",r[i],e,a,"kMedoids");return n},wh=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xi(e),s=new Array(i.k),o={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=Ti(a,i.k,i.attributes)):W(i.testCentroids)==="object"?l=i.testCentroids:l=Ti(a,i.k,i.attributes):l=Ti(a,i.k,i.attributes);for(var u=!0,f=0;u&&f<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],o[n.id()]=Hs(n,l,i.distance,i.attributes,"kMeans");u=!1;for(var c=0;c<i.k;c++){var d=Xs(c,a,o);if(d.length!==0){for(var v=i.attributes.length,p=l[c],y=new Array(v),g=new Array(v),m=0;m<v;m++){g[m]=0;for(var b=0;b<d.length;b++)n=d[b],g[m]+=i.attributes[m](n);y[m]=g[m]/d.length,mh(y[m],p[m],i.sensitivityThreshold)||(u=!0)}l[c]=y,s[c]=r.collection(d)}}f++}return s},xh=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xi(e),s=new Array(i.k),o,l={},u,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(W(i.testCentroids)==="object"?o=i.testCentroids:o=Ws(a,i.k)):o=Ws(a,i.k);for(var h=!0,c=0;h&&c<i.maxIterations;){for(var d=0;d<a.length;d++)n=a[d],l[n.id()]=Hs(n,o,i.distance,i.attributes,"kMedoids");h=!1;for(var v=0;v<o.length;v++){var p=Xs(v,a,l);if(p.length!==0){f[v]=qs(o[v],p,i.attributes);for(var y=0;y<p.length;y++)u=qs(p[y],p,i.attributes),u<f[v]&&(f[v]=u,o[v]=p[y],h=!0);s[v]=r.collection(p)}}c++}return s},Th=function(e,r,a,n,i){for(var s,o,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)n[l][u]=Math.pow(a[l][u],i.m);for(var f=0;f<e.length;f++)for(var h=0;h<i.attributes.length;h++){s=0,o=0;for(var c=0;c<r.length;c++)s+=n[c][f]*i.attributes[h](r[c]),o+=n[c][f];e[f][h]=s/o}},Ch=function(e,r,a,n,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var o,l,u,f=2/(i.m-1),h=0;h<a.length;h++)for(var c=0;c<n.length;c++){o=0;for(var d=0;d<a.length;d++)l=Dn(i.distance,n[c],a[h],i.attributes,"cmeans"),u=Dn(i.distance,n[c],a[d],i.attributes,"cmeans"),o+=Math.pow(l/u,f);e[c][h]=1/o}},Dh=function(e,r,a,n){for(var i=new Array(a.k),s=0;s<i.length;s++)i[s]=[];for(var o,l,u=0;u<r.length;u++){o=-1/0,l=-1;for(var f=0;f<r[0].length;f++)r[u][f]>o&&(o=r[u][f],l=f);i[l].push(e[u])}for(var h=0;h<i.length;h++)i[h]=n.collection(i[h]);return i},Ks=function(e){var r=this.cy(),a=this.nodes(),n=xi(e),i,s,o,l,u;l=new Array(a.length);for(var f=0;f<a.length;f++)l[f]=new Array(n.k);o=new Array(a.length);for(var h=0;h<a.length;h++)o[h]=new Array(n.k);for(var c=0;c<a.length;c++){for(var d=0,v=0;v<n.k;v++)o[c][v]=Math.random(),d+=o[c][v];for(var p=0;p<n.k;p++)o[c][p]=o[c][p]/d}s=new Array(n.k);for(var y=0;y<n.k;y++)s[y]=new Array(n.attributes.length);u=new Array(a.length);for(var g=0;g<a.length;g++)u[g]=new Array(n.k);for(var m=!0,b=0;m&&b<n.maxIterations;)m=!1,Th(s,a,o,u,n),Ch(o,l,s,a,n),bh(o,l,n.sensitivityThreshold)||(m=!0),b++;return i=Dh(a,o,n,r),{clusters:i,degreeOfMembership:o}},Sh={kMeans:wh,kMedoids:xh,fuzzyCMeans:Ks,fcm:Ks},Lh=Lt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Ah={single:"min",complete:"max"},Oh=function(e){var r=Lh(e),a=Ah[r.linkage];return a!=null&&(r.linkage=a),r},Zs=function(e,r,a,n,i){for(var s=0,o=1/0,l,u=i.attributes,f=function(D,F){return Cn(i.distance,u.length,function(G){return u[G](D)},function(G){return u[G](F)},D,F)},h=0;h<e.length;h++){var c=e[h].key,d=a[c][n[c]];d<o&&(s=c,o=d)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var v=r[s],p=r[n[s]],y;i.mode==="dendrogram"?y={left:v,right:p,key:v.key}:y={value:v.value.concat(p.value),key:v.key},e[v.index]=y,e.splice(p.index,1),r[v.key]=y;for(var g=0;g<e.length;g++){var m=e[g];v.key===m.key?l=1/0:i.linkage==="min"?(l=a[v.key][m.key],a[v.key][m.key]>a[p.key][m.key]&&(l=a[p.key][m.key])):i.linkage==="max"?(l=a[v.key][m.key],a[v.key][m.key]<a[p.key][m.key]&&(l=a[p.key][m.key])):i.linkage==="mean"?l=(a[v.key][m.key]*v.size+a[p.key][m.key]*p.size)/(v.size+p.size):i.mode==="dendrogram"?l=f(m.value,v.value):l=f(m.value[0],v.value[0]),a[v.key][m.key]=a[m.key][v.key]=l}for(var b=0;b<e.length;b++){var x=e[b].key;if(n[x]===v.key||n[x]===p.key){for(var M=x,O=0;O<e.length;O++){var T=e[O].key;a[x][T]<a[x][M]&&(M=T)}n[x]=M}e[b].index=b}return v.key=p.key=v.index=p.index=null,!0},Sn=function t(e,r,a){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},Nh=function t(e,r){if(!e)return"";if(e.left&&e.right){var a=t(e.left,r),n=t(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Mh=function t(e,r,a){if(!e)return[];var n=[],i=[],s=[];return r===0?(e.left&&Sn(e.left,n),e.right&&Sn(e.right,i),s=n.concat(i),[a.collection(s)]):r===1?e.value?[a.collection(e.value)]:(e.left&&Sn(e.left,n),e.right&&Sn(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=t(e.left,r-1,a)),e.right&&(i=t(e.right,r-1,a)),n.concat(i))},Qs=function(e){for(var r=this.cy(),a=this.nodes(),n=Oh(e),i=n.attributes,s=function(b,x){return Cn(n.distance,i.length,function(M){return i[M](b)},function(M){return i[M](x)},b,x)},o=[],l=[],u=[],f=[],h=0;h<a.length;h++){var c={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};o[h]=c,f[h]=c,l[h]=[],u[h]=0}for(var d=0;d<o.length;d++)for(var v=0;v<=d;v++){var p=void 0;n.mode==="dendrogram"?p=d===v?1/0:s(o[d].value,o[v].value):p=d===v?1/0:s(o[d].value[0],o[v].value[0]),l[d][v]=p,l[v][d]=p,p<l[d][u[d]]&&(u[d]=v)}for(var y=Zs(o,f,l,u,n);y;)y=Zs(o,f,l,u,n);var g;return n.mode==="dendrogram"?(g=Mh(o[0],n.dendrogramDepth,r),n.addDendrogram&&Nh(o[0],r)):(g=new Array(o.length),o.forEach(function(m,b){m.key=m.index=null,g[b]=r.collection(m.value)})),g},Ih={hierarchicalClustering:Qs,hca:Qs},Rh=Lt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),kh=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||Et("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||N(a)||Et("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),Rh(e)},Ph=function(e,r,a,n){var i=function(o,l){return n[l](o)};return-Cn(e,n.length,function(s){return i(r,s)},function(s){return i(a,s)},r,a)},Bh=function(e,r){var a=null;return r==="median"?a=kf(e):r==="mean"?a=Rf(e):r==="min"?a=Mf(e):r==="max"?a=If(e):a=r,a},Fh=function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},Js=function(e,r,a){for(var n=[],i=0;i<e;i++){for(var s=-1,o=-1/0,l=0;l<a.length;l++){var u=a[l];r[i*e+u]>o&&(s=u,o=r[i*e+u])}s>0&&n.push(s)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},zh=function(e,r,a){for(var n=Js(e,r,a),i=0;i<a.length;i++){for(var s=[],o=0;o<n.length;o++)n[o]===a[i]&&s.push(o);for(var l=-1,u=-1/0,f=0;f<s.length;f++){for(var h=0,c=0;c<s.length;c++)h+=r[s[c]*e+s[f]];h>u&&(l=f,u=h)}a[i]=s[l]}return n=Js(e,r,a),n},js=function(e){for(var r=this.cy(),a=this.nodes(),n=kh(e),i={},s=0;s<a.length;s++)i[a[s].id()]=s;var o,l,u,f,h,c;o=a.length,l=o*o,u=new Array(l);for(var d=0;d<l;d++)u[d]=-1/0;for(var v=0;v<o;v++)for(var p=0;p<o;p++)v!==p&&(u[v*o+p]=Ph(n.distance,a[v],a[p],n.attributes));f=Bh(u,n.preference);for(var y=0;y<o;y++)u[y*o+y]=f;h=new Array(l);for(var g=0;g<l;g++)h[g]=0;c=new Array(l);for(var m=0;m<l;m++)c[m]=0;for(var b=new Array(o),x=new Array(o),M=new Array(o),O=0;O<o;O++)b[O]=0,x[O]=0,M[O]=0;for(var T=new Array(o*n.minIterations),k=0;k<T.length;k++)T[k]=0;var D;for(D=0;D<n.maxIterations;D++){for(var F=0;F<o;F++){for(var G=-1/0,I=-1/0,H=-1,z=0,re=0;re<o;re++)b[re]=h[F*o+re],z=c[F*o+re]+u[F*o+re],z>=G?(I=G,G=z,H=re):z>I&&(I=z);for(var X=0;X<o;X++)h[F*o+X]=(1-n.damping)*(u[F*o+X]-G)+n.damping*b[X];h[F*o+H]=(1-n.damping)*(u[F*o+H]-I)+n.damping*b[H]}for(var K=0;K<o;K++){for(var ie=0,fe=0;fe<o;fe++)b[fe]=c[fe*o+K],x[fe]=Math.max(0,h[fe*o+K]),ie+=x[fe];ie-=x[K],x[K]=h[K*o+K],ie+=x[K];for(var ve=0;ve<o;ve++)c[ve*o+K]=(1-n.damping)*Math.min(0,ie-x[ve])+n.damping*b[ve];c[K*o+K]=(1-n.damping)*(ie-x[K])+n.damping*b[K]}for(var oe=0,ce=0;ce<o;ce++){var de=c[ce*o+ce]+h[ce*o+ce]>0?1:0;T[D%n.minIterations*o+ce]=de,oe+=de}if(oe>0&&(D>=n.minIterations-1||D==n.maxIterations-1)){for(var xe=0,pe=0;pe<o;pe++){M[pe]=0;for(var ge=0;ge<n.minIterations;ge++)M[pe]+=T[ge*o+pe];(M[pe]===0||M[pe]===n.minIterations)&&xe++}if(xe===o)break}}for(var ae=Fh(o,h,c),we=zh(o,u,ae),Te={},Ae=0;Ae<ae.length;Ae++)Te[ae[Ae]]=[];for(var Oe=0;Oe<a.length;Oe++){var Ye=i[a[Oe].id()],He=we[Ye];He!=null&&Te[He].push(a[Oe])}for(var Me=new Array(ae.length),Ne=0;Ne<ae.length;Ne++)Me[Ne]=r.collection(Te[ae[Ne]]);return Me},Gh={affinityPropagation:js,ap:js},Vh=Lt({root:void 0,directed:!1}),$h={hierholzer:function(e){if(!C(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Vh(e),n=a.root,i=a.directed,s=this,o=!1,l,u,f;n&&(f=ee(n)?this.filter(n)[0].id():n[0].id());var h={},c={};i?s.forEach(function(m){var b=m.id();if(m.isNode()){var x=m.indegree(!0),M=m.outdegree(!0),O=x-M,T=M-x;O==1?l?o=!0:l=b:T==1?u?o=!0:u=b:(T>1||O>1)&&(o=!0),h[b]=[],m.outgoers().forEach(function(k){k.isEdge()&&h[b].push(k.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var x=m.degree(!0);x%2&&(l?u?o=!0:u=b:l=b),h[b]=[],m.connectedEdges().forEach(function(M){return h[b].push(M.id())})}else c[b]=[m.source().id(),m.target().id()]});var d={found:!1,trail:void 0};if(o)return d;if(u&&l)if(i){if(f&&u!=f)return d;f=u}else{if(f&&u!=f&&l!=f)return d;f||(f=u)}else f||(f=s[0].id());var v=function(b){for(var x=b,M=[b],O,T,k;h[x].length;)O=h[x].shift(),T=c[O][0],k=c[O][1],x!=k?(h[k]=h[k].filter(function(D){return D!=O}),x=k):!i&&x!=T&&(h[T]=h[T].filter(function(D){return D!=O}),x=T),M.unshift(O),M.unshift(x);return M},p=[],y=[];for(y=v(f);y.length!=1;)h[y[0]].length==0?(p.unshift(s.getElementById(y.shift())),p.unshift(s.getElementById(y.shift()))):y=v(y.shift()).concat(y);p.unshift(s.getElementById(y.shift()));for(var g in h)if(h[g].length)return d;return d.found=!0,d.trail=this.spawn(p,!0),d}},Ln=function(){var e=this,r={},a=0,n=0,i=[],s=[],o={},l=function(c,d){for(var v=s.length-1,p=[],y=e.spawn();s[v].x!=c||s[v].y!=d;)p.push(s.pop().edge),v--;p.push(s.pop().edge),p.forEach(function(g){var m=g.connectedNodes().intersection(e);y.merge(g),m.forEach(function(b){var x=b.id(),M=b.connectedEdges().intersection(e);y.merge(b),r[x].cutVertex?y.merge(M.filter(function(O){return O.isLoop()})):y.merge(M)})}),i.push(y)},u=function h(c,d,v){c===v&&(n+=1),r[d]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(d).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(d)));else{var y,g,m,b;p.forEach(function(x){y=x.source().id(),g=x.target().id(),m=y===d?g:y,m!==v&&(b=x.id(),o[b]||(o[b]=!0,s.push({x:d,y:m,edge:x})),m in r?r[d].low=Math.min(r[d].low,r[m].id):(h(c,m,d),r[d].low=Math.min(r[d].low,r[m].low),r[d].id<=r[m].low&&(r[d].cutVertex=!0,l(d,m))))})}};e.forEach(function(h){if(h.isNode()){var c=h.id();c in r||(n=0,u(c,c),r[c].cutVertex=n>1)}});var f=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},_h={hopcroftTarjanBiconnected:Ln,htbc:Ln,htb:Ln,hopcroftTarjanBiconnectedComponents:Ln},An=function(){var e=this,r={},a=0,n=[],i=[],s=e.spawn(e),o=function l(u){i.push(u),r[u]={index:a,low:a++,explored:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.forEach(function(p){var y=p.target().id();y!==u&&(y in r||l(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var h=e.spawn();;){var c=i.pop();if(h.merge(e.getElementById(c)),r[c].low=r[u].index,r[c].explored=!0,c===u)break}var d=h.edgesWith(h),v=h.merge(d);n.push(v),s=s.difference(v)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:n}},Uh={tarjanStronglyConnected:An,tsc:An,tscc:An,tarjanStronglyConnectedComponents:An},eo={};[ka,bf,Ef,xf,Cf,Sf,Of,eh,ia,sa,wi,vh,Sh,Ih,Gh,$h,_h,Uh].forEach(function(t){$e(eo,t)});var to=0,ro=1,ao=2,pr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=to,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};pr.prototype={fulfill:function(e){return no(this,ro,"fulfillValue",e)},reject:function(e){return no(this,ao,"rejectReason",e)},then:function(e,r){var a=this,n=new pr;return a.onFulfilled.push(oo(e,n,"fulfill")),a.onRejected.push(oo(r,n,"reject")),io(a),n.proxy}};var no=function(e,r,a,n){return e.state===to&&(e.state=r,e[a]=n,io(e)),e},io=function(e){e.state===ro?so(e,"onFulfilled",e.fulfillValue):e.state===ao&&so(e,"onRejected",e.rejectReason)},so=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=function(){for(var o=0;o<n.length;o++)n[o](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},oo=function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(s){r.reject(s);return}Yh(r,i)}}},Yh=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(W(r)==="object"&&r!==null||typeof r=="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(i){n||(n=!0,i===r?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(r)};pr.all=function(t){return new pr(function(e,r){for(var a=new Array(t.length),n=0,i=function(l,u){a[l]=u,n++,n===t.length&&e(a)},s=0;s<t.length;s++)(function(o){var l=t[o],u=l!=null&&l.then!=null;if(u)l.then(function(h){i(o,h)},function(h){r(h)});else{var f=l;i(o,f)}})(s)})},pr.resolve=function(t){return new pr(function(e,r){e(t)})},pr.reject=function(t){return new pr(function(e,r){r(t)})};var ua=typeof Promise<"u"?Promise:pr,Ci=function(e,r,a){var n=Ge(e),i=!n,s=this._private=$e({duration:1e3},r,a);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&ne(s.complete)&&s.completes.push(s.complete),i){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(n){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},$r=Ci.prototype;$e($r,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;e.queue?r=a.queue:r=a.current,r.push(this),se(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;return e===void 0?r.progress:(a&&this.pause(),r.progress=e,r.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(u,f){var h=e[u];h!=null&&(e[u]=e[f],e[f]=h)};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],s=i.name,o=e.startStyle[s];e.startStyle[s]=i,e.style[n]=o}return r&&this.play(),this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new ua(function(n,i){a.push(function(){n()})})}}),$r.complete=$r.completed,$r.run=$r.play,$r.running=$r.playing;var Hh={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=n[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<n.length;s++){var o=n[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this}},animation:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this,l=!i,u=!l;if(!o.styleEnabled())return this;var f=o.style();r=$e({},r,a);var h=Object.keys(r).length===0;if(h)return new Ci(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var c=r.renderedPosition,d=o.pan(),v=o.zoom();r.position=Os(c,v,d)}if(l&&r.panBy!=null){var p=r.panBy,y=o.pan();r.pan={x:y.x+p.x,y:y.y+p.y}}var g=r.center||r.centre;if(l&&g!=null){var m=o.getCenterPan(g.eles,r.zoom);m!=null&&(r.pan=m)}if(l&&r.fit!=null){var b=r.fit,x=o.getFitViewport(b.eles||b.boundingBox,b.padding);x!=null&&(r.pan=x.pan,r.zoom=x.zoom)}if(l&&C(r.zoom)){var M=o.getZoomedViewport(r.zoom);M!=null?(M.zoomed&&(r.zoom=M.zoom),M.panned&&(r.pan=M.pan)):r.zoom=null}return new Ci(s[0],r)}},animate:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;a&&(r=$e({},r,a));for(var l=0;l<s.length;l++){var u=s[l],f=u.animated()&&(r.queue===void 0||r.queue),h=u.animation(r,f?{queue:!0}:void 0);h.play()}return this}},stop:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var u=s[l],f=u._private,h=f.animation.current,c=0;c<h.length;c++){var d=h[c],v=d._private;a&&(v.duration=0)}r&&(f.animation.queue=[]),a||(f.animation.current=[])}return o.notify("draw"),this}}},Xh=Array.isArray,On=Xh,Wh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qh=/^\w*$/;function Kh(t,e){if(On(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Na(t)?!0:qh.test(t)||!Wh.test(t)||e!=null&&t in Object(e)}var Zh=Kh,Qh="[object AsyncFunction]",Jh="[object Function]",jh="[object GeneratorFunction]",ec="[object Proxy]";function tc(t){if(!Br(t))return!1;var e=gs(t);return e==Jh||e==jh||e==Qh||e==ec}var rc=tc,ac=dn["__core-js_shared__"],Di=ac,uo=function(){var t=/[^.]+$/.exec(Di&&Di.keys&&Di.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function nc(t){return!!uo&&uo in t}var ic=nc,sc=Function.prototype,oc=sc.toString;function uc(t){if(t!=null){try{return oc.call(t)}catch{}try{return t+""}catch{}}return""}var lc=uc,fc=/[\\^$.*+?()[\]{}|]/g,hc=/^\[object .+?Constructor\]$/,cc=Function.prototype,vc=Object.prototype,dc=cc.toString,gc=vc.hasOwnProperty,pc=RegExp("^"+dc.call(gc).replace(fc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yc(t){if(!Br(t)||ic(t))return!1;var e=rc(t)?pc:hc;return e.test(lc(t))}var mc=yc;function bc(t,e){return t?.[e]}var Ec=bc;function wc(t,e){var r=Ec(t,e);return mc(r)?r:void 0}var Si=wc,xc=Si(Object,"create"),$a=xc;function Tc(){this.__data__=$a?$a(null):{},this.size=0}var Cc=Tc;function Dc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Sc=Dc,Lc="__lodash_hash_undefined__",Ac=Object.prototype,Oc=Ac.hasOwnProperty;function Nc(t){var e=this.__data__;if($a){var r=e[t];return r===Lc?void 0:r}return Oc.call(e,t)?e[t]:void 0}var Mc=Nc,Ic=Object.prototype,Rc=Ic.hasOwnProperty;function kc(t){var e=this.__data__;return $a?e[t]!==void 0:Rc.call(e,t)}var Pc=kc,Bc="__lodash_hash_undefined__";function Fc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=$a&&e===void 0?Bc:e,this}var zc=Fc;function la(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}la.prototype.clear=Cc,la.prototype.delete=Sc,la.prototype.get=Mc,la.prototype.has=Pc,la.prototype.set=zc;var lo=la;function Gc(){this.__data__=[],this.size=0}var Vc=Gc;function $c(t,e){return t===e||t!==t&&e!==e}var fo=$c;function _c(t,e){for(var r=t.length;r--;)if(fo(t[r][0],e))return r;return-1}var Nn=_c,Uc=Array.prototype,Yc=Uc.splice;function Hc(t){var e=this.__data__,r=Nn(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():Yc.call(e,r,1),--this.size,!0}var Xc=Hc;function Wc(t){var e=this.__data__,r=Nn(e,t);return r<0?void 0:e[r][1]}var qc=Wc;function Kc(t){return Nn(this.__data__,t)>-1}var Zc=Kc;function Qc(t,e){var r=this.__data__,a=Nn(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}var Jc=Qc;function fa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}fa.prototype.clear=Vc,fa.prototype.delete=Xc,fa.prototype.get=qc,fa.prototype.has=Zc,fa.prototype.set=Jc;var jc=fa,ev=Si(dn,"Map"),tv=ev;function rv(){this.size=0,this.__data__={hash:new lo,map:new(tv||jc),string:new lo}}var av=rv;function nv(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var iv=nv;function sv(t,e){var r=t.__data__;return iv(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Mn=sv;function ov(t){var e=Mn(this,t).delete(t);return this.size-=e?1:0,e}var uv=ov;function lv(t){return Mn(this,t).get(t)}var fv=lv;function hv(t){return Mn(this,t).has(t)}var cv=hv;function vv(t,e){var r=Mn(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}var dv=vv;function ha(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}ha.prototype.clear=av,ha.prototype.delete=uv,ha.prototype.get=fv,ha.prototype.has=cv,ha.prototype.set=dv;var ho=ha,gv="Expected a function";function Li(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(gv);var r=function(){var a=arguments,n=e?e.apply(this,a):a[0],i=r.cache;if(i.has(n))return i.get(n);var s=t.apply(this,a);return r.cache=i.set(n,s)||i,s};return r.cache=new(Li.Cache||ho),r}Li.Cache=ho;var pv=Li,yv=500;function mv(t){var e=pv(t,function(a){return r.size===yv&&r.clear(),a}),r=e.cache;return e}var bv=mv,Ev=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wv=/\\(\\)?/g,xv=bv(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ev,function(r,a,n,i){e.push(n?i.replace(wv,"$1"):a||r)}),e}),co=xv;function Tv(t,e){for(var r=-1,a=t==null?0:t.length,n=Array(a);++r<a;)n[r]=e(t[r],r,t);return n}var vo=Tv,Cv=1/0,go=jr?jr.prototype:void 0,po=go?go.toString:void 0;function yo(t){if(typeof t=="string")return t;if(On(t))return vo(t,yo)+"";if(Na(t))return po?po.call(t):"";var e=t+"";return e=="0"&&1/t==-Cv?"-0":e}var Dv=yo;function Sv(t){return t==null?"":Dv(t)}var mo=Sv;function Lv(t,e){return On(t)?t:Zh(t,e)?[t]:co(mo(t))}var bo=Lv,Av=1/0;function Ov(t){if(typeof t=="string"||Na(t))return t;var e=t+"";return e=="0"&&1/t==-Av?"-0":e}var Ai=Ov;function Nv(t,e){e=bo(e,t);for(var r=0,a=e.length;t!=null&&r<a;)t=t[Ai(e[r++])];return r&&r==a?t:void 0}var Mv=Nv;function Iv(t,e,r){var a=t==null?void 0:Mv(t,e);return a===void 0?r:a}var Rv=Iv,kv=function(){try{var t=Si(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Eo=kv;function Pv(t,e,r){e=="__proto__"&&Eo?Eo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Bv=Pv,Fv=Object.prototype,zv=Fv.hasOwnProperty;function Gv(t,e,r){var a=t[e];(!(zv.call(t,e)&&fo(a,r))||r===void 0&&!(e in t))&&Bv(t,e,r)}var Vv=Gv,$v=9007199254740991,_v=/^(?:0|[1-9]\d*)$/;function Uv(t,e){var r=typeof t;return e=e??$v,!!e&&(r=="number"||r!="symbol"&&_v.test(t))&&t>-1&&t%1==0&&t<e}var Yv=Uv;function Hv(t,e,r,a){if(!Br(t))return t;e=bo(e,t);for(var n=-1,i=e.length,s=i-1,o=t;o!=null&&++n<i;){var l=Ai(e[n]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(n!=s){var f=o[l];u=a?a(f,l,o):void 0,u===void 0&&(u=Br(f)?f:Yv(e[n+1])?[]:{})}Vv(o,l,u),o=o[l]}return t}var Xv=Hv;function Wv(t,e,r){return t==null?t:Xv(t,e,r)}var qv=Wv;function Kv(t,e){var r=-1,a=t.length;for(e||(e=Array(a));++r<a;)e[r]=t[r];return e}var Zv=Kv;function Qv(t){return On(t)?vo(t,Ai):Na(t)?[t]:Zv(co(mo(t)))}var Jv=Qv,jv={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,i){},onSet:function(n){},canSet:function(n){return!0}};return e=$e({},r,e),function(n,i){var s=e,o=this,l=o.length!==void 0,u=l?o:[o],f=l?o[0]:o;if(ee(n)){var h=n.indexOf(".")!==-1,c=h&&Jv(n);if(s.allowGetting&&i===void 0){var d;return f&&(s.beforeGet(f),c&&f._private[s.field][n]===void 0?d=Rv(f._private[s.field],c):d=f._private[s.field][n]),d}else if(s.allowSetting&&i!==void 0){var v=!s.immutableKeys[n];if(v){var p=E({},n,i);s.beforeSet(o,p);for(var y=0,g=u.length;y<g;y++){var m=u[y];s.canSet(m)&&(c&&f._private[s.field][n]===void 0?qv(m._private[s.field],c,i):m._private[s.field][n]=i)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&C(n)){var b=n,x,M,O=Object.keys(b);s.beforeSet(o,b);for(var T=0;T<O.length;T++){x=O[T],M=b[x];var k=!s.immutableKeys[x];if(k)for(var D=0;D<u.length;D++){var F=u[D];s.canSet(F)&&(F._private[s.field][x]=M)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&ne(n)){var G=n;o.on(s.bindingEvent,G)}else if(s.allowGetting&&n===void 0){var I;return f&&(s.beforeGet(f),I=f._private[s.field]),I}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=$e({},r,e),function(n){var i=e,s=this,o=s.length!==void 0,l=o?s:[s];if(ee(n)){for(var u=n.split(/\s+/),f=u.length,h=0;h<f;h++){var c=u[h];if(!Ue(c)){var d=!i.immutableKeys[c];if(d)for(var v=0,p=l.length;v<p;v++)l[v]._private[i.field][c]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(n===void 0){for(var y=0,g=l.length;y<g;y++)for(var m=l[y]._private[i.field],b=Object.keys(m),x=0;x<b.length;x++){var M=b[x],O=!i.immutableKeys[M];O&&(m[M]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},ed={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var i=this,s=Array.prototype.slice.call(arguments,0);return new ua(function(o,l){var u=function(d){i.off.apply(i,h),o(d)},f=s.concat([u]),h=f.concat([]);i.on.apply(i,f)})}}},ft={};[Hh,jv,ed].forEach(function(t){$e(ft,t)});var td={animate:ft.animate(),animation:ft.animation(),animated:ft.animated(),clearQueue:ft.clearQueue(),delay:ft.delay(),delayAnimation:ft.delayAnimation(),stop:ft.stop()},In={classes:function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(v){return a.push(v)}),a}else be(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new ta(e),s=0;s<r.length;s++){for(var o=r[s],l=o._private,u=l.classes,f=!1,h=0;h<e.length;h++){var c=e[h],d=u.has(c);if(!d){f=!0;break}}f||(f=u.size!==e.length),f&&(l.classes=i,n.push(o))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){be(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],s=0,o=a.length;s<o;s++)for(var l=a[s],u=l._private.classes,f=!1,h=0;h<e.length;h++){var c=e[h],d=u.has(c),v=!1;r||n&&!d?(u.add(c),v=!0):(!r||n&&d)&&(u.delete(c),v=!0),!f&&v&&(i.push(l),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a}};In.className=In.classNames=In.classes;var at={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:qe,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};at.variable="(?:[\\w-.]|(?:\\\\"+at.metaChar+"))+",at.className="(?:[\\w-]|(?:\\\\"+at.metaChar+"))+",at.value=at.string+"|"+at.number,at.id=at.variable,function(){var t,e,r;for(t=at.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],at.comparatorOp+="|@"+e;for(t=at.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(at.comparatorOp+="|\\!"+e)}();var dt=function(){return{checks:[]}},Re={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Oi=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return jt(t.selector,e.selector)}),rd=function(){for(var t={},e,r=0;r<Oi.length;r++)e=Oi[r],t[e.selector]=e.matches;return t}(),ad=function(e,r){return rd[e](r)},nd="("+Oi.map(function(t){return t.selector}).join("|")+")",ca=function(e){return e.replace(new RegExp("\\\\("+at.metaChar+")","g"),function(r,a){return a})},Sr=function(e,r,a){e[e.length-1]=a},Ni=[{name:"group",query:!0,regex:"("+at.group+")",populate:function(e,r,a){var n=w(a,1),i=n[0];r.checks.push({type:Re.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:nd,populate:function(e,r,a){var n=w(a,1),i=n[0];r.checks.push({type:Re.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+at.id+")",populate:function(e,r,a){var n=w(a,1),i=n[0];r.checks.push({type:Re.ID,value:ca(i)})}},{name:"className",query:!0,regex:"\\.("+at.className+")",populate:function(e,r,a){var n=w(a,1),i=n[0];r.checks.push({type:Re.CLASS,value:ca(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+at.variable+")\\s*\\]",populate:function(e,r,a){var n=w(a,1),i=n[0];r.checks.push({type:Re.DATA_EXIST,field:ca(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+at.variable+")\\s*("+at.comparatorOp+")\\s*("+at.value+")\\s*\\]",populate:function(e,r,a){var n=w(a,3),i=n[0],s=n[1],o=n[2],l=new RegExp("^"+at.string+"$").exec(o)!=null;l?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:Re.DATA_COMPARE,field:ca(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+at.boolOp+")\\s*("+at.variable+")\\s*\\]",populate:function(e,r,a){var n=w(a,2),i=n[0],s=n[1];r.checks.push({type:Re.DATA_BOOL,field:ca(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+at.meta+")\\s*("+at.comparatorOp+")\\s*("+at.number+")\\s*\\]\\]",populate:function(e,r,a){var n=w(a,3),i=n[0],s=n[1],o=n[2];r.checks.push({type:Re.META_COMPARE,field:ca(i),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:at.separator,populate:function(e,r){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,s=e[e.length-1];a!=null&&(s.subject=a,e.currentSubject=null),s.edgeCount=n,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=dt();return o}},{name:"directedEdge",separator:!0,regex:at.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=dt(),n=r,i=dt();return a.checks.push({type:Re.DIRECTED_EDGE,source:n,target:i}),Sr(e,r,a),e.edgeCount++,i}else{var s=dt(),o=r,l=dt();return s.checks.push({type:Re.NODE_SOURCE,source:o,target:l}),Sr(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:at.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=dt(),n=r,i=dt();return a.checks.push({type:Re.UNDIRECTED_EDGE,nodes:[n,i]}),Sr(e,r,a),e.edgeCount++,i}else{var s=dt(),o=r,l=dt();return s.checks.push({type:Re.NODE_NEIGHBOR,node:o,neighbor:l}),Sr(e,r,s),l}}},{name:"child",separator:!0,regex:at.child,populate:function(e,r){if(e.currentSubject==null){var a=dt(),n=dt(),i=e[e.length-1];return a.checks.push({type:Re.CHILD,parent:i,child:n}),Sr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var s=dt(),o=e[e.length-1],l=dt(),u=dt(),f=dt(),h=dt();return s.checks.push({type:Re.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Re.TRUE}],h.checks.push({type:Re.TRUE}),l.checks.push({type:Re.PARENT,parent:h,child:f}),Sr(e,o,s),e.currentSubject=u,e.compoundCount++,f}else{var c=dt(),d=dt(),v=[{type:Re.PARENT,parent:c,child:d}];return c.checks=r.checks,r.checks=v,e.compoundCount++,d}}},{name:"descendant",separator:!0,regex:at.descendant,populate:function(e,r){if(e.currentSubject==null){var a=dt(),n=dt(),i=e[e.length-1];return a.checks.push({type:Re.DESCENDANT,ancestor:i,descendant:n}),Sr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var s=dt(),o=e[e.length-1],l=dt(),u=dt(),f=dt(),h=dt();return s.checks.push({type:Re.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:Re.TRUE}],h.checks.push({type:Re.TRUE}),l.checks.push({type:Re.ANCESTOR,ancestor:h,descendant:f}),Sr(e,o,s),e.currentSubject=u,e.compoundCount++,f}else{var c=dt(),d=dt(),v=[{type:Re.ANCESTOR,ancestor:c,descendant:d}];return c.checks=r.checks,r.checks=v,e.compoundCount++,d}}},{name:"subject",modifier:!0,regex:at.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return ot("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;i===Re.DIRECTED_EDGE?n.type=Re.NODE_TARGET:i===Re.UNDIRECTED_EDGE&&(n.type=Re.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Ni.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var id=function(e){for(var r,a,n,i=0;i<Ni.length;i++){var s=Ni[i],o=s.name,l=e.match(s.regexObj);if(l!=null){a=l,r=s,n=o;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:a,name:n,remaining:e}},sd=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},od=function(e){var r=this,a=r.inputText=e,n=r[0]=dt();for(r.length=1,a=sd(a);;){var i=id(a);if(i.expr==null)return ot("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),o=i.expr.populate(r,n,s);if(o===!1)return!1;if(o!=null&&(n=o),a=i.remaining,a.match(/^\s*$/))break}var l=r[r.length-1];r.currentSubject!=null&&(l.subject=r.currentSubject),l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var f=r[u];if(f.compoundCount>0&&f.edgeCount>0)return ot("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return ot("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&ot("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},ud=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return ee(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var c=f.type,d=f.value;switch(c){case Re.GROUP:{var v=e(d);return v.substring(0,v.length-1)}case Re.DATA_COMPARE:{var p=f.field,y=f.operator;return"["+p+a(e(y))+r(d)+"]"}case Re.DATA_BOOL:{var g=f.operator,m=f.field;return"["+e(g)+m+"]"}case Re.DATA_EXIST:{var b=f.field;return"["+b+"]"}case Re.META_COMPARE:{var x=f.operator,M=f.field;return"[["+M+a(e(x))+r(d)+"]]"}case Re.STATE:return d;case Re.ID:return"#"+d;case Re.CLASS:return"."+d;case Re.PARENT:case Re.CHILD:return i(f.parent,h)+a(">")+i(f.child,h);case Re.ANCESTOR:case Re.DESCENDANT:return i(f.ancestor,h)+" "+i(f.descendant,h);case Re.COMPOUND_SPLIT:{var O=i(f.left,h),T=i(f.subject,h),k=i(f.right,h);return O+(O.length>0?" ":"")+T+k}case Re.TRUE:return""}},i=function(f,h){return f.checks.reduce(function(c,d,v){return c+(h===f&&v===0?"$":"")+n(d,h)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=i(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},ld={parse:od,toString:ud},wo=function(e,r,a){var n,i=ee(e),s=N(e),o=ee(a),l,u,f=!1,h=!1,c=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),h=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||o||f)&&(l=!i&&!s?"":""+e,u=""+a),f&&(e=l=l.toLowerCase(),a=u=u.toLowerCase()),r){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e<a;break;case"<=":c=!0,n=e<=a;break;default:n=!1;break}return h&&(e!=null||!c)&&(n=!n),n},fd=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},hd=function(e){return e!==void 0},Mi=function(e,r){return e.data(r)},cd=function(e,r){return e[r]()},wt=[],mt=function(e,r){return e.checks.every(function(a){return wt[a.type](a,r)})};wt[Re.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},wt[Re.STATE]=function(t,e){var r=t.value;return ad(r,e)},wt[Re.ID]=function(t,e){var r=t.value;return e.id()===r},wt[Re.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},wt[Re.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return wo(cd(e,r),a,n)},wt[Re.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return wo(Mi(e,r),a,n)},wt[Re.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return fd(Mi(e,r),a)},wt[Re.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,hd(Mi(e,r))},wt[Re.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return mt(r,n)&&mt(a,i)||mt(a,n)&&mt(r,i)},wt[Re.NODE_NEIGHBOR]=function(t,e){return mt(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&mt(t.neighbor,r)})},wt[Re.DIRECTED_EDGE]=function(t,e){return mt(t.source,e.source())&&mt(t.target,e.target())},wt[Re.NODE_SOURCE]=function(t,e){return mt(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&mt(t.target,r)})},wt[Re.NODE_TARGET]=function(t,e){return mt(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&mt(t.source,r)})},wt[Re.CHILD]=function(t,e){return mt(t.child,e)&&mt(t.parent,e.parent())},wt[Re.PARENT]=function(t,e){return mt(t.parent,e)&&e.children().some(function(r){return mt(t.child,r)})},wt[Re.DESCENDANT]=function(t,e){return mt(t.descendant,e)&&e.ancestors().some(function(r){return mt(t.ancestor,r)})},wt[Re.ANCESTOR]=function(t,e){return mt(t.ancestor,e)&&e.descendants().some(function(r){return mt(t.descendant,r)})},wt[Re.COMPOUND_SPLIT]=function(t,e){return mt(t.subject,e)&&mt(t.left,e)&&mt(t.right,e)},wt[Re.TRUE]=function(){return!0},wt[Re.COLLECTION]=function(t,e){var r=t.value;return r.has(e)},wt[Re.FILTER]=function(t,e){var r=t.value;return r(e)};var vd=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Re.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(i){for(var s=0;s<r.length;s++){var o=r[s];if(mt(o,i))return!0}return!1};return r.text()==null&&(a=function(){return!0}),e.filter(a)},dd=function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(mt(n,e))return!0}return!1},gd={matches:dd,filter:vd},Lr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||ee(e)&&e.match(/^\s*$/)||(se(e)?this.addQuery({checks:[{type:Re.COLLECTION,value:e.collection()}]}):ne(e)?this.addQuery({checks:[{type:Re.FILTER,value:e}]}):ee(e)?this.parse(e)||(this.invalid=!0):Et("A selector must be created from a string; found "))},Ar=Lr.prototype;[ld,gd].forEach(function(t){return $e(Ar,t)}),Ar.text=function(){return this.inputText},Ar.size=function(){return this.length},Ar.eq=function(t){return this[t]},Ar.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},Ar.addQuery=function(t){this[this.length++]=t},Ar.selector=Ar.toString;var Or={allAre:function(e){var r=new Lr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new Lr(e);return this.some(function(a){return r.matches(a)})},some:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,a=e.length;return r!==a?!1:r===1?this[0]===e[0]:this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})}};Or.allAreNeighbours=Or.allAreNeighbors,Or.has=Or.contains,Or.equal=Or.equals=Or.same;var Wt=function(e,r){return function(n,i,s,o){var l=n,u=this,f;if(l==null?f="":se(l)&&l.length===1&&(f=l.id()),u.length===1&&f){var h=u[0]._private,c=h.traversalCache=h.traversalCache||{},d=c[r]=c[r]||[],v=Fr(f),p=d[v];return p||(d[v]=e.call(u,n,i,s,o))}else return e.call(u,n,i,s,o)}},va={parent:function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n],s=i._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];r.push(i)}a=a.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,a=0;a<this.length;a++){var n=this[a],i=n.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Wt(function(t){for(var e=[],r=0;r<this.length;r++)for(var a=this[r],n=a._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function a(n){for(var i=0;i<n.length;i++){var s=n[i];r.push(s),s.children().nonempty()&&a(s.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function Ii(t,e,r,a){for(var n=[],i=new ta,s=t.cy(),o=s.hasCompoundNodes(),l=0;l<t.length;l++){var u=t[l];r?n.push(u):o&&a(n,i,u)}for(;n.length>0;){var f=n.shift();e(f),i.add(f.id()),o&&a(n,i,f)}return t}function xo(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||t.push(i)}}va.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ii(this,t,e,xo)};function To(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}va.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ii(this,t,e,To)};function pd(t,e,r){To(t,e,r),xo(t,e,r)}va.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ii(this,t,e,pd)},va.ancestors=va.parents;var _a,Co;_a=Co={data:ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ft.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ft.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},_a.attr=_a.data,_a.removeAttr=_a.removeData;var yd=Co,Rn={};function Ri(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var a=0,n=r[0],i=n._private.edges,s=0;s<i.length;s++){var o=i[s];!e&&o.isLoop()||(a+=t(n,o))}return a}else return}}$e(Rn,{degree:Ri(function(t,e){return e.source().same(e.target())?2:1}),indegree:Ri(function(t,e){return e.target().same(t)?1:0}),outdegree:Ri(function(t,e){return e.source().same(t)?1:0})});function da(t,e){return function(r){for(var a,n=this.nodes(),i=0;i<n.length;i++){var s=n[i],o=s[t](r);o!==void 0&&(a===void 0||e(o,a))&&(a=o)}return a}}$e(Rn,{minDegree:da("degree",function(t,e){return t<e}),maxDegree:da("degree",function(t,e){return t>e}),minIndegree:da("indegree",function(t,e){return t<e}),maxIndegree:da("indegree",function(t,e){return t>e}),minOutdegree:da("outdegree",function(t,e){return t<e}),maxOutdegree:da("outdegree",function(t,e){return t>e})}),$e(Rn,{totalDegree:function(e){for(var r=0,a=this.nodes(),n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var tr,Do,So=function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var s=i._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,a),i.dirtyBoundingBoxCache()}}},Lo={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){So(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};tr=Do={position:ft.data(Lo),silentPosition:ft.data($e({},Lo,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){So(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(C(e))r?this.silentPosition(e):this.position(e);else if(ne(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var s=this[i],o=void 0;(o=a(s,i))&&(r?s.silentPosition(o):s.position(o))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(C(e)?(n={x:N(e.x)?e.x:0,y:N(e.y)?e.y:0},a=r):ee(e)&&N(r)&&(n={x:0,y:0},n[e]=r),n!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var l=o.position(),u={x:l.x+n.x,y:l.y+n.y};a?o.silentPosition(u):o.position(u)}}i.endBatch()}return this},silentShift:function(e,r){return C(e)?this.shift(e,!0):ee(e)&&N(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),s=n.pan(),o=C(e)?e:void 0,l=o!==void 0||r!==void 0&&ee(e);if(a&&a.isNode())if(l)for(var u=0;u<this.length;u++){var f=this[u];r!==void 0?f.position(e,(r-s[e])/i):o!==void 0&&f.position(Os(o,i,s))}else{var h=a.position();return o=En(h,i,s),e===void 0?o:o[e]}else if(!l)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),i=C(e)?e:void 0,s=i!==void 0||r!==void 0&&ee(e),o=n.hasCompoundNodes();if(a&&a.isNode())if(s)for(var l=0;l<this.length;l++){var u=this[l],f=o?u.parent():null,h=f&&f.length>0,c=h;h&&(f=f[0]);var d=c?f.position():{x:0,y:0};r!==void 0?u.position(e,r+d[e]):i!==void 0&&u.position({x:i.x+d.x,y:i.y+d.y})}else{var v=a.position(),p=o?a.parent():null,y=p&&p.length>0,g=y;y&&(p=p[0]);var m=g?p.position():{x:0,y:0};return i={x:v.x-m.x,y:v.y-m.y},e===void 0?i:i[e]}else if(!s)return;return this}},tr.modelPosition=tr.point=tr.position,tr.modelPositions=tr.points=tr.positions,tr.renderedPoint=tr.renderedPosition,tr.relativePoint=tr.relativePosition;var md=Do,ga,Nr;ga=Nr={},Nr.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}},Nr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var a=r._private;a.compoundBoundsClean=!1,a.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},Nr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},h=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),c=o.position;(h.w===0||h.h===0)&&(h={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},h.x1=c.x-h.w/2,h.x2=c.x+h.w/2,h.y1=c.y-h.h/2,h.y2=c.y+h.h/2);function d(D,F,G){var I=0,H=0,z=F+G;return D>0&&z>0&&(I=F/z*D,H=G/z*D),{biasDiff:I,biasComplementDiff:H}}function v(D,F,G,I){if(G.units==="%")switch(I){case"width":return D>0?G.pfValue*D:0;case"height":return F>0?G.pfValue*F:0;case"average":return D>0&&F>0?G.pfValue*(D+F)/2:0;case"min":return D>0&&F>0?D>F?G.pfValue*F:G.pfValue*D:0;case"max":return D>0&&F>0?D>F?G.pfValue*D:G.pfValue*F:0;default:return 0}else return G.units==="px"?G.pfValue:0}var p=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var y=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(y=y*100/f.width.val);var g=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(g=g*100/f.height.val);var m=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(m=m*100/f.height.val);var b=d(f.width.val-h.w,p,y),x=b.biasDiff,M=b.biasComplementDiff,O=d(f.height.val-h.h,g,m),T=O.biasDiff,k=O.biasComplementDiff;o.autoPadding=v(h.w,h.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(h.w,f.width.val),c.x=(-x+h.x1+h.x2+M)/2,o.autoHeight=Math.max(h.h,f.height.val),c.y=(-T+h.y1+h.y2+k)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||t)&&(r(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var qt=function(e){return e===1/0||e===-1/0?0:e},rr=function(e,r,a,n,i){n-r===0||i-a===0||r==null||a==null||n==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},_r=function(e,r){return r==null?e:rr(e,r.x1,r.y1,r.x2,r.y2)},Ua=function(e,r,a){return er(e,r,a)},kn=function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,s=i.arrowWidth/2,o=r.pstyle(a+"-arrow-shape").value,l,u;if(o!=="none"){a==="source"?(l=i.srcX,u=i.srcY):a==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var f=n.arrowBounds=n.arrowBounds||{},h=f[a]=f[a]||{};h.x1=l-s,h.y1=u-s,h.x2=l+s,h.y2=u+s,h.w=h.x2-h.x1,h.h=h.y2-h.y1,xn(h,1),rr(e,h.x1,h.y1,h.x2,h.y2)}}},ki=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,s=i.rstyle,o=r.pstyle(n+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),f=Ua(s,"labelWidth",a),h=Ua(s,"labelHeight",a),c=Ua(s,"labelX",a),d=Ua(s,"labelY",a),v=r.pstyle(n+"text-margin-x").pfValue,p=r.pstyle(n+"text-margin-y").pfValue,y=r.isEdge(),g=r.pstyle(n+"text-rotation"),m=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,x=b/2,M=r.pstyle("text-background-padding").pfValue,O=2,T=h,k=f,D=k/2,F=T/2,G,I,H,z;if(y)G=c-D,I=c+D,H=d-F,z=d+F;else{switch(l.value){case"left":G=c-k,I=c;break;case"center":G=c-D,I=c+D;break;case"right":G=c,I=c+k;break}switch(u.value){case"top":H=d-T,z=d;break;case"center":H=d-F,z=d+F;break;case"bottom":H=d,z=d+T;break}}G+=v-Math.max(m,x)-M-O,I+=v+Math.max(m,x)+M+O,H+=p-Math.max(m,x)-M-O,z+=p+Math.max(m,x)+M+O;var re=a||"main",X=i.labelBounds,K=X[re]=X[re]||{};K.x1=G,K.y1=H,K.x2=I,K.y2=z,K.w=I-G,K.h=z-H;var ie=y&&g.strValue==="autorotate",fe=g.pfValue!=null&&g.pfValue!==0;if(ie||fe){var ve=ie?Ua(i.rstyle,"labelAngle",a):g.pfValue,oe=Math.cos(ve),ce=Math.sin(ve),de=(G+I)/2,xe=(H+z)/2;if(!y){switch(l.value){case"left":de=I;break;case"right":de=G;break}switch(u.value){case"top":xe=z;break;case"bottom":xe=H;break}}var pe=function(He,Me){return He=He-de,Me=Me-xe,{x:He*oe-Me*ce+de,y:He*ce+Me*oe+xe}},ge=pe(G,H),ae=pe(G,z),we=pe(I,H),Te=pe(I,z);G=Math.min(ge.x,ae.x,we.x,Te.x),I=Math.max(ge.x,ae.x,we.x,Te.x),H=Math.min(ge.y,ae.y,we.y,Te.y),z=Math.max(ge.y,ae.y,we.y,Te.y)}var Ae=re+"Rot",Oe=X[Ae]=X[Ae]||{};Oe.x1=G,Oe.y1=H,Oe.x2=I,Oe.y2=z,Oe.w=I-G,Oe.h=z-H,rr(e,G,H,I,z),rr(i.labelBounds.all,G,H,I,z)}return e}},bd=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=_t(),o=e._private,l=e.isNode(),u=e.isEdge(),f,h,c,d,v,p,y=o.rstyle,g=l&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(Be){return Be.pstyle("display").value!=="none"},b=!n||m(e)&&(!u||m(e.source())&&m(e.target()));if(b){var x=0,M=0;n&&r.includeOverlays&&(x=e.pstyle("overlay-opacity").value,x!==0&&(M=e.pstyle("overlay-padding").value));var O=0,T=0;n&&r.includeUnderlays&&(O=e.pstyle("underlay-opacity").value,O!==0&&(T=e.pstyle("underlay-padding").value));var k=Math.max(M,T),D=0,F=0;if(n&&(D=e.pstyle("width").pfValue,F=D/2),l&&r.includeNodes){var G=e.position();v=G.x,p=G.y;var I=e.outerWidth(),H=I/2,z=e.outerHeight(),re=z/2;f=v-H,h=v+H,c=p-re,d=p+re,rr(s,f,c,h,d)}else if(u&&r.includeEdges)if(n&&!i){var X=e.pstyle("curve-style").strValue;if(f=Math.min(y.srcX,y.midX,y.tgtX),h=Math.max(y.srcX,y.midX,y.tgtX),c=Math.min(y.srcY,y.midY,y.tgtY),d=Math.max(y.srcY,y.midY,y.tgtY),f-=F,h+=F,c-=F,d+=F,rr(s,f,c,h,d),X==="haystack"){var K=y.haystackPts;if(K&&K.length===2){if(f=K[0].x,c=K[0].y,h=K[1].x,d=K[1].y,f>h){var ie=f;f=h,h=ie}if(c>d){var fe=c;c=d,d=fe}rr(s,f-F,c-F,h+F,d+F)}}else if(X==="bezier"||X==="unbundled-bezier"||X==="segments"||X==="taxi"){var ve;switch(X){case"bezier":case"unbundled-bezier":ve=y.bezierPts;break;case"segments":case"taxi":ve=y.linePts;break}if(ve!=null)for(var oe=0;oe<ve.length;oe++){var ce=ve[oe];f=ce.x-F,h=ce.x+F,c=ce.y-F,d=ce.y+F,rr(s,f,c,h,d)}}}else{var de=e.source(),xe=de.position(),pe=e.target(),ge=pe.position();if(f=xe.x,h=ge.x,c=xe.y,d=ge.y,f>h){var ae=f;f=h,h=ae}if(c>d){var we=c;c=d,d=we}f-=F,h+=F,c-=F,d+=F,rr(s,f,c,h,d)}if(n&&r.includeEdges&&u&&(kn(s,e,"mid-source"),kn(s,e,"mid-target"),kn(s,e,"source"),kn(s,e,"target")),n){var Te=e.pstyle("ghost").value==="yes";if(Te){var Ae=e.pstyle("ghost-offset-x").pfValue,Oe=e.pstyle("ghost-offset-y").pfValue;rr(s,s.x1+Ae,s.y1+Oe,s.x2+Ae,s.y2+Oe)}}var Ye=o.bodyBounds=o.bodyBounds||{};Ms(Ye,s),gi(Ye,g),xn(Ye,1),n&&(f=s.x1,h=s.x2,c=s.y1,d=s.y2,rr(s,f-k,c-k,h+k,d+k));var He=o.overlayBounds=o.overlayBounds||{};Ms(He,s),gi(He,g),xn(He,1);var Me=o.labelBounds=o.labelBounds||{};Me.all!=null?Gf(Me.all):Me.all=_t(),n&&r.includeLabels&&(r.includeMainLabels&&ki(s,e,null),u&&(r.includeSourceLabels&&ki(s,e,"source"),r.includeTargetLabels&&ki(s,e,"target")))}return s.x1=qt(s.x1),s.y1=qt(s.y1),s.x2=qt(s.x2),s.y2=qt(s.y2),s.w=qt(s.x2-s.x1),s.h=qt(s.y2-s.y1),s.w>0&&s.h>0&&b&&(gi(s,g),xn(s,1)),s},Ao=function(e){var r=0,a=function(s){return(s?1:0)<<r++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n},Oo=function(e){if(e.isEdge()){var r=e.source().position(),a=e.target().position(),n=function(s){return Math.round(s)};return sf([n(r.x),n(r.y),n(a.x),n(a.y)])}else return 0},No=function(e,r){var a=e._private,n,i=e.isEdge(),s=r==null?Mo:Ao(r),o=s===Mo,l=Oo(e),u=a.bbCachePosKey===l,f=r.useCache&&u,h=function(p){return p._private.bbCache==null||p._private.styleDirty},c=!f||h(e)||i&&h(e.source())||h(e.target());if(c?(u||e.recalculateRenderedStyle(f),n=bd(e,Ya),a.bbCache=n,a.bbCachePosKey=l):n=a.bbCache,!o){var d=e.isNode();n=_t(),(r.includeNodes&&d||r.includeEdges&&!d)&&(r.includeOverlays?_r(n,a.overlayBounds):_r(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?_r(n,a.labelBounds.all):(r.includeMainLabels&&_r(n,a.labelBounds.mainRot),r.includeSourceLabels&&_r(n,a.labelBounds.sourceRot),r.includeTargetLabels&&_r(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ya={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},Mo=Ao(Ya),Io=Lt(Ya);Nr.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=Ya:t=Io(t),e=No(this[0],t);else{e=_t(),t=t||Ya;var r=Io(t),a=this,n=a.cy(),i=n.styleEnabled();if(i)for(var s=0;s<a.length;s++){var o=a[s],l=o._private,u=Oo(o),f=l.bbCachePosKey===u,h=r.useCache&&f&&!l.styleDirty;o.recalculateRenderedStyle(h)}this.updateCompoundBounds(!t.useCache);for(var c=0;c<a.length;c++){var d=a[c];_r(e,No(d,r))}}return e.x1=qt(e.x1),e.y1=qt(e.y1),e.x2=qt(e.x2),e.y2=qt(e.y2),e.w=qt(e.x2-e.x1),e.h=qt(e.y2-e.y1),e},Nr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},Nr.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(u){return u.isParent()}),e=e.not(n)),C(t)){var i=t;t=function(){return i}}var s=function(f,h){return f._private.bbAtOldPos=t(f,h)},o=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(s).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var l=zf(this.boundingBox({useCache:!1}));return e.silentPositions(o),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),l},ga.boundingbox=ga.bb=ga.boundingBox,ga.renderedBoundingbox=ga.renderedBoundingBox;var Ed=Nr,Ha,Xa;Ha=Xa={};var Ro=function(e){e.uppercaseName=Tt(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Tt(e.outerName),Ha[e.name]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var o=a.pstyle(e.name);switch(o.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},Ha["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){var o=a[e.name](),l=a.pstyle("border-width").pfValue,u=2*a.padding();return o+l+u}else return 1},Ha["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Ha["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};Ro({name:"width"}),Ro({name:"height"}),Xa.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},Xa.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Xa.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var wd=Xa,xd=function(e,r){if(e.isEdge())return r(e)},Td=function(e,r){if(e.isEdge()){var a=e.cy();return En(r(e),a.zoom(),a.pan())}},Cd=function(e,r){if(e.isEdge()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(s){return En(s,i,n)})}},Dd=function(e){return e.renderer().getControlPoints(e)},Sd=function(e){return e.renderer().getSegmentPoints(e)},Ld=function(e){return e.renderer().getSourceEndpoint(e)},Ad=function(e){return e.renderer().getTargetEndpoint(e)},Od=function(e){return e.renderer().getEdgeMidpoint(e)},ko={controlPoints:{get:Dd,mult:!0},segmentPoints:{get:Sd,mult:!0},sourceEndpoint:{get:Ld},targetEndpoint:{get:Ad},midpoint:{get:Od}},Nd=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Md=Object.keys(ko).reduce(function(t,e){var r=ko[e],a=Nd(e);return t[e]=function(){return xd(this,r.get)},r.mult?t[a]=function(){return Cd(this,r.get)}:t[a]=function(){return Td(this,r.get)},t},{}),Id=$e({},md,Ed,wd,Md);var Po=function(e,r){this.recycle(e,r)};function Wa(){return!1}function Pn(){return!0}Po.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Wa,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Pn:Wa):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Pn;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Pn;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Pn,this.stopPropagation()},isDefaultPrevented:Wa,isPropagationStopped:Wa,isImmediatePropagationStopped:Wa};var Bo=/^([^.]+)(\.(?:[^.]+))?$/,Rd=".*",Fo={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},zo=Object.keys(Fo),kd={};function Bn(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kd,e=arguments.length>1?arguments[1]:void 0,r=0;r<zo.length;r++){var a=zo[r];this[a]=t[a]||Fo[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Mr=Bn.prototype,Go=function(e,r,a,n,i,s,o){ne(n)&&(i=n,n=null),o&&(s==null?s=o:s=$e({},s,o));for(var l=be(a)?a:a.split(/\s+/),u=0;u<l.length;u++){var f=l[u];if(!Ue(f)){var h=f.match(Bo);if(h){var c=h[1],d=h[2]?h[2]:null,v=r(e,f,c,d,n,i,s);if(v===!1)break}}}},Vo=function(e,r){return e.addEventFields(e.context,r),new Po(r.type,r)},Pd=function(e,r,a){if(vt(a)){r(e,a);return}else if(C(a)){r(e,Vo(e,a));return}for(var n=be(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var s=n[i];if(!Ue(s)){var o=s.match(Bo);if(o){var l=o[1],u=o[2]?o[2]:null,f=Vo(e,{type:l,namespace:u,target:e.context});r(e,f)}}}};Mr.on=Mr.addListener=function(t,e,r,a,n){return Go(this,function(i,s,o,l,u,f,h){ne(f)&&i.listeners.push({event:s,callback:f,type:o,namespace:l,qualifier:u,conf:h})},t,e,r,a,n),this},Mr.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})},Mr.removeListener=Mr.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=hf(this.listeners));for(var i=this.listeners,s=function(u){var f=i[u];Go(n,function(h,c,d,v,p,y){if((f.type===d||t==="*")&&(!v&&f.namespace!==".*"||f.namespace===v)&&(!p||h.qualifierCompare(f.qualifier,p))&&(!y||f.callback===y))return i.splice(u,1),!1},t,e,r,a)},o=i.length-1;o>=0;o--)s(o);return this},Mr.removeAllListeners=function(){return this.removeListener("*")},Mr.emit=Mr.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,be(e)||(e=[e]),Pd(this,function(i,s){r!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],n=a.length);for(var o=function(f){var h=a[f];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===Rd)&&i.eventMatches(i.context,h,s)){var c=[s];e!=null&&vf(c,e),i.beforeEmit(i.context,h,s),h.conf&&h.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==h}));var d=i.callbackContext(i.context,h,s),v=h.callback.apply(d,c);i.afterEmit(i.context,h,s),v===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l<n;l++)o(l);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var Bd={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&Le(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Fn=function(e){return ee(e)?new Lr(e):e},$o={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new Bn(Bd,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Fn(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){for(var n=Fn(r),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,a){for(var n=Fn(r),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,n,a)}return this},once:function(e,r,a){for(var n=Fn(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,r){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};ft.eventAliasesOn($o);var _o={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(ee(e)||se(e))return new Lr(e).filter(this);if(ne(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var s=n[i],o=r?e.apply(r,[s,i,n]):e(s,i,n);o&&a.push(s)}return a}return this.spawn()},not:function(e){if(e){ee(e)&&(e=this.filter(e));for(var r=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||r.push(n)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(ee(e)){var r=e;return this.filter(r)}for(var a=this.spawn(),n=this,i=e,s=this.length<e.length,o=s?n:i,l=s?i:n,u=0;u<o.length;u++){var f=o[u];l.has(f)&&a.push(f)}return a},xor:function(e){var r=this._private.cy;ee(e)&&(e=r.$(e));var a=this.spawn(),n=this,i=e,s=function(l,u){for(var f=0;f<l.length;f++){var h=l[f],c=h._private.data.id,d=u.hasElementWithId(c);d||a.push(h)}};return s(n,i),s(i,n),a},diff:function(e){var r=this._private.cy;ee(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),s=this,o=e,l=function(f,h,c){for(var d=0;d<f.length;d++){var v=f[d],p=v._private.data.id,y=h.hasElementWithId(p);y?i.merge(v):c.push(v)}};return l(s,o,a),l(o,s,n),{left:a,right:n,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(ee(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],o=!this.has(s);o&&n.push(s)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&ee(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=r.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!i.has(l);if(u){var f=this.length++;this[f]=o,i.set(l,{ele:o,index:f})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&ee(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},map:function(e,r){for(var a=[],n=this,i=0;i<n.length;i++){var s=n[i],o=r?e.apply(r,[s,i,n]):e(s,i,n);a.push(o)}return a},reduce:function(e,r){for(var a=r,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,r){for(var a=-1/0,n,i=this,s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);l>a&&(a=l,n=o)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,i=this,s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);l<a&&(a=l,n=o)}return{value:a,ele:n}}},nt=_o;nt.u=nt["|"]=nt["+"]=nt.union=nt.or=nt.add,nt["\\"]=nt["!"]=nt["-"]=nt.difference=nt.relativeComplement=nt.subtract=nt.not,nt.n=nt["&"]=nt["."]=nt.and=nt.intersection=nt.intersect,nt["^"]=nt["(+)"]=nt["(-)"]=nt.symmetricDifference=nt.symdiff=nt.xor,nt.fnFilter=nt.filterFn=nt.stdFilter=nt.filter,nt.complement=nt.abscomp=nt.absoluteComplement;var Fd={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Uo=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function i(f){var h=f.pstyle("z-compound-depth");return h.value==="auto"?n?f.zDepth():0:h.value==="bottom"?-1:h.value==="top"?fi:0}var s=i(e)-i(r);if(s!==0)return s;function o(f){var h=f.pstyle("z-index-compare");return h.value==="auto"&&f.isNode()?1:0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},zn={forEach:function(e,r){if(ne(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],s=r?e.apply(r,[i,n,this]):e(i,n,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;r==null&&(r=n),e==null&&(e=0),e<0&&(e=n+e),r<0&&(r=n+r);for(var i=e;i>=0&&i<r&&i<n;i++)a.push(this[i]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!ne(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Uo)},zDepth:function(){var e=this[0];if(e){var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;return e.isParent()?n:fi-1}else{var i=r.source,s=r.target,o=i.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}}};zn.each=zn.forEach;var zd=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":W(Symbol))!=e&&W(Symbol.iterator)!=e;r&&(zn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return E({next:function(){return i<s?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};zd();var Gd=Lt({nodeDimensionsIncludeLabels:!1}),Gn={layoutDimensions:function(e){e=Gd(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(M){return!M.isParent()}),i=this.cy(),s=r.eles,o=function(O){return O.id()},l=lt(a,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(O,T,k){var D={x:T.x1+T.w/2,y:T.y1+T.h/2},F={x:(k.x-D.x)*O,y:(k.y-D.y)*O};return{x:D.x+F.x,y:D.y+F.y}},f=r.spacingFactor&&r.spacingFactor!==1,h=function(){if(!f)return null;for(var O=_t(),T=0;T<n.length;T++){var k=n[T],D=l(k,T);$f(O,D.x,D.y)}return O},c=h(),d=lt(function(M,O){var T=l(M,O);if(f){var k=Math.abs(r.spacingFactor);T=u(k,c,T)}return r.transform!=null&&(T=r.transform(M,T)),T},o);if(r.animate){for(var v=0;v<n.length;v++){var p=n[v],y=d(p,v),g=r.animateFilter==null||r.animateFilter(p,v);if(g){var m=p.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}else p.position(y)}if(r.fit){var b=i.animation({fit:{boundingBox:s.boundingBoxAt(d),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else if(r.zoom!==void 0&&r.pan!==void 0){var x=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(x)}e.animations.forEach(function(M){return M.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ua.all(e.animations.map(function(M){return M.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(d),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout($e({},e,{eles:this}))}};Gn.createLayout=Gn.makeLayout=Gn.layout;function Yo(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;return(i=n[t])!=null||(i=n[t]=e(r)),i}function Vn(t,e){return t=Fr(t),function(a){return Yo(t,e,a)}}function $n(t,e){t=Fr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return Yo(t,r,n)}}var At={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a;a=this.spawnSelf().merge(this.descendants()).merge(this.parents()),a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var a=r._private.batchStyleEles;return a.merge(this),this}var n=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){this.cleanStyle();var i=a._private.style[e];return i??(r?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},style:function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(C(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(ee(e))if(r===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var o=i[s];n.removeAllBypasses(o,a)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];n.removeBypasses(u,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!r)return i;var s=n.data.parent?a.parents():null;if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)return a?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function Pi(t,e){var r=t._private,a=r.data.parent?t.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function Bi(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],s=n.hasCompoundNodes();if(i){var o=i._private;if(!e(i))return!1;if(i.isNode())return!s||Pi(i,a);var l=o.source,u=o.target;return r(l)&&(!s||Pi(l,r))&&(l===u||r(u)&&(!s||Pi(u,r)))}}}var pa=Vn("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});At.takesUpSpace=$n("takesUpSpace",Bi({ok:pa}));var Vd=Vn("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&pa(t)}),$d=Vn("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&pa(t)});At.interactive=$n("interactive",Bi({ok:Vd,parentOk:$d,edgeOkViaNode:pa})),At.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var _d=Vn("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&pa(t)}),Ud=pa;At.visible=$n("visible",Bi({ok:_d,edgeOkViaNode:Ud})),At.hidden=function(){var t=this[0];if(t)return!t.visible()},At.isBundledBezier=$n("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),At.bypass=At.css=At.style,At.renderedCss=At.renderedStyle,At.removeBypass=At.removeCss=At.removeStyle,At.pstyle=At.parsedStyle;var Ir={};function Ho(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&ne(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&be(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],f=l._private[t.field]!=t.value;if(t.overrideAble){var h=t.overrideAble(l);if(h!==void 0&&(u=h,!h))return this}u&&(l._private[t.field]=t.value,f&&r.push(l))}var c=this.spawn(r);c.updateStyle(),c.emit(t.event),s&&c.emit(s)}return this}}function ya(t){Ir[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},Ir[t.on]=Ho({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Ir[t.off]=Ho({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}ya({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),ya({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),ya({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),ya({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),Ir.deselect=Ir.unselect,Ir.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},ya({field:"active",on:"activate",off:"unactivate"}),ya({field:"pannable",on:"panify",off:"unpanify"}),Ir.inactive=function(){var t=this[0];if(t)return!t._private.active};var kt={},Xo=function(e){return function(a){for(var n=this,i=[],s=0;s<n.length;s++){var o=n[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),f=0;f<u.length;f++){var h=u[f],c=h.source(),d=h.target();if(e.noIncomingEdges&&d===o&&c!==o||e.noOutgoingEdges&&c===o&&d!==o){l=!0;break}}l||i.push(o)}}return this.spawn(i,!0).filter(a)}},Wo=function(e){return function(r){for(var a=this,n=[],i=0;i<a.length;i++){var s=a[i];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],f=u.source(),h=u.target();e.outgoing&&f===s?(n.push(u),n.push(h)):e.incoming&&h===s&&(n.push(u),n.push(f))}}return this.spawn(n,!0).filter(r)}},qo=function(e){return function(r){for(var a=this,n=[],i={};;){var s=e.outgoing?a.outgoers():a.incomers();if(s.length===0)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],f=u.id();i[f]||(i[f]=!0,n.push(u),o=!0)}if(!o)break;a=s}return this.spawn(n,!0).filter(r)}};kt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},$e(kt,{roots:Xo({noIncomingEdges:!0}),leaves:Xo({noOutgoingEdges:!0}),outgoers:Wt(Wo({outgoing:!0}),"outgoers"),successors:qo({outgoing:!0}),incomers:Wt(Wo({incoming:!0}),"incomers"),predecessors:qo({incoming:!0})}),$e(kt,{neighborhood:Wt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],i=n.connectedEdges(),s=0;s<i.length;s++){var o=i[s],l=o.source(),u=o.target(),f=n===l?u:l;f.length>0&&e.push(f[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),kt.neighbourhood=kt.neighborhood,kt.closedNeighbourhood=kt.closedNeighborhood,kt.openNeighbourhood=kt.openNeighborhood,$e(kt,{source:Wt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:Wt(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"target"),sources:Ko({attr:"source"}),targets:Ko({attr:"target"})});function Ko(t){return function(r){for(var a=[],n=0;n<this.length;n++){var i=this[n],s=i._private[t.attr];s&&a.push(s)}return this.spawn(a,!0).filter(r)}}$e(kt,{edgesWith:Wt(Zo(),"edgesWith"),edgesTo:Wt(Zo({thisIsSrc:!0}),"edgesTo")});function Zo(t){return function(r){var a=[],n=this._private.cy,i=t||{};ee(r)&&(r=n.$(r));for(var s=0;s<r.length;s++)for(var o=r[s]._private.edges,l=0;l<o.length;l++){var u=o[l],f=u._private.data,h=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),c=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),d=h||c;d&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!h||i.thisIsTgt&&!c)||a.push(u))}return this.spawn(a,!0)}}$e(kt,{connectedEdges:Wt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var i=n._private.edges,s=0;s<i.length;s++){var o=i[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Wt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Wt(Qo(),"parallelEdges"),codirectedEdges:Wt(Qo({codirected:!0}),"codirectedEdges")});function Qo(t){var e={codirected:!1};return t=$e({},e,t),function(a){for(var n=[],i=this.edges(),s=t,o=0;o<i.length;o++)for(var l=i[o],u=l._private,f=u.source,h=f._private.data.id,c=u.data.target,d=f._private.edges,v=0;v<d.length;v++){var p=d[v],y=p._private.data,g=y.target,m=y.source,b=g===c&&m===h,x=h===g&&c===m;(s.codirected&&b||!s.codirected&&(b||x))&&n.push(p)}return this.spawn(n,!0).filter(a)}}$e(kt,{components:function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var o=function(f,h){n.merge(f),i.unmerge(f),h.merge(f)};if(i.empty())return r.spawn();var l=function(){var f=a.collection();s.push(f);var h=i[0];o(h,f),r.bfs({directed:!1,roots:h,visit:function(d){return o(d,f)}}),f.forEach(function(c){c.connectedEdges().forEach(function(d){r.has(d)&&f.has(d.source())&&f.has(d.target())&&f.merge(d)})})};do l();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),kt.componentsOf=kt.components;var Ot=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Et("A collection must have a reference to the core");return}var i=new ur,s=!1;if(!r)r=[];else if(r.length>0&&C(r[0])&&!Le(r[0])){s=!0;for(var o=[],l=new ta,u=0,f=r.length;u<f;u++){var h=r[u];h.data==null&&(h.data={});var c=h.data;if(c.id==null)c.id=Ss();else if(e.hasElementWithId(c.id)||l.has(c.id))continue;var d=new bn(e,h,!1);o.push(d),l.add(c.id)}r=o}this.length=0;for(var v=0,p=r.length;v<p;v++){var y=r[v][0];if(y!=null){var g=y._private.data.id;(!a||!i.has(g))&&(a&&i.set(g,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(m){this.lazyMap=m},rebuildMap:function(){for(var b=this.lazyMap=new ur,x=this.eles,M=0;M<x.length;M++){var O=x[M];b.set(O.id(),{index:M,ele:O})}}},a&&(this._private.map=i),s&&!n&&this.restore()},pt=bn.prototype=Ot.prototype=Object.create(Array.prototype);pt.instanceString=function(){return"collection"},pt.spawn=function(t,e){return new Ot(this.cy(),t,e)},pt.spawnSelf=function(){return this.spawn(this)},pt.cy=function(){return this._private.cy},pt.renderer=function(){return this._private.cy.renderer()},pt.element=function(){return this[0]},pt.collection=function(){return Ee(this)?this:new Ot(this._private.cy,[this])},pt.unique=function(){return new Ot(this._private.cy,this,!0)},pt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},pt.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Ot(e)},pt.$id=pt.getElementById,pt.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index},pt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},pt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},pt.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(C(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,s={},o=t.data.source,l=t.data.target;o!=null&&o!=n.source&&(s.source=""+o,i=!0),l!=null&&l!=n.target&&(s.target=""+l,i=!0),i&&(e=e.move(s))}else{var u="parent"in t.data,f=t.data.parent;u&&(f!=null||n.parent!=null)&&f!=n.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var h=function(p,y,g){var m=t[p];m!=null&&m!==a[p]&&(m?e[y]():e[g]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var c={data:or(a.data),position:or(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};c.classes="";var d=0;return a.classes.forEach(function(v){return c.classes+=d++===0?v:" "+v}),c}}},pt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t},pt.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new bn(t,n,!1);e.push(i)}return new Ot(t,e)},pt.copy=pt.clone,pt.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],s=[],o,l=0,u=r.length;l<u;l++){var f=r[l];e&&!f.removed()||(f.isNode()?i.push(f):s.push(f))}o=i.concat(s);var h,c=function(){o.splice(h,1),h--};for(h=0;h<o.length;h++){var d=o[h],v=d._private,p=v.data;if(d.clearTraversalCache(),!(!e&&!v.removed)){if(p.id===void 0)p.id=Ss();else if(N(p.id))p.id=""+p.id;else if(Ue(p.id)||!ee(p.id)){Et("Can not create element with invalid string ID `"+p.id+"`"),c();continue}else if(a.hasElementWithId(p.id)){Et("Can not create second element with ID `"+p.id+"`"),c();continue}}var y=p.id;if(d.isNode()){var g=v.position;g.x==null&&(g.x=0),g.y==null&&(g.y=0)}if(d.isEdge()){for(var m=d,b=["source","target"],x=b.length,M=!1,O=0;O<x;O++){var T=b[O],k=p[T];N(k)&&(k=p[T]=""+p[T]),k==null||k===""?(Et("Can not create edge `"+y+"` with unspecified "+T),M=!0):a.hasElementWithId(k)||(Et("Can not create edge `"+y+"` with nonexistant "+T+" `"+k+"`"),M=!0)}if(M){c();continue}var D=a.getElementById(p.source),F=a.getElementById(p.target);D.same(F)?D._private.edges.push(m):(D._private.edges.push(m),F._private.edges.push(m)),m._private.source=D,m._private.target=F}v.map=new ur,v.map.set(y,{ele:d,index:0}),v.removed=!1,e&&a.addToPool(d)}for(var G=0;G<i.length;G++){var I=i[G],H=I._private.data;N(H.parent)&&(H.parent=""+H.parent);var z=H.parent,re=z!=null;if(re||I._private.parent){var X=I._private.parent?a.collection().merge(I._private.parent):a.getElementById(z);if(X.empty())H.parent=void 0;else if(X[0].removed())ot("Node added with missing parent, reference to parent removed"),H.parent=void 0,I._private.parent=null;else{for(var K=!1,ie=X;!ie.empty();){if(I.same(ie)){K=!0,H.parent=void 0;break}ie=ie.parent()}K||(X[0]._private.children.push(I),I._private.parent=X[0],n.hasCompoundNodes=!0)}}}if(o.length>0){for(var fe=o.length===r.length?r:new Ot(a,o),ve=0;ve<fe.length;ve++){var oe=fe[ve];oe.isNode()||(oe.parallelEdges().clearTraversalCache(),oe.source().clearTraversalCache(),oe.target().clearTraversalCache())}var ce;n.hasCompoundNodes?ce=a.collection().merge(fe).merge(fe.connectedNodes()).merge(fe.parent()):ce=fe,ce.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?fe.emitAndNotify("add"):e&&fe.emit("add")}return r},pt.removed=function(){var t=this[0];return t&&t._private.removed},pt.inside=function(){var t=this[0];return t&&!t._private.removed},pt.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function s(z){for(var re=z._private.edges,X=0;X<re.length;X++)l(re[X])}function o(z){for(var re=z._private.children,X=0;X<re.length;X++)l(re[X])}function l(z){var re=n[z.id()];e&&z.removed()||re||(n[z.id()]=!0,z.isNode()?(a.push(z),s(z),o(z)):a.unshift(z))}for(var u=0,f=r.length;u<f;u++){var h=r[u];l(h)}function c(z,re){var X=z._private.edges;Tr(X,re),z.clearTraversalCache()}function d(z){z.clearTraversalCache()}var v=[];v.ids={};function p(z,re){re=re[0],z=z[0];var X=z._private.children,K=z.id();Tr(X,re),re._private.parent=null,v.ids[K]||(v.ids[K]=!0,v.push(z))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var y=0;y<a.length;y++){var g=a[y];if(g.isEdge()){var m=g.source()[0],b=g.target()[0];c(m,g),c(b,g);for(var x=g.parallelEdges(),M=0;M<x.length;M++){var O=x[M];d(O),O.isBundledBezier()&&O.dirtyBoundingBoxCache()}}else{var T=g.parent();T.length!==0&&p(T,g)}e&&(g._private.removed=!0)}var k=i._private.elements;i._private.hasCompoundNodes=!1;for(var D=0;D<k.length;D++){var F=k[D];if(F.isParent()){i._private.hasCompoundNodes=!0;break}}var G=new Ot(this.cy(),a);G.size()>0&&(t?G.emitAndNotify("remove"):e&&G.emit("remove"));for(var I=0;I<v.length;I++){var H=v[I];(!e||!H.removed())&&H.updateStyle()}return G},pt.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=function(v){return v==null?v:""+v};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),o=i(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var d=0;d<r.length;d++){var v=r[d],p=v._private.data;v.isEdge()&&(l&&(p.source=s),u&&(p.target=o))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent),h=f===null||e.hasElementWithId(f);if(h){var c=f===null?void 0:f;e.batch(function(){var d=r.remove(a,n);d.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var p=r[v],y=p._private.data;p.isNode()&&(y.parent=c)}d.restore(a,n)}),r.emitAndNotify("move")}}return this},[eo,td,In,Or,va,yd,Rn,Id,$o,_o,Fd,zn,Gn,At,Ir,kt].forEach(function(t){$e(pt,t)});var Yd={add:function(e){var r,a=this;if(se(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var i=[],s=0;s<n.length;s++){var o=n[s];i.push(o.json())}r=new Ot(a,i)}}else if(be(e)){var l=e;r=new Ot(a,l)}else if(C(e)&&(be(e.nodes)||be(e.edges))){for(var u=e,f=[],h=["nodes","edges"],c=0,d=h.length;c<d;c++){var v=h[c],p=u[v];if(be(p))for(var y=0,g=p.length;y<g;y++){var m=$e({group:v},p[y]);f.push(m)}}r=new Ot(a,f)}else{var b=e;r=new bn(a,b).collection()}return r},remove:function(e){if(!se(e)){if(ee(e)){var r=e;e=this.$(r)}}return e.remove()}};function Hd(t,e,r,a){var n=4,i=.001,s=1e-7,o=10,l=11,u=1/(l-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var h=0;h<4;++h)if(typeof arguments[h]!="number"||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var c=f?new Float32Array(l):new Array(l);function d(F,G){return 1-3*G+3*F}function v(F,G){return 3*G-6*F}function p(F){return 3*F}function y(F,G,I){return((d(G,I)*F+v(G,I))*F+p(G))*F}function g(F,G,I){return 3*d(G,I)*F*F+2*v(G,I)*F+p(G)}function m(F,G){for(var I=0;I<n;++I){var H=g(G,t,r);if(H===0)return G;var z=y(G,t,r)-F;G-=z/H}return G}function b(){for(var F=0;F<l;++F)c[F]=y(F*u,t,r)}function x(F,G,I){var H,z,re=0;do z=G+(I-G)/2,H=y(z,t,r)-F,H>0?I=z:G=z;while(Math.abs(H)>s&&++re<o);return z}function M(F){for(var G=0,I=1,H=l-1;I!==H&&c[I]<=F;++I)G+=u;--I;var z=(F-c[I])/(c[I+1]-c[I]),re=G+z*u,X=g(re,t,r);return X>=i?m(F,re):X===0?re:x(F,G,G+u)}var O=!1;function T(){O=!0,(t!==e||r!==a)&&b()}var k=function(G){return O||T(),t===e&&r===a?G:G===0?0:G===1?1:y(M(G),e,a)};k.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var D="generateBezier("+[t,e,r,a]+")";return k.toString=function(){return D},k}var Xd=function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:t(s)}}function r(a,n){var i={dx:a.v,dv:t(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),l=e(a,n,o),u=1/6*(i.dx+2*(s.dx+o.dx)+l.dx),f=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+f*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,f=1/1e4,h=16/1e3,c,d,v;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(u=a(n,i),d=u/s*h):d=h;v=r(v||o,d),l.push(1+v.x),u+=16,Math.abs(v.x)>f&&Math.abs(v.v)>f;);return c?function(p){return l[p*(l.length-1)|0]}:u}}(),yt=function(e,r,a,n){var i=Hd(e,r,a,n);return function(s,o,l){return s+(o-s)*i(l)}},_n={linear:function(e,r,a){return e+(r-e)*a},ease:yt(.25,.1,.25,1),"ease-in":yt(.42,0,1,1),"ease-out":yt(0,0,.58,1),"ease-in-out":yt(.42,0,.58,1),"ease-in-sine":yt(.47,0,.745,.715),"ease-out-sine":yt(.39,.575,.565,1),"ease-in-out-sine":yt(.445,.05,.55,.95),"ease-in-quad":yt(.55,.085,.68,.53),"ease-out-quad":yt(.25,.46,.45,.94),"ease-in-out-quad":yt(.455,.03,.515,.955),"ease-in-cubic":yt(.55,.055,.675,.19),"ease-out-cubic":yt(.215,.61,.355,1),"ease-in-out-cubic":yt(.645,.045,.355,1),"ease-in-quart":yt(.895,.03,.685,.22),"ease-out-quart":yt(.165,.84,.44,1),"ease-in-out-quart":yt(.77,0,.175,1),"ease-in-quint":yt(.755,.05,.855,.06),"ease-out-quint":yt(.23,1,.32,1),"ease-in-out-quint":yt(.86,0,.07,1),"ease-in-expo":yt(.95,.05,.795,.035),"ease-out-expo":yt(.19,1,.22,1),"ease-in-out-expo":yt(1,0,0,1),"ease-in-circ":yt(.6,.04,.98,.335),"ease-out-circ":yt(.075,.82,.165,1),"ease-in-out-circ":yt(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return _n.linear;var n=Xd(e,r,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":yt};function Jo(t,e,r,a,n){if(a===1||e===r)return r;var i=n(e,r,a);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function jo(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ma(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var s=jo(t,n),o=jo(e,n);if(N(s)&&N(o))return Jo(i,s,o,r,a);if(be(s)&&be(o)){for(var l=[],u=0;u<o.length;u++){var f=s[u],h=o[u];if(f!=null&&h!=null){var c=Jo(i,f,h,r,a);l.push(c)}else l.push(h)}return l}}function Wd(t,e,r,a){var n=!a,i=t._private,s=e._private,o=s.easing,l=s.startTime,u=a?t:t.cy(),f=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=_n.linear;else{var h;if(ee(o)){var c=f.parse("transition-timing-function",o);h=c.value}else h=o;var d,v;ee(h)?(d=h,v=[]):(d=h[1],v=h.slice(2).map(function(fe){return+fe})),v.length>0?(d==="spring"&&v.push(s.duration),s.easingImpl=_n[d].apply(null,v)):s.easingImpl=_n[d]}var p=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var g=s.startPosition,m=s.position;if(m&&n&&!t.locked()){var b={};qa(g.x,m.x)&&(b.x=ma(g.x,m.x,y,p)),qa(g.y,m.y)&&(b.y=ma(g.y,m.y,y,p)),t.position(b)}var x=s.startPan,M=s.pan,O=i.pan,T=M!=null&&a;T&&(qa(x.x,M.x)&&(O.x=ma(x.x,M.x,y,p)),qa(x.y,M.y)&&(O.y=ma(x.y,M.y,y,p)),t.emit("pan"));var k=s.startZoom,D=s.zoom,F=D!=null&&a;F&&(qa(k,D)&&(i.zoom=Ba(i.minZoom,ma(k,D,y,p),i.maxZoom)),t.emit("zoom")),(T||F)&&t.emit("viewport");var G=s.style;if(G&&G.length>0&&n){for(var I=0;I<G.length;I++){var H=G[I],z=H.name,re=H,X=s.startStyle[z],K=f.properties[X.name],ie=ma(X,re,y,p,K);f.overrideBypass(t,z,ie)}t.emit("style")}}return s.progress=y,y}function qa(t,e){return t==null||e==null?!1:N(t)&&N(e)?!0:!!(t&&e)}function qd(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function eu(t,e){var r=e._private.aniEles,a=[];function n(f,h){var c=f._private,d=c.animation.current,v=c.animation.queue,p=!1;if(d.length===0){var y=v.shift();y&&d.push(y)}for(var g=function(O){for(var T=O.length-1;T>=0;T--){var k=O[T];k()}O.splice(0,O.length)},m=d.length-1;m>=0;m--){var b=d[m],x=b._private;if(x.stopped){d.splice(m,1),x.hooked=!1,x.playing=!1,x.started=!1,g(x.frames);continue}!x.playing&&!x.applying||(x.playing&&x.applying&&(x.applying=!1),x.started||qd(f,b,t),Wd(f,b,t,h),x.applying&&(x.applying=!1),g(x.frames),x.step!=null&&x.step(t),b.completed()&&(d.splice(m,1),x.hooked=!1,x.playing=!1,x.started=!1,g(x.completes)),p=!0)}return!h&&d.length===0&&v.length===0&&a.push(f),p}for(var i=!1,s=0;s<r.length;s++){var o=r[s],l=n(o);i=i||l}var u=n(e,!0);(i||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var Kd={animate:ft.animate(),animation:ft.animation(),animated:ft.animated(),clearQueue:ft.clearQueue(),delay:ft.delay(),delayAnimation:ft.delayAnimation(),stop:ft.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&pn(function(i){eu(i,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){eu(s,e)},a.beforeRenderPriorities.animations):r()}},Zd={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&Le(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e}},Un=function(e){return ee(e)?new Lr(e):e},tu={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bn(Zd,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,Un(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,Un(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,Un(r),a),this},once:function(e,r,a){return this.emitter().one(e,Un(r),a),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};ft.eventAliasesOn(tu);var Fi={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};Fi.jpeg=Fi.jpg;var Yn={layout:function(e){var r=this;if(e==null){Et("Layout options must be specified to make a layout");return}if(e.name==null){Et("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){Et("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;ee(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new n($e({},e,{cy:r,eles:i}));return s}};Yn.createLayout=Yn.makeLayout=Yn.layout;var Qd={notify:function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();r!=null&&n.merge(r);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?r.notify(a):r.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],s=e[i],o=r.getElementById(i);o.data(s)}})}},Jd=Lt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),zi={renderTo:function(e,r,a,n){var i=this._private.renderer;return i.renderTo(e,r,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){Et("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&ot("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Jd(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};zi.invalidateDimensions=zi.resize;var Hn={collection:function(e,r){return ee(e)?this.$(e):se(e)?e.collection():be(e)?(r||(r={}),new Ot(this,e,r.unique,r.removed)):new Ot(this)},nodes:function(e){var r=this.$(function(a){return a.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(a){return a.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};Hn.elements=Hn.filter=Hn.$;var Pt={},Ka="t",jd="f";Pt.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),i=0;i<t.length;i++){var s=t[i],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var f=e.updateStyleHints(s);f&&n.push(s)}}return n},Pt.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;for(var s=[],o={},l=0;l<r.length;l++){var u=r[l],f=t[l]===Ka,h=e[l]===Ka,c=f!==h,d=u.mappedProperties.length>0;if(c||h&&d){var v=void 0;c&&d||c?v=u.properties:d&&(v=u.mappedProperties);for(var p=0;p<v.length;p++){for(var y=v[p],g=y.name,m=!1,b=l+1;b<r.length;b++){var x=r[b],M=e[b]===Ka;if(M&&(m=x.properties[y.name]!=null,m))break}!o[g]&&!m&&(o[g]=!0,s.push(g))}}}return a[n]=s,s},Pt.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],o=s.selector&&s.selector.matches(t);o?r+=Ka:r+=jd}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}},Pt.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<r.length;i++){var s=r[i],o=e[i]===Ka;if(o)for(var l=0;l<s.properties.length;l++){var u=s.properties[l];n[u.name]=u}}return a[e]=n,n},Pt.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,i={},s=a.types,o=0;o<n.length;o++){var l=n[o],u=e[l],f=r.pstyle(l);if(!u)if(f)f.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(f!==u){if(u.mapped===s.fn&&f!=null&&f.mapping!=null&&f.mapping.value===u.value){var h=f.mapping,c=h.fnValue=u.value(r);if(c===h.prevFnValue)continue}var d=i[l]={prev:f};a.applyParsedProperty(r,u),d.next=r.pstyle(l),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}},Pt.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,i=function(Ae,Oe,Ye){return r.getPropertiesHash(Ae,Oe,Ye)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;a=Object.keys(l);for(var u=0;u<n.length;u++){var f=n[u];e.styleKeys[f]=[ea,Ma]}for(var h=function(Ae,Oe){return e.styleKeys[Oe][0]=Ia(Ae,e.styleKeys[Oe][0])},c=function(Ae,Oe){return e.styleKeys[Oe][1]=Ra(Ae,e.styleKeys[Oe][1])},d=function(Ae,Oe){h(Ae,Oe),c(Ae,Oe)},v=function(Ae,Oe){for(var Ye=0;Ye<Ae.length;Ye++){var He=Ae.charCodeAt(Ye);h(He,Oe),c(He,Oe)}},p=2e9,y=function(Ae){return-128<Ae&&Ae<128&&Math.floor(Ae)!==Ae?p-(Ae*1024|0):Ae},g=0;g<a.length;g++){var m=a[g],b=l[m];if(b!=null){var x=this.properties[m],M=x.type,O=x.groupKey,T=void 0;x.hashOverride!=null?T=x.hashOverride(t,b):b.pfValue!=null&&(T=b.pfValue);var k=x.enums==null?b.value:null,D=T!=null,F=k!=null,G=D||F,I=b.units;if(M.number&&G&&!M.multiple){var H=D?T:k;d(y(H),O),!D&&I!=null&&v(I,O)}else v(b.strValue,O)}}for(var z=[ea,Ma],re=0;re<n.length;re++){var X=n[re],K=e.styleKeys[X];z[0]=Ia(K[0],z[0]),z[1]=Ra(K[1],z[1])}e.styleKey=nf(z[0],z[1]);var ie=e.styleKeys;e.labelDimsKey=xr(ie.labelDimensions);var fe=i(t,["label"],ie.labelDimensions);if(e.labelKey=xr(fe),e.labelStyleKey=xr(yn(ie.commonLabel,fe)),!o){var ve=i(t,["source-label"],ie.labelDimensions);e.sourceLabelKey=xr(ve),e.sourceLabelStyleKey=xr(yn(ie.commonLabel,ve));var oe=i(t,["target-label"],ie.labelDimensions);e.targetLabelKey=xr(oe),e.targetLabelStyleKey=xr(yn(ie.commonLabel,oe))}if(o){var ce=e.styleKeys,de=ce.nodeBody,xe=ce.nodeBorder,pe=ce.backgroundImage,ge=ce.compound,ae=ce.pie,we=[de,xe,pe,ge,ae].filter(function(Te){return Te!=null}).reduce(yn,[ea,Ma]);e.nodeKey=xr(we),e.hasPie=ae!=null&&ae[0]!==ea&&ae[1]!==Ma}return s!==e.styleKey},Pt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},Pt.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,s=r.types,o=r.properties[a.name].type,l=a.bypass,u=n[a.name],f=u&&u.bypass,h=t._private,c="mapping",d=function(de){return de==null?null:de.pfValue!=null?de.pfValue:de.value},v=function(){var de=d(u),xe=d(a);r.checkTriggers(t,a.name,de,xe)};if(a&&a.name.substr(0,3)==="pie"&&ot("The pie style properties are deprecated. Create charts using background images instead."),e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(a=e=this.parse(e.name,"bezier",l)),a.delete)return n[a.name]=void 0,v(),!0;if(a.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,v(),!0):!1:(v(),!0);if(a.deleteBypass)return u?u.bypass?(n[a.name]=u.bypassed,v(),!0):!1:(v(),!0);var p=function(){ot("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case s.mapData:{for(var y=a.field.split("."),g=h.data,m=0;m<y.length&&g;m++){var b=y[m];g=g[b]}if(g==null)return p(),!1;var x;if(N(g)){var M=a.fieldMax-a.fieldMin;M===0?x=0:x=(g-a.fieldMin)/M}else return ot("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+g+"` for `"+t.id()+"` is non-numeric)"),!1;if(x<0?x=0:x>1&&(x=1),o.color){var O=a.valueMin[0],T=a.valueMax[0],k=a.valueMin[1],D=a.valueMax[1],F=a.valueMin[2],G=a.valueMax[2],I=a.valueMin[3]==null?1:a.valueMin[3],H=a.valueMax[3]==null?1:a.valueMax[3],z=[Math.round(O+(T-O)*x),Math.round(k+(D-k)*x),Math.round(F+(G-F)*x),Math.round(I+(H-I)*x)];i={bypass:a.bypass,name:a.name,value:z,strValue:"rgb("+z[0]+", "+z[1]+", "+z[2]+")"}}else if(o.number){var re=a.valueMin+(a.valueMax-a.valueMin)*x;i=this.parse(a.name,re,a.bypass,c)}else return!1;if(!i)return p(),!1;i.mapping=a,a=i;break}case s.data:{for(var X=a.field.split("."),K=h.data,ie=0;ie<X.length&&K;ie++){var fe=X[ie];K=K[fe]}if(K!=null&&(i=this.parse(a.name,K,a.bypass,c)),!i)return p(),!1;i.mapping=a,a=i;break}case s.fn:{var ve=a.value,oe=a.fnValue!=null?a.fnValue:ve(t);if(a.prevFnValue=oe,oe==null)return ot("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,oe,a.bypass,c),!i)return ot("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=or(a),a=i;break}case void 0:break;default:return!1}return l?(f?a.bypassed=u.bypassed:a.bypassed=u,n[a.name]=a):f?u.bypassed=a:n[a.name]=a,v(),!0},Pt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],l=n[o];l!=null&&(l.bypass?l.bypassed=null:n[o]=null)}}},Pt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Pt.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var o={},l=!1,u=0;u<n.length;u++){var f=n[u],h=t.pstyle(f),c=e[f];if(c){var d=c.prev,v=d,p=c.next!=null?c.next:h,y=!1,g=void 0,m=1e-6;v&&(N(v.pfValue)&&N(p.pfValue)?(y=p.pfValue-v.pfValue,g=v.pfValue+m*y):N(v.value)&&N(p.value)?(y=p.value-v.value,g=v.value+m*y):be(v.value)&&be(p.value)&&(y=v.value[0]!==p.value[0]||v.value[1]!==p.value[1]||v.value[2]!==p.value[2],g=v.strValue),y&&(o[f]=p.strValue,this.applyBypass(t,f,g),l=!0))}}if(!l)return;a.transitioning=!0,new ua(function(b){s>0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1)},Pt.checkTrigger=function(t,e,r,a,n,i){var s=this.properties[e],o=n(s);o!=null&&o(r,a)&&i(s)},Pt.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})},Pt.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),n.triggersBoundsOfParallelBeziers&&(e==="curve-style"&&(r==="bezier"||a==="bezier")||e==="display"&&(r==="none"||a==="none"))&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()})})},Pt.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a)};var Za={};Za.applyBypass=function(t,e,r,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<n.properties.length;o++){var l=n.properties[o],u=l.name,f=this.parse(u,r,!0);f&&i.push(f)}}else if(ee(e)){var h=this.parse(e,r,!0);h&&i.push(h)}else if(C(e)){var c=e;a=r;for(var d=Object.keys(c),v=0;v<d.length;v++){var p=d[v],y=c[p];if(y===void 0&&(y=c[Ct(p)]),y!==void 0){var g=this.parse(p,y,!0);g&&i.push(g)}}}else return!1;if(i.length===0)return!1;for(var m=!1,b=0;b<t.length;b++){for(var x=t[b],M={},O=void 0,T=0;T<i.length;T++){var k=i[T];if(a){var D=x.pstyle(k.name);O=M[k.name]={prev:D}}m=this.applyParsedProperty(x,or(k))||m,a&&(O.next=x.pstyle(k.name))}m&&this.updateStyleHints(x),a&&this.updateTransitions(x,M,s)}return m},Za.overrideBypass=function(t,e,r){e=tt(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),o?i.strValue="rgb("+r.join(",")+")":l?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,u,r)}},Za.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},Za.removeBypasses=function(t,e,r){for(var a=!0,n=0;n<t.length;n++){for(var i=t[n],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],f=i.pstyle(u.name);if(!(!f||!f.bypass)){var h="",c=this.parse(l,h,!0),d=s[u.name]={prev:f};this.applyParsedProperty(i,c),d.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,s,a)}};var Gi={};Gi.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},Gi.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var lr={};lr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},lr.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var a={},n=0;n<r.properties.length;n++){var i=r.properties[n],s=r.getStylePropertyValue(t,i.name,e);s!=null&&(a[i.name]=s,a[Ct(i.name)]=s)}return a}},lr.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n??t.cy().style().getDefaultProperty(e)[r][0]},lr.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,s=t.pstyle(n.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(r&&i.number&&o!=null&&N(o)){var f=t.cy().zoom(),h=function(y){return y*f},c=function(y,g){return h(y)+g},d=be(o),v=d?l.every(function(p){return p!=null}):l!=null;return v?d?o.map(function(p,y){return c(p,l[y])}).join(" "):c(o,l):d?o.map(function(p){return ee(p)?p:""+h(p)}).join(" "):""+h(o)}else if(u!=null)return u}return null}},lr.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a],i=n.name,s=t.pstyle(i);s!==void 0&&(C(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(r[i]=s)}return r},lr.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var i=Object.keys(a),s=0;s<i.length;s++){var o=i[s],l=a[o],u=n[o]||n[tt(o)],f=this.parse(u.name,l);f&&r.push(f)}return r},lr.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,s,o,l,u;for(l=0;l<e.length;l++)if(n=e[l],i=t.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=Ia(o,a[0]),a[1]=Ra(o,a[1]);else for(s=i.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),a[0]=Ia(o,a[0]),a[1]=Ra(o,a[1]);return a},lr.getPropertiesHash=lr.getNonDefaultPropertiesHash;var Xn={};Xn.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,s=Object.keys(i);e.selector(n);for(var o=0;o<s.length;o++){var l=s[o],u=i[l];e.css(l,u)}}return e},Xn.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},Xn.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],a=r.selector,n=r.properties,i={},s=0;s<n.length;s++){var o=n[s];i[o.name]=o.strValue}t.push({selector:a?a.toString():"core",style:i})}return t};var Vi={};Vi.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,s;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){a.length>n.length?a=a.substr(n.length):a=""}function l(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=a.match(/^\s*$/);if(u)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){ot("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var h=f[1];if(h!=="core"){var c=new Lr(h);if(c.invalid){ot("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),o();continue}}var d=f[2],v=!1;i=d;for(var p=[];;){var y=i.match(/^\s*$/);if(y)break;var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){ot("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d),v=!0;break}s=g[0];var m=g[1],b=g[2],x=e.properties[m];if(!x){ot("Skipping property: Invalid property name in: "+s),l();continue}var M=r.parse(m,b);if(!M){ot("Skipping property: Invalid property definition in: "+s),l();continue}p.push({name:m,val:b}),l()}if(v){o();break}r.selector(h);for(var O=0;O<p.length;O++){var T=p[O];r.css(T.name,T.val)}o()}return r},Vi.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Nt={};(function(){var t=qe,e=Qt,r=Jt,a=vn,n=Qr,i=function(we){return"^"+we+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(we){var Te=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+we+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Te+")\\s*\\,\\s*("+Te+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Nt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(we,Te){switch(we.length){case 2:return Te[0]!=="deg"&&Te[0]!=="rad"&&Te[1]!=="deg"&&Te[1]!=="rad";case 1:return ee(we[0])||Te[0]==="deg"||Te[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(we){var Te=we.length;return Te===1||Te===2||Te===4}}};var l={zeroNonZero:function(we,Te){return(we==null||Te==null)&&we!==Te||we==0&&Te!=0?!0:we!=0&&Te==0},any:function(we,Te){return we!=Te},emptyNonEmpty:function(we,Te){var Ae=Ue(we),Oe=Ue(Te);return Ae&&!Oe||!Ae&&Oe}},u=Nt.types,f=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],h=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],c=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],d=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],v=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification}],p=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any}],y=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],g=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any}],m=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],x=function(we,Te){return Te.value==="label"?-we.poolIndex():Te.pfValue},M=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:x},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:x},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],O=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle}],T=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],k=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],D=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],F=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],G=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],I=[];Nt.pieBackgroundN=16,I.push({name:"pie-size",type:u.sizeMaybePercent});for(var H=1;H<=Nt.pieBackgroundN;H++)I.push({name:"pie-"+H+"-background-color",type:u.color}),I.push({name:"pie-"+H+"-background-size",type:u.percent}),I.push({name:"pie-"+H+"-background-opacity",type:u.zeroOneNumber});var z=[],re=Nt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill}].forEach(function(ae){re.forEach(function(we){var Te=we+"-"+ae.name,Ae=ae.type,Oe=ae.triggersBounds;z.push({name:Te,type:Ae,triggersBounds:Oe})})},{});var X=Nt.properties=[].concat(p,b,y,g,m,F,v,d,f,h,c,M,O,T,I,k,D,z,G),K=Nt.propertyGroups={behavior:p,transition:b,visibility:y,overlay:g,underlay:m,ghost:F,commonLabel:v,labelDimensions:d,mainLabel:f,sourceLabel:h,targetLabel:c,nodeBody:M,nodeBorder:O,backgroundImage:T,pie:I,compound:k,edgeLine:D,edgeArrow:z,core:G},ie=Nt.propertyGroupNames={},fe=Nt.propertyGroupKeys=Object.keys(K);fe.forEach(function(ae){ie[ae]=K[ae].map(function(we){return we.name}),K[ae].forEach(function(we){return we.groupKey=ae})});var ve=Nt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Nt.propertyNames=X.map(function(ae){return ae.name});for(var oe=0;oe<X.length;oe++){var ce=X[oe];X[ce.name]=ce}for(var de=0;de<ve.length;de++){var xe=ve[de],pe=X[xe.pointsTo],ge={name:xe.name,alias:!0,pointsTo:pe};X.push(ge),X[xe.name]=ge}})(),Nt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},Nt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=$e({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var f=1;f<=Nt.pieBackgroundN;f++){var h=u.name.replace("{{i}}",f),c=u.value;l[h]=c}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce(function(l,u){return Nt.arrowPrefixes.forEach(function(f){var h=f+"-"+u.name,c=u.value;l[h]=c}),l},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,s=e[i],o=this.parse(i,s);r[i]=o}}return t.defaultProperties=r,t.defaultProperties},Nt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Wn={};Wn.parse=function(t,e,r,a){var n=this;if(ne(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,s=r?"t":"f",o=""+e,l=ws(t,o,s,i),u=n.propCache=n.propCache||[],f;return(f=u[l])||(f=u[l]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(f=or(f),f&&(f.value=or(f.value))),f},Wn.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&ot("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&ot("The style value of `label` is deprecated for `"+n.name+"`"),n},Wn.parseImpl=function(t,e,r,a){var n=this;t=tt(t);var i=n.properties[t],s=e,o=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var l=ee(e);l&&(e=e.trim());var u=i.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(ne(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var f,h;if(!(!l||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(o.data.regex).exec(e))){if(r)return!1;var c=o.data;return{name:t,value:f,strValue:""+e,mapped:c,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(h=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var d=o.mapData;if(!(u.color||u.number))return!1;var v=this.parse(t,h[4]);if(!v||v.mapped)return!1;var p=this.parse(t,h[5]);if(!p||p.mapped)return!1;if(v.pfValue===p.pfValue||v.strValue===p.strValue)return ot("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+v.strValue+"`"),this.parse(t,v.strValue);if(u.color){var y=v.value,g=p.value,m=y[0]===g[0]&&y[1]===g[1]&&y[2]===g[2]&&(y[3]===g[3]||(y[3]==null||y[3]===1)&&(g[3]==null||g[3]===1));if(m)return!1}return{name:t,value:h,strValue:""+e,mapped:d,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:v.value,valueMax:p.value,bypass:r}}}if(u.multiple&&a!=="multiple"){var b;if(l?b=e.split(/\s+/):be(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var x=[],M=[],O=[],T="",k=!1,D=0;D<b.length;D++){var F=n.parse(t,b[D],r,"multiple");k=k||ee(F.value),x.push(F.value),O.push(F.pfValue!=null?F.pfValue:F.value),M.push(F.units),T+=(D>0?" ":"")+F.strValue}return u.validate&&!u.validate(x,M)?null:u.singleEnum&&k?x.length===1&&ee(x[0])?{name:t,value:x[0],strValue:x[0],bypass:r}:null:{name:t,value:x,pfValue:O,strValue:T,bypass:r,units:M}}var G=function(){for(var Te=0;Te<u.enums.length;Te++){var Ae=u.enums[Te];if(Ae===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var I,H="px";if(u.units&&(I=u.units),u.implicitUnits&&(H=u.implicitUnits),!u.unitless)if(l){var z="px|em"+(u.allowPercent?"|\\%":"");I&&(z=I);var re=e.match("^("+qe+")("+z+")?$");re&&(e=re[1],I=re[2]||H)}else(!I||u.implicitUnits)&&(I=H);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,G();if(u.integer&&!Z(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var X={name:t,value:e,strValue:""+e+(I||""),units:I,bypass:r};return u.unitless||I!=="px"&&I!=="em"?X.pfValue=e:X.pfValue=I==="px"||!I?e:this.getEmSizeInPixels()*e,(I==="ms"||I==="s")&&(X.pfValue=I==="ms"?e:1e3*e),(I==="deg"||I==="rad")&&(X.pfValue=I==="rad"?e:Pf(e)),I==="%"&&(X.pfValue=e/100),X}else if(u.propList){var K=[],ie=""+e;if(ie!=="none"){for(var fe=ie.split(/\s*,\s*|\s+/),ve=0;ve<fe.length;ve++){var oe=fe[ve].trim();n.properties[oe]?K.push(oe):ot("`"+oe+"` is not a valid property name")}if(K.length===0)return null}return{name:t,value:K,strValue:K.length===0?"none":K.join(" "),bypass:r}}else if(u.color){var ce=yl(e);return ce?{name:t,value:ce,pfValue:ce,strValue:"rgb("+ce[0]+","+ce[1]+","+ce[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var de=G();if(de)return de}for(var xe=u.regexes?u.regexes:[u.regex],pe=0;pe<xe.length;pe++){var ge=new RegExp(xe[pe]),ae=ge.exec(e);if(ae)return{name:t,value:u.singleRegexMatchValue?ae[1]:ae,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?G():null};var Bt=function t(e){if(!(this instanceof t))return new t(e);if(!Ge(e)){Et("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Ft=Bt.prototype;Ft.instanceString=function(){return"style"},Ft.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},Ft.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Ft.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Ft.selector=function(t){var e=t==="core"?null:new Lr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},Ft.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];i===void 0&&(i=r[Ct(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Ft.style=Ft.css,Ft.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[a].mappedProperties.push(r);var n=!this[a].selector;n&&(this._private.coreStyle[r.name]=r)}return this},Ft.append=function(t){return et(t)?t.appendToStyle(this):be(t)?this.appendFromJson(t):ee(t)&&this.appendFromString(t),this},Bt.fromJson=function(t,e){var r=new Bt(t);return r.fromJson(e),r},Bt.fromString=function(t,e){return new Bt(t).fromString(e)},[Pt,Za,Gi,lr,Xn,Vi,Nt,Wn].forEach(function(t){$e(Ft,t)}),Bt.types=Ft.types,Bt.properties=Ft.properties,Bt.propertyGroups=Ft.propertyGroups,Bt.propertyGroupNames=Ft.propertyGroupNames,Bt.propertyGroupKeys=Ft.propertyGroupKeys;var eg={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return et(e)?r.style=e.generateStyle(this):be(e)?r.style=Bt.fromJson(this,e):ee(e)?r.style=Bt.fromString(this,e):r.style=Bt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},tg="single",Ur={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=tg),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,i,s,o;switch(e.length){case 0:return r;case 1:if(ee(e[0]))return a=e[0],r[a];if(C(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,o=i.y,N(s)&&(r.x=s),N(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&N(n)&&(r[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var a=arguments,n=this._private.pan,i,s,o,l,u;if(!this._private.panningEnabled)return this;switch(a.length){case 1:C(e)&&(o=a[0],l=o.x,u=o.y,N(l)&&(n.x+=l),N(u)&&(n.y+=u),this.emit("pan viewport"));break;case 2:i=e,s=r,(i==="x"||i==="y")&&N(s)&&(n[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(N(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(ee(e)){var n=e;e=this.$(n)}else if(ze(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else se(e)||(e=this.mutableElements());if(!(se(e)&&e.empty())){a=a||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=N(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((s-2*r)/a.w,(o-2*r)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(a.x1+a.x2))/2,y:(o-l*(a.y1+a.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return N(e)&&N(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):N(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:N(r)&&e===void 0&&r>=a.minZoom&&(a.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,a=r.pan,n=r.zoom,i,s,o=!1;if(r.zoomingEnabled||(o=!0),N(e)?s=e:C(e)&&(s=e.level,e.position!=null?i=En(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!N(s)||s===n||i!=null&&(!N(i.x)||!N(i.y)))return null;if(i!=null){var l=a,u=n,f=s,h={x:-f/u*(i.x-l.x)+i.x,y:-f/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:h}}else return{zoomed:!0,panned:!1,zoom:s,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),a=this._private;return r==null||!r.zoomed?this:(a.zoom=r.zoom,r.panned&&(a.pan.x=r.pan.x,a.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,a=!0,n=!0,i=[],s=!1,o=!1;if(!e)return this;if(N(e.zoom)||(a=!1),C(e.pan)||(n=!1),!a&&!n)return this;if(a){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;N(u.x)&&(r.pan.x=u.x,o=!1),N(u.y)&&(r.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(ee(e)){var a=e;e=this.mutableElements().filter(a)}else se(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(n.x1+n.x2))/2,y:(s-r*(n.y1+n.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?function(){var n=a.window().getComputedStyle(r),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Ur.centre=Ur.center,Ur.autolockNodes=Ur.autolock,Ur.autoungrabifyNodes=Ur.autoungrabify;var Qa={data:ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Qa.attr=Qa.data,Qa.removeAttr=Qa.removeData;var Ja=function(e){var r=this;e=$e({},e);var a=e.container;a&&!ue(a)&&ue(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var s=L!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=$e({name:s?"grid":"null"},o.layout),o.renderer=$e({name:s?"canvas":"null"},o.renderer);var l=function(v,p,y){return p!==void 0?p:y!==void 0?y:v},u=this._private={container:a,ready:!1,options:o,elements:new Ot(this),listeners:[],aniEles:new Ot(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:N(o.zoom)?o.zoom:1,pan:{x:C(o.pan)&&N(o.pan.x)?o.pan.x:0,y:C(o.pan)&&N(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var f=function(v,p){var y=v.some(Je);if(y)return ua.all(v).then(p);p(v)};u.styleEnabled&&r.setStyle([]);var h=$e({},o,o.renderer);r.initRenderer(h);var c=function(v,p,y){r.notifications(!1);var g=r.mutableElements();g.length>0&&g.remove(),v!=null&&(C(v)||be(v))&&r.add(v),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",p),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var m=$e({},r._private.options.layout);m.eles=r.elements(),r.layout(m).run()};f([o.style,o.elements],function(d){var v=d[0],p=d[1];u.styleEnabled&&r.style().append(v),c(p,function(){r.startAnimationLoop(),u.ready=!0,ne(o.ready)&&r.on("ready",o.ready);for(var y=0;y<i.length;y++){var g=i[y];r.on("ready",g)}n&&(n.readies=[]),r.emit("ready")},o.done)})},qn=Ja.prototype;$e(qn,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return L;var r=this._private.container.ownerDocument;return r===void 0||r==null?L:r.defaultView||L},mount:function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!ue(e)&&ue(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer($e({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return or(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),i=function(x){return r.getElementById(x.id())};if(C(e)){if(r.startBatch(),e.elements){var s={},o=function(x,M){for(var O=[],T=[],k=0;k<x.length;k++){var D=x[k];if(!D.data.id){ot("cy.json() cannot handle elements without an ID attribute");continue}var F=""+D.data.id,G=r.getElementById(F);s[F]=!0,G.length!==0?T.push({ele:G,json:D}):(M&&(D.group=M),O.push(D))}r.add(O);for(var I=0;I<T.length;I++){var H=T[I],z=H.ele,re=H.json;z.json(re)}};if(be(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var f=l[u],h=e.elements[f];be(h)&&o(h,f)}var c=r.collection();n.filter(function(b){return!s[b.id()]}).forEach(function(b){b.isParent()?c.merge(b):b.remove()}),c.forEach(function(b){return b.children().move({parent:null})}),c.forEach(function(b){return i(b).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],v=0;v<d.length;v++){var p=d[v];e[p]!=null&&r[p](e[p])}return r.endBatch(),this}else{var y=!!e,g={};y?g.elements=this.elements().map(function(b){return b.json()}):(g.elements={},n.forEach(function(b){var x=b.group();g.elements[x]||(g.elements[x]=[]),g.elements[x].push(b.json())})),this._private.styleEnabled&&(g.style=r.style().json()),g.data=or(r.data());var m=a.options;return g.zoomingEnabled=a.zoomingEnabled,g.userZoomingEnabled=a.userZoomingEnabled,g.zoom=a.zoom,g.minZoom=a.minZoom,g.maxZoom=a.maxZoom,g.panningEnabled=a.panningEnabled,g.userPanningEnabled=a.userPanningEnabled,g.pan=or(a.pan),g.boxSelectionEnabled=a.boxSelectionEnabled,g.renderer=or(m.renderer),g.hideEdgesOnViewport=m.hideEdgesOnViewport,g.textureOnViewport=m.textureOnViewport,g.wheelSensitivity=m.wheelSensitivity,g.motionBlur=m.motionBlur,g.multiClickDebounceTime=m.multiClickDebounceTime,g}}}),qn.$id=qn.getElementById,[Yd,Kd,tu,Fi,Yn,Qd,zi,Hn,eg,Ur,Qa].forEach(function(t){$e(qn,t)});var rg={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},ag={maximal:!1,acyclic:!1},ba=function(e){return e.scratch("breadthfirst")},ru=function(e,r){return e.scratch("breadthfirst",r)};function au(t){this.options=$e({},rg,ag,t)}au.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().filter(function(Me){return!Me.isParent()}),i=a,s=e.directed,o=e.acyclic||e.maximal||e.maximalAdjustments>0,l=_t(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(se(e.roots))u=e.roots;else if(be(e.roots)){for(var f=[],h=0;h<e.roots.length;h++){var c=e.roots[h],d=r.getElementById(c);f.push(d)}u=r.collection(f)}else if(ee(e.roots))u=r.$(e.roots);else if(s)u=n.roots();else{var v=a.components();u=r.collection();for(var p=function(Ne){var Be=v[Ne],ke=Be.maxDegree(!1),Ie=Be.filter(function(Pe){return Pe.degree(!1)===ke});u=u.add(Ie)},y=0;y<v.length;y++)p(y)}var g=[],m={},b=function(Ne,Be){g[Be]==null&&(g[Be]=[]);var ke=g[Be].length;g[Be].push(Ne),ru(Ne,{index:ke,depth:Be})},x=function(Ne,Be){var ke=ba(Ne),Ie=ke.depth,Pe=ke.index;g[Ie][Pe]=null,b(Ne,Be)};i.bfs({roots:u,directed:e.directed,visit:function(Ne,Be,ke,Ie,Pe){var je=Ne[0],Ke=je.id();b(je,Pe),m[Ke]=!0}});for(var M=[],O=0;O<n.length;O++){var T=n[O];m[T.id()]||M.push(T)}var k=function(Ne){for(var Be=g[Ne],ke=0;ke<Be.length;ke++){var Ie=Be[ke];if(Ie==null){Be.splice(ke,1),ke--;continue}ru(Ie,{depth:Ne,index:ke})}},D=function(){for(var Ne=0;Ne<g.length;Ne++)k(Ne)},F=function(Ne,Be){for(var ke=ba(Ne),Ie=Ne.incomers().filter(function(P){return P.isNode()&&a.has(P)}),Pe=-1,je=Ne.id(),Ke=0;Ke<Ie.length;Ke++){var _e=Ie[Ke],ht=ba(_e);Pe=Math.max(Pe,ht.depth)}if(ke.depth<=Pe){if(!e.acyclic&&Be[je])return null;var Ce=Pe+1;return x(Ne,Ce),Be[je]=Ce,!0}return!1};if(s&&o){var G=[],I={},H=function(Ne){return G.push(Ne)},z=function(){return G.shift()};for(n.forEach(function(Me){return G.push(Me)});G.length>0;){var re=z(),X=F(re,I);if(X)re.outgoers().filter(function(Me){return Me.isNode()&&a.has(Me)}).forEach(H);else if(X===null){ot("Detected double maximal shift for node `"+re.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}D();var K=0;if(e.avoidOverlap)for(var ie=0;ie<n.length;ie++){var fe=n[ie],ve=fe.layoutDimensions(e),oe=ve.w,ce=ve.h;K=Math.max(K,oe,ce)}var de={},xe=function(Ne){if(de[Ne.id()])return de[Ne.id()];for(var Be=ba(Ne).depth,ke=Ne.neighborhood(),Ie=0,Pe=0,je=0;je<ke.length;je++){var Ke=ke[je];if(!(Ke.isEdge()||Ke.isParent()||!n.has(Ke))){var _e=ba(Ke);if(_e!=null){var ht=_e.index,Ce=_e.depth;if(!(ht==null||Ce==null)){var P=g[Ce].length;Ce<Be&&(Ie+=ht/P,Pe++)}}}}return Pe=Math.max(1,Pe),Ie=Ie/Pe,Pe===0&&(Ie=0),de[Ne.id()]=Ie,Ie},pe=function(Ne,Be){var ke=xe(Ne),Ie=xe(Be),Pe=ke-Ie;return Pe===0?Jr(Ne.id(),Be.id()):Pe};e.depthSort!==void 0&&(pe=e.depthSort);for(var ge=0;ge<g.length;ge++)g[ge].sort(pe),k(ge);for(var ae=[],we=0;we<M.length;we++)ae.push(M[we]);g.unshift(ae),D();for(var Te=0,Ae=0;Ae<g.length;Ae++)Te=Math.max(g[Ae].length,Te);var Oe={x:l.x1+l.w/2,y:l.x1+l.h/2},Ye=g.reduce(function(Me,Ne){return Math.max(Me,Ne.length)},0),He=function(Ne){var Be=ba(Ne),ke=Be.depth,Ie=Be.index,Pe=g[ke].length,je=Math.max(l.w/((e.grid?Ye:Pe)+1),K),Ke=Math.max(l.h/(g.length+1),K),_e=Math.min(l.w/2/g.length,l.h/2/g.length);if(_e=Math.max(_e,K),e.circle){var Ce=_e*ke+_e-(g.length>0&&g[0].length<=3?_e/2:0),P=2*Math.PI/g[ke].length*Ie;return ke===0&&g[0].length===1&&(Ce=1),{x:Oe.x+Ce*Math.cos(P),y:Oe.y+Ce*Math.sin(P)}}else{var ht={x:Oe.x+(Ie+1-(Pe+1)/2)*je,y:(ke+1)*Ke};return ht}};return a.nodes().layoutPositions(this,e,He),this};var ng={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function nu(t){this.options=$e({},ng,t)}nu.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=_t(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),f,h=0,c=0;c<i.length;c++){var d=i[c],v=d.layoutDimensions(e),p=v.w,y=v.h;h=Math.max(h,p,y)}if(N(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(s.h,s.w)/2-h,i.length>1&&e.avoidOverlap){h*=1.75;var g=Math.cos(u)-Math.cos(0),m=Math.sin(u)-Math.sin(0),b=Math.sqrt(h*h/(g*g+m*m));f=Math.max(b,f)}var x=function(O,T){var k=e.startAngle+T*u*(n?1:-1),D=f*Math.cos(k),F=f*Math.sin(k),G={x:o.x+D,y:o.y+F};return G};return a.nodes().layoutPositions(this,e,x),this};var ig={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function iu(t){this.options=$e({},ig,t)}iu.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),s=_t(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,f=0;f<i.length;f++){var h=i[f],c=void 0;c=e.concentric(h),l.push({value:c,node:h}),h._private.scratch.concentric=c}i.updateStyle();for(var d=0;d<i.length;d++){var v=i[d],p=v.layoutDimensions(e);u=Math.max(u,p.w,p.h)}l.sort(function(Me,Ne){return Ne.value-Me.value});for(var y=e.levelWidth(i),g=[[]],m=g[0],b=0;b<l.length;b++){var x=l[b];if(m.length>0){var M=Math.abs(m[0].value-x.value);M>=y&&(m=[],g.push(m))}m.push(x)}var O=u+e.minNodeSpacing;if(!e.avoidOverlap){var T=g.length>0&&g[0].length>1,k=Math.min(s.w,s.h)/2-O,D=k/(g.length+T?1:0);O=Math.min(O,D)}for(var F=0,G=0;G<g.length;G++){var I=g[G],H=e.sweep===void 0?2*Math.PI-2*Math.PI/I.length:e.sweep,z=I.dTheta=H/Math.max(1,I.length-1);if(I.length>1&&e.avoidOverlap){var re=Math.cos(z)-Math.cos(0),X=Math.sin(z)-Math.sin(0),K=Math.sqrt(O*O/(re*re+X*X));F=Math.max(K,F)}I.r=F,F+=O}if(e.equidistant){for(var ie=0,fe=0,ve=0;ve<g.length;ve++){var oe=g[ve],ce=oe.r-fe;ie=Math.max(ie,ce)}fe=0;for(var de=0;de<g.length;de++){var xe=g[de];de===0&&(fe=xe.r),xe.r=fe,fe+=ie}}for(var pe={},ge=0;ge<g.length;ge++)for(var ae=g[ge],we=ae.dTheta,Te=ae.r,Ae=0;Ae<ae.length;Ae++){var Oe=ae[Ae],Ye=e.startAngle+(r?1:-1)*we*Ae,He={x:o.x+Te*Math.cos(Ye),y:o.y+Te*Math.sin(Ye)};pe[Oe.node.id()]=He}return n.nodes().layoutPositions(this,e,function(Me){var Ne=Me.id();return pe[Ne]}),this};var $i,sg={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Kn(t){this.options=$e({},sg,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),a=r.filter(function(n){var i=n.source().data("id"),s=n.target().data("id"),o=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(a)}Kn.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?$i=!0:$i=!1;var a=og(e,r,t);$i&&fg(a),t.randomize&&hg(a);var n=dr(),i=function(){cg(a,e,t),t.fit===!0&&e.fit(t.padding)},s=function(c){return!(r.stopped||c>=t.numIter||(vg(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var c=t.eles.nodes(),d=su(a,t,c);c.layoutPositions(r,t,d)}},l=0,u=!0;if(t.animate===!0){var f=function h(){for(var c=0;u&&c<t.refresh;)u=s(l),l++,c++;if(!u)uu(a,t),o();else{var d=dr();d-n>=t.animationThreshold&&i(),pn(h)}};f()}else{for(;u;)u=s(l),l++;uu(a,t),o()}return this},Kn.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Kn.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var og=function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=_t(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=a.eles.components(),u={},f=0;f<l.length;f++)for(var h=l[f],c=0;c<h.length;c++){var d=h[c];u[d.id()]=f}for(var f=0;f<o.nodeSize;f++){var v=i[f],p=v.layoutDimensions(a),y={};y.isLocked=v.locked(),y.id=v.data("id"),y.parentId=v.data("parent"),y.cmptId=u[v.id()],y.children=[],y.positionX=v.position("x"),y.positionY=v.position("y"),y.offsetX=0,y.offsetY=0,y.height=p.w,y.width=p.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(v.style("padding")),y.padRight=parseFloat(v.style("padding")),y.padTop=parseFloat(v.style("padding")),y.padBottom=parseFloat(v.style("padding")),y.nodeRepulsion=ne(a.nodeRepulsion)?a.nodeRepulsion(v):a.nodeRepulsion,o.layoutNodes.push(y),o.idToIndex[y.id]=f}for(var g=[],m=0,b=-1,x=[],f=0;f<o.nodeSize;f++){var v=o.layoutNodes[f],M=v.parentId;M!=null?o.layoutNodes[o.idToIndex[M]].children.push(v.id):(g[++b]=v.id,x.push(v.id))}for(o.graphSet.push(x);m<=b;){var O=g[m++],T=o.idToIndex[O],d=o.layoutNodes[T],k=d.children;if(k.length>0){o.graphSet.push(k);for(var f=0;f<k.length;f++)g[++b]=k[f]}}for(var f=0;f<o.graphSet.length;f++)for(var D=o.graphSet[f],c=0;c<D.length;c++){var F=o.idToIndex[D[c]];o.indexToGraph[F]=f}for(var f=0;f<o.edgeSize;f++){var G=n[f],I={};I.id=G.data("id"),I.sourceId=G.data("source"),I.targetId=G.data("target");var H=ne(a.idealEdgeLength)?a.idealEdgeLength(G):a.idealEdgeLength,z=ne(a.edgeElasticity)?a.edgeElasticity(G):a.edgeElasticity,re=o.idToIndex[I.sourceId],X=o.idToIndex[I.targetId],K=o.indexToGraph[re],ie=o.indexToGraph[X];if(K!=ie){for(var fe=ug(I.sourceId,I.targetId,o),ve=o.graphSet[fe],oe=0,y=o.layoutNodes[re];ve.indexOf(y.id)===-1;)y=o.layoutNodes[o.idToIndex[y.parentId]],oe++;for(y=o.layoutNodes[X];ve.indexOf(y.id)===-1;)y=o.layoutNodes[o.idToIndex[y.parentId]],oe++;H*=oe*a.nestingFactor}I.idealLength=H,I.elasticity=z,o.layoutEdges.push(I)}return o},ug=function(e,r,a){var n=lg(e,r,0,a);return 2>n.count?0:n.graph},lg=function t(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};for(var s=0,o=0;o<i.length;o++){var l=i[o],u=n.idToIndex[l],f=n.layoutNodes[u].children;if(f.length!==0){var h=n.indexToGraph[n.idToIndex[f[0]]],c=t(e,r,h,n);if(c.count!==0)if(c.count===1){if(s++,s===2)break}else return c}}return{count:s,graph:a}},fg,hg=function(e,r){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*a,s.positionY=Math.random()*n)}},su=function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=(l.positionX-i.x1)/i.w,f=(l.positionY-i.y1)/i.h;return{x:n.x1+u*n.w,y:n.y1+f*n.h}}else return{x:l.positionX,y:l.positionY}}},cg=function(e,r,a){var n=a.layout,i=a.eles.nodes(),s=su(e,a,i);i.positions(s),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},vg=function(e,r,a){dg(e,r),yg(e),mg(e,r),bg(e),Eg(e)},dg=function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,s=0;s<i;s++)for(var o=e.layoutNodes[e.idToIndex[n[s]]],l=s+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[n[l]]];gg(o,u,e,r)}},ou=function(e){return-e+2*e*Math.random()},gg=function(e,r,a,n){var i=e.cmptId,s=r.cmptId;if(!(i!==s&&!a.isCompound)){var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;o===0&&l===0&&(o=ou(u),l=ou(u));var f=pg(e,r,o,l);if(f>0)var h=n.nodeOverlap*f,c=Math.sqrt(o*o+l*l),d=h*o/c,v=h*l/c;else var p=Zn(e,o,l),y=Zn(r,-1*o,-1*l),g=y.x-p.x,m=y.y-p.y,b=g*g+m*m,c=Math.sqrt(b),h=(e.nodeRepulsion+r.nodeRepulsion)/b,d=h*g/c,v=h*m/c;e.isLocked||(e.offsetX-=d,e.offsetY-=v),r.isLocked||(r.offsetX+=d,r.offsetY+=v)}},pg=function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Zn=function(e,r,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=a/r,u=s/o,f={};return r===0&&0<a||r===0&&0>a?(f.x=n,f.y=i+s/2,f):0<r&&-1*u<=l&&l<=u?(f.x=n+o/2,f.y=i+o*a/2/r,f):0>r&&-1*u<=l&&l<=u?(f.x=n-o/2,f.y=i-o*a/2/r,f):0<a&&(l<=-1*u||l>=u)?(f.x=n+s*r/2/a,f.y=i+s/2,f):(0>a&&(l<=-1*u||l>=u)&&(f.x=n-s*r/2/a,f.y=i-s/2),f)},yg=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],s=e.layoutNodes[i],o=e.idToIndex[n.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,f=l.positionY-s.positionY;if(!(u===0&&f===0)){var h=Zn(s,u,f),c=Zn(l,-1*u,-1*f),d=c.x-h.x,v=c.y-h.y,p=Math.sqrt(d*d+v*v),y=Math.pow(n.idealLength-p,2)/n.elasticity;if(p!==0)var g=y*d/p,m=y*v/p;else var g=0,m=0;s.isLocked||(s.offsetX+=g,s.offsetY+=m),l.isLocked||(l.offsetX-=g,l.offsetY-=m)}}},mg=function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],s=i.length;if(n===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[u.parentId]],o=f.positionX,l=f.positionY;for(var h=0;h<s;h++){var c=e.layoutNodes[e.idToIndex[i[h]]];if(!c.isLocked){var d=o-c.positionX,v=l-c.positionY,p=Math.sqrt(d*d+v*v);if(p>a){var y=r.gravity*d/p,g=r.gravity*v/p;c.offsetX+=y,c.offsetY+=g}}}}},bg=function(e,r){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){for(var f=l.offsetX,h=l.offsetY,c=0;c<u.length;c++){var d=e.layoutNodes[e.idToIndex[u[c]]];d.offsetX+=f,d.offsetY+=h,a[++i]=u[c]}l.offsetX=0,l.offsetY=0}}},Eg=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(!(0<n.children.length||n.isLocked)){var i=wg(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,xg(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&!n.isLocked&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},wg=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},xg=function t(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,i=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,i=!0),i)return t(n,r)}},uu=function(e,r){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var s=a[i],o=s.cmptId,l=n[o]=n[o]||[];l.push(s)}for(var u=0,i=0;i<n.length;i++){var f=n[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var h=0;h<f.length;h++){var c=f[h];f.x1=Math.min(f.x1,c.positionX-c.width/2),f.x2=Math.max(f.x2,c.positionX+c.width/2),f.y1=Math.min(f.y1,c.positionY-c.height/2),f.y2=Math.max(f.y2,c.positionY+c.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,u+=f.w*f.h}}n.sort(function(m,b){return b.w*b.h-m.w*m.h});for(var d=0,v=0,p=0,y=0,g=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var f=n[i];if(f){for(var h=0;h<f.length;h++){var c=f[h];c.isLocked||(c.positionX+=d-f.x1,c.positionY+=v-f.y1)}d+=f.w+r.componentSpacing,p+=f.w+r.componentSpacing,y=Math.max(y,f.h),p>g&&(v+=y+r.componentSpacing,d=0,p=0,y=0)}}},Tg={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function lu(t){this.options=$e({},Tg,t)}lu.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=_t(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(de){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),f=function(xe){if(xe==null)return Math.min(l,u);var pe=Math.min(l,u);pe==l?l=xe:u=xe},h=function(xe){if(xe==null)return Math.max(l,u);var pe=Math.max(l,u);pe==l?l=xe:u=xe},c=e.rows,d=e.cols!=null?e.cols:e.columns;if(c!=null&&d!=null)l=c,u=d;else if(c!=null&&d==null)l=c,u=Math.ceil(s/l);else if(c==null&&d!=null)u=d,l=Math.ceil(s/u);else if(u*l>s){var v=f(),p=h();(v-1)*p>=s?f(v-1):(p-1)*v>=s&&h(p-1)}else for(;u*l<s;){var y=f(),g=h();(g+1)*y>=s?h(g+1):f(y+1)}var m=i.w/u,b=i.h/l;if(e.condense&&(m=0,b=0),e.avoidOverlap)for(var x=0;x<n.length;x++){var M=n[x],O=M._private.position;(O.x==null||O.y==null)&&(O.x=0,O.y=0);var T=M.layoutDimensions(e),k=e.avoidOverlapPadding,D=T.w+k,F=T.h+k;m=Math.max(m,D),b=Math.max(b,F)}for(var G={},I=function(xe,pe){return!!G["c-"+xe+"-"+pe]},H=function(xe,pe){G["c-"+xe+"-"+pe]=!0},z=0,re=0,X=function(){re++,re>=u&&(re=0,z++)},K={},ie=0;ie<n.length;ie++){var fe=n[ie],ve=e.position(fe);if(ve&&(ve.row!==void 0||ve.col!==void 0)){var oe={row:ve.row,col:ve.col};if(oe.col===void 0)for(oe.col=0;I(oe.row,oe.col);)oe.col++;else if(oe.row===void 0)for(oe.row=0;I(oe.row,oe.col);)oe.row++;K[fe.id()]=oe,H(oe.row,oe.col)}}var ce=function(xe,pe){var ge,ae;if(xe.locked()||xe.isParent())return!1;var we=K[xe.id()];if(we)ge=we.col*m+m/2+i.x1,ae=we.row*b+b/2+i.y1;else{for(;I(z,re);)X();ge=re*m+m/2+i.x1,ae=z*b+b/2+i.y1,H(z,re),X()}return{x:ge,y:ae}};n.layoutPositions(this,e,ce)}return this};var Cg={ready:function(){},stop:function(){}};function _i(t){this.options=$e({},Cg,t)}_i.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this},_i.prototype.stop=function(){return this};var Dg={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function fu(t){this.options=$e({},Dg,t)}fu.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=ne(t.positions);function n(i){if(t.positions==null)return Nf(i.position());if(a)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return r.layoutPositions(this,t,function(i,s){var o=n(i);return i.locked()||o==null?!1:o}),this};var Sg={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function hu(t){this.options=$e({},Sg,t)}hu.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=_t(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(s,o){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var Lg=[{name:"breadthfirst",impl:au},{name:"circle",impl:nu},{name:"concentric",impl:iu},{name:"cose",impl:Kn},{name:"grid",impl:lu},{name:"null",impl:_i},{name:"preset",impl:fu},{name:"random",impl:hu}];function cu(t){this.options=t,this.notifications=0}var vu=function(){},du=function(){throw new Error("A headless instance can not render images")};cu.prototype={recalculateRenderedStyle:vu,notify:function(){this.notifications++},init:vu,isHeadless:function(){return!0},png:du,jpg:du};var Ui={};Ui.arrowShapeWidth=.3,Ui.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,f,h,c,d,v,p){var y=d.x-h/2-p,g=d.x+h/2+p,m=d.y-h/2-p,b=d.y+h/2+p,x=y<=u&&u<=g&&m<=f&&f<=b;return x},a=function(u,f,h,c,d){var v=u*Math.cos(c)-f*Math.sin(c),p=u*Math.sin(c)+f*Math.cos(c),y=v*h,g=p*h,m=y+d.x,b=g+d.y;return{x:m,y:b}},n=function(u,f,h,c){for(var d=[],v=0;v<u.length;v+=2){var p=u[v],y=u[v+1];d.push(a(p,y,f,h,c))}return d},i=function(u){for(var f=[],h=0;h<u.length;h++){var c=u[h];f.push(c.x,c.y)}return f},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,f){ee(f)&&(f=t[f]),t[u]=$e({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(c,d,v,p,y,g){var m=i(n(this.points,v+2*g,p,y)),b=Ut(c,d,m);return b},roughCollide:r,draw:function(c,d,v,p){var y=n(this.points,d,v,p);e.arrowShapeImpl("polygon")(c,y)},spacing:function(c){return 0},gap:s},f)};o("none",{collide:mn,roughCollide:mn,draw:hi,spacing:Cs,gap:Cs}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,f,h,c,d){var v=n(this.points,f,h,c),p=this.controlPoint,y=a(p[0],p[1],f,h,c);e.arrowShapeImpl(this.name)(u,v,y)},gap:function(u){return s(u)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,f,h,c,d,v,p){var y=i(n(this.points,h+2*p,c,d)),g=i(n(this.pointsTee,h+2*p,c,d)),m=Ut(u,f,y)||Ut(u,f,g);return m},draw:function(u,f,h,c,d){var v=n(this.points,f,h,c),p=n(this.pointsTee,f,h,c);e.arrowShapeImpl(this.name)(u,v,p)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,f,h,c,d,v,p){var y=d,g=Math.pow(y.x-u,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*p)*this.radius,2),m=i(n(this.points,h+2*p,c,d));return Ut(u,f,m)||g},draw:function(u,f,h,c,d){var v=n(this.pointsTr,f,h,c);e.arrowShapeImpl(this.name)(u,v,c.x,c.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,f){var h=this.baseCrossLinePts.slice(),c=f/u,d=3,v=5;return h[d]=h[d]-c,h[v]=h[v]-c,h},collide:function(u,f,h,c,d,v,p){var y=i(n(this.points,h+2*p,c,d)),g=i(n(this.crossLinePts(h,v),h+2*p,c,d)),m=Ut(u,f,y)||Ut(u,f,g);return m},draw:function(u,f,h,c,d){var v=n(this.points,f,h,c),p=n(this.crossLinePts(f,d),f,h,c);e.arrowShapeImpl(this.name)(u,v,p)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),o("circle",{radius:.15,collide:function(u,f,h,c,d,v,p){var y=d,g=Math.pow(y.x-u,2)+Math.pow(y.y-f,2)<=Math.pow((h+2*p)*this.radius,2);return g},draw:function(u,f,h,c,d){e.arrowShapeImpl(this.name)(u,c.x,c.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Yr={};Yr.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],s=a[4],o=r.pan(),l=r.zoom(),u=((t-n)/s-o.x)/l,f=((e-i)/s-o.y)/l;return[u,f]},Yr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(g){return parseFloat(r.getPropertyValue(g))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},s=t.clientWidth,o=t.clientHeight,l=n.left+n.right,u=n.top+n.bottom,f=i.left+i.right,h=e.width/(s+f),c=s-l,d=o-u,v=e.left+n.left+i.left,p=e.top+n.top+i.top;return this.containerBB=[v,p,c,d,h]},Yr.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Yr.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]},Yr.findNearestElements=function(t,e,r,a){var n=this,i=this,s=i.getCachedZSortedEles(),o=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),f=(a?24:8)/l,h=(a?8:2)/l,c=(a?8:2)/l,d=1/0,v,p;r&&(s=s.interactive);function y(T,k){if(T.isNode()){if(p)return;p=T,o.push(T)}if(T.isEdge()&&(k==null||k<d))if(v){if(v.pstyle("z-compound-depth").value===T.pstyle("z-compound-depth").value&&v.pstyle("z-compound-depth").value===T.pstyle("z-compound-depth").value){for(var D=0;D<o.length;D++)if(o[D].isEdge()){o[D]=T,v=T,d=k??d;break}}}else o.push(T),v=T,d=k??d}function g(T){var k=T.outerWidth()+2*h,D=T.outerHeight()+2*h,F=k/2,G=D/2,I=T.position();if(I.x-F<=t&&t<=I.x+F&&I.y-G<=e&&e<=I.y+G){var H=i.nodeShapes[n.getNodeShape(T)];if(H.checkPoint(t,e,0,k,D,I.x,I.y))return y(T,0),!0}}function m(T){var k=T._private,D=k.rscratch,F=T.pstyle("width").pfValue,G=T.pstyle("arrow-scale").value,I=F/2+f,H=I*I,z=I*2,ie=k.source,fe=k.target,re;if(D.edgeType==="segments"||D.edgeType==="straight"||D.edgeType==="haystack"){for(var X=D.allpts,K=0;K+3<X.length;K+=2)if(Uf(t,e,X[K],X[K+1],X[K+2],X[K+3],z)&&H>(re=qf(t,e,X[K],X[K+1],X[K+2],X[K+3])))return y(T,re),!0}else if(D.edgeType==="bezier"||D.edgeType==="multibezier"||D.edgeType==="self"||D.edgeType==="compound"){for(var X=D.allpts,K=0;K+5<D.allpts.length;K+=4)if(Yf(t,e,X[K],X[K+1],X[K+2],X[K+3],X[K+4],X[K+5],z)&&H>(re=Wf(t,e,X[K],X[K+1],X[K+2],X[K+3],X[K+4],X[K+5])))return y(T,re),!0}for(var ie=ie||k.source,fe=fe||k.target,ve=n.getArrowWidth(F,G),oe=[{name:"source",x:D.arrowStartX,y:D.arrowStartY,angle:D.srcArrowAngle},{name:"target",x:D.arrowEndX,y:D.arrowEndY,angle:D.tgtArrowAngle},{name:"mid-source",x:D.midX,y:D.midY,angle:D.midsrcArrowAngle},{name:"mid-target",x:D.midX,y:D.midY,angle:D.midtgtArrowAngle}],K=0;K<oe.length;K++){var ce=oe[K],de=i.arrowShapes[T.pstyle(ce.name+"-arrow-shape").value],xe=T.pstyle("width").pfValue;if(de.roughCollide(t,e,ve,ce.angle,{x:ce.x,y:ce.y},xe,f)&&de.collide(t,e,ve,ce.angle,{x:ce.x,y:ce.y},xe,f))return y(T),!0}u&&o.length>0&&(g(ie),g(fe))}function b(T,k,D){return er(T,k,D)}function x(T,k){var D=T._private,F=c,G;k?G=k+"-":G="",T.boundingBox();var I=D.labelBounds[k||"main"],H=T.pstyle(G+"label").value,z=T.pstyle("text-events").strValue==="yes";if(!(!z||!H)){var re=b(D.rscratch,"labelX",k),X=b(D.rscratch,"labelY",k),K=b(D.rscratch,"labelAngle",k),ie=T.pstyle(G+"text-margin-x").pfValue,fe=T.pstyle(G+"text-margin-y").pfValue,ve=I.x1-F-ie,oe=I.x2+F-ie,ce=I.y1-F-fe,de=I.y2+F-fe;if(K){var xe=Math.cos(K),pe=Math.sin(K),ge=function(He,Me){return He=He-re,Me=Me-X,{x:He*xe-Me*pe+re,y:He*pe+Me*xe+X}},ae=ge(ve,ce),we=ge(ve,de),Te=ge(oe,ce),Ae=ge(oe,de),Oe=[ae.x+ie,ae.y+fe,Te.x+ie,Te.y+fe,Ae.x+ie,Ae.y+fe,we.x+ie,we.y+fe];if(Ut(t,e,Oe))return y(T),!0}else if(na(I,t,e))return y(T),!0}}for(var M=s.length-1;M>=0;M--){var O=s[M];O.isNode()?g(O)||x(O):m(O)||x(O)||x(O,"source")||x(O,"target")}return o},Yr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,r),o=Math.max(t,r),l=Math.min(e,a),u=Math.max(e,a);t=s,r=o,e=l,a=u;for(var f=_t({x1:t,y1:e,x2:r,y2:a}),h=0;h<n.length;h++){var c=n[h];if(c.isNode()){var d=c,v=d.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});pi(f,v)&&!Is(v,f)&&i.push(d)}else{var p=c,y=p._private,g=y.rscratch;if(g.startX!=null&&g.startY!=null&&!na(f,g.startX,g.startY)||g.endX!=null&&g.endY!=null&&!na(f,g.endX,g.endY))continue;if(g.edgeType==="bezier"||g.edgeType==="multibezier"||g.edgeType==="self"||g.edgeType==="compound"||g.edgeType==="segments"||g.edgeType==="haystack"){for(var m=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,b=!0,x=0;x<m.length;x++)if(!_f(f,m[x])){b=!1;break}b&&i.push(p)}else(g.edgeType==="haystack"||g.edgeType==="straight")&&i.push(p)}}return i};var Qn={};Qn.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,f,h,c,d,g,m;if(r?(f=e.haystackPts[0],h=e.haystackPts[1],c=e.haystackPts[2],d=e.haystackPts[3]):(f=e.arrowStartX,h=e.arrowStartY,c=e.arrowEndX,d=e.arrowEndY),g=e.midX,m=e.midY,i)l=f-e.segpts[0],u=h-e.segpts[1];else if(n||s||o||a){var v=e.allpts,p=St(v[0],v[2],v[4],.1),y=St(v[1],v[3],v[5],.1);l=f-p,u=h-y}else l=f-g,u=h-m;e.srcArrowAngle=wn(l,u);var g=e.midX,m=e.midY;if(r&&(g=(f+c)/2,m=(h+d)/2),l=c-f,u=d-h,i){var v=e.allpts;if(v.length/2%2===0){var b=v.length/2,x=b-2;l=v[b]-v[x],u=v[b+1]-v[x+1]}else{var b=v.length/2-1,x=b-2,M=b+2;l=v[b]-v[x],u=v[b+1]-v[x+1]}}else if(n||s||o){var v=e.allpts,O=e.ctrlpts,T,k,D,F;if(O.length/2%2===0){var G=v.length/2-1,I=G+2,H=I+2;T=St(v[G],v[I],v[H],0),k=St(v[G+1],v[I+1],v[H+1],0),D=St(v[G],v[I],v[H],1e-4),F=St(v[G+1],v[I+1],v[H+1],1e-4)}else{var I=v.length/2-1,G=I-2,H=I+2;T=St(v[G],v[I],v[H],.4999),k=St(v[G+1],v[I+1],v[H+1],.4999),D=St(v[G],v[I],v[H],.5),F=St(v[G+1],v[I+1],v[H+1],.5)}l=D-T,u=F-k}if(e.midtgtArrowAngle=wn(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var v=e.allpts;if(v.length/2%2!==0){var b=v.length/2-1,M=b+2;l=-(v[M]-v[b]),u=-(v[M+1]-v[b+1])}}if(e.midsrcArrowAngle=wn(l,u),i)l=c-e.segpts[e.segpts.length-2],u=d-e.segpts[e.segpts.length-1];else if(n||s||o||a){var v=e.allpts,z=v.length,p=St(v[z-6],v[z-4],v[z-2],.9),y=St(v[z-5],v[z-3],v[z-1],.9);l=c-p,u=d-y}else l=c-g,u=d-m;e.tgtArrowAngle=wn(l,u)},Qn.getArrowWidth=Qn.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];return a||(a=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=a,a)};var zt={};zt.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(M,O,T,k){var D=k-O,F=T-M,G=Math.sqrt(F*F+D*D);return{x:-D/G,y:F/G}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(l){var h=this.manualEndptToPx(t.source()[0],s),c=w(h,2),d=c[0],v=c[1],p=this.manualEndptToPx(t.target()[0],o),y=w(p,2),g=y[0],m=y[1],b={x1:d,y1:v,x2:g,y2:m};n=u(d,v,g,m),i=b}else ot("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}},zt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var s=a.source,o=a.target,l=s.position(),u=o.position(),f=s.width(),h=o.width(),c=s.height(),d=o.height(),v=r.pstyle("haystack-radius").value,p=v/2;n.haystackPts=n.allpts=[n.source.x*f*p+l.x,n.source.y*c*p+l.y,n.target.x*h*p+u.x,n.target.y*d*p+u.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}},zt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),i=Math.min(a.pfValue.length,n.pfValue.length);r.edgeType="segments",r.segpts=[];for(var s=0;s<i;s++){var o=a.pfValue[s],l=n.pfValue[s],u=1-o,f=o,h=this.findMidptPtsEtc(t,e),c=h.midptPts,d=h.vectorNormInverse,v={x:c.x1*u+c.x2*f,y:c.y1*u+c.y2*f};r.segpts.push(v.x+d.x*l,v.y+d.y*l)}},zt.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,i=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,h=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var c=r,d=h;a&&(c=0,d=l);var v=u-Math.PI/2,p=v-f/2,y=v+f/2,g=u+"_"+f;c=i[g]===void 0?i[g]=0:++i[g],n.ctrlpts=[s.x+Math.cos(p)*1.4*d*(c/3+1),s.y+Math.sin(p)*1.4*d*(c/3+1),s.x+Math.cos(y)*1.4*d*(c/3+1),s.y+Math.sin(y)*1.4*d*(c/3+1)]},zt.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var i=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,u=e.tgtW,f=e.tgtH,h=t.pstyle("control-point-step-size").pfValue,c=t.pstyle("control-point-distances"),d=c?c.pfValue[0]:void 0,v=r,p=h;a&&(v=0,p=d);var y=50,g={x:i.x-o/2,y:i.y-l/2},m={x:s.x-u/2,y:s.y-f/2},b={x:Math.min(g.x,m.x),y:Math.min(g.y,m.y)},x=.5,M=Math.max(x,Math.log(o*.01)),O=Math.max(x,Math.log(u*.01));n.ctrlpts=[b.x,b.y-(1+Math.pow(y,1.12)/100)*p*(v/3+1)*M,b.x-(1+Math.pow(y,1.12)/100)*p*(v/3+1)*O,b.y]},zt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},zt.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,f=o?o.pfValue[0]:void 0,h=l.value[0],c=a;i.edgeType=c?"multibezier":"bezier",i.ctrlpts=[];for(var d=0;d<u;d++){var v=(.5-e.eles.length/2+r)*s*(n?-1:1),p=void 0,y=Ns(v);c&&(f=o?o.pfValue[d]:s,h=l.value[d]),a?p=f:p=f!==void 0?y*f:void 0;var g=p!==void 0?p:v,m=1-h,b=h,x=this.findMidptPtsEtc(t,e),M=x.midptPts,O=x.vectorNormInverse,T={x:M.x1*m+M.x2*b,y:M.y1*m+M.y2*b};i.ctrlpts.push(T.x+O.x*g,T.y+O.y*g)}},zt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",s="rightward",o="downward",l="upward",u="auto",f=e.posPts,h=e.srcW,c=e.srcH,d=e.tgtW,v=e.tgtH,p=t.pstyle("edge-distances").value,y=p!=="node-position",g=t.pstyle("taxi-direction").value,m=g,b=t.pstyle("taxi-turn"),x=b.units==="%",M=b.pfValue,O=M<0,T=t.pstyle("taxi-turn-min-distance").pfValue,k=y?(h+d)/2:0,D=y?(c+v)/2:0,F=f.x2-f.x1,G=f.y2-f.y1,I=function(Se,Ve){return Se>0?Math.max(Se-Ve,0):Math.min(Se+Ve,0)},H=I(F,k),z=I(G,D),re=!1;m===u?g=Math.abs(H)>Math.abs(z)?n:a:m===l||m===o?(g=a,re=!0):(m===i||m===s)&&(g=n,re=!0);var X=g===a,K=X?z:H,ie=X?G:F,fe=Ns(ie),ve=!1;!(re&&(x||O))&&(m===o&&ie<0||m===l&&ie>0||m===i&&ie>0||m===s&&ie<0)&&(fe*=-1,K=fe*Math.abs(K),ve=!0);var oe;if(x){var ce=M<0?1+M:M;oe=ce*K}else{var de=M<0?K:0;oe=de+M*fe}var xe=function(Se){return Math.abs(Se)<T||Math.abs(Se)>=Math.abs(K)},pe=xe(oe),ge=xe(Math.abs(K)-Math.abs(oe)),ae=pe||ge;if(ae&&!ve)if(X){var we=Math.abs(ie)<=c/2,Te=Math.abs(F)<=d/2;if(we){var Ae=(f.x1+f.x2)/2,Oe=f.y1,Ye=f.y2;r.segpts=[Ae,Oe,Ae,Ye]}else if(Te){var He=(f.y1+f.y2)/2,Me=f.x1,Ne=f.x2;r.segpts=[Me,He,Ne,He]}else r.segpts=[f.x1,f.y2]}else{var Be=Math.abs(ie)<=h/2,ke=Math.abs(G)<=v/2;if(Be){var Ie=(f.y1+f.y2)/2,Pe=f.x1,je=f.x2;r.segpts=[Pe,Ie,je,Ie]}else if(ke){var Ke=(f.x1+f.x2)/2,_e=f.y1,ht=f.y2;r.segpts=[Ke,_e,Ke,ht]}else r.segpts=[f.x2,f.y1]}else if(X){var Ce=f.y1+oe+(y?c/2*fe:0),P=f.x1,he=f.x2;r.segpts=[P,Ce,he,Ce]}else{var De=f.x1+oe+(y?h/2*fe:0),ye=f.y1,me=f.y2;r.segpts=[De,ye,De,me]}},zt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,f=e.tgtShape,h=!N(r.startX)||!N(r.startY),c=!N(r.arrowStartX)||!N(r.arrowStartY),d=!N(r.endX)||!N(r.endY),v=!N(r.arrowEndX)||!N(r.arrowEndY),p=3,y=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,g=p*y,m=zr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),b=m<g,x=zr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),M=x<g,O=!1;if(h||c||b){O=!0;var T={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},k=Math.sqrt(T.x*T.x+T.y*T.y),D={x:T.x/k,y:T.y/k},F=Math.max(i,s),G={x:r.ctrlpts[0]+D.x*2*F,y:r.ctrlpts[1]+D.y*2*F},I=u.intersectLine(a.x,a.y,i,s,G.x,G.y,0);b?(r.ctrlpts[0]=r.ctrlpts[0]+D.x*(g-m),r.ctrlpts[1]=r.ctrlpts[1]+D.y*(g-m)):(r.ctrlpts[0]=I[0]+D.x*g,r.ctrlpts[1]=I[1]+D.y*g)}if(d||v||M){O=!0;var H={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},z=Math.sqrt(H.x*H.x+H.y*H.y),re={x:H.x/z,y:H.y/z},X=Math.max(i,s),K={x:r.ctrlpts[0]+re.x*2*X,y:r.ctrlpts[1]+re.y*2*X},ie=f.intersectLine(n.x,n.y,o,l,K.x,K.y,0);M?(r.ctrlpts[0]=r.ctrlpts[0]+re.x*(g-x),r.ctrlpts[1]=r.ctrlpts[1]+re.y*(g-x)):(r.ctrlpts[0]=ie[0]+re.x*g,r.ctrlpts[1]=ie[1]+re.y*g)}O&&this.findEndpoints(t)}},zt.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=St(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=St(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments")if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.segpts.length%4===0){var i=e.segpts.length/2,s=i-2;e.midX=(e.segpts[s]+e.segpts[i])/2,e.midY=(e.segpts[s+1]+e.segpts[i+1])/2}else{var o=e.segpts.length/2-1;e.midX=e.segpts[o],e.midY=e.segpts[o+1]}},zt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||N(e.startX)&&N(e.startY)&&N(e.endX)&&N(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,ot("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},zt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),i={map:new ur,get:function(T){var k=this.map.get(T[0]);return k!=null?k.get(T[1]):null},set:function(T,k){var D=this.map.get(T[0]);D==null&&(D=new ur,this.map.set(T[0],D)),D.set(T[1],k)}},s=[],o=[],l=0;l<t.length;l++){var u=t[l],f=u._private,h=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(h==="haystack"){o.push(u);continue}var c=h==="unbundled-bezier"||h==="segments"||h==="straight"||h==="straight-triangle"||h==="taxi",d=h==="unbundled-bezier"||h==="bezier",v=f.source,p=f.target,y=v.poolIndex(),g=p.poolIndex(),m=[y,g].sort(),b=i.get(m);b==null&&(b={eles:[]},i.set(m,b),s.push(m)),b.eles.push(u),c&&(b.hasUnbundled=!0),d&&(b.hasBezier=!0)}}for(var x=function(T){var k=s[T],D=i.get(k),F=void 0;if(!D.hasUnbundled){var G=D.eles[0].parallelEdges().filter(function(ht){return ht.isBundledBezier()});ci(D.eles),G.forEach(function(ht){return D.eles.push(ht)}),D.eles.sort(function(ht,Ce){return ht.poolIndex()-Ce.poolIndex()})}var I=D.eles[0],H=I.source(),z=I.target();if(H.poolIndex()>z.poolIndex()){var re=H;H=z,z=re}var X=D.srcPos=H.position(),K=D.tgtPos=z.position(),ie=D.srcW=H.outerWidth(),fe=D.srcH=H.outerHeight(),ve=D.tgtW=z.outerWidth(),oe=D.tgtH=z.outerHeight(),ce=D.srcShape=r.nodeShapes[e.getNodeShape(H)],de=D.tgtShape=r.nodeShapes[e.getNodeShape(z)];D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var xe=0;xe<D.eles.length;xe++){var pe=D.eles[xe],ge=pe[0]._private.rscratch,ae=pe.pstyle("curve-style").value,we=ae==="unbundled-bezier"||ae==="segments"||ae==="taxi",Te=!H.same(pe.source());if(!D.calculatedIntersection&&H!==z&&(D.hasBezier||D.hasUnbundled)){D.calculatedIntersection=!0;var Ae=ce.intersectLine(X.x,X.y,ie,fe,K.x,K.y,0),Oe=D.srcIntn=Ae,Ye=de.intersectLine(K.x,K.y,ve,oe,X.x,X.y,0),He=D.tgtIntn=Ye,Me=D.intersectionPts={x1:Ae[0],x2:Ye[0],y1:Ae[1],y2:Ye[1]},Ne=D.posPts={x1:X.x,x2:K.x,y1:X.y,y2:K.y},Be=Ye[1]-Ae[1],ke=Ye[0]-Ae[0],Ie=Math.sqrt(ke*ke+Be*Be),Pe=D.vector={x:ke,y:Be},je=D.vectorNorm={x:Pe.x/Ie,y:Pe.y/Ie},Ke={x:-je.y,y:je.x};D.nodesOverlap=!N(Ie)||de.checkPoint(Ae[0],Ae[1],0,ve,oe,K.x,K.y)||ce.checkPoint(Ye[0],Ye[1],0,ie,fe,X.x,X.y),D.vectorNormInverse=Ke,F={nodesOverlap:D.nodesOverlap,dirCounts:D.dirCounts,calculatedIntersection:!0,hasBezier:D.hasBezier,hasUnbundled:D.hasUnbundled,eles:D.eles,srcPos:K,tgtPos:X,srcW:ve,srcH:oe,tgtW:ie,tgtH:fe,srcIntn:He,tgtIntn:Oe,srcShape:de,tgtShape:ce,posPts:{x1:Ne.x2,y1:Ne.y2,x2:Ne.x1,y2:Ne.y1},intersectionPts:{x1:Me.x2,y1:Me.y2,x2:Me.x1,y2:Me.y1},vector:{x:-Pe.x,y:-Pe.y},vectorNorm:{x:-je.x,y:-je.y},vectorNormInverse:{x:-Ke.x,y:-Ke.y}}}var _e=Te?F:D;ge.nodesOverlap=_e.nodesOverlap,ge.srcIntn=_e.srcIntn,ge.tgtIntn=_e.tgtIntn,n&&(H.isParent()||H.isChild()||z.isParent()||z.isChild())&&(H.parents().anySame(z)||z.parents().anySame(H)||H.same(z)&&H.isParent())?e.findCompoundLoopPoints(pe,_e,xe,we):H===z?e.findLoopPoints(pe,_e,xe,we):ae==="segments"?e.findSegmentsPoints(pe,_e):ae==="taxi"?e.findTaxiPoints(pe,_e):ae==="straight"||!we&&D.eles.length%2===1&&xe===Math.floor(D.eles.length/2)?e.findStraightEdgePoints(pe):e.findBezierPoints(pe,_e,xe,we,Te),e.findEndpoints(pe),e.tryToCorrectInvalidPoints(pe,_e),e.checkForInvalidEdgeWarning(pe),e.storeAllpts(pe),e.storeEdgeProjections(pe),e.calculateArrowAngles(pe),e.recalculateEdgeLabelProjections(pe),e.calculateLabelAngles(pe)}},M=0;M<s.length;M++)x(M);this.findHaystackPoints(o)}};function gu(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}}zt.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),gu(e.segpts)},zt.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),gu(e.ctrlpts)},zt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var ja={};ja.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight();if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*n),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=a.x,s[1]+=a.y,s}else{var o=e.pfValue[0];o=-Math.PI/2+o;var l=2*Math.max(n,i),u=[a.x+Math.cos(o)*l,a.y+Math.sin(o)*l];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,i,u[0],u[1],0)}},ja.findEndpoints=function(t){var e=this,r,a=t.source()[0],n=t.target()[0],i=a.position(),s=n.position(),o=t.pstyle("target-arrow-shape").value,l=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,f=t.pstyle("source-distance-from-node").pfValue,h=t.pstyle("curve-style").value,c=t._private.rscratch,d=c.edgeType,v=h==="taxi",p=d==="self"||d==="compound",y=d==="bezier"||d==="multibezier"||p,g=d!=="bezier",m=d==="straight"||d==="segments",b=d==="segments",x=y||g||m,M=p||v,O=t.pstyle("source-endpoint"),T=M?"outside-to-node":O.value,k=t.pstyle("target-endpoint"),D=M?"outside-to-node":k.value;c.srcManEndpt=O,c.tgtManEndpt=k;var F,G,I,H;if(y){var z=[c.ctrlpts[0],c.ctrlpts[1]],re=g?[c.ctrlpts[c.ctrlpts.length-2],c.ctrlpts[c.ctrlpts.length-1]]:z;F=re,G=z}else if(m){var X=b?c.segpts.slice(0,2):[s.x,s.y],K=b?c.segpts.slice(c.segpts.length-2):[i.x,i.y];F=K,G=X}if(D==="inside-to-node")r=[s.x,s.y];else if(k.units)r=this.manualEndptToPx(n,k);else if(D==="outside-to-line")r=c.tgtIntn;else if(D==="outside-to-node"||D==="outside-to-node-or-label"?I=F:(D==="outside-to-line"||D==="outside-to-line-or-label")&&(I=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(s.x,s.y,n.outerWidth(),n.outerHeight(),I[0],I[1],0),D==="outside-to-node-or-label"||D==="outside-to-line-or-label"){var ie=n._private.rscratch,fe=ie.labelWidth,ve=ie.labelHeight,oe=ie.labelX,ce=ie.labelY,de=fe/2,xe=ve/2,pe=n.pstyle("text-valign").value;pe==="top"?ce-=xe:pe==="bottom"&&(ce+=xe);var ge=n.pstyle("text-halign").value;ge==="left"?oe-=de:ge==="right"&&(oe+=de);var ae=za(I[0],I[1],[oe-de,ce-xe,oe+de,ce-xe,oe+de,ce+xe,oe-de,ce+xe],s.x,s.y);if(ae.length>0){var we=i,Te=Gr(we,ra(r)),Ae=Gr(we,ra(ae)),Oe=Te;if(Ae<Te&&(r=ae,Oe=Ae),ae.length>2){var Ye=Gr(we,{x:ae[2],y:ae[3]});Ye<Oe&&(r=[ae[2],ae[3]])}}}var He=Tn(r,F,e.arrowShapes[o].spacing(t)+u),Me=Tn(r,F,e.arrowShapes[o].gap(t)+u);if(c.endX=Me[0],c.endY=Me[1],c.arrowEndX=He[0],c.arrowEndY=He[1],T==="inside-to-node")r=[i.x,i.y];else if(O.units)r=this.manualEndptToPx(a,O);else if(T==="outside-to-line")r=c.srcIntn;else if(T==="outside-to-node"||T==="outside-to-node-or-label"?H=G:(T==="outside-to-line"||T==="outside-to-line-or-label")&&(H=[s.x,s.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(i.x,i.y,a.outerWidth(),a.outerHeight(),H[0],H[1],0),T==="outside-to-node-or-label"||T==="outside-to-line-or-label"){var Ne=a._private.rscratch,Be=Ne.labelWidth,ke=Ne.labelHeight,Ie=Ne.labelX,Pe=Ne.labelY,je=Be/2,Ke=ke/2,_e=a.pstyle("text-valign").value;_e==="top"?Pe-=Ke:_e==="bottom"&&(Pe+=Ke);var ht=a.pstyle("text-halign").value;ht==="left"?Ie-=je:ht==="right"&&(Ie+=je);var Ce=za(H[0],H[1],[Ie-je,Pe-Ke,Ie+je,Pe-Ke,Ie+je,Pe+Ke,Ie-je,Pe+Ke],i.x,i.y);if(Ce.length>0){var P=s,he=Gr(P,ra(r)),De=Gr(P,ra(Ce)),ye=he;if(De<he&&(r=[Ce[0],Ce[1]],ye=De),Ce.length>2){var me=Gr(P,{x:Ce[2],y:Ce[3]});me<ye&&(r=[Ce[2],Ce[3]])}}}var Xe=Tn(r,G,e.arrowShapes[l].spacing(t)+f),Se=Tn(r,G,e.arrowShapes[l].gap(t)+f);c.startX=Se[0],c.startY=Se[1],c.arrowStartX=Xe[0],c.arrowStartY=Xe[1],x&&(!N(c.startX)||!N(c.startY)||!N(c.endX)||!N(c.endY)?c.badLine=!0:c.badLine=!1)},ja.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},ja.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Yi={};function Ag(t,e,r){for(var a=function(u,f,h,c){return St(u,f,h,c)},n=e._private,i=n.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];i.push({x:a(r[0],r[2],r[4],o),y:a(r[1],r[3],r[5],o)})}}Yi.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)Ag(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)i.push({x:r.allpts[n],y:r.allpts[n+1]});else if(a==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},Yi.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var fr={};fr.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Ue(e)){var r,a,n=t._private,i=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,h=n.rscratch,c=n.rstyle;switch(u){case"left":r=l.x-i/2-o;break;case"right":r=l.x+i/2+o;break;default:r=l.x}switch(f){case"top":a=l.y-s/2-o;break;case"bottom":a=l.y+s/2+o;break;default:a=l.y}h.labelX=r,h.labelY=a,c.labelX=r,c.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var pu=function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},yu=function(e,r){var a=r.x-e.x,n=r.y-e.y;return pu(a,n)},Og=function(e,r,a,n){var i=Ba(0,n-.001,1),s=Ba(0,n+.001,1),o=aa(e,r,a,i),l=aa(e,r,a,s);return yu(o,l)};fr.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:a.midX,y:a.midY};var s=function(h,c,d){Cr(r.rscratch,h,c,d),Cr(r.rstyle,h,c,d)};s("labelX",null,e.x),s("labelY",null,e.y);var o=pu(a.midDispX,a.midDispY);s("labelAutoAngle",null,o);var l=function f(){if(f.cache)return f.cache;for(var h=[],c=0;c+5<a.allpts.length;c+=4){var d={x:a.allpts[c],y:a.allpts[c+1]},v={x:a.allpts[c+2],y:a.allpts[c+3]},p={x:a.allpts[c+4],y:a.allpts[c+5]};h.push({p0:d,p1:v,p2:p,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,g=n.bezierProjPcts.length;function m(T,k,D,F,G){var I=zr(k,D),H=T.segments[T.segments.length-1],z={p0:k,p1:D,t0:F,t1:G,startDist:H?H.startDist+H.length:0,length:I};T.segments.push(z),T.length+=I}for(var b=0;b<h.length;b++){var x=h[b],M=h[b-1];M&&(x.startDist=M.startDist+M.length),m(x,x.p0,y[b*g],0,n.bezierProjPcts[0]);for(var O=0;O<g-1;O++)m(x,y[b*g+O],y[b*g+O+1],n.bezierProjPcts[O],n.bezierProjPcts[O+1]);m(x,y[b*g+g-1],x.p2,n.bezierProjPcts[g-1],1)}return f.cache=h},u=function(h){var c,d=h==="source";if(i[h]){var v=t.pstyle(h+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=l(),y,g=0,m=0,b=0;b<p.length;b++){for(var x=p[d?b:p.length-1-b],M=0;M<x.segments.length;M++){var O=x.segments[d?M:x.segments.length-1-M],T=b===p.length-1&&M===x.segments.length-1;if(g=m,m+=O.length,m>=v||T){y={cp:x,segment:O};break}}if(y)break}var k=y.cp,D=y.segment,F=(v-g)/D.length,G=D.t1-D.t0,I=d?D.t0+G*F:D.t1-G*F;I=Ba(0,I,1),e=aa(k.p0,k.p1,k.p2,I),c=Og(k.p0,k.p1,k.p2,I);break}case"straight":case"segments":case"haystack":{for(var H=0,z,re,X,K,ie=a.allpts.length,fe=0;fe+3<ie&&(d?(X={x:a.allpts[fe],y:a.allpts[fe+1]},K={x:a.allpts[fe+2],y:a.allpts[fe+3]}):(X={x:a.allpts[ie-2-fe],y:a.allpts[ie-1-fe]},K={x:a.allpts[ie-4-fe],y:a.allpts[ie-3-fe]}),z=zr(X,K),re=H,H+=z,!(H>=v));fe+=2);var ve=v-re,oe=ve/z;oe=Ba(0,oe,1),e=Ff(X,K,oe),c=yu(X,K);break}}s("labelX",h,e.x),s("labelY",h,e.y),s("labelAutoAngle",h,c)}};u("source"),u("target"),this.applyLabelDimensions(t)}},fr.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},fr.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=this.calculateLabelDimensions(t,a),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=er(r.rscratch,"labelWrapCachedLines",e)||[],l=s!=="wrap"?1:Math.max(o.length,1),u=n.height/l,f=u*i,h=n.width,c=n.height+(l-1)*(i-1)*u;Cr(r.rstyle,"labelWidth",e,h),Cr(r.rscratch,"labelWidth",e,h),Cr(r.rstyle,"labelHeight",e,c),Cr(r.rscratch,"labelHeight",e,c),Cr(r.rscratch,"labelLineHeight",e,f)},fr.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,s=function(ve,oe){return oe?(Cr(r.rscratch,ve,e,oe),oe):er(r.rscratch,ve,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="\u200B",f=n.split(`
3
3
  `),h=t.pstyle("text-max-width").pfValue,c=t.pstyle("text-overflow-wrap").value,d=c==="anywhere",v=[],p=/[\s\u200b]+/,y=d?"":" ",g=0;g<f.length;g++){var m=f[g],b=this.calculateLabelDimensions(t,m),x=b.width;if(d){var M=m.split("").join(u);m=M}if(x>h){for(var O=m.split(p),T="",k=0;k<O.length;k++){var D=O[k],F=T.length===0?D:T+y+D,G=this.calculateLabelDimensions(t,F),I=G.width;I<=h?T+=D+y:(T&&v.push(T),T=D+y)}T.match(/^[\s\u200b]+$/)||v.push(T)}else v.push(m)}s("labelWrapCachedLines",v),n=s("labelWrapCachedText",v.join(`
4
4
  `)),s("labelWrapKey",l)}else if(o==="ellipsis"){var H=t.pstyle("text-max-width").pfValue,z="",re="\u2026",X=!1;if(this.calculateLabelDimensions(t,n).width<H)return n;for(var K=0;K<n.length;K++){var ie=this.calculateLabelDimensions(t,z+n[K]+re).width;if(ie>H)break;z+=n[K],K===n.length-1&&(X=!0)}return X||(z+=re),z}return n},fr.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},fr.calculateLabelDimensions=function(t,e){var r=this,a=Fr(e,t._private.labelDimsKey),n=r.labelDimCache||(r.labelDimCache=[]),i=n[a];if(i!=null)return i;var s=0,o=t.pstyle("font-style").strValue,l=t.pstyle("font-size").pfValue,u=t.pstyle("font-family").strValue,f=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=h.getContext("2d");var d=h.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}c.font="".concat(o," ").concat(f," ").concat(l,"px ").concat(u);for(var v=0,p=0,y=e.split(`