@datalayer/agent-runtimes 1.6.7 → 1.6.8

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 (253) hide show
  1. package/dist-embed/chunks/{CollapsiblePlugin-D5OnWN4w.js → CollapsiblePlugin-DcBzz9ed.js} +1 -1
  2. package/dist-embed/chunks/{DeckComponent-CMzqudmP.js → DeckComponent-C-iZsNNb.js} +2 -2
  3. package/dist-embed/chunks/{DocumentView-5rJBkuGi.js → DocumentView-Ycxtl72z.js} +1 -1
  4. package/dist-embed/chunks/{EphemeralDocument-DbXlbD45.js → EphemeralDocument-BXXohFcr.js} +1 -1
  5. package/dist-embed/chunks/{ExcalidrawComponent-qDofi_fV.js → ExcalidrawComponent-DDkUHt0W.js} +1 -1
  6. package/dist-embed/chunks/{ExcalidrawModal-DJcSHz0C.js → ExcalidrawModal-BXVmFlTC.js} +1 -1
  7. package/dist-embed/chunks/{JupyterLexicalExtension-DPgvwtkz.js → JupyterLexicalExtension-C6zMmGiE.js} +4 -4
  8. package/dist-embed/chunks/{YouTubePlugin-CldEfidK.js → YouTubePlugin-tlns_Gba.js} +1 -1
  9. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-CTG06sGF.js → abnfDiagram-VCTEODGH-0Ws9rXCJ.js} +1 -1
  10. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-DqfSDyQW.js → abnfDiagram-VCTEODGH-B8_xbHzP.js} +1 -1
  11. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-D-YjI_3k.js → abnfDiagram-VCTEODGH-BeluKYTS.js} +1 -1
  12. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-D65Mq2ue.js → ar-SA-G6X2FPQ2-C7_LpT3-.js} +1 -1
  13. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-o0YkJSjl.js → architectureDiagram-5GKGNRK7-BJlJpdrd.js} +1 -1
  14. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-DCDdzaoK.js → architectureDiagram-5GKGNRK7-CC0W5BgA.js} +1 -1
  15. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-BHztFVtN.js → architectureDiagram-5GKGNRK7-Cw_nr9xB.js} +1 -1
  16. package/dist-embed/chunks/{az-AZ-76LH7QW2-FSNZRzay.js → az-AZ-76LH7QW2-DC1YnvB7.js} +1 -1
  17. package/dist-embed/chunks/{bg-BG-XCXSNQG7-ufD6FI71.js → bg-BG-XCXSNQG7-SPsL8OU-.js} +1 -1
  18. package/dist-embed/chunks/{blockDiagram-868be97b-BX-k54G1.js → blockDiagram-868be97b-BSXU0Kvu.js} +1 -1
  19. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-Ctiuq9Mf.js → blockDiagram-I7D4REHJ--9Bv1dPO.js} +1 -1
  20. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-ByNZ4gDN.js → blockDiagram-I7D4REHJ-BEQaDFbE.js} +1 -1
  21. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-BMMZraik.js → blockDiagram-I7D4REHJ-DxaDtv_3.js} +1 -1
  22. package/dist-embed/chunks/{bn-BD-2XOGV67Q--i6JiFe5.js → bn-BD-2XOGV67Q-BHHqLrjo.js} +1 -1
  23. package/dist-embed/chunks/{c4Diagram-3f4bdde3-C4fKYF4-.js → c4Diagram-3f4bdde3-xeh-6NOw.js} +1 -1
  24. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BoG7Rudg.js → c4Diagram-7LVT6UL2-BJ_FHbHl.js} +1 -1
  25. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-DzmpSRbX.js → c4Diagram-7LVT6UL2-DFdisifm.js} +1 -1
  26. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-V0ARu9Yh.js → c4Diagram-7LVT6UL2-rGsLvQnj.js} +1 -1
  27. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-vwaYjiDJ.js → ca-ES-6MX7JW3Y-wZuwOFMH.js} +1 -1
  28. package/dist-embed/chunks/{chunk-2Q5K7J3B-1b-s3PVN.js → chunk-2Q5K7J3B-D7odi-_O.js} +1 -1
  29. package/dist-embed/chunks/{chunk-2Q5K7J3B-BmBlHnVI.js → chunk-2Q5K7J3B-TmWHfRax.js} +1 -1
  30. package/dist-embed/chunks/{chunk-2Q5K7J3B-Yn3ssDsW.js → chunk-2Q5K7J3B-cixWnbMn.js} +1 -1
  31. package/dist-embed/chunks/{chunk-5VM5RSS4-CEOHhvD9.js → chunk-5VM5RSS4-Bxc9_59A.js} +1 -1
  32. package/dist-embed/chunks/{chunk-5VM5RSS4-D2tEkK5p.js → chunk-5VM5RSS4-Cx82la57.js} +1 -1
  33. package/dist-embed/chunks/{chunk-5VM5RSS4-CbCDnop3.js → chunk-5VM5RSS4-wWeCZIJS.js} +1 -1
  34. package/dist-embed/chunks/{chunk-F27PBJKO-BNZl1hc8.js → chunk-F27PBJKO-BcFWZDhH.js} +1 -1
  35. package/dist-embed/chunks/{chunk-F27PBJKO-CZMM4MBF.js → chunk-F27PBJKO-BrSmzknm.js} +1 -1
  36. package/dist-embed/chunks/{chunk-F27PBJKO-J-4XuTCa.js → chunk-F27PBJKO-o4gdnifC.js} +1 -1
  37. package/dist-embed/chunks/{chunk-IMKFNOWR-CYT_HCLD.js → chunk-IMKFNOWR-BHqtkbGU.js} +1 -1
  38. package/dist-embed/chunks/{chunk-IMKFNOWR-CrGAqWjJ.js → chunk-IMKFNOWR-Bvvb587Q.js} +1 -1
  39. package/dist-embed/chunks/{chunk-IMKFNOWR-B3WYfiWU.js → chunk-IMKFNOWR-D0HMuxmQ.js} +1 -1
  40. package/dist-embed/chunks/{chunk-JWPE2WC7-D_-QFJP2.js → chunk-JWPE2WC7-CafuI2ep.js} +1 -1
  41. package/dist-embed/chunks/{chunk-JWPE2WC7-BJuxLF68.js → chunk-JWPE2WC7-DBjxITsj.js} +1 -1
  42. package/dist-embed/chunks/{chunk-JWPE2WC7-Dhf2nfwA.js → chunk-JWPE2WC7-eVcZ9xFv.js} +1 -1
  43. package/dist-embed/chunks/{chunk-POPQ4Y6H-CsTbM2Up.js → chunk-POPQ4Y6H-B4LQU4J8.js} +1 -1
  44. package/dist-embed/chunks/{chunk-POPQ4Y6H-Nd3Njhrd.js → chunk-POPQ4Y6H-BvYfauYC.js} +1 -1
  45. package/dist-embed/chunks/{chunk-POPQ4Y6H-qwh0DdXu.js → chunk-POPQ4Y6H-DoMMdDzl.js} +1 -1
  46. package/dist-embed/chunks/{chunk-SVP7TREG-Csyp9AM7.js → chunk-SVP7TREG-BTbQTNVB.js} +1 -1
  47. package/dist-embed/chunks/{chunk-SVP7TREG-BzwLk0q0.js → chunk-SVP7TREG-Da-xq5bg.js} +1 -1
  48. package/dist-embed/chunks/{chunk-SVP7TREG-D0tzHXy8.js → chunk-SVP7TREG-OCtWCMf0.js} +1 -1
  49. package/dist-embed/chunks/{chunk-TICWLB2K-DeaNAxkX.js → chunk-TICWLB2K-BGxvPdYt.js} +1 -1
  50. package/dist-embed/chunks/{chunk-TICWLB2K-CBMF5C93.js → chunk-TICWLB2K-BJdhXGsr.js} +1 -1
  51. package/dist-embed/chunks/{chunk-TICWLB2K-BslQaBGw.js → chunk-TICWLB2K-CKHxE2Q8.js} +1 -1
  52. package/dist-embed/chunks/{chunk-XXDRQBXY-CICtrrlo.js → chunk-XXDRQBXY-38uqpTm6.js} +1 -1
  53. package/dist-embed/chunks/{chunk-XXDRQBXY-BpexFcxO.js → chunk-XXDRQBXY-B0SWfD_N.js} +1 -1
  54. package/dist-embed/chunks/{chunk-XXDRQBXY-wJ94Rf8J.js → chunk-XXDRQBXY-CBFLaKdI.js} +1 -1
  55. package/dist-embed/chunks/{classDiagram-ZZMXUADV-CB8NL-j3.js → classDiagram-ZZMXUADV-B5fGQo6H.js} +1 -1
  56. package/dist-embed/chunks/{classDiagram-ZZMXUADV-CvImB5-s.js → classDiagram-ZZMXUADV-BqgX02hh.js} +1 -1
  57. package/dist-embed/chunks/{classDiagram-ZZMXUADV-B7C4ggcH.js → classDiagram-ZZMXUADV-CH7YhSmZ.js} +1 -1
  58. package/dist-embed/chunks/{classDiagram-f62afe4f-B2H3GkiS.js → classDiagram-f62afe4f-m3m-Jl-t.js} +1 -1
  59. package/dist-embed/chunks/{classDiagram-v2-604399ef-BPghHIDI.js → classDiagram-v2-604399ef-s7nEInls.js} +1 -1
  60. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-CB8NL-j3.js → classDiagram-v2-VYDZK3BY-B5fGQo6H.js} +1 -1
  61. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-CvImB5-s.js → classDiagram-v2-VYDZK3BY-BqgX02hh.js} +1 -1
  62. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-B7C4ggcH.js → classDiagram-v2-VYDZK3BY-CH7YhSmZ.js} +1 -1
  63. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DfogTSI0.js → cose-bilkent-JH36ORCC-C_ID2ynD.js} +1 -1
  64. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-PqEuUNdm.js → cose-bilkent-JH36ORCC-DKEDfD_M.js} +1 -1
  65. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-QlSjYcer.js → cose-bilkent-JH36ORCC-rmqymmkF.js} +1 -1
  66. package/dist-embed/chunks/{createText-aed3d8b3-CXkpNIxq.js → createText-aed3d8b3-ByusaZ77.js} +1 -1
  67. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-BXHu2VJz.js → cs-CZ-2BRQDIVT-B7C8858m.js} +1 -1
  68. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-BM97cGV7.js → cynefinDiagram-5FMLGOSQ-CAklz7DZ.js} +1 -1
  69. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-1XdWtEj9.js → cynefinDiagram-5FMLGOSQ-DNbz6FCa.js} +1 -1
  70. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-DKl3DGkd.js → cynefinDiagram-5FMLGOSQ-DbR-JTJA.js} +1 -1
  71. package/dist-embed/chunks/cytoscape.esm-By_5ytxT.js +321 -0
  72. package/dist-embed/chunks/{da-DK-5WZEPLOC-CwNxyqIn.js → da-DK-5WZEPLOC-Bia9gQrj.js} +1 -1
  73. package/dist-embed/chunks/{dagre-GXQ25YYZ-D6kgS4Ax.js → dagre-GXQ25YYZ-BnEtC1P4.js} +1 -1
  74. package/dist-embed/chunks/{dagre-GXQ25YYZ-BKXvqmmX.js → dagre-GXQ25YYZ-DLJc0dK5.js} +1 -1
  75. package/dist-embed/chunks/{dagre-GXQ25YYZ-Co1APkPi.js → dagre-GXQ25YYZ-_mRe9pRt.js} +1 -1
  76. package/dist-embed/chunks/{de-DE-XR44H4JA-CaIo6awk.js → de-DE-XR44H4JA-DH4TQpIH.js} +1 -1
  77. package/dist-embed/chunks/{diagram-S7CK7UJ4-CunhQP3h.js → diagram-S7CK7UJ4-CjUTjjdx.js} +1 -1
  78. package/dist-embed/chunks/{diagram-S7CK7UJ4-CuRnBHF8.js → diagram-S7CK7UJ4-CvDLVE8r.js} +1 -1
  79. package/dist-embed/chunks/{diagram-S7CK7UJ4-oLmPHPPl.js → diagram-S7CK7UJ4-Dg6dN3uG.js} +1 -1
  80. package/dist-embed/chunks/{diagram-UQ7AKVKN-cO8d9DHK.js → diagram-UQ7AKVKN-4lsu33JH.js} +1 -1
  81. package/dist-embed/chunks/{diagram-UQ7AKVKN-Cde1cWy4.js → diagram-UQ7AKVKN-B3PPDAUi.js} +1 -1
  82. package/dist-embed/chunks/{diagram-UQ7AKVKN-DMfktoG3.js → diagram-UQ7AKVKN-CtAXPVV9.js} +1 -1
  83. package/dist-embed/chunks/{diagram-VSXAHHWV-tGQ9WLDg.js → diagram-VSXAHHWV-BkgJJ-8t.js} +1 -1
  84. package/dist-embed/chunks/{diagram-VSXAHHWV-BeWbDzB1.js → diagram-VSXAHHWV-DTyBcKiy.js} +1 -1
  85. package/dist-embed/chunks/{diagram-VSXAHHWV-lvVK1mef.js → diagram-VSXAHHWV-EeuWVrCk.js} +1 -1
  86. package/dist-embed/chunks/{diagram-VX7I27RA-CwhU8k37.js → diagram-VX7I27RA-CRO1d9sJ.js} +1 -1
  87. package/dist-embed/chunks/{diagram-VX7I27RA-scmTNQJR.js → diagram-VX7I27RA-Cfto_PKF.js} +1 -1
  88. package/dist-embed/chunks/{diagram-VX7I27RA-QNsPYtdn.js → diagram-VX7I27RA-doA8P3qt.js} +1 -1
  89. package/dist-embed/chunks/{diagram-Z3DM3KII-C5Ph-aHc.js → diagram-Z3DM3KII--AdLn10I.js} +1 -1
  90. package/dist-embed/chunks/{diagram-Z3DM3KII-BnWG2V69.js → diagram-Z3DM3KII-B7rf49uM.js} +1 -1
  91. package/dist-embed/chunks/{diagram-Z3DM3KII-DauYmznS.js → diagram-Z3DM3KII-CPgpikux.js} +1 -1
  92. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-JSjIOtxg.js → ebnfDiagram-PWID7BFC-CBHv7Imk.js} +1 -1
  93. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-FG69s30Z.js → ebnfDiagram-PWID7BFC-DVC6wAs5.js} +1 -1
  94. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-BsHxCZlu.js → ebnfDiagram-PWID7BFC-Dtc6EfL4.js} +1 -1
  95. package/dist-embed/chunks/{edges-b2856ca0-DEJbOnzY.js → edges-b2856ca0-B8by7vui.js} +1 -1
  96. package/dist-embed/chunks/{el-GR-BZB4AONW-BNEz9ghw.js → el-GR-BZB4AONW-B-AxjHUw.js} +1 -1
  97. package/dist-embed/chunks/{erDiagram-5d81789a-DzOhmgx_.js → erDiagram-5d81789a-BGB_pG1U.js} +1 -1
  98. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-BpdgQKy2.js → erDiagram-RLTQ6QDP-C8yDadLn.js} +1 -1
  99. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-ByGgpa1A.js → erDiagram-RLTQ6QDP-CuFzNwGJ.js} +1 -1
  100. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-DWCPWFft.js → erDiagram-RLTQ6QDP-cniJfGdI.js} +1 -1
  101. package/dist-embed/chunks/{es-ES-U4NZUMDT-CLH2G-rn.js → es-ES-U4NZUMDT-b_TuITvX.js} +1 -1
  102. package/dist-embed/chunks/{eu-ES-A7QVB2H4-DDWZFR3B.js → eu-ES-A7QVB2H4-BoePUF6g.js} +1 -1
  103. package/dist-embed/chunks/{fa-IR-HGAKTJCU-ytUXdfkK.js → fa-IR-HGAKTJCU-B1EBoxWL.js} +1 -1
  104. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-BUPC_MWA.js → fi-FI-Z5N7JZ37-9W90ZogS.js} +1 -1
  105. package/dist-embed/chunks/{flowDb-185abca5-B1q85a-x.js → flowDb-185abca5-CQ7gbwwM.js} +1 -1
  106. package/dist-embed/chunks/{flowDiagram-1629c991-Csq6DRpv.js → flowDiagram-1629c991-Dp5HKs_2.js} +1 -1
  107. package/dist-embed/chunks/{flowDiagram-HODETNUW-CTU6mH-W.js → flowDiagram-HODETNUW-B2YyuTfb.js} +1 -1
  108. package/dist-embed/chunks/{flowDiagram-HODETNUW--wYFkVp_.js → flowDiagram-HODETNUW-DBJ2CSfg.js} +1 -1
  109. package/dist-embed/chunks/{flowDiagram-HODETNUW-mq8xAg1M.js → flowDiagram-HODETNUW-R9hBuaXL.js} +1 -1
  110. package/dist-embed/chunks/{flowDiagram-v2-1d953310-yPDKJcBg.js → flowDiagram-v2-1d953310-CTmhCjWv.js} +1 -1
  111. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-CHaXb510.js → flowchart-elk-definition-6df44142-walE_yTF.js} +1 -1
  112. package/dist-embed/chunks/{fr-FR-RHASNOE6-JTwVsOuH.js → fr-FR-RHASNOE6-BbQ3o66c.js} +1 -1
  113. package/dist-embed/chunks/{ganttDiagram-3b0b3873-Ds3LxJyt.js → ganttDiagram-3b0b3873-BPMhtO3X.js} +1 -1
  114. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-B0CeoMuW.js → ganttDiagram-EL5Y4UJY-BSHl4R7O.js} +1 -1
  115. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-BYh-fMw7.js → ganttDiagram-EL5Y4UJY-C0jQJyXo.js} +1 -1
  116. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-Be4ppjN1.js → ganttDiagram-EL5Y4UJY-DaAiP9PL.js} +1 -1
  117. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX--4WTKBJ1.js → gitGraphDiagram-WWUBYQGX-CVyUbbuW.js} +1 -1
  118. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-Bdkvhiw0.js → gitGraphDiagram-WWUBYQGX-DfrYweJv.js} +1 -1
  119. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CKLsiWAC.js → gitGraphDiagram-WWUBYQGX-RYOnVzHz.js} +1 -1
  120. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-D3KFX6sZ.js → gitGraphDiagram-f01e8bc2-B0F5shwi.js} +1 -1
  121. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-BdxZC4tu.js → gl-ES-HMX3MZ6V-C-b5f_gx.js} +1 -1
  122. package/dist-embed/chunks/{he-IL-6SHJWFNN-JAbyqBiH.js → he-IL-6SHJWFNN-DkgM71qz.js} +1 -1
  123. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-CcRjCOJL.js → hi-IN-IWLTKZ5I-L5g6QTW5.js} +1 -1
  124. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-B8qbiTHN.js → hu-HU-A5ZG7DT2-3jsiB6XB.js} +1 -1
  125. package/dist-embed/chunks/{id-ID-SAP4L64H-D0CEzwZy.js → id-ID-SAP4L64H-BjFiFDHJ.js} +1 -1
  126. package/dist-embed/chunks/{index-9bae90f3-BoF5CmSL.js → index-9bae90f3-BhZ9DiTP.js} +1 -1
  127. package/dist-embed/chunks/{index-O5uyTYL5.js → index-CAWdjL5V.js} +3 -3
  128. package/dist-embed/chunks/{index-vYgHQz2d.js → index-Cs1hG--0.js} +3 -3
  129. package/dist-embed/chunks/{infoDiagram-27XIBGKW-yDdn2ys1.js → infoDiagram-27XIBGKW-Bl1Pzj0u.js} +1 -1
  130. package/dist-embed/chunks/{infoDiagram-27XIBGKW-DhcbxFur.js → infoDiagram-27XIBGKW-DCppdNG8.js} +1 -1
  131. package/dist-embed/chunks/{infoDiagram-27XIBGKW-DMSiRsPL.js → infoDiagram-27XIBGKW-NPmfl4N4.js} +1 -1
  132. package/dist-embed/chunks/{infoDiagram-a29d40f1-lMbGYhRA.js → infoDiagram-a29d40f1-CMQFQwx7.js} +1 -1
  133. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-D9Lpd-qW.js → ishikawaDiagram-5VMMS53U-BooLHkgT.js} +1 -1
  134. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-xAm1DqfO.js → ishikawaDiagram-5VMMS53U-CS41azG7.js} +1 -1
  135. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-Bs5MXGby.js → ishikawaDiagram-5VMMS53U-CpZaAw2N.js} +1 -1
  136. package/dist-embed/chunks/{it-IT-JPQ66NNP-D8vgJYOR.js → it-IT-JPQ66NNP-DIHnHyB7.js} +1 -1
  137. package/dist-embed/chunks/{ja-JP-DBVTYXUO-uNmMFGbM.js → ja-JP-DBVTYXUO-Ds2LiJlq.js} +1 -1
  138. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-UWvb1n7z.js → journeyDiagram-3NMN7TZE-Rhrjh8Iz.js} +1 -1
  139. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-DsK4E2pa.js → journeyDiagram-3NMN7TZE-kfNcGwLY.js} +1 -1
  140. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-CqOjB9qC.js → journeyDiagram-3NMN7TZE-qt0dfewx.js} +1 -1
  141. package/dist-embed/chunks/{journeyDiagram-95396277-DaL67Nt9.js → journeyDiagram-95396277-BOzieewc.js} +1 -1
  142. package/dist-embed/chunks/{kaa-6HZHGXH3-B5unU3uz.js → kaa-6HZHGXH3-Bm9ip0Ev.js} +1 -1
  143. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-B5H4IbGk.js → kab-KAB-ZGHBKWFO-DKtPNDu-.js} +1 -1
  144. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-B4u5UtF8.js → kanban-definition-UXKFOSKX-8DD90WYG.js} +1 -1
  145. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-Dw4NP_ei.js → kanban-definition-UXKFOSKX-BojBUM4h.js} +1 -1
  146. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-nLzuO7SQ.js → kanban-definition-UXKFOSKX-DlSlWXrv.js} +1 -1
  147. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-jkjUgYOW.js → kk-KZ-P5N5QNE5-BE95kg02.js} +1 -1
  148. package/dist-embed/chunks/{km-KH-HSX4SM5Z-DHJ4OvO0.js → km-KH-HSX4SM5Z-Cp3j-F6T.js} +1 -1
  149. package/dist-embed/chunks/{ko-KR-MTYHY66A-DX6xT6T7.js → ko-KR-MTYHY66A-BJ-sw_57.js} +1 -1
  150. package/dist-embed/chunks/{ku-TR-6OUDTVRD-aMNDsoCq.js → ku-TR-6OUDTVRD-awoL4FjI.js} +1 -1
  151. package/dist-embed/chunks/{layout-CbX7cOw6.js → layout-BYKl55FS.js} +1 -1
  152. package/dist-embed/chunks/{layout-budm1d9Z.js → layout-C_yOZkc2.js} +1 -1
  153. package/dist-embed/chunks/{layout-BBclPDkZ.js → layout-ChYpapTk.js} +1 -1
  154. package/dist-embed/chunks/{lib-DsSHOc59.js → lib--qRKTceu.js} +1 -1
  155. package/dist-embed/chunks/{lt-LT-XHIRWOB4-CFvk2lSA.js → lt-LT-XHIRWOB4-CNEHR25x.js} +1 -1
  156. package/dist-embed/chunks/{lv-LV-5QDEKY6T-RtfLJiJ2.js → lv-LV-5QDEKY6T-BikdY7uL.js} +1 -1
  157. package/dist-embed/chunks/{mermaid.core-BdY790tt.js → mermaid.core-CnWnBqDh.js} +2 -2
  158. package/dist-embed/chunks/{mermaid.core-Ded6th0k.js → mermaid.core-D4sqHwDm.js} +3 -3
  159. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-DI33cFKM.js → mindmap-definition-YA3MSWOX-Bbk0l2Uj.js} +1 -1
  160. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-C1M2WNCz.js → mindmap-definition-YA3MSWOX-D_h1OI7b.js} +1 -1
  161. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-alx6Cf7F.js → mindmap-definition-YA3MSWOX-KfqEojam.js} +1 -1
  162. package/dist-embed/chunks/{mindmap-definition-e4c1d938-BWE8P1P2.js → mindmap-definition-e4c1d938-DhLTAa52.js} +1 -1
  163. package/dist-embed/chunks/{mr-IN-CRQNXWMA-D8_Mabbi.js → mr-IN-CRQNXWMA-BL7I68Ao.js} +1 -1
  164. package/dist-embed/chunks/{my-MM-5M5IBNSE-CpXJoZVO.js → my-MM-5M5IBNSE-ByCU1-9D.js} +1 -1
  165. package/dist-embed/chunks/{nb-NO-T6EIAALU-DV0yn6n2.js → nb-NO-T6EIAALU-BCcE1Fcq.js} +1 -1
  166. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-BShUfztw.js → nl-NL-IS3SIHDZ-DccTIAIb.js} +1 -1
  167. package/dist-embed/chunks/{nn-NO-6E72VCQL-DT67tBGp.js → nn-NO-6E72VCQL-fU6oIV9Z.js} +1 -1
  168. package/dist-embed/chunks/{oc-FR-POXYY2M6-C9beX7l6.js → oc-FR-POXYY2M6-DRz48Zf2.js} +1 -1
  169. package/dist-embed/chunks/{pa-IN-N4M65BXN-BfWw7Fcm.js → pa-IN-N4M65BXN-Dn6RUhjM.js} +1 -1
  170. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-D43gxP_r.js → pegDiagram-XKGWAZYB-DHcc_OPa.js} +1 -1
  171. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-DxVOcMZA.js → pegDiagram-XKGWAZYB-DaH65flI.js} +1 -1
  172. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-B-STlrnN.js → pegDiagram-XKGWAZYB-Dw8pYpra.js} +1 -1
  173. package/dist-embed/chunks/{percentages-BXMCSKIN-DnOPjw1c.js → percentages-BXMCSKIN-7qo6Vcj0.js} +5 -5
  174. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-DHCSEzPE.js → pieDiagram-E7YTZNPT-B-ku6GN6.js} +1 -1
  175. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-BHp_a9_V.js → pieDiagram-E7YTZNPT-CtZic9lc.js} +1 -1
  176. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-Gzy_dRcT.js → pieDiagram-E7YTZNPT-R19M4ttg.js} +1 -1
  177. package/dist-embed/chunks/{pieDiagram-c941bede-COfap22O.js → pieDiagram-c941bede-9AjBAeZt.js} +1 -1
  178. package/dist-embed/chunks/{pl-PL-T2D74RX3-D_-aGMy6.js → pl-PL-T2D74RX3-DVAUO1O_.js} +1 -1
  179. package/dist-embed/chunks/{pt-BR-5N22H2LF-S9-rvdh-.js → pt-BR-5N22H2LF-1Tez_fAL.js} +1 -1
  180. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-B3YwXhX2.js → pt-PT-UZXXM6DQ-BuWm1PCV.js} +1 -1
  181. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-C_b3F-T8.js → quadrantDiagram-AXDQQJYC-Cg8W31sE.js} +1 -1
  182. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-BCsAVe36.js → quadrantDiagram-AXDQQJYC-DnLtWDyk.js} +1 -1
  183. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-B55m_E_j.js → quadrantDiagram-AXDQQJYC-Mx1FE_sA.js} +1 -1
  184. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-C_xZhVnv.js → quadrantDiagram-cf8b8fe0-PybiUp7j.js} +1 -1
  185. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BxRisPAC.js → railroadDiagram-O6MQD6OU-CwJ3nO0E.js} +1 -1
  186. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-fbmW_Rmh.js → railroadDiagram-O6MQD6OU-JnOPUtcS.js} +1 -1
  187. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-DVdFHJSU.js → railroadDiagram-O6MQD6OU-ooNBC07F.js} +1 -1
  188. package/dist-embed/chunks/{requirementDiagram-53bda41b-BmZjKHQB.js → requirementDiagram-53bda41b-1nKB7JHP.js} +1 -1
  189. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-BENcRGSI.js → requirementDiagram-BXWQKSXE-C1Zlodd3.js} +1 -1
  190. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-5ZOq4RNc.js → requirementDiagram-BXWQKSXE-CEY9Orn-.js} +1 -1
  191. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-BUeCb6ve.js → requirementDiagram-BXWQKSXE-CTW14inu.js} +1 -1
  192. package/dist-embed/chunks/{ro-RO-JPDTUUEW-yYRbH_ru.js → ro-RO-JPDTUUEW-BZO6J21O.js} +1 -1
  193. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-BTc6cwjB.js → ru-RU-B4JR7IUQ-CIgcHo9F.js} +1 -1
  194. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-BKj_03rc.js → sankeyDiagram-P5KCCOFB-5mrZ12oe.js} +1 -1
  195. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-BSLcGNSw.js → sankeyDiagram-P5KCCOFB-CMZFkIO-.js} +1 -1
  196. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-CFAZBZI4.js → sankeyDiagram-P5KCCOFB-CxTxWAhL.js} +1 -1
  197. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-B8gCHZA6.js → sankeyDiagram-c3ef121a-fMTuDkkW.js} +1 -1
  198. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-AklXnQgP.js → sequenceDiagram-82a5b84f-DovuOEeX.js} +1 -1
  199. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-CShpzQ4V.js → sequenceDiagram-WJ2MYXX4-CctCVP8F.js} +1 -1
  200. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-DxT2acAk.js → sequenceDiagram-WJ2MYXX4-Cu55FAea.js} +1 -1
  201. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-Cj84kVBc.js → sequenceDiagram-WJ2MYXX4-DaQsUJrf.js} +1 -1
  202. package/dist-embed/chunks/{si-LK-N5RQ5JYF-CTBffWXK.js → si-LK-N5RQ5JYF-D3OWuPGy.js} +1 -1
  203. package/dist-embed/chunks/{sizeCapture-INFHLROL-yGqMMGpB.js → sizeCapture-INFHLROL-BhIlhaXt.js} +1 -1
  204. package/dist-embed/chunks/{sizeCapture-INFHLROL-CWKUF5eK.js → sizeCapture-INFHLROL-BvInErJV.js} +1 -1
  205. package/dist-embed/chunks/{sizeCapture-INFHLROL-ZwPNGyk_.js → sizeCapture-INFHLROL-KdnUrgO7.js} +1 -1
  206. package/dist-embed/chunks/{sk-SK-C5VTKIMK-CSFUvwJi.js → sk-SK-C5VTKIMK-KXmf-wYd.js} +1 -1
  207. package/dist-embed/chunks/{sl-SI-NN7IZMDC-C9mEJcPH.js → sl-SI-NN7IZMDC-BY3hgxE5.js} +1 -1
  208. package/dist-embed/chunks/{stateDiagram-43e79a5f-C6o-SWex.js → stateDiagram-43e79a5f-rp2ng0Sn.js} +1 -1
  209. package/dist-embed/chunks/{stateDiagram-D77RDMKH-CmQCyPn_.js → stateDiagram-D77RDMKH-B-5j7DiB.js} +1 -1
  210. package/dist-embed/chunks/{stateDiagram-D77RDMKH-fTVFrwFS.js → stateDiagram-D77RDMKH-C66YorOq.js} +1 -1
  211. package/dist-embed/chunks/{stateDiagram-D77RDMKH-MJDRvRDw.js → stateDiagram-D77RDMKH-cCIUBLhL.js} +1 -1
  212. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-K9L665Uq.js → stateDiagram-v2-2041ed4f-Cm4_GOYO.js} +1 -1
  213. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-cLBRcr_4.js → stateDiagram-v2-MP3YSRHH-BdjSXShL.js} +1 -1
  214. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-BTDh758R.js → stateDiagram-v2-MP3YSRHH-COwOHw5B.js} +1 -1
  215. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-DA2nXTkd.js → stateDiagram-v2-MP3YSRHH-DX1QRcU0.js} +1 -1
  216. package/dist-embed/chunks/{styles-455b33cd-6ttcxSbf.js → styles-455b33cd-CO3Y1vly.js} +1 -1
  217. package/dist-embed/chunks/{styles-f932cba9-Bd2fl0pK.js → styles-f932cba9-DN2pl3Kp.js} +1 -1
  218. package/dist-embed/chunks/{styles-fcc2142b-DS9XDqpK.js → styles-fcc2142b-DQhCVPQv.js} +1 -1
  219. package/dist-embed/chunks/{subset-shared.chunk-BV2qx58E.js → subset-shared.chunk-Bq9jn-da.js} +1 -1
  220. package/dist-embed/chunks/{subset-worker.chunk-CeiZxQyM.js → subset-worker.chunk-BsGlz8UI.js} +1 -1
  221. package/dist-embed/chunks/{sv-SE-XGPEYMSR-1smmCF_L.js → sv-SE-XGPEYMSR-DKcebCX0.js} +1 -1
  222. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-BVJA2vNU.js → svgDrawCommon-148a3cd9-DcBEdsOn.js} +1 -1
  223. package/dist-embed/chunks/{swimlanes-42K2YHIH-BEA12t9Q.js → swimlanes-42K2YHIH-BaUhjRxD.js} +1 -1
  224. package/dist-embed/chunks/{swimlanes-42K2YHIH-BootRY6U.js → swimlanes-42K2YHIH-CUfDuu7T.js} +1 -1
  225. package/dist-embed/chunks/{swimlanes-42K2YHIH-IxeTbXyk.js → swimlanes-42K2YHIH-DAVgbRCJ.js} +1 -1
  226. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-igRz14wA.js → swimlanesDiagram-VR7AAH4N-Ch_GdrLj.js} +1 -1
  227. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BSQ9SnBY.js → swimlanesDiagram-VR7AAH4N-DSV8Wcb6.js} +1 -1
  228. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-G1JMIDU4.js → swimlanesDiagram-VR7AAH4N-q8ziqhKL.js} +1 -1
  229. package/dist-embed/chunks/{ta-IN-2NMHFXQM-CrRu26yk.js → ta-IN-2NMHFXQM-Br8-RR0y.js} +1 -1
  230. package/dist-embed/chunks/{th-TH-HPSO5L25-wd_Lh_1U.js → th-TH-HPSO5L25-CJK_UyVZ.js} +1 -1
  231. package/dist-embed/chunks/{timeline-definition-24CTP7MA-B8ARTuT8.js → timeline-definition-24CTP7MA-BIiy7TOV.js} +1 -1
  232. package/dist-embed/chunks/{timeline-definition-24CTP7MA-M1iVeCZp.js → timeline-definition-24CTP7MA-CiKjPwx-.js} +1 -1
  233. package/dist-embed/chunks/{timeline-definition-24CTP7MA-CSSHgGzg.js → timeline-definition-24CTP7MA-CxHTYLgu.js} +1 -1
  234. package/dist-embed/chunks/{timeline-definition-7545f45a-CQp2boqy.js → timeline-definition-7545f45a-DSO55aof.js} +1 -1
  235. package/dist-embed/chunks/{tr-TR-DEFEU3FU-CHCQloY1.js → tr-TR-DEFEU3FU-lLeZ3ze9.js} +1 -1
  236. package/dist-embed/chunks/{uk-UA-QMV73CPH-C0h4-2EB.js → uk-UA-QMV73CPH-eKq0P8Ay.js} +1 -1
  237. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-a91Zo7m8.js → vennDiagram-4TSXK5OY-CbxtGmTK.js} +1 -1
  238. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-CNpqMxUb.js → vennDiagram-4TSXK5OY-CfcgsZ27.js} +1 -1
  239. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-B1jzA_Q5.js → vennDiagram-4TSXK5OY-t3Ad3R5t.js} +1 -1
  240. package/dist-embed/chunks/{vi-VN-M7AON7JQ-xY-LexnE.js → vi-VN-M7AON7JQ-DBihSars.js} +1 -1
  241. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-B_fwPDT1.js → wardleyDiagram-VM6X3IG4-BQu0inLU.js} +1 -1
  242. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-DgkNToe-.js → wardleyDiagram-VM6X3IG4-DCE_WGW3.js} +1 -1
  243. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-BJlSAO4E.js → wardleyDiagram-VM6X3IG4-nPlOd9Cq.js} +1 -1
  244. package/dist-embed/chunks/{xychartDiagram-3f383b91-CPFgw7m_.js → xychartDiagram-3f383b91-mUTXbWIJ.js} +1 -1
  245. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-GFqI7WSb.js → xychartDiagram-S5SC5T6Z-0blY3Ojt.js} +1 -1
  246. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-B3INyGsf.js → xychartDiagram-S5SC5T6Z-D4C0-PPM.js} +1 -1
  247. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-DGZHxLSh.js → xychartDiagram-S5SC5T6Z-DEmpndzb.js} +1 -1
  248. package/dist-embed/chunks/{zh-CN-LNUGB5OW-DpBIJ4AH.js → zh-CN-LNUGB5OW-BohX_zex.js} +1 -1
  249. package/dist-embed/chunks/{zh-HK-E62DVLB3-DMknmNwa.js → zh-HK-E62DVLB3-BVA9hSDO.js} +1 -1
  250. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-CFHfvsa1.js → zh-TW-RAJ6MFWO-fJay1Sou.js} +1 -1
  251. package/dist-embed/datalayer-app-main.js +4 -4
  252. package/package.json +1 -1
  253. package/dist-embed/chunks/cytoscape.esm-CkK8FqzY.js +0 -321
@@ -0,0 +1,321 @@
1
+ function Fo(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t<e;t++)a[t]=r[t];return a}function mc(r){if(Array.isArray(r))return r}function bc(r){if(Array.isArray(r))return Fo(r)}function mt(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function wc(r,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,vv(a.key),a)}}function bt(r,e,t){return e&&wc(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function Dr(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=ns(r))||e){t&&(r=t);var a=0,n=function(){};return{s:n,n:function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||t.return==null||t.return()}finally{if(s)throw i}}}}function lv(r,e,t){return(e=vv(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xc(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Ec(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,o,s=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(s.push(a.value),s.length!==e);u=!0);}catch(v){l=!0,n=v}finally{try{if(!u&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(l)throw n}}return s}}function Cc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tc(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function er(r,e){return mc(r)||Ec(r,e)||ns(r,e)||Cc()}function Tn(r){return bc(r)||xc(r)||ns(r)||Tc()}function Sc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function vv(r){var e=Sc(r,"string");return typeof e=="symbol"?e:e+""}function ar(r){"@babel/helpers - typeof";return ar=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},ar(r)}function ns(r,e){if(r){if(typeof r=="string")return Fo(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Fo(r,e):void 0}}var rr=typeof window>"u"?null:window,Ls=rr?rr.navigator:null;rr&&rr.document;var kc=ar(""),fv=ar({}),Dc=ar(function(){}),Bc=typeof HTMLElement>"u"?"undefined":ar(HTMLElement),Va=function(e){return e&&e.instanceString&&Ye(e.instanceString)?e.instanceString():null},ce=function(e){return e!=null&&ar(e)==kc},Ye=function(e){return e!=null&&ar(e)===Dc},Ge=function(e){return!Pr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ie=function(e){return e!=null&&ar(e)===fv&&!Ge(e)&&e.constructor===Object},Pc=function(e){return e!=null&&ar(e)===fv},te=function(e){return e!=null&&ar(e)===ar(1)&&!isNaN(e)},Sn=function(e){return te(e)&&Math.floor(e)===e},kn=function(e){if(Bc!=="undefined")return e!=null&&e instanceof HTMLElement},Pr=function(e){return qa(e)||cv(e)},qa=function(e){return Va(e)==="collection"&&e._private.single},cv=function(e){return Va(e)==="collection"&&!e._private.single},is=function(e){return Va(e)==="core"},hv=function(e){return Va(e)==="stylesheet"},Ac=function(e){return Va(e)==="event"},ft=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Rc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Mc=function(e){return Ie(e)&&te(e.x1)&&te(e.x2)&&te(e.y1)&&te(e.y2)},Lc=function(e){return Pc(e)&&Ye(e.then)},Ic=function(){return Ls&&Ls.userAgent.match(/msie|trident|edge/i)},ta=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var a=function(){var i=this,o=arguments,s,u=t.apply(i,o),l=a.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return a.cache={},a},os=ta(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Gn=ta(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),dv=ta(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),Is=function(e){return ft(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},st=function(e,t){return e.slice(-1*t.length)===t},tr="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Oc="rgb[a]?\\(("+tr+"[%]?)\\s*,\\s*("+tr+"[%]?)\\s*,\\s*("+tr+"[%]?)(?:\\s*,\\s*("+tr+"))?\\)",Nc="rgb[a]?\\((?:"+tr+"[%]?)\\s*,\\s*(?:"+tr+"[%]?)\\s*,\\s*(?:"+tr+"[%]?)(?:\\s*,\\s*(?:"+tr+"))?\\)",zc="hsl[a]?\\(("+tr+")\\s*,\\s*("+tr+"[%])\\s*,\\s*("+tr+"[%])(?:\\s*,\\s*("+tr+"))?\\)",Fc="hsl[a]?\\((?:"+tr+")\\s*,\\s*(?:"+tr+"[%])\\s*,\\s*(?:"+tr+"[%])(?:\\s*,\\s*(?:"+tr+"))?\\)",Vc="\\#[0-9a-fA-F]{3}",qc="\\#[0-9a-fA-F]{6}",gv=function(e,t){return e<t?-1:e>t?1:0},_c=function(e,t){return-1*gv(e,t)},ge=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var a=e[t];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];r[o]=a[o]}}return r},Gc=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,a,n,i,o=16;return t?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},Hc=function(e){var t,a,n,i,o,s,u,l;function v(h,y,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?h+(y-h)*6*g:g<1/2?y:g<2/3?h+(y-h)*(2/3-g)*6:h}var f=new RegExp("^"+zc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,o=f[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,d=2*i-c;s=Math.round(255*v(d,c,a+1/3)),u=Math.round(255*v(d,c,a)),l=Math.round(255*v(d,c,a-1/3))}t=[s,u,l,o]}return t},Wc=function(e){var t,a=new RegExp("^"+Oc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var s=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(s&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},$c=function(e){return Kc[e.toLowerCase()]},pv=function(e){return(Ge(e)?e:null)||$c(e)||Gc(e)||Wc(e)||Hc(e)},Kc={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]},yv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ie(o))throw Error("Tried to set map with object key");i<a.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},mv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ie(o))throw Error("Tried to get map with object key");if(t=t[o],t==null)return t}return t},ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function _a(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ui,Os;function Ga(){if(Os)return ui;Os=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ui=r,ui}var li,Ns;function Uc(){if(Ns)return li;Ns=1;var r=typeof ja=="object"&&ja&&ja.Object===Object&&ja;return li=r,li}var vi,zs;function Hn(){if(zs)return vi;zs=1;var r=Uc(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return vi=t,vi}var fi,Fs;function Xc(){if(Fs)return fi;Fs=1;var r=Hn(),e=function(){return r.Date.now()};return fi=e,fi}var ci,Vs;function Yc(){if(Vs)return ci;Vs=1;var r=/\s/;function e(t){for(var a=t.length;a--&&r.test(t.charAt(a)););return a}return ci=e,ci}var hi,qs;function Zc(){if(qs)return hi;qs=1;var r=Yc(),e=/^\s+/;function t(a){return a&&a.slice(0,r(a)+1).replace(e,"")}return hi=t,hi}var di,_s;function ss(){if(_s)return di;_s=1;var r=Hn(),e=r.Symbol;return di=e,di}var gi,Gs;function Qc(){if(Gs)return gi;Gs=1;var r=ss(),e=Object.prototype,t=e.hasOwnProperty,a=e.toString,n=r?r.toStringTag:void 0;function i(o){var s=t.call(o,n),u=o[n];try{o[n]=void 0;var l=!0}catch{}var v=a.call(o);return l&&(s?o[n]=u:delete o[n]),v}return gi=i,gi}var pi,Hs;function Jc(){if(Hs)return pi;Hs=1;var r=Object.prototype,e=r.toString;function t(a){return e.call(a)}return pi=t,pi}var yi,Ws;function bv(){if(Ws)return yi;Ws=1;var r=ss(),e=Qc(),t=Jc(),a="[object Null]",n="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):t(s)}return yi=o,yi}var mi,$s;function jc(){if($s)return mi;$s=1;function r(e){return e!=null&&typeof e=="object"}return mi=r,mi}var bi,Ks;function Ha(){if(Ks)return bi;Ks=1;var r=bv(),e=jc(),t="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&r(n)==t}return bi=a,bi}var wi,Us;function eh(){if(Us)return wi;Us=1;var r=Zc(),e=Ga(),t=Ha(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(t(l))return a;if(e(l)){var v=typeof l.valueOf=="function"?l.valueOf():l;l=e(v)?v+"":v}if(typeof l!="string")return l===0?l:+l;l=r(l);var f=i.test(l);return f||o.test(l)?s(l.slice(2),f?2:8):n.test(l)?a:+l}return wi=u,wi}var xi,Xs;function rh(){if(Xs)return xi;Xs=1;var r=Ga(),e=Xc(),t=eh(),a="Expected a function",n=Math.max,i=Math.min;function o(s,u,l){var v,f,c,d,h,y,g=0,p=!1,m=!1,b=!0;if(typeof s!="function")throw new TypeError(a);u=t(u)||0,r(l)&&(p=!!l.leading,m="maxWait"in l,c=m?n(t(l.maxWait)||0,u):c,b="trailing"in l?!!l.trailing:b);function w(B){var R=v,M=f;return v=f=void 0,g=B,d=s.apply(M,R),d}function x(B){return g=B,h=setTimeout(T,u),p?w(B):d}function C(B){var R=B-y,M=B-g,I=u-R;return m?i(I,c-M):I}function E(B){var R=B-y,M=B-g;return y===void 0||R>=u||R<0||m&&M>=c}function T(){var B=e();if(E(B))return k(B);h=setTimeout(T,C(B))}function k(B){return h=void 0,b&&v?w(B):(v=f=void 0,d)}function D(){h!==void 0&&clearTimeout(h),g=0,v=y=f=h=void 0}function A(){return h===void 0?d:k(e())}function P(){var B=e(),R=E(B);if(v=arguments,f=this,y=B,R){if(h===void 0)return x(y);if(m)return clearTimeout(h),h=setTimeout(T,u),w(y)}return h===void 0&&(h=setTimeout(T,u)),d}return P.cancel=D,P.flush=A,P}return xi=o,xi}var th=rh(),Wa=_a(th),Ei=rr?rr.performance:null,wv=Ei&&Ei.now?function(){return Ei.now()}:function(){return Date.now()},ah=(function(){if(rr){if(rr.requestAnimationFrame)return function(r){rr.requestAnimationFrame(r)};if(rr.mozRequestAnimationFrame)return function(r){rr.mozRequestAnimationFrame(r)};if(rr.webkitRequestAnimationFrame)return function(r){rr.webkitRequestAnimationFrame(r)};if(rr.msRequestAnimationFrame)return function(r){rr.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(wv())},1e3/60)}})(),Dn=function(e){return ah(e)},Jr=wv,Pt=9261,xv=65599,Xt=5381,Ev=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pt,a=t,n;n=e.next(),!n.done;)a=a*xv+n.value|0;return a},Pa=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pt;return t*xv+e|0},Aa=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xt;return(t<<5)+t+e|0},nh=function(e,t){return e*2097152+t},at=function(e){return e[0]*2097152+e[1]},en=function(e,t){return[Pa(e[0],t[0]),Aa(e[1],t[1])]},Bn=function(e,t){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return Ev(o,t)},Lt=function(e,t){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return Ev(o,t)},Cv=function(){return ih(arguments)},ih=function(e){for(var t,a=0;a<e.length;a++){var n=e[a];a===0?t=Lt(n):t=Lt(n,t)}return t};function oh(r,e,t,a,n){var i=n*Math.PI/180,o=Math.cos(i)*(r-t)-Math.sin(i)*(e-a)+t,s=Math.sin(i)*(r-t)+Math.cos(i)*(e-a)+a;return{x:o,y:s}}var sh=function(e,t,a,n,i,o){return{x:(e-a)*i+a,y:(t-n)*o+n}};function uh(r,e,t){if(t===0)return r;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=oh(r.x,r.y,a,n,t),u=sh(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}var Ys=!0,lh=console.warn!=null,vh=console.trace!=null,us=Number.MAX_SAFE_INTEGER||9007199254740991,Tv=function(){return!0},Pn=function(){return!1},Zs=function(){return 0},ls=function(){},Ue=function(e){throw new Error(e)},Sv=function(e){if(e!==void 0)Ys=!!e;else return Ys},Fe=function(e){Sv()&&(lh?console.warn(e):(console.log(e),vh&&console.trace()))},fh=function(e){return ge({},e)},$r=function(e){return e==null?e:Ge(e)?e.slice():Ie(e)?fh(e):e},ch=function(e){return e.slice()},kv=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},hh={},Dv=function(){return hh},dr=function(e){var t=Object.keys(e);return function(a){for(var n={},i=0;i<t.length;i++){var o=t[i],s=a?.[o];n[o]=s===void 0?e[o]:s}return n}},ct=function(e,t,a){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},vs=function(e){e.splice(0,e.length)},dh=function(e,t){for(var a=0;a<t.length;a++){var n=t[a];e.push(n)}},pr=function(e,t,a){return a&&(t=dv(a,t)),e[t]},Wr=function(e,t,a,n){a&&(t=dv(a,t)),e[t]=n},gh=(function(){function r(){mt(this,r),this._obj={}}return bt(r,[{key:"set",value:function(t,a){return this._obj[t]=a,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])})(),Qr=typeof Map<"u"?Map:gh,ph="undefined",yh=(function(){function r(e){if(mt(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var a=0;a<t.length;a++)this.add(t[a])}}return bt(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var a=this._obj;a[t]!==1&&(a[t]=1,this.size++)}},{key:"delete",value:function(t){var a=this._obj;a[t]===1&&(a[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(a){return t.has(a)})}},{key:"forEach",value:function(t,a){return this.toArray().forEach(t,a)}}])})(),ht=(typeof Set>"u"?"undefined":ar(Set))!==ph?Set:yh,Wn=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!is(e)){Ue("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Ue("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:t.data||{},position:t.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:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new ht,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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),t.renderedPosition){var o=t.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Ge(t.classes)?l=t.classes:ce(t.classes)&&(l=t.classes.split(/\s+/));for(var v=0,f=l.length;v<f;v++){var c=l[v];!c||c===""||i.classes.add(c)}this.createEmitter(),(a===void 0||a)&&this.restore();var d=t.style||t.css;d&&(Fe("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d))},Qs=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var o;Ie(a)&&!Pr(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!Ye(n)?n:i,n=Ye(n)?n:function(){};for(var s=this._private.cy,u=a=ce(a)?this.filter(a):a,l=[],v=[],f={},c={},d={},h=0,y,g=this.byGroup(),p=g.nodes,m=g.edges,b=0;b<u.length;b++){var w=u[b],x=w.id();w.isNode()&&(l.unshift(w),e.bfs&&(d[x]=!0,v.push(w)),c[x]=0)}for(var C=function(){var B=e.bfs?l.shift():l.pop(),R=B.id();if(e.dfs){if(d[R])return 0;d[R]=!0,v.push(B)}var M=c[R],I=f[R],L=I!=null?I.source():null,O=I!=null?I.target():null,G=I==null?void 0:B.same(L)?O[0]:L[0],_;if(_=n(B,I,G,h++,M),_===!0)return y=B,1;if(_===!1)return 1;for(var N=B.connectedEdges().filter(function(j){return(!i||j.source().same(B))&&m.has(j)}),F=0;F<N.length;F++){var Z=N[F],J=Z.connectedNodes().filter(function(j){return!j.same(B)&&p.has(j)}),U=J.id();J.length!==0&&!d[U]&&(J=J[0],l.push(J),e.bfs&&(d[U]=!0,v.push(J)),f[U]=Z,c[U]=c[R]+1)}},E;l.length!==0&&(E=C(),!(E!==0&&E===1)););for(var T=s.collection(),k=0;k<v.length;k++){var D=v[k],A=f[D.id()];A!=null&&T.push(A),T.push(D)}return{path:s.collection(T),found:s.collection(y)}}},Ra={breadthFirstSearch:Qs({bfs:!0}),depthFirstSearch:Qs({dfs:!0})};Ra.bfs=Ra.breadthFirstSearch;Ra.dfs=Ra.depthFirstSearch;var hn={exports:{}},mh=hn.exports,Js;function bh(){return Js||(Js=1,(function(r,e){(function(){var t,a,n,i,o,s,u,l,v,f,c,d,h,y,g;n=Math.floor,f=Math.min,a=function(p,m){return p<m?-1:p>m?1:0},v=function(p,m,b,w,x){var C;if(b==null&&(b=0),x==null&&(x=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);b<w;)C=n((b+w)/2),x(m,p[C])<0?w=C:b=C+1;return[].splice.apply(p,[b,b-b].concat(m)),m},s=function(p,m,b){return b==null&&(b=a),p.push(m),y(p,0,p.length-1,b)},o=function(p,m){var b,w;return m==null&&(m=a),b=p.pop(),p.length?(w=p[0],p[0]=b,g(p,0,m)):w=b,w},l=function(p,m,b){var w;return b==null&&(b=a),w=p[0],p[0]=m,g(p,0,b),w},u=function(p,m,b){var w;return b==null&&(b=a),p.length&&b(p[0],m)<0&&(w=[p[0],m],m=w[0],p[0]=w[1],g(p,0,b)),m},i=function(p,m){var b,w,x,C,E,T;for(m==null&&(m=a),C=(function(){T=[];for(var k=0,D=n(p.length/2);0<=D?k<D:k>D;0<=D?k++:k--)T.push(k);return T}).apply(this).reverse(),E=[],w=0,x=C.length;w<x;w++)b=C[w],E.push(g(p,b,m));return E},h=function(p,m,b){var w;if(b==null&&(b=a),w=p.indexOf(m),w!==-1)return y(p,0,w,b),g(p,w,b)},c=function(p,m,b){var w,x,C,E,T;if(b==null&&(b=a),x=p.slice(0,m),!x.length)return x;for(i(x,b),T=p.slice(m),C=0,E=T.length;C<E;C++)w=T[C],u(x,w,b);return x.sort(b).reverse()},d=function(p,m,b){var w,x,C,E,T,k,D,A,P;if(b==null&&(b=a),m*10<=p.length){if(C=p.slice(0,m).sort(b),!C.length)return C;for(x=C[C.length-1],D=p.slice(m),E=0,k=D.length;E<k;E++)w=D[E],b(w,x)<0&&(v(C,w,0,null,b),C.pop(),x=C[C.length-1]);return C}for(i(p,b),P=[],T=0,A=f(m,p.length);0<=A?T<A:T>A;0<=A?++T:--T)P.push(o(p,b));return P},y=function(p,m,b,w){var x,C,E;for(w==null&&(w=a),x=p[b];b>m;){if(E=b-1>>1,C=p[E],w(x,C)<0){p[b]=C,b=E;continue}break}return p[b]=x},g=function(p,m,b){var w,x,C,E,T;for(b==null&&(b=a),x=p.length,T=m,C=p[m],w=2*m+1;w<x;)E=w+1,E<x&&!(b(p[w],p[E])<0)&&(w=E),p[m]=p[w],m=w,w=2*m+1;return p[m]=C,y(p,T,m,b)},t=(function(){p.push=s,p.pop=o,p.replace=l,p.pushpop=u,p.heapify=i,p.updateItem=h,p.nlargest=c,p.nsmallest=d;function p(m){this.cmp=m??a,this.nodes=[]}return p.prototype.push=function(m){return s(this.nodes,m,this.cmp)},p.prototype.pop=function(){return o(this.nodes,this.cmp)},p.prototype.peek=function(){return this.nodes[0]},p.prototype.contains=function(m){return this.nodes.indexOf(m)!==-1},p.prototype.replace=function(m){return l(this.nodes,m,this.cmp)},p.prototype.pushpop=function(m){return u(this.nodes,m,this.cmp)},p.prototype.heapify=function(){return i(this.nodes,this.cmp)},p.prototype.updateItem=function(m){return h(this.nodes,m,this.cmp)},p.prototype.clear=function(){return this.nodes=[]},p.prototype.empty=function(){return this.nodes.length===0},p.prototype.size=function(){return this.nodes.length},p.prototype.clone=function(){var m;return m=new p,m.nodes=this.nodes.slice(0),m},p.prototype.toArray=function(){return this.nodes.slice(0)},p.prototype.insert=p.prototype.push,p.prototype.top=p.prototype.peek,p.prototype.front=p.prototype.peek,p.prototype.has=p.prototype.contains,p.prototype.copy=p.prototype.clone,p})(),(function(p,m){return r.exports=m()})(this,function(){return t})}).call(mh)})(hn)),hn.exports}var Ci,js;function wh(){return js||(js=1,Ci=bh()),Ci}var xh=wh(),$a=_a(xh),Eh=dr({root:null,weight:function(e){return 1},directed:!1}),Ch={dijkstra:function(e){if(!Ie(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var a=Eh(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=ce(n)?this.filter(n)[0]:n[0],v={},f={},c={},d=this.byGroup(),h=d.nodes,y=d.edges;y.unmergeBy(function(M){return M.isLoop()});for(var g=function(I){return v[I.id()]},p=function(I,L){v[I.id()]=L,m.updateItem(I)},m=new $a(function(M,I){return g(M)-g(I)}),b=0;b<h.length;b++){var w=h[b];v[w.id()]=w.same(l)?0:1/0,m.push(w)}for(var x=function(I,L){for(var O=(o?I.edgesTo(L):I.edgesWith(L)).intersect(y),G=1/0,_,N=0;N<O.length;N++){var F=O[N],Z=u(F);(Z<G||!_)&&(G=Z,_=F)}return{edge:_,dist:G}};m.size()>0;){var C=m.pop(),E=g(C),T=C.id();if(c[T]=E,E!==1/0)for(var k=C.neighborhood().intersect(h),D=0;D<k.length;D++){var A=k[D],P=A.id(),B=x(C,A),R=E+B.dist;R<g(A)&&(p(A,R),f[P]={node:C,edge:B.edge})}}return{distanceTo:function(I){var L=ce(I)?h.filter(I)[0]:I[0];return c[L.id()]},pathTo:function(I){var L=ce(I)?h.filter(I)[0]:I[0],O=[],G=L,_=G.id();if(L.length>0)for(O.unshift(L);f[_];){var N=f[_];O.unshift(N.edge),O.unshift(N.node),G=N.node,_=G.id()}return s.spawn(O)}}}},Th={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,o=new Array(i),s=a,u=function(w){for(var x=0;x<o.length;x++){var C=o[x];if(C.has(w))return x}},l=0;l<i;l++)o[l]=this.spawn(a[l]);for(var v=n.sort(function(b,w){return e(b)-e(w)}),f=0;f<v.length;f++){var c=v[f],d=c.source()[0],h=c.target()[0],y=u(d),g=u(h),p=o[y],m=o[g];y!==g&&(s.merge(c),p.merge(m),o.splice(g,1))}return s}},Sh=dr({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),kh={aStar:function(e){var t=this.cy(),a=Sh(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,u=a.weight;n=t.collection(n)[0],i=t.collection(i)[0];var l=n.id(),v=i.id(),f={},c={},d={},h=new $a(function(_,N){return c[_.id()]-c[N.id()]}),y=new ht,g={},p={},m=function(N,F){h.push(N),y.add(F)},b,w,x=function(){b=h.pop(),w=b.id(),y.delete(w)},C=function(N){return y.has(N)};m(n,l),f[l]=0,c[l]=o(n);for(var E=0;h.size()>0;){if(x(),E++,w===v){for(var T=[],k=i,D=v,A=p[D];T.unshift(k),A!=null&&T.unshift(A),k=g[D],k!=null;)D=k.id(),A=p[D];return{found:!0,distance:f[w],path:this.spawn(T),steps:E}}d[w]=!0;for(var P=b._private.edges,B=0;B<P.length;B++){var R=P[B];if(this.hasElementWithId(R.id())&&!(s&&R.data("source")!==w)){var M=R.source(),I=R.target(),L=M.id()!==w?M:I,O=L.id();if(this.hasElementWithId(O)&&!d[O]){var G=f[w]+u(R);if(!C(O)){f[O]=G,c[O]=G+o(L),m(L,O),g[O]=b,p[O]=R;continue}G<f[O]&&(f[O]=G,c[O]=G+o(L),h.updateItem(L),g[O]=b,p[O]=R)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},Dh=dr({weight:function(e){return 1},directed:!1}),Bh={floydWarshall:function(e){for(var t=this.cy(),a=Dh(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),u=s.nodes,l=s.edges,v=u.length,f=v*v,c=function(Z){return u.indexOf(Z)},d=function(Z){return u[Z]},h=new Array(f),y=0;y<f;y++){var g=y%v,p=(y-g)/v;p===g?h[y]=0:h[y]=1/0}for(var m=new Array(f),b=new Array(f),w=0;w<l.length;w++){var x=l[w],C=x.source()[0],E=x.target()[0];if(C!==E){var T=c(C),k=c(E),D=T*v+k,A=o(x);if(h[D]>A&&(h[D]=A,m[D]=k,b[D]=x),!i){var P=k*v+T;!i&&h[P]>A&&(h[P]=A,m[P]=T,b[P]=x)}}}for(var B=0;B<v;B++)for(var R=0;R<v;R++)for(var M=R*v+B,I=0;I<v;I++){var L=R*v+I,O=B*v+I;h[M]+h[O]<h[L]&&(h[L]=h[M]+h[O],m[L]=m[M])}var G=function(Z){return(ce(Z)?t.filter(Z):Z)[0]},_=function(Z){return c(G(Z))},N={distance:function(Z,J){var U=_(Z),j=_(J);return h[U*v+j]},path:function(Z,J){var U=_(Z),j=_(J),re=d(U);if(U===j)return re.collection();if(m[U*v+j]==null)return t.collection();var ne=t.collection(),W=U,z;for(ne.merge(re);U!==j;)W=U,U=m[U*v+j],z=b[W*v+U],ne.merge(z),ne.merge(d(U));return ne}};return N}},Ph=dr({weight:function(e){return 1},directed:!1,root:null}),Ah={bellmanFord:function(e){var t=this,a=Ph(e),n=a.weight,i=a.directed,o=a.root,s=n,u=this,l=this.cy(),v=this.byGroup(),f=v.edges,c=v.nodes,d=c.length,h=new Qr,y=!1,g=[];o=l.collection(o)[0],f.unmergeBy(function(Se){return Se.isLoop()});for(var p=f.length,m=function(we){var pe=h.get(we.id());return pe||(pe={},h.set(we.id(),pe)),pe},b=function(we){return(ce(we)?l.$(we):we)[0]},w=function(we){return m(b(we)).dist},x=function(we){for(var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ie=b(we),ye=[],he=ie;;){if(he==null)return t.spawn();var Ce=m(he),be=Ce.edge,Ae=Ce.pred;if(ye.unshift(he[0]),he.same(pe)&&ye.length>0)break;be!=null&&ye.unshift(be),he=Ae}return u.spawn(ye)},C=0;C<d;C++){var E=c[C],T=m(E);E.same(o)?T.dist=0:T.dist=1/0,T.pred=null,T.edge=null}for(var k=!1,D=function(we,pe,ie,ye,he,Ce){var be=ye.dist+Ce;be<he.dist&&!ie.same(ye.edge)&&(he.dist=be,he.pred=we,he.edge=ie,k=!0)},A=1;A<d;A++){k=!1;for(var P=0;P<p;P++){var B=f[P],R=B.source(),M=B.target(),I=s(B),L=m(R),O=m(M);D(R,M,B,L,O,I),i||D(M,R,B,O,L,I)}if(!k)break}if(k)for(var G=[],_=0;_<p;_++){var N=f[_],F=N.source(),Z=N.target(),J=s(N),U=m(F).dist,j=m(Z).dist;if(U+J<j||!i&&j+J<U)if(y||(Fe("Graph contains a negative weight cycle for Bellman-Ford"),y=!0),e.findNegativeWeightCycles!==!1){var re=[];U+J<j&&re.push(F),!i&&j+J<U&&re.push(Z);for(var ne=re.length,W=0;W<ne;W++){var z=re[W],q=[z];q.push(m(z).edge);for(var X=m(z).pred;q.indexOf(X)===-1;)q.push(X),q.push(m(X).edge),X=m(X).pred;q=q.slice(q.indexOf(X));for(var Y=q[0].id(),ae=0,ve=2;ve<q.length;ve+=2)q[ve].id()<Y&&(Y=q[ve].id(),ae=ve);q=q.slice(ae).concat(q.slice(0,ae)),q.push(q[0]);var Ne=q.map(function(Se){return Se.id()}).join(",");G.indexOf(Ne)===-1&&(g.push(u.spawn(q)),G.push(Ne))}}else break}return{distanceTo:w,pathTo:x,hasNegativeWeightCycle:y,negativeWeightCycles:g}}},Rh=Math.sqrt(2),Mh=function(e,t,a){a.length===0&&Ue("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=t[i],u=t[o],l=a,v=l.length-1;v>=0;v--){var f=l[v],c=f[1],d=f[2];(t[c]===s&&t[d]===u||t[c]===u&&t[d]===s)&&l.splice(v,1)}for(var h=0;h<l.length;h++){var y=l[h];y[1]===u?(l[h]=y.slice(),l[h][1]=s):y[2]===u&&(l[h]=y.slice(),l[h][2]=s)}for(var g=0;g<t.length;g++)t[g]===u&&(t[g]=s);return l},Ti=function(e,t,a,n){for(;a>n;){var i=Math.floor(Math.random()*t.length);t=Mh(i,e,t),a--}return t},Lh={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/Rh);if(i<2){Ue("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],v=0;v<o;v++){var f=n[v];l.push([v,a.indexOf(f.source()),a.indexOf(f.target())])}for(var c=1/0,d=[],h=new Array(i),y=new Array(i),g=new Array(i),p=function(G,_){for(var N=0;N<i;N++)_[N]=G[N]},m=0;m<=s;m++){for(var b=0;b<i;b++)y[b]=b;var w=Ti(y,l.slice(),i,u),x=w.slice();p(y,g);var C=Ti(y,w,u,2),E=Ti(g,x,u,2);C.length<=E.length&&C.length<c?(c=C.length,d=C,p(y,h)):E.length<=C.length&&E.length<c&&(c=E.length,d=E,p(g,h))}for(var T=this.spawn(d.map(function(O){return n[O[0]]})),k=this.spawn(),D=this.spawn(),A=h[0],P=0;P<h.length;P++){var B=h[P],R=a[P];B===A?k.merge(R):D.merge(R)}var M=function(G){var _=e.spawn();return G.forEach(function(N){_.merge(N),N.connectedEdges().forEach(function(F){e.contains(F)&&!T.contains(F)&&_.merge(F)})}),_},I=[M(k),M(D)],L={cut:T,components:I,partition1:k,partition2:D};return L}},Si,Ih=function(e){return{x:e.x,y:e.y}},$n=function(e,t,a){return{x:e.x*t+a.x,y:e.y*t+a.y}},Bv=function(e,t,a){return{x:(e.x-a.x)/t,y:(e.y-a.y)/t}},Yt=function(e){return{x:e[0],y:e[1]}},Oh=function(e){for(var t=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=t;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},Nh=function(e){for(var t=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=t;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},zh=function(e){for(var t=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,o=t;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},Fh=function(e){var t=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,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a<e.length&&e.splice(a,e.length-a),t>0&&e.splice(0,t));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(c,d){return c-d});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+s]:(e[f-1+s]+e[f+s])/2},Pv=function(e,t){return t===0?e:Pv(t,e%t)},eu=function(e){for(var t=e[0],a=0;a<e.length;a++)if(Sn(e[a]))a>0&&(t=Pv(t,e[a]));else return 0;return t},ru=function(e,t){var a=e/t,n=Math.round(a);return n>=1&&Math.abs(a-n)<1e-6},Vh=function(e){return Math.PI*e/180},rn=function(e,t){return Math.atan2(t,e)-Math.PI/2},fs=Math.log2||function(r){return Math.log(r)/Math.log(2)},An=function(e){return e>0?1:e<0?-1:0},It=function(e,t){return Math.sqrt(Dt(e,t))},Dt=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},qh=function(e){for(var t=e.length,a=0,n=0;n<t;n++)a+=e[n];for(var i=0;i<t;i++)e[i]=e[i]/a;return e},ur=function(e,t,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*a},Jt=function(e,t,a,n){return{x:ur(e.x,t.x,a.x,n),y:ur(e.y,t.y,a.y,n)}},_h=function(e,t,a,n){var i={x:t.x-e.x,y:t.y-e.y},o=It(e,t),s={x:i.x/o,y:i.y/o};return a=a??0,n=n??a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},Ma=function(e,t,a){return Math.max(e,Math.min(a,t))},yr=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}}},Gh=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Hh=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Wh=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Av=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),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},dn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},gn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(t.length===1)a=n=i=o=t[0];else if(t.length===2)a=i=t[0],o=n=t[1];else if(t.length===4){var s=er(t,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tu=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},cs=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Rt=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},au=function(e,t){return Rt(e,t.x,t.y)},Rv=function(e,t){return Rt(e,t.x1,t.y1)&&Rt(e,t.x2,t.y2)},$h=(Si=Math.hypot)!==null&&Si!==void 0?Si:function(r,e){return Math.sqrt(r*r+e*e)};function Kh(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(T,k){return{x:T.x+k.x,y:T.y+k.y}},a=function(T,k){return{x:T.x-k.x,y:T.y-k.y}},n=function(T,k){return{x:T.x*k,y:T.y*k}},i=function(T,k){return T.x*k.y-T.y*k.x},o=function(T){var k=$h(T.x,T.y);return k===0?{x:0,y:0}:{x:T.x/k,y:T.y/k}},s=function(T){for(var k=0,D=0;D<T.length;D++){var A=T[D],P=T[(D+1)%T.length];k+=A.x*P.y-P.x*A.y}return k/2},u=function(T,k,D,A){var P=a(k,T),B=a(A,D),R=i(P,B);if(Math.abs(R)<1e-9)return t(T,n(P,.5));var M=i(a(D,T),B)/R;return t(T,n(P,M))},l=r.map(function(E){return{x:E.x,y:E.y}});s(l)<0&&l.reverse();for(var v=l.length,f=[],c=0;c<v;c++){var d=l[c],h=l[(c+1)%v],y=a(h,d),g=o({x:y.y,y:-y.x});f.push(g)}for(var p=f.map(function(E,T){var k=t(l[T],n(E,e)),D=t(l[(T+1)%v],n(E,e));return{p1:k,p2:D}}),m=[],b=0;b<v;b++){var w=p[(b-1+v)%v],x=p[b],C=u(w.p1,w.p2,x.p1,x.p2);m.push(C)}return m}function Uh(r,e,t,a,n,i){var o=Jh(r,e,t,a,n),s=Kh(o,i),u=yr();return s.forEach(function(l){return Av(u,l.x,l.y)}),u}var Mv=function(e,t,a,n,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?dt(i,o):u,v=i/2,f=o/2;l=Math.min(l,v,f);var c=l!==v,d=l!==f,h;if(c){var y=a-v+l-s,g=n-f-s,p=a+v-l+s,m=g;if(h=ut(e,t,a,n,y,g,p,m,!1),h.length>0)return h}if(d){var b=a+v+s,w=n-f+l-s,x=b,C=n+f-l+s;if(h=ut(e,t,a,n,b,w,x,C,!1),h.length>0)return h}if(c){var E=a-v+l-s,T=n+f+s,k=a+v-l+s,D=T;if(h=ut(e,t,a,n,E,T,k,D,!1),h.length>0)return h}if(d){var A=a-v-s,P=n-f+l-s,B=A,R=n+f-l+s;if(h=ut(e,t,a,n,A,P,B,R,!1),h.length>0)return h}var M;{var I=a-v+l,L=n-f+l;if(M=Ea(e,t,a,n,I,L,l+s),M.length>0&&M[0]<=I&&M[1]<=L)return[M[0],M[1]]}{var O=a+v-l,G=n-f+l;if(M=Ea(e,t,a,n,O,G,l+s),M.length>0&&M[0]>=O&&M[1]<=G)return[M[0],M[1]]}{var _=a+v-l,N=n+f-l;if(M=Ea(e,t,a,n,_,N,l+s),M.length>0&&M[0]>=_&&M[1]>=N)return[M[0],M[1]]}{var F=a-v+l,Z=n+f-l;if(M=Ea(e,t,a,n,F,Z,l+s),M.length>0&&M[0]<=F&&M[1]>=Z)return[M[0],M[1]]}return[]},Lv=function(e,t,a,n,i,o,s){var u=s,l=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,o),c=Math.max(n,o);return l-u<=e&&e<=v+u&&f-u<=t&&t<=c+u},Iv=function(e,t,a,n,i,o,s,u,l){var v={x1:Math.min(a,s,i)-l,x2:Math.max(a,s,i)+l,y1:Math.min(n,u,o)-l,y2:Math.max(n,u,o)+l};return!(e<v.x1||e>v.x2||t<v.y1||t>v.y2)},Xh=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-t+o)/s,l=(-t-o)/s;return[u,l]},Yh=function(e,t,a,n,i){var o=1e-5;e===0&&(e=o),t/=e,a/=e,n/=e;var s,u,l,v,f,c,d,h;if(u=(3*a-t*t)/9,l=-(27*n)+t*(9*a-2*(t*t)),l/=54,s=u*u*u+l*l,i[1]=0,d=t/3,s>0){f=l+Math.sqrt(s),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=l-Math.sqrt(s),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+f+c,d+=(f+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+f)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,s===0){h=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-d+2*h,i[4]=i[2]=-(h+d);return}u=-u,v=u*u*u,v=Math.acos(l/Math.sqrt(v)),h=2*Math.sqrt(u),i[0]=-d+h*Math.cos(v/3),i[2]=-d+h*Math.cos((v+2*Math.PI)/3),i[4]=-d+h*Math.cos((v+4*Math.PI)/3)},Ov=function(e,t,a,n,i,o,s,u){var l=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*u+4*o*o-4*o*u+u*u,v=9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*u-6*o*o+3*o*u,f=3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*u-n*t+2*o*o+2*o*t-u*t,c=1*a*i-a*a+a*e-i*e+n*o-n*n+n*t-o*t,d=[];Yh(l,v,f,c,d);for(var h=1e-7,y=[],g=0;g<6;g+=2)Math.abs(d[g+1])<h&&d[g]>=0&&d[g]<=1&&y.push(d[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,x=0;x<y.length;x++)m=Math.pow(1-y[x],2)*a+2*(1-y[x])*y[x]*i+y[x]*y[x]*s,b=Math.pow(1-y[x],2)*n+2*(1-y[x])*y[x]*o+y[x]*y[x]*u,w=Math.pow(m-e,2)+Math.pow(b-t,2),p>=0?w<p&&(p=w):p=w;return p},Nv=function(e,t,a,n,i,o){var s=[e-a,t-n],u=[i-a,o-n],l=u[0]*u[0]+u[1]*u[1],v=s[0]*s[0]+s[1]*s[1],f=s[0]*u[0]+s[1]*u[1],c=f*f/l;return f<0?v:c>l?(e-i)*(e-i)+(t-o)*(t-o):v-c},kr=function(e,t,a){for(var n,i,o,s,u,l=0,v=0;v<a.length/2;v++)if(n=a[v*2],i=a[v*2+1],v+1<a.length/2?(o=a[(v+1)*2],s=a[(v+1)*2+1]):(o=a[(v+1-a.length/2)*2],s=a[(v+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)u=(e-n)/(o-n)*(s-i)+i,u>t&&l++;else continue;return l%2!==0},jr=function(e,t,a,n,i,o,s,u,l){var v=new Array(a.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var c=Math.cos(-f),d=Math.sin(-f),h=0;h<v.length/2;h++)v[h*2]=o/2*(a[h*2]*c-a[h*2+1]*d),v[h*2+1]=s/2*(a[h*2+1]*c+a[h*2]*d),v[h*2]+=n,v[h*2+1]+=i;var y;if(l>0){var g=Mn(v,-l);y=Rn(g)}else y=v;return kr(e,t,y)},Zh=function(e,t,a,n,i,o,s,u){for(var l=new Array(a.length*2),v=0;v<u.length;v++){var f=u[v];l[v*4+0]=f.startX,l[v*4+1]=f.startY,l[v*4+2]=f.stopX,l[v*4+3]=f.stopY;var c=Math.pow(f.cx-e,2)+Math.pow(f.cy-t,2);if(c<=Math.pow(f.radius,2))return!0}return kr(e,t,l)},Rn=function(e){for(var t=new Array(e.length/2),a,n,i,o,s,u,l,v,f=0;f<e.length/4;f++){a=e[f*4],n=e[f*4+1],i=e[f*4+2],o=e[f*4+3],f<e.length/4-1?(s=e[(f+1)*4],u=e[(f+1)*4+1],l=e[(f+1)*4+2],v=e[(f+1)*4+3]):(s=e[0],u=e[1],l=e[2],v=e[3]);var c=ut(a,n,i,o,s,u,l,v,!0);t[f*2]=c[0],t[f*2+1]=c[1]}return t},Mn=function(e,t){for(var a=new Array(e.length*2),n,i,o,s,u=0;u<e.length/2;u++){n=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,v=-(o-n),f=Math.sqrt(l*l+v*v),c=l/f,d=v/f;a[u*4]=n+c*t,a[u*4+1]=i+d*t,a[u*4+2]=o+c*t,a[u*4+3]=s+d*t}return a},Qh=function(e,t,a,n,i,o){var s=a-e,u=n-t;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),v=l-1;if(v<0)return[];var f=v/l;return[(a-e)*f+e,(n-t)*f+t]},Mt=function(e,t,a,n,i,o,s){return e-=i,t-=o,e/=a/2+s,t/=n/2+s,e*e+t*t<=1},Ea=function(e,t,a,n,i,o,s){var u=[a-e,n-t],l=[e-i,t-o],v=u[0]*u[0]+u[1]*u[1],f=2*(l[0]*u[0]+l[1]*u[1]),c=l[0]*l[0]+l[1]*l[1]-s*s,d=f*f-4*v*c;if(d<0)return[];var h=(-f+Math.sqrt(d))/(2*v),y=(-f-Math.sqrt(d))/(2*v),g=Math.min(h,y),p=Math.max(h,y),m=[];if(g>=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*u[0]+e,w=m[0]*u[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var x=m[1]*u[0]+e,C=m[1]*u[1]+t;return[b,w,x,C]}else return[b,w]},ki=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},ut=function(e,t,a,n,i,o,s,u,l){var v=e-i,f=a-e,c=s-i,d=t-o,h=n-t,y=u-o,g=c*d-y*v,p=f*d-h*v,m=y*f-c*h;if(m!==0){var b=g/m,w=p/m,x=.001,C=0-x,E=1+x;return C<=b&&b<=E&&C<=w&&w<=E?[e+b*f,t+b*h]:l?[e+b*f,t+b*h]:[]}else return g===0||p===0?ki(e,a,s)===s?[s,u]:ki(e,a,i)===i?[i,o]:ki(i,s,a)===a?[a,n]:[]:[]},Jh=function(e,t,a,n,i){var o=[],s=n/2,u=i/2,l=t,v=a;o.push({x:l+s*e[0],y:v+u*e[1]});for(var f=1;f<e.length/2;f++)o.push({x:l+s*e[f*2],y:v+u*e[f*2+1]});return o},La=function(e,t,a,n,i,o,s,u){var l=[],v,f=new Array(a.length),c=!0;o==null&&(c=!1);var d;if(c){for(var h=0;h<f.length/2;h++)f[h*2]=a[h*2]*o+n,f[h*2+1]=a[h*2+1]*s+i;if(u>0){var y=Mn(f,-u);d=Rn(y)}else d=f}else d=a;for(var g,p,m,b,w=0;w<d.length/2;w++)g=d[w*2],p=d[w*2+1],w<d.length/2-1?(m=d[(w+1)*2],b=d[(w+1)*2+1]):(m=d[0],b=d[1]),v=ut(e,t,n,i,g,p,m,b),v.length!==0&&l.push(v[0],v[1]);return l},jh=function(e,t,a,n,i,o,s,u,l){var v=[],f,c=new Array(a.length*2);l.forEach(function(m,b){b===0?(c[c.length-2]=m.startX,c[c.length-1]=m.startY):(c[b*4-2]=m.startX,c[b*4-1]=m.startY),c[b*4]=m.stopX,c[b*4+1]=m.stopY,f=Ea(e,t,n,i,m.cx,m.cy,m.radius),f.length!==0&&v.push(f[0],f[1])});for(var d=0;d<c.length/4;d++)f=ut(e,t,n,i,c[d*4],c[d*4+1],c[d*4+2],c[d*4+3],!1),f.length!==0&&v.push(f[0],f[1]);if(v.length>2){for(var h=[v[0],v[1]],y=Math.pow(h[0]-e,2)+Math.pow(h[1]-t,2),g=1;g<v.length/2;g++){var p=Math.pow(v[g*2]-e,2)+Math.pow(v[g*2+1]-t,2);p<=y&&(h[0]=v[g*2],h[1]=v[g*2+1],y=p)}return h}return v},tn=function(e,t,a){var n=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),o=(i-a)/i;return o<0&&(o=1e-5),[t[0]+o*n[0],t[1]+o*n[1]]},xr=function(e,t){var a=Vo(e,t);return a=zv(a),a},zv=function(e){for(var t,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<n;l++)t=e[2*l],a=e[2*l+1],i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,a),u=Math.max(u,a);for(var v=2/(s-i),f=2/(u-o),c=0;c<n;c++)t=e[2*c]=e[2*c]*v,a=e[2*c+1]=e[2*c+1]*f,i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,a),u=Math.max(u,a);if(o<-1)for(var d=0;d<n;d++)a=e[2*d+1]=e[2*d+1]+(-1-o);return e},Vo=function(e,t){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=t;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},dt=function(e,t){return Math.min(e/4,t/4,8)},Fv=function(e,t){return Math.min(e/10,t/10,8)},hs=function(){return 8},ed=function(e,t,a){return[e-2*t+a,2*(t-e),e]},qo=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Vv=function(e,t,a,n,i,o,s){var u=e.x1-s-i,l=e.x2+s-i,v=e.y1-s-o,f=e.y2+s-o;if(n){var c=Math.cos(n),d=Math.sin(n),h=function(g,p){return g=g-t,p=p-a,{x:g*c-p*d+t+i,y:g*d+p*c+a+o}};return[h(u,v),h(l,v),h(l,f),h(u,f)]}else return[{x:u+i,y:v+o},{x:l+i,y:v+o},{x:l+i,y:f+o},{x:u+i,y:f+o}]};function Sa(r,e){function t(f){for(var c=[],d=0;d<f.length;d++){var h=f[d],y=f[(d+1)%f.length],g={x:y.x-h.x,y:y.y-h.y},p={x:-g.y,y:g.x},m=Math.sqrt(p.x*p.x+p.y*p.y);c.push({x:p.x/m,y:p.y/m})}return c}function a(f,c){var d=1/0,h=-1/0,y=Dr(f),g;try{for(y.s();!(g=y.n()).done;){var p=g.value,m=p.x*c.x+p.y*c.y;d=Math.min(d,m),h=Math.max(h,m)}}catch(b){y.e(b)}finally{y.f()}return{min:d,max:h}}function n(f,c){return!(f.max<c.min||c.max<f.min)}var i=[].concat(Tn(t(r)),Tn(t(e))),o=Dr(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=a(r,u),v=a(e,u);if(!n(l,v))return!1}}catch(f){o.e(f)}finally{o.f()}return!0}function rd(r,e,t,a){function n(i,o,s){return(s.y-i.y)*(o.x-i.x)>(o.y-i.y)*(s.x-i.x)}return n(r,t,a)!==n(e,t,a)&&n(r,e,t)!==n(r,e,a)}function td(r,e){for(var t=!1,a=0,n=e.length-1;a<e.length;n=a++){var i=e[a],o=e[n],s=i.y>r.y!=o.y>r.y&&r.x<(o.x-i.x)*(r.y-i.y)/(o.y-i.y)+i.x;s&&(t=!t)}return t}function ad(r,e,t){if(td(r,t))return!0;for(var a=0;a<t.length;a++){var n=t[a],i=t[(a+1)%t.length];if(rd(r,e,n,i))return!0}return!1}var nd=dr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),id={pageRank:function(e){for(var t=nd(e),a=t.dampingFactor,n=t.precision,i=t.iterations,o=t.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,v=u.edges,f=l.length,c=f*f,d=v.length,h=new Array(c),y=new Array(f),g=(1-a)/f,p=0;p<f;p++){for(var m=0;m<f;m++){var b=p*f+m;h[b]=0}y[p]=0}for(var w=0;w<d;w++){var x=v[w],C=x.data("source"),E=x.data("target");if(C!==E){var T=l.indexOfId(C),k=l.indexOfId(E),D=o(x),A=k*f+T;h[A]+=D,y[T]+=D}}for(var P=a/f+g,B=0;B<f;B++)if(y[B]===0)for(var R=0;R<f;R++){var M=R*f+B;h[M]=P}else for(var I=0;I<f;I++){var L=I*f+B;h[L]=a*h[L]/y[B]+g}for(var O=new Array(f),G=new Array(f),_,N=0;N<f;N++)O[N]=1;for(var F=0;F<i;F++){for(var Z=0;Z<f;Z++)G[Z]=0;for(var J=0;J<f;J++)for(var U=0;U<f;U++){var j=J*f+U;G[J]+=h[j]*O[U]}qh(G),_=O,O=G,G=_;for(var re=0,ne=0;ne<f;ne++){var W=_[ne]-O[ne];re+=W*W}if(re<n)break}var z={rank:function(X){return X=s.collection(X)[0],O[l.indexOf(X)]}};return z}},nu=dr({root:null,weight:function(e){return 1},directed:!1,alpha:0}),jt={degreeCentralityNormalized:function(e){e=nu(e);var t=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var v={},f={},c=0,d=0,h=0;h<n;h++){var y=a[h],g=y.id();e.root=y;var p=this.degreeCentrality(e);c<p.indegree&&(c=p.indegree),d<p.outdegree&&(d=p.outdegree),v[g]=p.indegree,f[g]=p.outdegree}return{indegree:function(b){return c==0?0:(ce(b)&&(b=t.filter(b)),v[b.id()]/c)},outdegree:function(b){return d===0?0:(ce(b)&&(b=t.filter(b)),f[b.id()]/d)}}}else{for(var i={},o=0,s=0;s<n;s++){var u=a[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(b){return o===0?0:(ce(b)&&(b=t.filter(b)),i[b.id()]/o)}}}},degreeCentrality:function(e){e=nu(e);var t=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,u=n.alpha;if(i=t.collection(i)[0],s){for(var d=i.connectedEdges(),h=d.filter(function(C){return C.target().same(i)&&a.has(C)}),y=d.filter(function(C){return C.source().same(i)&&a.has(C)}),g=h.length,p=y.length,m=0,b=0,w=0;w<h.length;w++)m+=o(h[w]);for(var x=0;x<y.length;x++)b+=o(y[x]);return{indegree:Math.pow(g,1-u)*Math.pow(m,u),outdegree:Math.pow(p,1-u)*Math.pow(b,u)}}else{for(var l=i.connectedEdges().intersection(a),v=l.length,f=0,c=0;c<l.length;c++)f+=o(l[c]);return{degree:Math.pow(v,1-u)*Math.pow(f,u)}}}};jt.dc=jt.degreeCentrality;jt.dcn=jt.degreeCentralityNormalised=jt.degreeCentralityNormalized;var iu=dr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),ea={closenessCentralityNormalized:function(e){for(var t=iu(e),a=t.harmonic,n=t.weight,i=t.directed,o=this.cy(),s={},u=0,l=this.nodes(),v=this.floydWarshall({weight:n,directed:i}),f=0;f<l.length;f++){for(var c=0,d=l[f],h=0;h<l.length;h++)if(f!==h){var y=v.distance(d,l[h]);a?c+=1/y:c+=y}a||(c=1/c),u<c&&(u=c),s[d.id()]=c}return{closeness:function(p){return u==0?0:(ce(p)?p=o.filter(p)[0].id():p=p.id(),s[p]/u)}}},closenessCentrality:function(e){var t=iu(e),a=t.root,n=t.weight,i=t.directed,o=t.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),u=0,l=this.nodes(),v=0;v<l.length;v++){var f=l[v];if(!f.same(a)){var c=s.distanceTo(f);o?u+=1/c:u+=c}}return o?u:1/u}};ea.cc=ea.closenessCentrality;ea.ccn=ea.closenessCentralityNormalised=ea.closenessCentralityNormalized;var od=dr({weight:null,directed:!1}),_o={betweennessCentrality:function(e){for(var t=od(e),a=t.directed,n=t.weight,i=n!=null,o=this.cy(),s=this.nodes(),u={},l={},v=0,f={set:function(b,w){l[b]=w,w>v&&(v=w)},get:function(b){return l[b]}},c=0;c<s.length;c++){var d=s[c],h=d.id();a?u[h]=d.outgoers().nodes():u[h]=d.openNeighborhood().nodes(),f.set(h,0)}for(var y=function(){for(var b=s[g].id(),w=[],x={},C={},E={},T=new $a(function(J,U){return E[J]-E[U]}),k=0;k<s.length;k++){var D=s[k].id();x[D]=[],C[D]=0,E[D]=1/0}for(C[b]=1,E[b]=0,T.push(b);!T.empty();){var A=T.pop();if(w.push(A),i)for(var P=0;P<u[A].length;P++){var B=u[A][P],R=o.getElementById(A),M=void 0;R.edgesTo(B).length>0?M=R.edgesTo(B)[0]:M=B.edgesTo(R)[0];var I=n(M);B=B.id(),E[B]>E[A]+I&&(E[B]=E[A]+I,T.nodes.indexOf(B)<0?T.push(B):T.updateItem(B),C[B]=0,x[B]=[]),E[B]==E[A]+I&&(C[B]=C[B]+C[A],x[B].push(A))}else for(var L=0;L<u[A].length;L++){var O=u[A][L].id();E[O]==1/0&&(T.push(O),E[O]=E[A]+1),E[O]==E[A]+1&&(C[O]=C[O]+C[A],x[O].push(A))}}for(var G={},_=0;_<s.length;_++)G[s[_].id()]=0;for(;w.length>0;){for(var N=w.pop(),F=0;F<x[N].length;F++){var Z=x[N][F];G[Z]=G[Z]+C[Z]/C[N]*(1+G[N])}N!=s[g].id()&&f.set(N,f.get(N)+G[N])}},g=0;g<s.length;g++)y();var p={betweenness:function(b){var w=o.collection(b).id();return f.get(w)},betweennessNormalized:function(b){if(v==0)return 0;var w=o.collection(b).id();return f.get(w)/v}};return p.betweennessNormalised=p.betweennessNormalized,p}};_o.bc=_o.betweennessCentrality;var sd=dr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),ud=function(e){return sd(e)},ld=function(e,t){for(var a=0,n=0;n<t.length;n++)a+=t[n](e);return a},vd=function(e,t,a){for(var n=0;n<t;n++)e[n*t+n]=a},qv=function(e,t){for(var a,n=0;n<t;n++){a=0;for(var i=0;i<t;i++)a+=e[i*t+n];for(var o=0;o<t;o++)e[o*t+n]=e[o*t+n]/a}},fd=function(e,t,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+s]*t[s*a+u]}return n},cd=function(e,t,a){for(var n=e.slice(0),i=1;i<a;i++)e=fd(e,n,t);return e},hd=function(e,t,a){for(var n=new Array(t*t),i=0;i<t*t;i++)n[i]=Math.pow(e[i],a);return qv(n,t),n},dd=function(e,t,a,n){for(var i=0;i<a;i++){var o=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(t[i]*Math.pow(10,n))/Math.pow(10,n);if(o!==s)return!1}return!0},gd=function(e,t,a,n){for(var i=[],o=0;o<t;o++){for(var s=[],u=0;u<t;u++)Math.round(e[o*t+u]*1e3)/1e3>0&&s.push(a[u]);s.length!==0&&i.push(n.collection(s))}return i},pd=function(e,t){for(var a=0;a<e.length;a++)if(!t[a]||e[a].id()!==t[a].id())return!1;return!0},yd=function(e){for(var t=0;t<e.length;t++)for(var a=0;a<e.length;a++)t!=a&&pd(e[t],e[a])&&e.splice(a,1);return e},ou=function(e){for(var t=this.nodes(),a=this.edges(),n=this.cy(),i=ud(e),o={},s=0;s<t.length;s++)o[t[s].id()]=s;for(var u=t.length,l=u*u,v=new Array(l),f,c=0;c<l;c++)v[c]=0;for(var d=0;d<a.length;d++){var h=a[d],y=o[h.source().id()],g=o[h.target().id()],p=ld(h,i.attributes);v[y*u+g]+=p,v[g*u+y]+=p}vd(v,u,i.multFactor),qv(v,u);for(var m=!0,b=0;m&&b<i.maxIterations;)m=!1,f=cd(v,u,i.expandFactor),v=hd(f,u,i.inflateFactor),dd(v,f,l,4)||(m=!0),b++;var w=gd(v,u,t,n);return w=yd(w),w},md={markovClustering:ou,mcl:ou},bd=function(e){return e},_v=function(e,t){return Math.abs(t-e)},su=function(e,t,a){return e+_v(t,a)},uu=function(e,t,a){return e+Math.pow(a-t,2)},wd=function(e){return Math.sqrt(e)},xd=function(e,t,a){return Math.max(e,_v(t,a))},pa=function(e,t,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:bd,s=n,u,l,v=0;v<e;v++)u=t(v),l=a(v),s=i(s,u,l);return o(s)},aa={euclidean:function(e,t,a){return e>=2?pa(e,t,a,0,uu,wd):pa(e,t,a,0,su)},squaredEuclidean:function(e,t,a){return pa(e,t,a,0,uu)},manhattan:function(e,t,a){return pa(e,t,a,0,su)},max:function(e,t,a){return pa(e,t,a,-1/0,xd)}};aa["squared-euclidean"]=aa.squaredEuclidean;aa.squaredeuclidean=aa.squaredEuclidean;function Kn(r,e,t,a,n,i){var o;return Ye(r)?o=r:o=aa[r]||aa.euclidean,e===0&&Ye(r)?o(n,i):o(e,t,a,n,i)}var Ed=dr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ds=function(e){return Ed(e)},Ln=function(e,t,a,n,i){var o=i!=="kMedoids",s=o?function(f){return a[f]}:function(f){return n[f](a)},u=function(c){return n[c](t)},l=a,v=t;return Kn(e,n.length,s,u,l,v)},Di=function(e,t,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(t),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,o[l]=e.max(a[l]).value;for(var v=0;v<t;v++){u=[];for(var f=0;f<n;f++)u[f]=Math.random()*(o[f]-i[f])+i[f];s[v]=u}return s},Gv=function(e,t,a,n,i){for(var o=1/0,s=0,u=0;u<t.length;u++){var l=Ln(a,e,t[u],n,i);l<o&&(o=l,s=u)}return s},Hv=function(e,t,a){for(var n=[],i=null,o=0;o<t.length;o++)i=t[o],a[i.id()]===e&&n.push(i);return n},Cd=function(e,t,a){return Math.abs(t-e)<=a},Td=function(e,t,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var o=Math.abs(e[n][i]-t[n][i]);if(o>a)return!1}return!0},Sd=function(e,t,a){for(var n=0;n<a;n++)if(e===t[n])return!0;return!1},lu=function(e,t){var a=new Array(t);if(e.length<50)for(var n=0;n<t;n++){for(var i=e[Math.floor(Math.random()*e.length)];Sd(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<t;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},vu=function(e,t,a){for(var n=0,i=0;i<t.length;i++)n+=Ln("manhattan",t[i],e,a,"kMedoids");return n},kd=function(e){var t=this.cy(),a=this.nodes(),n=null,i=ds(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=Di(a,i.k,i.attributes)):ar(i.testCentroids)==="object"?u=i.testCentroids:u=Di(a,i.k,i.attributes):u=Di(a,i.k,i.attributes);for(var l=!0,v=0;l&&v<i.maxIterations;){for(var f=0;f<a.length;f++)n=a[f],s[n.id()]=Gv(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var c=0;c<i.k;c++){var d=Hv(c,a,s);if(d.length!==0){for(var h=i.attributes.length,y=u[c],g=new Array(h),p=new Array(h),m=0;m<h;m++){p[m]=0;for(var b=0;b<d.length;b++)n=d[b],p[m]+=i.attributes[m](n);g[m]=p[m]/d.length,Cd(g[m],y[m],i.sensitivityThreshold)||(l=!0)}u[c]=g,o[c]=t.collection(d)}}v++}return o},Dd=function(e){var t=this.cy(),a=this.nodes(),n=null,i=ds(e);i.k>a.length&&Ue("kMedoids: k (".concat(i.k,") cannot exceed the number of nodes (").concat(a.length,")."));var o=new Array(i.k),s,u={},l,v=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ar(i.testCentroids)==="object"?s=i.testCentroids:s=lu(a,i.k)):s=lu(a,i.k);for(var f=!0,c=0;f&&c<i.maxIterations;){for(var d=0;d<a.length;d++)n=a[d],u[n.id()]=Gv(n,s,i.distance,i.attributes,"kMedoids");f=!1;for(var h=0;h<s.length;h++){var y=Hv(h,a,u);if(y.length!==0){v[h]=vu(s[h],y,i.attributes);for(var g=0;g<y.length;g++)l=vu(y[g],y,i.attributes),l<v[h]&&(v[h]=l,s[h]=y[g],f=!0);o[h]=t.collection(y)}}c++}return o},Bd=function(e,t,a,n,i){for(var o,s,u=0;u<t.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],i.m);for(var v=0;v<e.length;v++)for(var f=0;f<i.attributes.length;f++){o=0,s=0;for(var c=0;c<t.length;c++)o+=n[c][v]*i.attributes[f](t[c]),s+=n[c][v];e[v][f]=o/s}},Pd=function(e,t,a,n,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var s,u,l,v=2/(i.m-1),f=0;f<a.length;f++)for(var c=0;c<n.length;c++){s=0;for(var d=0;d<a.length;d++)u=Ln(i.distance,n[c],a[f],i.attributes,"cmeans"),l=Ln(i.distance,n[c],a[d],i.attributes,"cmeans"),s+=Math.pow(u/l,v);e[c][f]=1/s}},Ad=function(e,t,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<t.length;l++){s=-1/0,u=-1;for(var v=0;v<t[0].length;v++)t[l][v]>s&&(s=t[l][v],u=v);i[u].push(e[l])}for(var f=0;f<i.length;f++)i[f]=n.collection(i[f]);return i},fu=function(e){var t=this.cy(),a=this.nodes(),n=ds(e),i,o,s,u,l;u=new Array(a.length);for(var v=0;v<a.length;v++)u[v]=new Array(n.k);s=new Array(a.length);for(var f=0;f<a.length;f++)s[f]=new Array(n.k);for(var c=0;c<a.length;c++){for(var d=0,h=0;h<n.k;h++)s[c][h]=Math.random(),d+=s[c][h];for(var y=0;y<n.k;y++)s[c][y]=s[c][y]/d}o=new Array(n.k);for(var g=0;g<n.k;g++)o[g]=new Array(n.attributes.length);l=new Array(a.length);for(var p=0;p<a.length;p++)l[p]=new Array(n.k);for(var m=!0,b=0;m&&b<n.maxIterations;)m=!1,Bd(o,a,s,l,n),Pd(s,u,o,a,n),Td(s,u,n.sensitivityThreshold)||(m=!0),b++;return i=Ad(a,s,n,t),{clusters:i,degreeOfMembership:s}},Rd={kMeans:kd,kMedoids:Dd,fuzzyCMeans:fu,fcm:fu},Md=dr({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Ld={single:"min",complete:"max"},Id=function(e){var t=Md(e),a=Ld[t.linkage];return a!=null&&(t.linkage=a),t},cu=function(e,t,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,v=function(k,D){return Kn(i.distance,l.length,function(A){return l[A](k)},function(A){return l[A](D)},k,D)},f=0;f<e.length;f++){var c=e[f].key,d=a[c][n[c]];d<s&&(o=c,s=d)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var h=t[o],y=t[n[o]],g;i.mode==="dendrogram"?g={left:h,right:y,key:h.key,size:h.size+y.size}:g={value:h.value.concat(y.value),key:h.key,size:h.size+y.size},e[h.index]=g,e.splice(y.index,1),t[h.key]=g;for(var p=0;p<e.length;p++){var m=e[p];h.key===m.key?u=1/0:i.linkage==="min"?(u=a[h.key][m.key],a[h.key][m.key]>a[y.key][m.key]&&(u=a[y.key][m.key])):i.linkage==="max"?(u=a[h.key][m.key],a[h.key][m.key]<a[y.key][m.key]&&(u=a[y.key][m.key])):i.linkage==="mean"?u=(a[h.key][m.key]*h.size+a[y.key][m.key]*y.size)/(h.size+y.size):i.mode==="dendrogram"?u=v(m.value,h.value):u=v(m.value[0],h.value[0]),a[h.key][m.key]=a[m.key][h.key]=u}for(var b=0;b<e.length;b++){var w=e[b].key;if(n[w]===h.key||n[w]===y.key){for(var x=w,C=0;C<e.length;C++){var E=e[C].key;a[w][E]<a[w][x]&&(x=E)}n[w]=x}e[b].index=b}return h.key=y.key=h.index=y.index=null,!0},Zt=function(e,t,a){e&&(e.value?t.push(e.value):(e.left&&Zt(e.left,t),e.right&&Zt(e.right,t)))},Go=function(e,t){if(!e)return"";if(e.left&&e.right){var a=Go(e.left,t),n=Go(e.right,t),i=t.add({group:"nodes",data:{id:a+","+n}});return t.add({group:"edges",data:{source:a,target:i.id()}}),t.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Ho=function(e,t,a){if(!e)return[];var n=[],i=[],o=[];return t===0?(e.left&&Zt(e.left,n),e.right&&Zt(e.right,i),o=n.concat(i),[a.collection(o)]):t===1?e.value?[a.collection(e.value)]:(e.left&&Zt(e.left,n),e.right&&Zt(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=Ho(e.left,t-1,a)),e.right&&(i=Ho(e.right,t-1,a)),n.concat(i))},hu=function(e){var t=this.cy(),a=this.nodes();if(a.length===0)return[];for(var n=Id(e),i=n.attributes,o=function(b,w){return Kn(n.distance,i.length,function(x){return i[x](b)},function(x){return i[x](w)},b,w)},s=[],u=[],l=[],v=[],f=0;f<a.length;f++){var c={value:n.mode==="dendrogram"?a[f]:[a[f]],key:f,index:f,size:1};s[f]=c,v[f]=c,u[f]=[],l[f]=0}for(var d=0;d<s.length;d++)for(var h=0;h<=d;h++){var y=void 0;n.mode==="dendrogram"?y=d===h?1/0:o(s[d].value,s[h].value):y=d===h?1/0:o(s[d].value[0],s[h].value[0]),u[d][h]=y,u[h][d]=y,y<u[d][l[d]]&&(l[d]=h)}for(var g=cu(s,v,u,l,n);g;)g=cu(s,v,u,l,n);var p;return n.mode==="dendrogram"?(p=Ho(s[0],n.dendrogramDepth,t),n.addDendrogram&&Go(s[0],t)):(p=new Array(s.length),s.forEach(function(m,b){m.key=m.index=null,p[b]=t.collection(m.value)})),p},Od={hierarchicalClustering:hu,hca:hu},Nd=dr({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),zd=function(e){var t=e.damping,a=e.preference;.5<=t&&t<1||Ue("Damping must range on [0.5, 1). Got: ".concat(t));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||te(a)||Ue("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),Nd(e)},Fd=function(e,t,a,n){var i=function(s,u){return n[u](s)};return-Kn(e,n.length,function(o){return i(t,o)},function(o){return i(a,o)},t,a)},Vd=function(e,t){var a=null;return t==="median"?a=Fh(e):t==="mean"?a=zh(e):t==="min"?a=Oh(e):t==="max"?a=Nh(e):a=t,a},qd=function(e,t,a){for(var n=[],i=0;i<e;i++)t[i*e+i]+a[i*e+i]>0&&n.push(i);return n},du=function(e,t,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<a.length;u++){var l=a[u];t[i*e+l]>s&&(o=l,s=t[i*e+l])}o>0&&n.push(o)}for(var v=0;v<a.length;v++)n[a[v]]=a[v];return n},_d=function(e,t,a){for(var n=du(e,t,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var u=-1,l=-1/0,v=0;v<o.length;v++){for(var f=0,c=0;c<o.length;c++)f+=t[o[c]*e+o[v]];f>l&&(u=v,l=f)}a[i]=o[u]}return n=du(e,t,a),n},gu=function(e){for(var t=this.cy(),a=this.nodes(),n=zd(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,u,l,v,f,c;s=a.length,u=s*s,l=new Array(u);for(var d=0;d<u;d++)l[d]=-1/0;for(var h=0;h<s;h++)for(var y=0;y<s;y++)h!==y&&(l[h*s+y]=Fd(n.distance,a[h],a[y],n.attributes));v=Vd(l,n.preference);for(var g=0;g<s;g++)l[g*s+g]=v;f=new Array(u);for(var p=0;p<u;p++)f[p]=0;c=new Array(u);for(var m=0;m<u;m++)c[m]=0;for(var b=new Array(s),w=new Array(s),x=new Array(s),C=0;C<s;C++)b[C]=0,w[C]=0,x[C]=0;for(var E=new Array(s*n.minIterations),T=0;T<E.length;T++)E[T]=0;var k;for(k=0;k<n.maxIterations;k++){for(var D=0;D<s;D++){for(var A=-1/0,P=-1/0,B=-1,R=0,M=0;M<s;M++)b[M]=f[D*s+M],R=c[D*s+M]+l[D*s+M],R>=A?(P=A,A=R,B=M):R>P&&(P=R);for(var I=0;I<s;I++)f[D*s+I]=(1-n.damping)*(l[D*s+I]-A)+n.damping*b[I];f[D*s+B]=(1-n.damping)*(l[D*s+B]-P)+n.damping*b[B]}for(var L=0;L<s;L++){for(var O=0,G=0;G<s;G++)b[G]=c[G*s+L],w[G]=Math.max(0,f[G*s+L]),O+=w[G];O-=w[L],w[L]=f[L*s+L],O+=w[L];for(var _=0;_<s;_++)c[_*s+L]=(1-n.damping)*Math.min(0,O-w[_])+n.damping*b[_];c[L*s+L]=(1-n.damping)*(O-w[L])+n.damping*b[L]}for(var N=0,F=0;F<s;F++){var Z=c[F*s+F]+f[F*s+F]>0?1:0;E[k%n.minIterations*s+F]=Z,N+=Z}if(N>0&&(k>=n.minIterations-1||k==n.maxIterations-1)){for(var J=0,U=0;U<s;U++){x[U]=0;for(var j=0;j<n.minIterations;j++)x[U]+=E[j*s+U];(x[U]===0||x[U]===n.minIterations)&&J++}if(J===s)break}}for(var re=qd(s,f,c),ne=_d(s,l,re),W={},z=0;z<re.length;z++)W[re[z]]=[];for(var q=0;q<a.length;q++){var X=i[a[q].id()],Y=ne[X];Y!=null&&W[Y].push(a[q])}for(var ae=new Array(re.length),ve=0;ve<re.length;ve++)ae[ve]=t.collection(W[re[ve]]);return ae},Gd={affinityPropagation:gu,ap:gu},Hd=dr({root:void 0,directed:!1}),Wd={hierholzer:function(e){if(!Ie(e)){var t=arguments;e={root:t[0],directed:t[1]}}var a=Hd(e),n=a.root,i=a.directed,o=this,s=!1,u,l,v;n&&(v=ce(n)?this.filter(n)[0].id():n[0].id());var f={},c={},d=o.edges().filter(function(b){return o.has(b.source())&&o.has(b.target())});i?o.forEach(function(b){var w=b.id();if(b.isNode()){var x=b.incomers().edges().intersection(d),C=b.outgoers().edges().intersection(d),E=x.length,T=C.length,k=E-T,D=T-E;k==1?u?s=!0:u=w:D==1?l?s=!0:l=w:(D>1||k>1)&&(s=!0),f[w]=[],C.forEach(function(A){return f[w].push(A.id())})}else c[w]=[void 0,b.target().id()]}):o.forEach(function(b){var w=b.id();if(b.isNode()){var x=b.connectedEdges().intersection(d),C=x.length+x.filter(function(E){return E.isLoop()}).length;C%2&&(u?l?s=!0:l=w:u=w),f[w]=[],x.forEach(function(E){return f[w].push(E.id())})}else c[w]=[b.source().id(),b.target().id()]});var h={found:!1,trail:void 0};if(s)return h;if(l&&u)if(i){if(v&&l!=v)return h;v=l}else{if(v&&l!=v&&u!=v)return h;v||(v=l)}else v||(v=o[0].id());var y=function(w){for(var x=w,C=[w],E,T,k;f[x].length;)E=f[x].shift(),T=c[E][0],k=c[E][1],x!=k?(f[k]=f[k].filter(function(D){return D!=E}),x=k):!i&&x!=T&&(f[T]=f[T].filter(function(D){return D!=E}),x=T),C.unshift(E),C.unshift(x);return C},g=[],p=[];for(p=y(v);p.length!=1;)f[p[0]].length==0?(g.unshift(o.getElementById(p.shift())),g.unshift(o.getElementById(p.shift()))):p=y(p.shift()).concat(p);g.unshift(o.getElementById(p.shift()));for(var m in f)if(f[m].length)return h;return h.found=!0,h.trail=this.spawn(g,!0),h}},an=function(){var e=this,t={},a=0,n=0,i=[],o=[],s={},u=function(c,d){for(var h=o.length-1,y=[],g=e.spawn();o[h].x!=c||o[h].y!=d;)y.push(o.pop().edge),h--;y.push(o.pop().edge),y.forEach(function(p){var m=p.connectedNodes().intersection(e);g.merge(p),m.forEach(function(b){var w=b.id(),x=b.connectedEdges().intersection(e);g.merge(b),t[w].cutVertex?g.merge(x.filter(function(C){return C.isLoop()})):g.merge(x)})}),i.push(g)},l=function(c,d,h){c===h&&(n+=1),t[d]={id:a,low:a++,cutVertex:!1};var y=e.getElementById(d).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(d)));else{var g,p,m,b;y.forEach(function(w){g=w.source().id(),p=w.target().id(),m=g===d?p:g,m!==h&&(b=w.id(),s[b]||(s[b]=!0,o.push({x:d,y:m,edge:w})),m in t?t[d].low=Math.min(t[d].low,t[m].id):(l(c,m,d),t[d].low=Math.min(t[d].low,t[m].low),t[d].id<=t[m].low&&(t[d].cutVertex=!0,u(d,m))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,l(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},$d={hopcroftTarjanBiconnected:an,htbc:an,htb:an,hopcroftTarjanBiconnectedComponents:an},nn=function(){var e=this,t={},a=0,n=[],i=[],o=e.spawn(e),s=function(l){i.push(l),t[l]={index:a,low:a++,explored:!1};var v=e.getElementById(l).connectedEdges().intersection(e);if(v.forEach(function(y){var g=y.target().id();g!==l&&(g in t||s(g),t[g].explored||(t[l].low=Math.min(t[l].low,t[g].low)))}),t[l].index===t[l].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[l].index,t[c].explored=!0,c===l)break}var d=f.edgesWith(f),h=f.merge(d);n.push(h),o=o.difference(h)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||s(l)}}),{cut:o,components:n}},Kd={tarjanStronglyConnected:nn,tsc:nn,tscc:nn,tarjanStronglyConnectedComponents:nn},Wv={};[Ra,Ch,Th,kh,Bh,Ah,Lh,id,jt,ea,_o,md,Rd,Od,Gd,Wd,$d,Kd].forEach(function(r){ge(Wv,r)});var $v=0,Kv=1,Uv=2,qr=function(e){if(!(this instanceof qr))return new qr(e);this.id="Thenable/1.0.7",this.state=$v,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))};qr.prototype={fulfill:function(e){return pu(this,Kv,"fulfillValue",e)},reject:function(e){return pu(this,Uv,"rejectReason",e)},then:function(e,t){var a=this,n=new qr;return a.onFulfilled.push(mu(e,n,"fulfill")),a.onRejected.push(mu(t,n,"reject")),Xv(a),n.proxy}};var pu=function(e,t,a,n){return e.state===$v&&(e.state=t,e[a]=n,Xv(e)),e},Xv=function(e){e.state===Kv?yu(e,"onFulfilled",e.fulfillValue):e.state===Uv&&yu(e,"onRejected",e.rejectReason)},yu=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var s=0;s<n.length;s++)n[s](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},mu=function(e,t,a){return function(n){if(typeof e!="function")t[a].call(t,n);else{var i;try{i=e(n)}catch(o){t.reject(o);return}Yv(t,i)}}},Yv=function(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(ar(t)==="object"&&t!==null||typeof t=="function")try{a=t.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(t,function(i){n||(n=!0,i===t?e.reject(new TypeError("circular thenable chain")):Yv(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(t)};qr.all=function(r){return new qr(function(e,t){for(var a=new Array(r.length),n=0,i=function(u,l){a[u]=l,n++,n===r.length&&e(a)},o=0;o<r.length;o++)(function(s){var u=r[s],l=u!=null&&u.then!=null;if(l)u.then(function(f){i(s,f)},function(f){t(f)});else{var v=u;i(s,v)}})(o)})};qr.resolve=function(r){return new qr(function(e,t){e(r)})};qr.reject=function(r){return new qr(function(e,t){t(r)})};var ua=typeof Promise<"u"?Promise:qr,Wo=function(e,t,a){var n=is(e),i=!n,o=this._private=ge({duration:1e3},t,a);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Ye(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(n){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Ot=Wo.prototype;ge(Ot,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,a=e.target._private.animation;e.queue?t=a.queue:t=a.current,t.push(this),Pr(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 t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,a=t.playing;return e===void 0?t.progress:(a&&this.pause(),t.progress=e,t.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(l,v){var f=e[l];f!=null&&(e[l]=e[v],e[v]=f)};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],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[n]=s}return t&&this.play(),this},promise:function(e){var t=this._private,a;switch(e){case"frame":a=t.frames;break;default:case"complete":case"completed":a=t.completes}return new ua(function(n,i){a.push(function(){n()})})}});Ot.complete=Ot.completed;Ot.run=Ot.play;Ot.running=Ot.playing;var Ud={animated:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=n[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<n.length;o++){var s=n[o];s._private.animation.queue=[]}return this}},delay:function(){return function(t,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:t,duration:t,complete:a}):this}},delayAnimation:function(){return function(t,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:t,duration:t,complete:a}):this}},animation:function(){return function(t,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var v=s.style();t=ge({},t,a);var f=Object.keys(t).length===0;if(f)return new Wo(o[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(l&&(t.style=v.getPropsList(t.style||t.css),t.css=void 0),l&&t.renderedPosition!=null){var c=t.renderedPosition,d=s.pan(),h=s.zoom();t.position=Bv(c,h,d)}if(u&&t.panBy!=null){var y=t.panBy,g=s.pan();t.pan={x:g.x+y.x,y:g.y+y.y}}var p=t.center||t.centre;if(u&&p!=null){var m=s.getCenterPan(p.eles,t.zoom);m!=null&&(t.pan=m)}if(u&&t.fit!=null){var b=t.fit,w=s.getFitViewport(b.eles||b.boundingBox,b.padding);w!=null&&(t.pan=w.pan,t.zoom=w.zoom)}if(u&&Ie(t.zoom)){var x=s.getZoomedViewport(t.zoom);x!=null?(x.zoomed&&(t.zoom=x.zoom),x.panned&&(t.pan=x.pan)):t.zoom=null}return new Wo(o[0],t)}},animate:function(){return function(t,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;a&&(t=ge({},t,a));for(var u=0;u<o.length;u++){var l=o[u],v=l.animated()&&(t.queue===void 0||t.queue),f=l.animation(t,v?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(t,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var l=o[u],v=l._private,f=v.animation.current,c=0;c<f.length;c++){var d=f[c],h=d._private;a&&(h.duration=0)}t&&(v.animation.queue=[]),a||(v.animation.current=[])}return s.notify("draw"),this}}},Bi,bu;function Un(){if(bu)return Bi;bu=1;var r=Array.isArray;return Bi=r,Bi}var Pi,wu;function Xd(){if(wu)return Pi;wu=1;var r=Un(),e=Ha(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:a.test(i)||!t.test(i)||o!=null&&i in Object(o)}return Pi=n,Pi}var Ai,xu;function Yd(){if(xu)return Ai;xu=1;var r=bv(),e=Ga(),t="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=r(s);return u==a||u==n||u==t||u==i}return Ai=o,Ai}var Ri,Eu;function Zd(){if(Eu)return Ri;Eu=1;var r=Hn(),e=r["__core-js_shared__"];return Ri=e,Ri}var Mi,Cu;function Qd(){if(Cu)return Mi;Cu=1;var r=Zd(),e=(function(){var a=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function t(a){return!!e&&e in a}return Mi=t,Mi}var Li,Tu;function Jd(){if(Tu)return Li;Tu=1;var r=Function.prototype,e=r.toString;function t(a){if(a!=null){try{return e.call(a)}catch{}try{return a+""}catch{}}return""}return Li=t,Li}var Ii,Su;function jd(){if(Su)return Ii;Su=1;var r=Yd(),e=Qd(),t=Ga(),a=Jd(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,v=RegExp("^"+u.call(l).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(c){if(!t(c)||e(c))return!1;var d=r(c)?v:i;return d.test(a(c))}return Ii=f,Ii}var Oi,ku;function eg(){if(ku)return Oi;ku=1;function r(e,t){return e?.[t]}return Oi=r,Oi}var Ni,Du;function gs(){if(Du)return Ni;Du=1;var r=jd(),e=eg();function t(a,n){var i=e(a,n);return r(i)?i:void 0}return Ni=t,Ni}var zi,Bu;function Xn(){if(Bu)return zi;Bu=1;var r=gs(),e=r(Object,"create");return zi=e,zi}var Fi,Pu;function rg(){if(Pu)return Fi;Pu=1;var r=Xn();function e(){this.__data__=r?r(null):{},this.size=0}return Fi=e,Fi}var Vi,Au;function tg(){if(Au)return Vi;Au=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Vi=r,Vi}var qi,Ru;function ag(){if(Ru)return qi;Ru=1;var r=Xn(),e="__lodash_hash_undefined__",t=Object.prototype,a=t.hasOwnProperty;function n(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return a.call(o,i)?o[i]:void 0}return qi=n,qi}var _i,Mu;function ng(){if(Mu)return _i;Mu=1;var r=Xn(),e=Object.prototype,t=e.hasOwnProperty;function a(n){var i=this.__data__;return r?i[n]!==void 0:t.call(i,n)}return _i=a,_i}var Gi,Lu;function ig(){if(Lu)return Gi;Lu=1;var r=Xn(),e="__lodash_hash_undefined__";function t(a,n){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=r&&n===void 0?e:n,this}return Gi=t,Gi}var Hi,Iu;function og(){if(Iu)return Hi;Iu=1;var r=rg(),e=tg(),t=ag(),a=ng(),n=ig();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=a,i.prototype.set=n,Hi=i,Hi}var Wi,Ou;function sg(){if(Ou)return Wi;Ou=1;function r(){this.__data__=[],this.size=0}return Wi=r,Wi}var $i,Nu;function Zv(){if(Nu)return $i;Nu=1;function r(e,t){return e===t||e!==e&&t!==t}return $i=r,$i}var Ki,zu;function Yn(){if(zu)return Ki;zu=1;var r=Zv();function e(t,a){for(var n=t.length;n--;)if(r(t[n][0],a))return n;return-1}return Ki=e,Ki}var Ui,Fu;function ug(){if(Fu)return Ui;Fu=1;var r=Yn(),e=Array.prototype,t=e.splice;function a(n){var i=this.__data__,o=r(i,n);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return Ui=a,Ui}var Xi,Vu;function lg(){if(Vu)return Xi;Vu=1;var r=Yn();function e(t){var a=this.__data__,n=r(a,t);return n<0?void 0:a[n][1]}return Xi=e,Xi}var Yi,qu;function vg(){if(qu)return Yi;qu=1;var r=Yn();function e(t){return r(this.__data__,t)>-1}return Yi=e,Yi}var Zi,_u;function fg(){if(_u)return Zi;_u=1;var r=Yn();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return Zi=e,Zi}var Qi,Gu;function cg(){if(Gu)return Qi;Gu=1;var r=sg(),e=ug(),t=lg(),a=vg(),n=fg();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=a,i.prototype.set=n,Qi=i,Qi}var Ji,Hu;function hg(){if(Hu)return Ji;Hu=1;var r=gs(),e=Hn(),t=r(e,"Map");return Ji=t,Ji}var ji,Wu;function dg(){if(Wu)return ji;Wu=1;var r=og(),e=cg(),t=hg();function a(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return ji=a,ji}var eo,$u;function gg(){if($u)return eo;$u=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return eo=r,eo}var ro,Ku;function Zn(){if(Ku)return ro;Ku=1;var r=gg();function e(t,a){var n=t.__data__;return r(a)?n[typeof a=="string"?"string":"hash"]:n.map}return ro=e,ro}var to,Uu;function pg(){if(Uu)return to;Uu=1;var r=Zn();function e(t){var a=r(this,t).delete(t);return this.size-=a?1:0,a}return to=e,to}var ao,Xu;function yg(){if(Xu)return ao;Xu=1;var r=Zn();function e(t){return r(this,t).get(t)}return ao=e,ao}var no,Yu;function mg(){if(Yu)return no;Yu=1;var r=Zn();function e(t){return r(this,t).has(t)}return no=e,no}var io,Zu;function bg(){if(Zu)return io;Zu=1;var r=Zn();function e(t,a){var n=r(this,t),i=n.size;return n.set(t,a),this.size+=n.size==i?0:1,this}return io=e,io}var oo,Qu;function wg(){if(Qu)return oo;Qu=1;var r=dg(),e=pg(),t=yg(),a=mg(),n=bg();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=a,i.prototype.set=n,oo=i,oo}var so,Ju;function xg(){if(Ju)return so;Ju=1;var r=wg(),e="Expected a function";function t(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw new TypeError(e);var i=function(){var o=arguments,s=n?n.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=a.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(t.Cache||r),i}return t.Cache=r,so=t,so}var uo,ju;function Eg(){if(ju)return uo;ju=1;var r=xg(),e=500;function t(a){var n=r(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return uo=t,uo}var lo,el;function Qv(){if(el)return lo;el=1;var r=Eg(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,a=r(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(e,function(o,s,u,l){i.push(u?l.replace(t,"$1"):s||o)}),i});return lo=a,lo}var vo,rl;function Jv(){if(rl)return vo;rl=1;function r(e,t){for(var a=-1,n=e==null?0:e.length,i=Array(n);++a<n;)i[a]=t(e[a],a,e);return i}return vo=r,vo}var fo,tl;function Cg(){if(tl)return fo;tl=1;var r=ss(),e=Jv(),t=Un(),a=Ha(),n=r?r.prototype:void 0,i=n?n.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(a(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return fo=o,fo}var co,al;function jv(){if(al)return co;al=1;var r=Cg();function e(t){return t==null?"":r(t)}return co=e,co}var ho,nl;function ef(){if(nl)return ho;nl=1;var r=Un(),e=Xd(),t=Qv(),a=jv();function n(i,o){return r(i)?i:e(i,o)?[i]:t(a(i))}return ho=n,ho}var go,il;function ps(){if(il)return go;il=1;var r=Ha();function e(t){if(typeof t=="string"||r(t))return t;var a=t+"";return a=="0"&&1/t==-1/0?"-0":a}return go=e,go}var po,ol;function Tg(){if(ol)return po;ol=1;var r=ef(),e=ps();function t(a,n){n=r(n,a);for(var i=0,o=n.length;a!=null&&i<o;)a=a[e(n[i++])];return i&&i==o?a:void 0}return po=t,po}var yo,sl;function Sg(){if(sl)return yo;sl=1;var r=Tg();function e(t,a,n){var i=t==null?void 0:r(t,a);return i===void 0?n:i}return yo=e,yo}var kg=Sg(),Dg=_a(kg),mo,ul;function Bg(){if(ul)return mo;ul=1;var r=gs(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return mo=e,mo}var bo,ll;function Pg(){if(ll)return bo;ll=1;var r=Bg();function e(t,a,n){a=="__proto__"&&r?r(t,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[a]=n}return bo=e,bo}var wo,vl;function Ag(){if(vl)return wo;vl=1;var r=Pg(),e=Zv(),t=Object.prototype,a=t.hasOwnProperty;function n(i,o,s){var u=i[o];(!(a.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&r(i,o,s)}return wo=n,wo}var xo,fl;function Rg(){if(fl)return xo;fl=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(a,n){var i=typeof a;return n=n??r,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&a>-1&&a%1==0&&a<n}return xo=t,xo}var Eo,cl;function Mg(){if(cl)return Eo;cl=1;var r=Ag(),e=ef(),t=Rg(),a=Ga(),n=ps();function i(o,s,u,l){if(!a(o))return o;s=e(s,o);for(var v=-1,f=s.length,c=f-1,d=o;d!=null&&++v<f;){var h=n(s[v]),y=u;if(h==="__proto__"||h==="constructor"||h==="prototype")return o;if(v!=c){var g=d[h];y=l?l(g,h,d):void 0,y===void 0&&(y=a(g)?g:t(s[v+1])?[]:{})}r(d,h,y),d=d[h]}return o}return Eo=i,Eo}var Co,hl;function Lg(){if(hl)return Co;hl=1;var r=Mg();function e(t,a,n){return t==null?t:r(t,a,n)}return Co=e,Co}var Ig=Lg(),Og=_a(Ig),To,dl;function Ng(){if(dl)return To;dl=1;function r(e,t){var a=-1,n=e.length;for(t||(t=Array(n));++a<n;)t[a]=e[a];return t}return To=r,To}var So,gl;function zg(){if(gl)return So;gl=1;var r=Jv(),e=Ng(),t=Un(),a=Ha(),n=Qv(),i=ps(),o=jv();function s(u){return t(u)?r(u,i):a(u)?[u]:e(n(o(u)))}return So=s,So}var Fg=zg(),Vg=_a(Fg),qg={data:function(e){var t={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=ge({},t,e),function(n,i){var o=e,s=this,u=s.length!==void 0,l=u?s:[s],v=u?s[0]:s;if(ce(n)){var f=n.indexOf(".")!==-1,c=f&&Vg(n);if(o.allowGetting&&i===void 0){var d;return v&&(o.beforeGet(v),c&&v._private[o.field][n]===void 0?d=Dg(v._private[o.field],c):d=v._private[o.field][n]),d}else if(o.allowSetting&&i!==void 0){var h=!o.immutableKeys[n];if(h){var y=lv({},n,i);o.beforeSet(s,y);for(var g=0,p=l.length;g<p;g++){var m=l[g];o.canSet(m)&&(c&&v._private[o.field][n]===void 0?Og(m._private[o.field],c,i):m._private[o.field][n]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Ie(n)){var b=n,w,x,C=Object.keys(b);o.beforeSet(s,b);for(var E=0;E<C.length;E++){w=C[E],x=b[w];var T=!o.immutableKeys[w];if(T)for(var k=0;k<l.length;k++){var D=l[k];o.canSet(D)&&(D._private[o.field][w]=x)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Ye(n)){var A=n;s.on(o.bindingEvent,A)}else if(o.allowGetting&&n===void 0){var P;return v&&(o.beforeGet(v),P=v._private[o.field]),P}return s}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=ge({},t,e),function(n){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(ce(n)){for(var l=n.split(/\s+/),v=l.length,f=0;f<v;f++){var c=l[f];if(!ft(c)){var d=!i.immutableKeys[c];if(d)for(var h=0,y=u.length;h<y;h++)u[h]._private[i.field][c]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(n===void 0){for(var g=0,p=u.length;g<p;g++)for(var m=u[g]._private[i.field],b=Object.keys(m),w=0;w<b.length;w++){var x=b[w],C=!i.immutableKeys[x];C&&(m[x]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},_g={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(a,n){var i=this,o=Array.prototype.slice.call(arguments,0);return new ua(function(s,u){var l=function(d){i.off.apply(i,f),s(d)},v=o.concat([l]),f=v.concat([]);i.on.apply(i,v)})}}},ze={};[Ud,qg,_g].forEach(function(r){ge(ze,r)});var Gg={animate:ze.animate(),animation:ze.animation(),animated:ze.animated(),clearQueue:ze.clearQueue(),delay:ze.delay(),delayAnimation:ze.delayAnimation(),stop:ze.stop()},pn={classes:function(e){var t=this;if(e===void 0){var a=[];return t[0]._private.classes.forEach(function(h){return a.push(h)}),a}else Ge(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new ht(e),o=0;o<t.length;o++){for(var s=t[o],u=s._private,l=u.classes,v=!1,f=0;f<e.length;f++){var c=e[f],d=l.has(c);if(!d){v=!0;break}}v||(v=l.size!==e.length),v&&(u.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Ge(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],o=0,s=a.length;o<s;o++)for(var u=a[o],l=u._private.classes,v=!1,f=0;f<e.length;f++){var c=e[f],d=l.has(c),h=!1;t||n&&!d?(l.add(c),h=!0):(!t||n&&d)&&(l.delete(c),h=!0),!v&&h&&(i.push(u),v=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};pn.className=pn.classNames=pn.classes;var Le={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:tr,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Le.variable="(?:[\\w-.]|(?:\\\\"+Le.metaChar+"))+";Le.className="(?:[\\w-]|(?:\\\\"+Le.metaChar+"))+";Le.value=Le.string+"|"+Le.number;Le.id=Le.variable;(function(){var r,e,t;for(r=Le.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],Le.comparatorOp+="|@"+e;for(r=Le.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(Le.comparatorOp+="|\\!"+e)})();var Ve=function(){return{checks:[]}},oe={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},$o=[{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(r,e){return _c(r.selector,e.selector)}),Hg=(function(){for(var r={},e,t=0;t<$o.length;t++)e=$o[t],r[e.selector]=e.matches;return r})(),Wg=function(e,t){return Hg[e](t)},$g="("+$o.map(function(r){return r.selector}).join("|")+")",qt=function(e){return e.replace(new RegExp("\\\\("+Le.metaChar+")","g"),function(t,a){return a})},nt=function(e,t,a){e[e.length-1]=a},Ko=[{name:"group",query:!0,regex:"("+Le.group+")",populate:function(e,t,a){var n=er(a,1),i=n[0];t.checks.push({type:oe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:$g,populate:function(e,t,a){var n=er(a,1),i=n[0];t.checks.push({type:oe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Le.id+")",populate:function(e,t,a){var n=er(a,1),i=n[0];t.checks.push({type:oe.ID,value:qt(i)})}},{name:"className",query:!0,regex:"\\.("+Le.className+")",populate:function(e,t,a){var n=er(a,1),i=n[0];t.checks.push({type:oe.CLASS,value:qt(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Le.variable+")\\s*\\]",populate:function(e,t,a){var n=er(a,1),i=n[0];t.checks.push({type:oe.DATA_EXIST,field:qt(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Le.variable+")\\s*("+Le.comparatorOp+")\\s*("+Le.value+")\\s*\\]",populate:function(e,t,a){var n=er(a,3),i=n[0],o=n[1],s=n[2],u=new RegExp("^"+Le.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),t.checks.push({type:oe.DATA_COMPARE,field:qt(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Le.boolOp+")\\s*("+Le.variable+")\\s*\\]",populate:function(e,t,a){var n=er(a,2),i=n[0],o=n[1];t.checks.push({type:oe.DATA_BOOL,field:qt(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Le.meta+")\\s*("+Le.comparatorOp+")\\s*("+Le.number+")\\s*\\]\\]",populate:function(e,t,a){var n=er(a,3),i=n[0],o=n[1],s=n[2];t.checks.push({type:oe.META_COMPARE,field:qt(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:Le.separator,populate:function(e,t){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,o=e[e.length-1];a!=null&&(o.subject=a,e.currentSubject=null),o.edgeCount=n,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Ve();return s}},{name:"directedEdge",separator:!0,regex:Le.directedEdge,populate:function(e,t){if(e.currentSubject==null){var a=Ve(),n=t,i=Ve();return a.checks.push({type:oe.DIRECTED_EDGE,source:n,target:i}),nt(e,t,a),e.edgeCount++,i}else{var o=Ve(),s=t,u=Ve();return o.checks.push({type:oe.NODE_SOURCE,source:s,target:u}),nt(e,t,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Le.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var a=Ve(),n=t,i=Ve();return a.checks.push({type:oe.UNDIRECTED_EDGE,nodes:[n,i]}),nt(e,t,a),e.edgeCount++,i}else{var o=Ve(),s=t,u=Ve();return o.checks.push({type:oe.NODE_NEIGHBOR,node:s,neighbor:u}),nt(e,t,o),u}}},{name:"child",separator:!0,regex:Le.child,populate:function(e,t){if(e.currentSubject==null){var a=Ve(),n=Ve(),i=e[e.length-1];return a.checks.push({type:oe.CHILD,parent:i,child:n}),nt(e,t,a),e.compoundCount++,n}else if(e.currentSubject===t){var o=Ve(),s=e[e.length-1],u=Ve(),l=Ve(),v=Ve(),f=Ve();return o.checks.push({type:oe.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:oe.TRUE}],f.checks.push({type:oe.TRUE}),u.checks.push({type:oe.PARENT,parent:f,child:v}),nt(e,s,o),e.currentSubject=l,e.compoundCount++,v}else{var c=Ve(),d=Ve(),h=[{type:oe.PARENT,parent:c,child:d}];return c.checks=t.checks,t.checks=h,e.compoundCount++,d}}},{name:"descendant",separator:!0,regex:Le.descendant,populate:function(e,t){if(e.currentSubject==null){var a=Ve(),n=Ve(),i=e[e.length-1];return a.checks.push({type:oe.DESCENDANT,ancestor:i,descendant:n}),nt(e,t,a),e.compoundCount++,n}else if(e.currentSubject===t){var o=Ve(),s=e[e.length-1],u=Ve(),l=Ve(),v=Ve(),f=Ve();return o.checks.push({type:oe.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:oe.TRUE}],f.checks.push({type:oe.TRUE}),u.checks.push({type:oe.ANCESTOR,ancestor:f,descendant:v}),nt(e,s,o),e.currentSubject=l,e.compoundCount++,v}else{var c=Ve(),d=Ve(),h=[{type:oe.ANCESTOR,ancestor:c,descendant:d}];return c.checks=t.checks,t.checks=h,e.compoundCount++,d}}},{name:"subject",modifier:!0,regex:Le.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Fe("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;i===oe.DIRECTED_EDGE?n.type=oe.NODE_TARGET:i===oe.UNDIRECTED_EDGE&&(n.type=oe.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Ko.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var Kg=function(e){for(var t,a,n,i=0;i<Ko.length;i++){var o=Ko[i],s=o.name,u=e.match(o.regexObj);if(u!=null){a=u,t=o,n=s;var l=u[0];e=e.substring(l.length);break}}return{expr:t,match:a,name:n,remaining:e}},Ug=function(e){var t=e.match(/^\s+/);if(t){var a=t[0];e=e.substring(a.length)}return e},Xg=function(e){var t=this,a=t.inputText=e,n=t[0]=Ve();for(t.length=1,a=Ug(a);;){var i=Kg(a);if(i.expr==null)return Fe("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(t,n,o);if(s===!1)return!1;if(s!=null&&(n=s),a=i.remaining,a.match(/^\s*$/))break}var u=t[t.length-1];t.currentSubject!=null&&(u.subject=t.currentSubject),u.edgeCount=t.edgeCount,u.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var v=t[l];if(v.compoundCount>0&&v.edgeCount>0)return Fe("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return Fe("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.edgeCount===1&&Fe("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},Yg=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v??""},t=function(v){return ce(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var c=v.type,d=v.value;switch(c){case oe.GROUP:{var h=e(d);return h.substring(0,h.length-1)}case oe.DATA_COMPARE:{var y=v.field,g=v.operator;return"["+y+a(e(g))+t(d)+"]"}case oe.DATA_BOOL:{var p=v.operator,m=v.field;return"["+e(p)+m+"]"}case oe.DATA_EXIST:{var b=v.field;return"["+b+"]"}case oe.META_COMPARE:{var w=v.operator,x=v.field;return"[["+x+a(e(w))+t(d)+"]]"}case oe.STATE:return d;case oe.ID:return"#"+d;case oe.CLASS:return"."+d;case oe.PARENT:case oe.CHILD:return i(v.parent,f)+a(">")+i(v.child,f);case oe.ANCESTOR:case oe.DESCENDANT:return i(v.ancestor,f)+" "+i(v.descendant,f);case oe.COMPOUND_SPLIT:{var C=i(v.left,f),E=i(v.subject,f),T=i(v.right,f);return C+(C.length>0?" ":"")+E+T}case oe.TRUE:return""}},i=function(v,f){return v.checks.reduce(function(c,d,h){return c+(f===v&&h===0?"$":"")+n(d,f)},"")},o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},Zg={parse:Xg,toString:Yg},rf=function(e,t,a){var n,i=ce(e),o=te(e),s=ce(a),u,l,v=!1,f=!1,c=!1;t.indexOf("!")>=0&&(t=t.replace("!",""),f=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),v=!0);var d=t==="*="||t==="^="||t==="$=";switch((i||s||v||d)&&(u=!i&&!o?"":""+e,l=""+a),v&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),t){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===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 f&&(e!=null||!c)&&(n=!n),n},Qg=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Jg=function(e){return e!==void 0},ys=function(e,t){return e.data(t)},jg=function(e,t){return e[t]()},Ze=[],Xe=function(e,t){return e.checks.every(function(a){return Ze[a.type](a,t)})};Ze[oe.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};Ze[oe.STATE]=function(r,e){var t=r.value;return Wg(t,e)};Ze[oe.ID]=function(r,e){var t=r.value;return e.id()===t};Ze[oe.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};Ze[oe.META_COMPARE]=function(r,e){var t=r.field,a=r.operator,n=r.value;return rf(jg(e,t),a,n)};Ze[oe.DATA_COMPARE]=function(r,e){var t=r.field,a=r.operator,n=r.value;return rf(ys(e,t),a,n)};Ze[oe.DATA_BOOL]=function(r,e){var t=r.field,a=r.operator;return Qg(ys(e,t),a)};Ze[oe.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,Jg(ys(e,t))};Ze[oe.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],a=r.nodes[1],n=e.source(),i=e.target();return Xe(t,n)&&Xe(a,i)||Xe(a,n)&&Xe(t,i)};Ze[oe.NODE_NEIGHBOR]=function(r,e){return Xe(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Xe(r.neighbor,t)})};Ze[oe.DIRECTED_EDGE]=function(r,e){return Xe(r.source,e.source())&&Xe(r.target,e.target())};Ze[oe.NODE_SOURCE]=function(r,e){return Xe(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Xe(r.target,t)})};Ze[oe.NODE_TARGET]=function(r,e){return Xe(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Xe(r.source,t)})};Ze[oe.CHILD]=function(r,e){return Xe(r.child,e)&&Xe(r.parent,e.parent())};Ze[oe.PARENT]=function(r,e){return Xe(r.parent,e)&&e.children().some(function(t){return Xe(r.child,t)})};Ze[oe.DESCENDANT]=function(r,e){return Xe(r.descendant,e)&&e.ancestors().some(function(t){return Xe(r.ancestor,t)})};Ze[oe.ANCESTOR]=function(r,e){return Xe(r.ancestor,e)&&e.descendants().some(function(t){return Xe(r.descendant,t)})};Ze[oe.COMPOUND_SPLIT]=function(r,e){return Xe(r.subject,e)&&Xe(r.left,e)&&Xe(r.right,e)};Ze[oe.TRUE]=function(){return!0};Ze[oe.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};Ze[oe.FILTER]=function(r,e){var t=r.value;return t(e)};var ep=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===oe.ID)return e.getElementById(t[0].checks[0].value).collection();var a=function(i){for(var o=0;o<t.length;o++){var s=t[o];if(Xe(s,i))return!0}return!1};return t.text()==null&&(a=function(){return!0}),e.filter(a)},rp=function(e){for(var t=this,a=0;a<t.length;a++){var n=t[a];if(Xe(n,e))return!0}return!1},tp={matches:rp,filter:ep},gt=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||ce(e)&&e.match(/^\s*$/)||(Pr(e)?this.addQuery({checks:[{type:oe.COLLECTION,value:e.collection()}]}):Ye(e)?this.addQuery({checks:[{type:oe.FILTER,value:e}]}):ce(e)?this.parse(e)||(this.invalid=!0):Ue("A selector must be created from a string; found "))},pt=gt.prototype;[Zg,tp].forEach(function(r){return ge(pt,r)});pt.text=function(){return this.inputText};pt.size=function(){return this.length};pt.eq=function(r){return this[r]};pt.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};pt.addQuery=function(r){this[this.length++]=r};pt.selector=pt.toString;var lt={allAre:function(e){var t=new gt(e);return this.every(function(a){return t.matches(a)})},is:function(e){var t=new gt(e);return this.some(function(a){return t.matches(a)})},some:function(e,t){for(var a=0;a<this.length;a++){var n=t?e.apply(t,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,t){for(var a=0;a<this.length;a++){var n=t?e.apply(t,[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 t=this.length,a=e.length;return t!==a?!1:t===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(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(a){return t.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(a){return t.hasElementWithId(a.id())})}};lt.allAreNeighbours=lt.allAreNeighbors;lt.has=lt.contains;lt.equal=lt.equals=lt.same;var Ir=function(e,t){return function(n,i,o,s){var u=n,l=this,v;if(u==null?v="":Pr(u)&&u.length===1&&(v=u.id()),l.length===1&&v){var f=l[0]._private,c=f.traversalCache=f.traversalCache||{},d=c[t]=c[t]||[],h=Lt(v),y=d[h];return y||(d[h]=e.call(l,n,i,o,s))}else return e.call(l,n,i,o,s)}},na={parent:function(e){var t=[];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],o=i._private.parent;o&&t.push(o)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];t.push(i)}a=a.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,a=0;a<this.length;a++){var n=this[a],i=n.parents();t=t||i,t=t.intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:Ir(function(r){for(var e=[],t=0;t<this.length;t++)for(var a=this[t],n=a._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(r)},"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 t=[];function a(n){for(var i=0;i<n.length;i++){var o=n[i];t.push(o),o.children().nonempty()&&a(o.children())}}return a(this.children()),this.spawn(t,!0).filter(e)}};function ms(r,e,t,a){for(var n=[],i=new ht,o=r.cy(),s=o.hasCompoundNodes(),u=0;u<r.length;u++){var l=r[u];t?n.push(l):s&&a(n,i,l)}for(;n.length>0;){var v=n.shift();e(v),i.add(v.id()),s&&a(n,i,v)}return r}function tf(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||r.push(i)}}na.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ms(this,r,e,tf)};function af(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}na.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ms(this,r,e,af)};function ap(r,e,t){af(r,e,t),tf(r,e,t)}na.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ms(this,r,e,ap)};na.ancestors=na.parents;var Ia,nf;Ia=nf={data:ze.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:ze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ze.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ze.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Ia.attr=Ia.data;Ia.removeAttr=Ia.removeData;var np=nf,Qn={};function ko(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(a+=r(n,s))}return a}else return}}ge(Qn,{degree:ko(function(r,e){return e.source().same(e.target())?2:1}),indegree:ko(function(r,e){return e.target().same(r)?1:0}),outdegree:ko(function(r,e){return e.source().same(r)?1:0})});function _t(r,e){return function(t){for(var a,n=this.nodes(),i=0;i<n.length;i++){var o=n[i],s=o[r](t);s!==void 0&&(a===void 0||e(s,a))&&(a=s)}return a}}ge(Qn,{minDegree:_t("degree",function(r,e){return r<e}),maxDegree:_t("degree",function(r,e){return r>e}),minIndegree:_t("indegree",function(r,e){return r<e}),maxIndegree:_t("indegree",function(r,e){return r>e}),minOutdegree:_t("outdegree",function(r,e){return r<e}),maxOutdegree:_t("outdegree",function(r,e){return r>e})});ge(Qn,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n<a.length;n++)t+=a[n].degree(e);return t}});var Vr,of,sf=function(e,t,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var o=i._private.position,s={x:t.x!=null?t.x-o.x:0,y:t.y!=null?t.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,a),i.dirtyBoundingBoxCache(),i.isNode()&&i.connectedEdges().dirtyBoundingBoxCache()}}},pl={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,t){sf(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Vr=of={position:ze.data(pl),silentPosition:ze.data(ge({},pl,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){sf(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Ie(e))t?this.silentPosition(e):this.position(e);else if(Ye(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=a(o,i))&&(t?o.silentPosition(s):o.position(s))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,a){var n;if(Ie(e)?(n={x:te(e.x)?e.x:0,y:te(e.y)?e.y:0},a=t):ce(e)&&te(t)&&(n={x:0,y:0},n[e]=t),n!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+n.x,y:u.y+n.y};a?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return Ie(e)?this.shift(e,!0):ce(e)&&te(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var a=this[0],n=this.cy(),i=n.zoom(),o=n.pan(),s=Ie(e)?e:void 0,u=s!==void 0||t!==void 0&&ce(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var v=this[l];t!==void 0?v.position(e,(t-o[e])/i):s!==void 0&&v.position(Bv(s,i,o))}else{var f=a.position();return s=$n(f,i,o),e===void 0?s:s[e]}else if(!u)return;return this},relativePosition:function(e,t){var a=this[0],n=this.cy(),i=Ie(e)?e:void 0,o=i!==void 0||t!==void 0&&ce(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],v=s?l.parent():null,f=v&&v.length>0,c=f;f&&(v=v[0]);var d=c?v.position():{x:0,y:0};t!==void 0?l.position(e,t+d[e]):i!==void 0&&l.position({x:i.x+d.x,y:i.y+d.y})}else{var h=a.position(),y=s?a.parent():null,g=y&&y.length>0,p=g;g&&(y=y[0]);var m=p?y.position():{x:0,y:0};return i={x:h.x-m.x,y:h.y-m.y},e===void 0?i:i[e]}else if(!o)return;return this}};Vr.modelPosition=Vr.point=Vr.position;Vr.modelPositions=Vr.points=Vr.positions;Vr.renderedPoint=Vr.renderedPosition;Vr.relativePoint=Vr.relativePosition;var ip=of,ia=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},oa=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},op=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},ra,wt;ra=wt={};wt.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,o=e.x2*a+n.x,s=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};var sp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"main";if(!e||!e.cy().styleEnabled())return null;var a=t==="main"?void 0:t,n=e._private,i=n.labelPolygonCache,o=bl(e),s=i==null||i[t]==null||n.styleDirty||n.labelPolygonPosKey!==o;if(!s)return i[t];e.recalculateRenderedStyle(),o=bl(e),(n.labelPolygonCache==null||n.labelPolygonPosKey!==o)&&(n.labelPolygonCache={},n.labelPolygonPosKey=o);var u=up(e,a);return n.labelPolygonCache[t]=u,u};wt.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};wt.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",v={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),c=s.position;(f.w===0||f.h===0)&&(f={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},f.x1=c.x-f.w/2,f.x2=c.x+f.w/2,f.y1=c.y-f.h/2,f.y2=c.y+f.h/2);function d(k,D,A){var P=0,B=0,R=D+A;return k>0&&R>0&&(P=D/R*k,B=A/R*k),{biasDiff:P,biasComplementDiff:B}}function h(k,D,A,P){if(A.units==="%")switch(P){case"width":return k>0?A.pfValue*k:0;case"height":return D>0?A.pfValue*D:0;case"average":return k>0&&D>0?A.pfValue*(k+D)/2:0;case"min":return k>0&&D>0?k>D?A.pfValue*D:A.pfValue*k:0;case"max":return k>0&&D>0?k>D?A.pfValue*k:A.pfValue*D:0;default:return 0}else return A.units==="px"?A.pfValue:0}var y=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(y=y*100/v.width.val);var g=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(g=g*100/v.width.val);var p=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(p=p*100/v.height.val);var m=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(m=m*100/v.height.val);var b=d(v.width.val-f.w,y,g),w=b.biasDiff,x=b.biasComplementDiff,C=d(v.height.val-f.h,p,m),E=C.biasDiff,T=C.biasComplementDiff;s.autoPadding=h(f.w,f.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(f.w,v.width.val),c.x=(-w+f.x1+f.x2+x)/2,s.autoHeight=Math.max(f.h,v.height.val),c.y=(-E+f.y1+f.y2+T)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||r)&&(t(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var Mr=function(e){return e===1/0||e===-1/0?0:e},Fr=function(e,t,a,n,i){n-t===0||i-a===0||t==null||a==null||n==null||i==null||(e.x1=t<e.x1?t: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)},it=function(e,t){return t==null?e:Fr(e,t.x1,t.y1,t.x2,t.y2)},ot=function(e,t,a){return pr(e,t,a)},up=function(e,t){if(!e.cy().headless()){var a=e._private,n=t?t+"-":"",i=e.pstyle(n+"label").strValue;if(!i)return null;e.boundingBox({includeLabels:!0});var o=t||"main",s=a.labelBounds[o];if(!s)return null;var u=ot(a.rscratch,"labelX",t),l=ot(a.rscratch,"labelY",t),v=ot(a.rscratch,"labelAngle",t),f=e.pstyle(n+"text-margin-x").pfValue,c=e.pstyle(n+"text-margin-y").pfValue;return Vv(s,u,l,v,f,c,0)}},on=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,o=i.arrowWidths!=null&&i.arrowWidths[a]!=null?i.arrowWidths[a]:i.arrowWidth,s=o/2,u=t.pstyle(a+"-arrow-shape").value,l,v;if(u!=="none"){a==="source"?(l=i.srcX,v=i.srcY):a==="target"?(l=i.tgtX,v=i.tgtY):(l=i.midX,v=i.midY);var f=n.arrowBounds=n.arrowBounds||{},c=f[a]=f[a]||{};c.x1=l-s,c.y1=v-s,c.x2=l+s,c.y2=v+s,c.w=c.x2-c.x1,c.h=c.y2-c.y1,dn(c,1),Fr(e,c.x1,c.y1,c.x2,c.y2)}}},Do=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,o=i.rstyle,s=t.pstyle(n+"label").strValue;if(s){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),v=ot(o,"labelWidth",a),f=ot(o,"labelHeight",a),c=ot(o,"labelX",a),d=ot(o,"labelY",a),h=t.pstyle(n+"text-margin-x").pfValue,y=t.pstyle(n+"text-margin-y").pfValue,g=t.isEdge(),p=t.pstyle(n+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,w=b/2,x=t.pstyle("text-background-padding").pfValue,C=2,E=f,T=v,k=T/2,D=E/2,A,P,B,R;if(g)A=c-k,P=c+k,B=d-D,R=d+D;else{switch(ia(u.value)){case"left":A=c-T,P=c;break;case"center":A=c-k,P=c+k;break;case"right":A=c,P=c+T;break}switch(oa(l.value)){case"top":B=d-E,R=d;break;case"center":B=d-D,R=d+D;break;case"bottom":B=d,R=d+E;break}}var M=h-Math.max(m,w)-x-C,I=h+Math.max(m,w)+x+C,L=y-Math.max(m,w)-x-C,O=y+Math.max(m,w)+x+C;A+=M,P+=I,B+=L,R+=O;var G=a||"main",_=i.labelBounds,N=_[G]=_[G]||{};N.x1=A,N.y1=B,N.x2=P,N.y2=R,N.w=P-A,N.h=R-B,N.leftPad=M,N.rightPad=I,N.topPad=L,N.botPad=O;var F=g&&p.strValue==="autorotate",Z=p.pfValue!=null&&p.pfValue!==0;if(F||Z){var J=F?ot(i.rstyle,"labelAngle",a):p.pfValue,U=Math.cos(J),j=Math.sin(J),re=(A+P)/2,ne=(B+R)/2;if(!g){switch(ia(u.value)){case"left":re=P;break;case"right":re=A;break}switch(oa(l.value)){case"top":ne=R;break;case"bottom":ne=B;break}}var W=function(Se,we){return Se=Se-re,we=we-ne,{x:Se*U-we*j+re,y:Se*j+we*U+ne}},z=W(A,B),q=W(A,R),X=W(P,B),Y=W(P,R);A=Math.min(z.x,q.x,X.x,Y.x),P=Math.max(z.x,q.x,X.x,Y.x),B=Math.min(z.y,q.y,X.y,Y.y),R=Math.max(z.y,q.y,X.y,Y.y)}var ae=G+"Rot",ve=_[ae]=_[ae]||{};ve.x1=A,ve.y1=B,ve.x2=P,ve.y2=R,ve.w=P-A,ve.h=R-B,Fr(e,A,B,P,R),Fr(i.labelBounds.all,A,B,P,R)}return e}},yl=function(e,t){if(!t.cy().headless()){var a=t.pstyle("outline-opacity").value,n=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,o=n+i;uf(e,t,a,o,"outside",o/2)}},uf=function(e,t,a,n,i,o){if(!(a===0||n<=0||i==="inside")){var s=t.cy(),u=s.renderer(),l=u.nodeShapes[u.getNodeShape(t)];if(l){var v=t.position(),f=v.x,c=v.y,d=t.width(),h=t.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var y=l.miterBounds(f,c,d,h,n);it(e,y)}else o!=null&&o>0&&gn(e,[o,o,o,o])}}},lp=function(e,t){if(!t.cy().headless()){var a=t.pstyle("border-opacity").value,n=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;uf(e,t,a,n,i)}},vp=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=yr(),s=e._private,u=e.isNode(),l=e.isEdge(),v,f,c,d,h,y,g=s.rstyle,p=u&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(Ne){return Ne.pstyle("display").value!=="none"},b=!n||m(e)&&(!l||m(e.source())&&m(e.target()));if(b){var w=0,x=0;n&&t.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(x=e.pstyle("overlay-padding").value));var C=0,E=0;n&&t.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(E=e.pstyle("underlay-padding").value));var T=Math.max(x,E),k=0,D=0;if(n&&(k=e.pstyle("width").pfValue,D=k/2),u&&t.includeNodes){var A=e.position();h=A.x,y=A.y;var P=e.outerWidth(),B=P/2,R=e.outerHeight(),M=R/2;v=h-B,f=h+B,c=y-M,d=y+M,Fr(o,v,c,f,d),n&&yl(o,e),n&&t.includeOutlines&&!i&&yl(o,e),n&&lp(o,e)}else if(l&&t.includeEdges)if(n&&!i){var I=e.pstyle("curve-style").strValue;if(v=Math.min(g.srcX,g.midX,g.tgtX),f=Math.max(g.srcX,g.midX,g.tgtX),c=Math.min(g.srcY,g.midY,g.tgtY),d=Math.max(g.srcY,g.midY,g.tgtY),v-=D,f+=D,c-=D,d+=D,Fr(o,v,c,f,d),I==="haystack"){var L=g.haystackPts;if(L&&L.length===2){if(v=L[0].x,c=L[0].y,f=L[1].x,d=L[1].y,v>f){var O=v;v=f,f=O}if(c>d){var G=c;c=d,d=G}Fr(o,v-D,c-D,f+D,d+D)}}else if(I==="bezier"||I==="unbundled-bezier"||st(I,"segments")||st(I,"taxi")){var _;switch(I){case"bezier":case"unbundled-bezier":_=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":_=g.linePts;break}if(_!=null)for(var N=0;N<_.length;N++){var F=_[N];v=F.x-D,f=F.x+D,c=F.y-D,d=F.y+D,Fr(o,v,c,f,d)}}}else{var Z=e.source(),J=Z.position(),U=e.target(),j=U.position();if(v=J.x,f=j.x,c=J.y,d=j.y,v>f){var re=v;v=f,f=re}if(c>d){var ne=c;c=d,d=ne}v-=D,f+=D,c-=D,d+=D,Fr(o,v,c,f,d)}if(n&&t.includeEdges&&l&&(on(o,e,"mid-source"),on(o,e,"mid-target"),on(o,e,"source"),on(o,e,"target")),n){var W=e.pstyle("ghost").value==="yes";if(W){var z=e.pstyle("ghost-offset-x").pfValue,q=e.pstyle("ghost-offset-y").pfValue;Fr(o,o.x1+z,o.y1+q,o.x2+z,o.y2+q)}}var X=s.bodyBounds=s.bodyBounds||{};tu(X,o),gn(X,p),dn(X,1),n&&(v=o.x1,f=o.x2,c=o.y1,d=o.y2,Fr(o,v-T,c-T,f+T,d+T));var Y=s.overlayBounds=s.overlayBounds||{};tu(Y,o),gn(Y,p),dn(Y,1);var ae=s.labelBounds=s.labelBounds||{};ae.all!=null?Hh(ae.all):ae.all=yr(),n&&t.includeLabels&&(t.includeMainLabels&&Do(o,e,null),l&&(t.includeSourceLabels&&Do(o,e,"source"),t.includeTargetLabels&&Do(o,e,"target")))}return o.x1=Mr(o.x1),o.y1=Mr(o.y1),o.x2=Mr(o.x2),o.y2=Mr(o.y2),o.w=Mr(o.x2-o.x1),o.h=Mr(o.y2-o.y1),o.w>0&&o.h>0&&b&&(gn(o,p),dn(o,1)),o},lf=function(e){var t=0,a=function(o){return(o?1:0)<<t++},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+=a(e.includeOutlines),n},vf=function(e){var t=function(s){return Math.round(s)};if(e.isEdge()){var a=e.source().position(),n=e.target().position();return Bn([t(a.x),t(a.y),t(n.x),t(n.y)])}else{var i=e.position();return Bn([t(i.x),t(i.y)])}},ml=function(e,t){var a=e._private,n,i=e.isEdge(),o=t==null?wl:lf(t),s=o===wl;if(a.bbCache==null?(n=vp(e,Oa),a.bbCache=n,a.bbCachePosKey=vf(e)):n=a.bbCache,!s){var u=e.isNode();n=yr(),(t.includeNodes&&u||t.includeEdges&&!u)&&(t.includeOverlays?it(n,a.overlayBounds):it(n,a.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?it(n,a.labelBounds.all):(t.includeMainLabels&&it(n,a.labelBounds.mainRot),t.includeSourceLabels&&it(n,a.labelBounds.sourceRot),t.includeTargetLabels&&it(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bl=function(e){var t=e.pstyle("text-rotation").pfValue||0;if(e.isEdge()){var a=e.source().position(),n=e.target().position();return Bn([Math.round(a.x),Math.round(a.y),Math.round(n.x),Math.round(n.y),Math.round(t*1e3)])}else{var i=e.position();return Bn([Math.round(i.x),Math.round(i.y),Math.round(t*1e3)])}},Oa={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},wl=lf(Oa),xl=dr(Oa);wt.boundingBox=function(r){var e,t=r===void 0||r.useCache===void 0||r.useCache===!0,a=ta(function(v){var f=v._private;return f.bbCache==null||f.styleDirty||f.bbCachePosKey!==vf(v)},function(v){return v.id()});if(t&&this.length===1&&!a(this[0]))r===void 0?r=Oa:r=xl(r),e=ml(this[0],r);else{e=yr(),r=r||Oa;var n=xl(r),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(a),this.nodes().forEach(a),s&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var u=0;u<i.length;u++){var l=i[u];a(l)&&l.dirtyBoundingBoxCache(),it(e,ml(l,n))}}return e.x1=Mr(e.x1),e.y1=Mr(e.y1),e.x2=Mr(e.x2),e.y2=Mr(e.y2),e.w=Mr(e.x2-e.x1),e.h=Mr(e.y2-e.y1),e};wt.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._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,e.labelPolygonCache={},e.labelPolygonPosKey=null}return this.emitAndNotify("bounds"),this};wt.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),a=t.hasCompoundNodes(),n=t.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),Ie(r)){var i=r;r=function(){return i}}var o=function(v,f){return v._private.bbAtOldPos=r(v,f)},s=function(v){return v._private.bbAtOldPos};t.startBatch(),e.forEach(o).silentPositions(r),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=Gh(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),t.endBatch(),u};ra.boundingbox=ra.bb=ra.boundingBox;ra.renderedBoundingbox=ra.renderedBoundingBox;var fp=wt,Ca,Ka;Ca=Ka={};var ff=function(e){e.uppercaseName=Is(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Is(e.outerName),Ca[e.name]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var s=a.pstyle(e.name);return s.strValue==="label"?(a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):s.pfValue}else return 1},Ca["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){var s=a[e.name](),u=a.pstyle("border-position").value,l;u==="center"?l=a.pstyle("border-width").pfValue:u==="outside"?l=2*a.pstyle("border-width").pfValue:l=0;var v=2*a.padding();return s+l+v}else return 1},Ca["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Ca["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};ff({name:"width"});ff({name:"height"});Ka.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue};Ka.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};Ka.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var cp=Ka,hp=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},dp=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return $n(t(e),a.zoom(),a.pan())}},gp=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy(),n=a.pan(),i=a.zoom();return t(e).map(function(o){return $n(o,i,n)})}},pp=function(e){return e.renderer().getControlPoints(e)},yp=function(e){return e.renderer().getSegmentPoints(e)},mp=function(e){return e.renderer().getSourceEndpoint(e)},bp=function(e){return e.renderer().getTargetEndpoint(e)},wp=function(e){return e.renderer().getEdgeMidpoint(e)},El={controlPoints:{get:pp,mult:!0},segmentPoints:{get:yp,mult:!0},sourceEndpoint:{get:mp},targetEndpoint:{get:bp},midpoint:{get:wp}},xp=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Ep=Object.keys(El).reduce(function(r,e){var t=El[e],a=xp(e);return r[e]=function(){return hp(this,t.get)},t.mult?r[a]=function(){return gp(this,t.get)}:r[a]=function(){return dp(this,t.get)},r},{}),Cp=ge({},ip,fp,cp,Ep);var cf=function(e,t){this.recycle(e,t)};function ya(){return!1}function sn(){return!0}cf.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=ya,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?sn:ya):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.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=sn;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=sn;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=sn,this.stopPropagation()},isDefaultPrevented:ya,isPropagationStopped:ya,isImmediatePropagationStopped:ya};var hf=/^([^.]+)(\.(?:[^.]+))?$/,Tp=".*",df={qualifierCompare:function(e,t){return e===t},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},Cl=Object.keys(df),Sp={};function Jn(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sp,e=arguments.length>1?arguments[1]:void 0,t=0;t<Cl.length;t++){var a=Cl[t];this[a]=r[a]||df[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var yt=Jn.prototype,gf=function(e,t,a,n,i,o,s){Ye(n)&&(i=n,n=null),s&&(o==null?o=s:o=ge({},o,s));for(var u=Ge(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var v=u[l];if(!ft(v)){var f=v.match(hf);if(f){var c=f[1],d=f[2]?f[2]:null,h=t(e,v,c,d,n,i,o);if(h===!1)break}}}},Tl=function(e,t){return e.addEventFields(e.context,t),new cf(t.type,t)},kp=function(e,t,a){if(Ac(a)){t(e,a);return}else if(Ie(a)){t(e,Tl(e,a));return}for(var n=Ge(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var o=n[i];if(!ft(o)){var s=o.match(hf);if(s){var u=s[1],l=s[2]?s[2]:null,v=Tl(e,{type:u,namespace:l,target:e.context});t(e,v)}}}};yt.on=yt.addListener=function(r,e,t,a,n){return gf(this,function(i,o,s,u,l,v,f){Ye(v)&&i.listeners.push({event:o,callback:v,type:s,namespace:u,qualifier:l,conf:f})},r,e,t,a,n),this};yt.one=function(r,e,t,a){return this.on(r,e,t,a,{one:!0})};yt.removeListener=yt.off=function(r,e,t,a){var n=this;this.emitting!==0&&(this.listeners=ch(this.listeners));for(var i=this.listeners,o=function(l){var v=i[l];gf(n,function(f,c,d,h,y,g){if((v.type===d||r==="*")&&(!h&&v.namespace!==".*"||v.namespace===h)&&(!y||f.qualifierCompare(v.qualifier,y))&&(!g||v.callback===g))return i.splice(l,1),!1},r,e,t,a)},s=i.length-1;s>=0;s--)o(s);return this};yt.removeAllListeners=function(){return this.removeListener("*")};yt.emit=yt.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,Ge(e)||(e=[e]),kp(this,function(i,o){t!=null&&(a=[{event:o.event,type:o.type,namespace:o.namespace,callback:t}],n=a.length);for(var s=function(){var v=a[u];if(v.type===o.type&&(!v.namespace||v.namespace===o.namespace||v.namespace===Tp)&&i.eventMatches(i.context,v,o)){var f=[o];e!=null&&dh(f,e),i.beforeEmit(i.context,v,o),v.conf&&v.conf.one&&(i.listeners=i.listeners.filter(function(h){return h!==v}));var c=i.callbackContext(i.context,v,o),d=v.callback.apply(c,f);i.afterEmit(i.context,v,o),d===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<n;u++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},r),this.emitting--,this};var Dp={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&qa(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},un=function(e){return ce(e)?new gt(e):e},pf={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],a=t._private;a.emitter||(a.emitter=new Jn(Dp,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,a){for(var n=un(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a)}return this},removeListener:function(e,t,a){for(var n=un(t),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,a){for(var n=un(t),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,n,a)}return this},once:function(e,t,a){for(var n=un(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,t){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};ze.eventAliasesOn(pf);var yf={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):t.push(n)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(ce(e)||Pr(e))return new gt(e).filter(this);if(Ye(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var o=n[i],s=t?e.apply(t,[o,i,n]):e(o,i,n);s&&a.push(o)}return a}return this.spawn()},not:function(e){if(e){ce(e)&&(e=this.filter(e));for(var t=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||t.push(n)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(ce(e)){var t=e;return this.filter(t)}for(var a=this.spawn(),n=this,i=e,o=this.length<e.length,s=o?n:i,u=o?i:n,l=0;l<s.length;l++){var v=s[l];u.has(v)&&a.push(v)}return a},xor:function(e){var t=this._private.cy;ce(e)&&(e=t.$(e));var a=this.spawn(),n=this,i=e,o=function(u,l){for(var v=0;v<u.length;v++){var f=u[v],c=f._private.data.id,d=l.hasElementWithId(c);d||a.push(f)}};return o(n,i),o(i,n),a},diff:function(e){var t=this._private.cy;ce(e)&&(e=t.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),o=this,s=e,u=function(v,f,c){for(var d=0;d<v.length;d++){var h=v[d],y=h._private.data.id,g=f.hasElementWithId(y);g?i.merge(h):c.push(h)}};return u(o,s,a),u(s,o,n),{left:a,right:n,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(ce(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&n.push(o)}return n},merge:function(e){var t=this._private,a=t.cy;if(!e)return this;if(e&&ce(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=t.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id,l=!i.has(u);if(l){var v=this.length++;this[v]=s,i.set(u,{ele:s,index:v})}}return this},unmergeAt:function(e){var t=this[e],a=t.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,u=this[s],l=u._private.data.id;this[s]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&ce(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;i<n.length;i++){var o=n[i],s=t?e.apply(t,[o,i,n]):e(o,i,n);a.push(s)}return a},reduce:function(e,t){for(var a=t,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,t){for(var a=-1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=t?e.apply(t,[s,o,i]):e(s,o,i);u>a&&(a=u,n=s)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=t?e.apply(t,[s,o,i]):e(s,o,i);u<a&&(a=u,n=s)}return{value:a,ele:n}},withinBox:function(e){var t=this.cy(),a=t.renderer();t.styleEnabled()&&this.recalculateRenderedStyle();var n=e.x2!=null?e.x2:e.x1+e.w,i=e.y2!=null?e.y2:e.y1+e.h,o=yr({x1:Math.min(e.x1,n),x2:Math.max(e.x1,n),y1:Math.min(e.y1,i),y2:Math.max(e.y1,i)}),s=a.getAllInBox(o.x1,o.y1,o.x2,o.y2),u=this;return this.spawn(s.filter(function(l){return u.has(l)}))},hit:function(e,t){var a=this.cy(),n=a.renderer();return a.styleEnabled()&&this.recalculateRenderedStyle(),this.spawn(n.hitTestAt(e.x,e.y,this,t))},polygonIntersection:function(e){var t=this,a=t.cy();a.styleEnabled()&&this.recalculateRenderedStyle();for(var n=[],i=0;i<t.length;i++){var o=t[i];if(o.boundingBox(),o.isEdge()){var s=o._private.rscratch,u=o._private.rstyle,l=u.bezierPts||u.linePts||u.haystackPts;if(u.bezierPts&&s.allpts&&s.allpts.length>=6){var v=(s.allpts.length-2)/4,f=u.bezierPts.length/v;l=[{x:s.allpts[0],y:s.allpts[1]}];for(var c=0;c<v;c++){for(var d=0;d<f;d++)l.push(u.bezierPts[c*f+d]);l.push({x:s.allpts[c*4+4],y:s.allpts[c*4+5]})}}if((!l||l.length<2)&&s.startX!=null&&s.startY!=null&&s.endX!=null&&s.endY!=null&&(l=[{x:s.startX,y:s.startY},{x:s.endX,y:s.endY}]),l&&l.length>1){for(var h=!1,y=0;y<l.length-1&&!h;y++)ad(l[y],l[y+1],e)&&(n.push(o),h=!0);if(h)continue}}else{var g=o._private.bodyBounds;if(g){var p=[{x:g.x1,y:g.y1},{x:g.x2,y:g.y1},{x:g.x2,y:g.y2},{x:g.x1,y:g.y2}];if(Sa(p,e)){n.push(o);continue}}}for(var m=o.isEdge()?["main","source","target"]:["main"],b=!1,w=0;w<m.length&&!b;w++){var x=sp(o,m[w]);x&&x.length&&Sa(x,e)&&(n.push(o),b=!0)}}return this.spawn(n)}},Oe=yf;Oe.u=Oe["|"]=Oe["+"]=Oe.union=Oe.or=Oe.add;Oe["\\"]=Oe["!"]=Oe["-"]=Oe.difference=Oe.relativeComplement=Oe.subtract=Oe.not;Oe.n=Oe["&"]=Oe["."]=Oe.and=Oe.intersection=Oe.intersect;Oe["^"]=Oe["(+)"]=Oe["(-)"]=Oe.symmetricDifference=Oe.symdiff=Oe.xor;Oe.fnFilter=Oe.filterFn=Oe.stdFilter=Oe.filter;Oe.complement=Oe.abscomp=Oe.absoluteComplement;var Bp={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}},mf=function(e,t){var a=e.cy(),n=a.hasCompoundNodes();function i(v){var f=v.pstyle("z-compound-depth");return f.value==="auto"?n?v.zDepth():0:f.value==="bottom"?-1:f.value==="top"?us:0}var o=i(e)-i(t);if(o!==0)return o;function s(v){var f=v.pstyle("z-index-compare");return f.value==="auto"&&v.isNode()?1:0}var u=s(e)-s(t);if(u!==0)return u;var l=e.pstyle("z-index").value-t.pstyle("z-index").value;return l!==0?l:e.poolIndex()-t.poolIndex()},In={forEach:function(e,t){if(Ye(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],o=t?e.apply(t,[i,n,this]):e(i,n,this);if(o===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var a=[],n=this.length;t==null&&(t=n),e==null&&(e=0),e<0&&(e=n+e),t<0&&(t=n+t);for(var i=e;i>=0&&i<t&&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(!Ye(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(mf)},zDepth:function(){var e=this[0];if(e){var t=e._private,a=t.group;if(a==="nodes"){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:us-1}else{var i=t.source,o=t.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};In.each=In.forEach;var Pp=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":ar(Symbol))!=e&&ar(Symbol.iterator)!=e;t&&(In[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,o=this.length;return lv({next:function(){return i<o?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};Pp();var Ap=dr({nodeDimensionsIncludeLabels:!1}),yn={layoutDimensions:function(e){e=Ap(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();t={w:a.w,h:a.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,a){var n=this.nodes().filter(function(x){return!x.isParent()}),i=this.cy(),o=t.eles,s=function(C){return C.id()},u=ta(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(C,E,T){var k={x:E.x1+E.w/2,y:E.y1+E.h/2},D={x:(T.x-k.x)*C,y:(T.y-k.y)*C};return{x:k.x+D.x,y:k.y+D.y}},v=t.spacingFactor&&t.spacingFactor!==1,f=function(){if(!v)return null;for(var C=yr(),E=0;E<n.length;E++){var T=n[E],k=u(T,E);Av(C,k.x,k.y)}return C},c=f(),d=ta(function(x,C){var E=u(x,C);if(v){var T=Math.abs(t.spacingFactor);E=l(T,c,E)}return t.transform!=null&&(E=t.transform(x,E)),E},s);if(t.animate){for(var h=0;h<n.length;h++){var y=n[h],g=d(y,h),p=t.animateFilter==null||t.animateFilter(y,h);if(p){var m=y.animation({position:g,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(m)}else y.position(g)}if(t.fit){var b=i.animation({fit:{boundingBox:o.boundingBoxAt(d),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(b)}else if(t.zoom!==void 0&&t.pan!==void 0){var w=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}e.animations.forEach(function(x){return x.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),ua.all(e.animations.map(function(x){return x.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(d),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(ge({},e,{eles:this}))}};yn.createLayout=yn.makeLayout=yn.layout;function bf(r,e,t){var a=t._private,n=a.styleCache=a.styleCache||[],i;return(i=n[r])!=null||(i=n[r]=e(t)),i}function jn(r,e){return r=Lt(r),function(a){return bf(r,e,a)}}function ei(r,e){r=Lt(r);var t=function(n){return e.call(n)};return function(){var n=this[0];if(n)return bf(r,t,n)}}var cr={recalculateRenderedStyle:function(e){var t=this.cy(),a=t.renderer(),n=t.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=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(t)}else this.forEach(function(n){t(n),n.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var a=t._private.batchStyleEles;return a.merge(this),this}var n=t.hasCompoundNodes(),i=this;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var a=this[t];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(t?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Ie(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(ce(e))if(t===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,t,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];n.removeBypasses(l,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 t=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!t)return i;var o=n.data.parent?a.parents():null;if(o)for(var s=0;s<o.length;s++){var u=o[s],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],a=t.cy().hasCompoundNodes();if(t)return a?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function Bo(r,e){var t=r._private,a=t.data.parent?r.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function bs(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,a=r.parentOk||r.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],o=n.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||Bo(i,a);var u=s.source,l=s.target;return t(u)&&(!o||Bo(u,t))&&(u===l||t(l)&&(!o||Bo(l,t)))}}}var la=jn("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});cr.takesUpSpace=ei("takesUpSpace",bs({ok:la}));var Rp=jn("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&la(r)}),Mp=jn("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&la(r)});cr.interactive=ei("interactive",bs({ok:Rp,parentOk:Mp,edgeOkViaNode:la}));cr.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var Lp=jn("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&la(r)}),Ip=la;cr.visible=ei("visible",bs({ok:Lp,edgeOkViaNode:Ip}));cr.hidden=function(){var r=this[0];if(r)return!r.visible()};cr.isBundledBezier=ei("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});cr.bypass=cr.css=cr.style;cr.renderedCss=cr.renderedStyle;cr.removeBypass=cr.removeCss=cr.removeStyle;cr.pstyle=cr.parsedStyle;var vt={};function Sl(r){return function(){var e=arguments,t=[];if(e.length===2){var a=e[0],n=e[1];this.on(r.event,a,n)}else if(e.length===1&&Ye(e[0])){var i=e[0];this.on(r.event,i)}else if(e.length===0||e.length===1&&Ge(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!r.ableField||u._private[r.ableField],v=u._private[r.field]!=r.value;if(r.overrideAble){var f=r.overrideAble(u);if(f!==void 0&&(l=f,!f))return this}l&&(u._private[r.field]=r.value,v&&t.push(u))}var c=this.spawn(t);c.updateStyle(),c.emit(r.event),o&&c.emit(o)}return this}}function va(r){vt[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},vt[r.on]=Sl({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),vt[r.off]=Sl({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}va({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});va({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});va({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});va({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});vt.deselect=vt.unselect;vt.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};va({field:"active",on:"activate",off:"unactivate"});va({field:"pannable",on:"panify",off:"unpanify"});vt.inactive=function(){var r=this[0];if(r)return!r._private.active};var mr={},kl=function(e){return function(a){for(var n=this,i=[],o=0;o<n.length;o++){var s=n[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),v=0;v<l.length;v++){var f=l[v],c=f.source(),d=f.target();if(e.noIncomingEdges&&d===s&&c!==s||e.noOutgoingEdges&&c===s&&d!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(a)}},Dl=function(e){return function(t){for(var a=this,n=[],i=0;i<a.length;i++){var o=a[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],v=l.source(),f=l.target();e.outgoing&&v===o?(n.push(l),n.push(f)):e.incoming&&f===o&&(n.push(l),n.push(v))}}return this.spawn(n,!0).filter(t)}},Bl=function(e){return function(t){for(var a=this,n=[],i={};;){var o=e.outgoing?a.outgoers():a.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],v=l.id();i[v]||(i[v]=!0,n.push(l),s=!0)}if(!s)break;a=o}return this.spawn(n,!0).filter(t)}};mr.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};ge(mr,{roots:kl({noIncomingEdges:!0}),leaves:kl({noOutgoingEdges:!0}),outgoers:Ir(Dl({outgoing:!0}),"outgoers"),successors:Bl({outgoing:!0}),incomers:Ir(Dl({incoming:!0}),"incomers"),predecessors:Bl({})});ge(mr,{neighborhood:Ir(function(r){for(var e=[],t=this.nodes(),a=0;a<t.length;a++)for(var n=t[a],i=n.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),v=n===u?l:u;v.length>0&&e.push(v[0]),e.push(s[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});mr.neighbourhood=mr.neighborhood;mr.closedNeighbourhood=mr.closedNeighborhood;mr.openNeighbourhood=mr.openNeighborhood;ge(mr,{source:Ir(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:Ir(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:Pl({attr:"source"}),targets:Pl({attr:"target"})});function Pl(r){return function(t){for(var a=[],n=0;n<this.length;n++){var i=this[n],o=i._private[r.attr];o&&a.push(o)}return this.spawn(a,!0).filter(t)}}ge(mr,{edgesWith:Ir(Al(),"edgesWith"),edgesTo:Ir(Al({thisIsSrc:!0}),"edgesTo")});function Al(r){return function(t){var a=[],n=this._private.cy,i=r||{};ce(t)&&(t=n.$(t));for(var o=0;o<t.length;o++)for(var s=t[o]._private.edges,u=0;u<s.length;u++){var l=s[u],v=l._private.data,f=this.hasElementWithId(v.source)&&t.hasElementWithId(v.target),c=t.hasElementWithId(v.source)&&this.hasElementWithId(v.target),d=f||c;d&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!c)||a.push(l))}return this.spawn(a,!0)}}ge(mr,{connectedEdges:Ir(function(r){for(var e=[],t=this,a=0;a<t.length;a++){var n=t[a];if(n.isNode())for(var i=n._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:Ir(function(r){for(var e=[],t=this,a=0;a<t.length;a++){var n=t[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:Ir(Rl(),"parallelEdges"),codirectedEdges:Ir(Rl({codirected:!0}),"codirectedEdges")});function Rl(r){var e={codirected:!1};return r=ge({},e,r),function(a){for(var n=[],i=this.edges(),o=r,s=0;s<i.length;s++)for(var u=i[s],l=u._private,v=l.source,f=v._private.data.id,c=l.data.target,d=v._private.edges,h=0;h<d.length;h++){var y=d[h],g=y._private.data,p=g.target,m=g.source,b=p===c&&m===f,w=f===p&&c===m;(o.codirected&&b||!o.codirected&&(b||w))&&n.push(y)}return this.spawn(n,!0).filter(a)}}ge(mr,{components:function(e){var t=this,a=t.cy(),n=a.collection(),i=e==null?t.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(v,f){n.merge(v),i.unmerge(v),f.merge(v)};if(i.empty())return t.spawn();var u=function(){var v=a.collection();o.push(v);var f=i[0];s(f,v),t.bfs({directed:!1,roots:f,visit:function(d){return s(d,v)}}),v.forEach(function(c){c.connectedEdges().forEach(function(d){t.has(d)&&v.has(d.source())&&v.has(d.target())&&v.merge(d)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});mr.componentsOf=mr.components;var hr=function(e,t){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){Ue("A collection must have a reference to the core");return}var i=new Qr,o=!1;if(!t)t=[];else if(t.length>0&&Ie(t[0])&&!qa(t[0])){o=!0;for(var s=[],u=new ht,l=0,v=t.length;l<v;l++){var f=t[l];f.data==null&&(f.data={});var c=f.data;if(c.id==null)c.id=kv();else if(e.hasElementWithId(c.id)||u.has(c.id))continue;var d=new Wn(e,f,!1);s.push(d),u.add(c.id)}t=s}this.length=0;for(var h=0,y=t.length;h<y;h++){var g=t[h][0];if(g!=null){var p=g._private.data.id;(!a||!i.has(p))&&(a&&i.set(p,{index:this.length,ele:g}),this[this.length]=g,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 Qr,w=this.eles,x=0;x<w.length;x++){var C=w[x];b.set(C.id(),{index:x,ele:C})}}},a&&(this._private.map=i),o&&!n&&this.restore()},$e=Wn.prototype=hr.prototype=Object.create(Array.prototype);$e.instanceString=function(){return"collection"};$e.spawn=function(r,e){return new hr(this.cy(),r,e)};$e.spawnSelf=function(){return this.spawn(this)};$e.cy=function(){return this._private.cy};$e.renderer=function(){return this._private.cy.renderer()};$e.element=function(){return this[0]};$e.collection=function(){return cv(this)?this:new hr(this._private.cy,[this])};$e.unique=function(){return new hr(this._private.cy,this,!0)};$e.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)};$e.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new hr(e)};$e.$id=$e.getElementById;$e.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index};$e.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index};$e.indexOfId=function(r){return r=""+r,this._private.map.get(r).index};$e.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var a=e._private;if(Ie(r)){if(t.startBatch(),r.data){e.data(r.data);var n=a.data;if(e.isEdge()){var i=!1,o={},s=r.data.source,u=r.data.target;s!=null&&s!=n.source&&(o.source=""+s,i=!0),u!=null&&u!=n.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in r.data,v=r.data.parent;l&&(v!=null||n.parent!=null)&&v!=n.parent&&(v===void 0&&(v=null),v!=null&&(v=""+v),e=e.move({parent:v}))}}r.position&&e.position(r.position);var f=function(y,g,p){var m=r[y];m!=null&&m!==a[y]&&(m?e[g]():e[p]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var c={data:$r(a.data),position:$r(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(h){return c.classes+=d++===0?h:" "+h}),c}}};$e.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],a=t.json();r.push(a)}return r};$e.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var a=this[t],n=a.json(),i=new Wn(r,n,!1);e.push(i)}return new hr(r,e)};$e.copy=$e.clone;$e.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],o=[],s,u=0,l=t.length;u<l;u++){var v=t[u];e&&!v.removed()||(v.isNode()?i.push(v):o.push(v))}s=i.concat(o);var f,c=function(){s.splice(f,1),f--};for(f=0;f<s.length;f++){var d=s[f],h=d._private,y=h.data;if(d.clearTraversalCache(),!(!e&&!h.removed)){if(y.id===void 0)y.id=kv();else if(te(y.id))y.id=""+y.id;else if(ft(y.id)||!ce(y.id)){Ue("Can not create element with invalid string ID `"+y.id+"`"),c();continue}else if(a.hasElementWithId(y.id)){Ue("Can not create second element with ID `"+y.id+"`"),c();continue}}var g=y.id;if(d.isNode()){var p=h.position;p.x==null&&(p.x=0),p.y==null&&(p.y=0)}if(d.isEdge()){for(var m=d,b=["source","target"],w=b.length,x=!1,C=0;C<w;C++){var E=b[C],T=y[E];te(T)&&(T=y[E]=""+y[E]),T==null||T===""?(Ue("Can not create edge `"+g+"` with unspecified "+E),x=!0):a.hasElementWithId(T)||(Ue("Can not create edge `"+g+"` with nonexistent "+E+" `"+T+"`"),x=!0)}if(x){c();continue}var k=a.getElementById(y.source),D=a.getElementById(y.target);k.same(D)?k._private.edges.push(m):(k._private.edges.push(m),D._private.edges.push(m)),m._private.source=k,m._private.target=D}h.map=new Qr,h.map.set(g,{ele:d,index:0}),h.removed=!1,e&&a.addToPool(d)}for(var A=0;A<i.length;A++){var P=i[A],B=P._private.data;te(B.parent)&&(B.parent=""+B.parent);var R=B.parent,M=R!=null;if(M||P._private.parent){var I=P._private.parent?a.collection().merge(P._private.parent):a.getElementById(R);if(I.empty())B.parent=void 0;else if(I[0].removed())Fe("Node added with missing parent, reference to parent removed"),B.parent=void 0,P._private.parent=null;else{for(var L=!1,O=I;!O.empty();){if(P.same(O)){L=!0,B.parent=void 0;break}O=O.parent()}L||(I[0]._private.children.push(P),P._private.parent=I[0],n.hasCompoundNodes=!0)}}}if(s.length>0){for(var G=s.length===t.length?t:new hr(a,s),_=0;_<G.length;_++){var N=G[_];N.isNode()||(N.parallelEdges().clearTraversalCache(),N.source().clearTraversalCache(),N.target().clearTraversalCache())}var F;n.hasCompoundNodes?F=a.collection().merge(G).merge(G.connectedNodes()).merge(G.parent()):F=G,F.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?G.emitAndNotify("add"):e&&G.emit("add")}return t};$e.removed=function(){var r=this[0];return r&&r._private.removed};$e.inside=function(){var r=this[0];return r&&!r._private.removed};$e.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n=new ht,i=t._private.cy;function o(R){for(var M=R._private.edges,I=0;I<M.length;I++)u(M[I])}function s(R){for(var M=R._private.children,I=0;I<M.length;I++)u(M[I])}function u(R){var M=n.has(R.id());e&&R.removed()||M||(n.add(R.id()),R.isNode()?(a.push(R),o(R),s(R)):a.unshift(R))}for(var l=0,v=t.length;l<v;l++){var f=t[l];u(f)}function c(R,M){var I=R._private.edges;ct(I,M),R.clearTraversalCache()}function d(R){R.clearTraversalCache()}var h=[];h.ids=new ht;function y(R,M){M=M[0],R=R[0];var I=R._private.children,L=R.id();ct(I,M),M._private.parent=null,h.ids.has(L)||(h.ids.add(L),h.push(R))}t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var g=0;g<a.length;g++){var p=a[g];if(p.isEdge()){var m=p.source()[0],b=p.target()[0];c(m,p),c(b,p);for(var w=p.parallelEdges(),x=0;x<w.length;x++){var C=w[x];d(C),C.isBundledBezier()&&C.dirtyBoundingBoxCache()}}else{var E=p.parent();E.length!==0&&y(E,p)}e&&(p._private.removed=!0)}var T=i._private.elements;i._private.hasCompoundNodes=!1;for(var k=0;k<T.length;k++){var D=T[k];if(D.isParent()){i._private.hasCompoundNodes=!0;break}}var A=new hr(this.cy(),a);A.size()>0&&(r?A.emitAndNotify("remove"):e&&A.emit("remove"));for(var P=0;P<h.length;P++){var B=h[P];(!e||!B.removed())&&B.updateStyle()}return A};$e.move=function(r){var e=this._private.cy,t=this,a=!1,n=!1,i=function(h){return h==null?h:""+h};if(r.source!==void 0||r.target!==void 0){var o=i(r.source),s=i(r.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(e.batch(function(){t.remove(a,n),t.emitAndNotify("moveout");for(var d=0;d<t.length;d++){var h=t[d],y=h._private.data;h.isEdge()&&(u&&(y.source=o),l&&(y.target=s))}t.restore(a,n)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var v=i(r.parent),f=v===null||e.hasElementWithId(v);if(f){var c=v===null?void 0:v;e.batch(function(){var d=t.remove(a,n);d.emitAndNotify("moveout");for(var h=0;h<t.length;h++){var y=t[h],g=y._private.data;y.isNode()&&(g.parent=c)}d.restore(a,n)}),t.emitAndNotify("move")}}return this};[Wv,Gg,pn,lt,na,np,Qn,Cp,pf,yf,Bp,In,yn,cr,vt,mr].forEach(function(r){ge($e,r)});var Op={add:function(e){var t,a=this;if(Pr(e)){var n=e;if(n._private.cy===a)t=n.restore();else{for(var i=[],o=0;o<n.length;o++){var s=n[o];i.push(s.json())}t=new hr(a,i)}}else if(Ge(e)){var u=e;t=new hr(a,u)}else if(Ie(e)&&(Ge(e.nodes)||Ge(e.edges))){for(var l=e,v=[],f=["nodes","edges"],c=0,d=f.length;c<d;c++){var h=f[c],y=l[h];if(Ge(y))for(var g=0,p=y.length;g<p;g++){var m=ge({group:h},y[g]);v.push(m)}}t=new hr(a,v)}else{var b=e;t=new Wn(a,b).collection()}return t},remove:function(e){if(!Pr(e)){if(ce(e)){var t=e;e=this.$(t)}}return e.remove()}};var Np=Math.cbrt||function(r){return r<0?-Math.pow(-r,1/3):Math.pow(r,1/3)};function zp(r,e,t,a){var n=1/Math.max(a,Math.sqrt(r)),i=r*n,o=i*n,s=a*n,u=t*o,l=s*s+u,v=-s*(s*s+1.5*u)-e*i*o,f=v*v-l*l*l,c;if(l===0||f>1e-12*v*v){var d=-Np(v<0?v-Math.sqrt(f):v+Math.sqrt(f));c=d+l/d||0}else{var h=Math.sqrt(l);c=2*h*Math.cos(Math.acos(Math.max(-1,Math.min(1,-v/(l*h))))/3)}return Math.min(1,i/(c+s))}function Fp(r,e,t,a){if(arguments.length!==4)return!1;for(var n=0;n<4;++n)if(typeof arguments[n]!="number"||isNaN(arguments[n])||!isFinite(arguments[n]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var i=r===e&&t===a,o=(3*r-3*t+1)/2,s=t-2*r,u=r,l=3*e-3*a+1,v=3*(a-2*e),f=3*e,c=function(y){if(i)return y;if(y<=0)return 0;if(y>=1)return 1;var g=zp(y,o,s,u);return((l*g+v)*g+f)*g};c.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var d="generateBezier("+[r,e,t,a]+")";return c.toString=function(){return d},c}var Vp=(function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var o={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:o.v,dv:r(o)}}function t(a,n){var i={dx:a.v,dv:r(a)},o=e(a,n*.5,i),s=e(a,n*.5,o),u=e(a,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),v=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+v*n,a}return function a(n,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,v=1/1e4,f=16/1e3,c,d,h;for(n=parseFloat(n)||500,i=parseFloat(i)||20,o=o||null,s.tension=n,s.friction=i,c=o!==null,c?(l=a(n,i),d=l/o*f):d=f;h=t(h||s,d),u.push(1+h.x),l+=16,Math.abs(h.x)>v&&Math.abs(h.v)>v;);return c?function(y){return u[y*(u.length-1)|0]}:l}})(),We=function(e,t,a,n){var i=Fp(e,t,a,n);return function(o,s,u){return o+(s-o)*i(u)}},mn={linear:function(e,t,a){return e+(t-e)*a},ease:We(.25,.1,.25,1),"ease-in":We(.42,0,1,1),"ease-out":We(0,0,.58,1),"ease-in-out":We(.42,0,.58,1),"ease-in-sine":We(.47,0,.745,.715),"ease-out-sine":We(.39,.575,.565,1),"ease-in-out-sine":We(.445,.05,.55,.95),"ease-in-quad":We(.55,.085,.68,.53),"ease-out-quad":We(.25,.46,.45,.94),"ease-in-out-quad":We(.455,.03,.515,.955),"ease-in-cubic":We(.55,.055,.675,.19),"ease-out-cubic":We(.215,.61,.355,1),"ease-in-out-cubic":We(.645,.045,.355,1),"ease-in-quart":We(.895,.03,.685,.22),"ease-out-quart":We(.165,.84,.44,1),"ease-in-out-quart":We(.77,0,.175,1),"ease-in-quint":We(.755,.05,.855,.06),"ease-out-quint":We(.23,1,.32,1),"ease-in-out-quint":We(.86,0,.07,1),"ease-in-expo":We(.95,.05,.795,.035),"ease-out-expo":We(.19,1,.22,1),"ease-in-out-expo":We(1,0,0,1),"ease-in-circ":We(.6,.04,.98,.335),"ease-out-circ":We(.075,.82,.165,1),"ease-in-out-circ":We(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return mn.linear;var n=Vp(e,t,a);return function(i,o,s){return i+(o-i)*n(s)}},"cubic-bezier":We};function Ml(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function Ll(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Gt(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var o=Ll(r,n),s=Ll(e,n);if(te(o)&&te(s))return Ml(i,o,s,t,a);if(Ge(o)&&Ge(s)){for(var u=[],l=0;l<s.length;l++){var v=o[l],f=s[l];if(v!=null&&f!=null){var c=Ml(i,v,f,t,a);u.push(c)}else u.push(f)}return u}}function qp(r,e,t,a){var n=!a,i=r._private,o=e._private,s=o.easing,u=o.startTime,l=a?r:r.cy(),v=l.style();if(!o.easingImpl)if(s==null)o.easingImpl=mn.linear;else{var f;if(ce(s)){var c=v.parse("transition-timing-function",s);f=c.value}else f=s;var d,h;ce(f)?(d=f,h=[]):(d=f[1],h=f.slice(2).map(function(G){return+G})),h.length>0?(d==="spring"&&h.push(o.duration),o.easingImpl=mn[d].apply(null,h)):o.easingImpl=mn[d]}var y=o.easingImpl,g;if(o.duration===0?g=1:g=(t-u)/o.duration,o.applying&&(g=o.progress),g<0?g=0:g>1&&(g=1),o.delay==null){var p=o.startPosition,m=o.position;if(m&&n&&!r.locked()){var b={};ma(p.x,m.x)&&(b.x=Gt(p.x,m.x,g,y)),ma(p.y,m.y)&&(b.y=Gt(p.y,m.y,g,y)),r.position(b)}var w=o.startPan,x=o.pan,C=i.pan,E=x!=null&&a;E&&(ma(w.x,x.x)&&(C.x=Gt(w.x,x.x,g,y)),ma(w.y,x.y)&&(C.y=Gt(w.y,x.y,g,y)),r.emit("pan"));var T=o.startZoom,k=o.zoom,D=k!=null&&a;D&&(ma(T,k)&&(i.zoom=Ma(i.minZoom,Gt(T,k,g,y),i.maxZoom)),r.emit("zoom")),(E||D)&&r.emit("viewport");var A=o.style;if(A&&A.length>0&&n){for(var P=0;P<A.length;P++){var B=A[P],R=B.name,M=B,I=o.startStyle[R],L=v.properties[I.name],O=Gt(I,M,g,y,L);v.overrideBypass(r,R,O)}r.emit("style")}}return o.progress=g,g}function ma(r,e){return r==null||e==null?!1:te(r)&&te(e)?!0:!!(r&&e)}function _p(r,e,t,a){var n=e._private;n.started=!0,n.startTime=t-n.progress*n.duration}function Il(r,e){var t=e._private.aniEles,a=[];function n(v,f){var c=v._private,d=c.animation.current,h=c.animation.queue,y=!1;if(d.length===0){var g=h.shift();g&&d.push(g)}for(var p=function(C){for(var E=C.length-1;E>=0;E--){var T=C[E];T()}C.splice(0,C.length)},m=d.length-1;m>=0;m--){var b=d[m],w=b._private;if(w.stopped){d.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||_p(v,b,r),qp(v,b,r,f),w.applying&&(w.applying=!1),p(w.frames),w.step!=null&&w.step(r),b.completed()&&(d.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.completes)),y=!0)}return!f&&d.length===0&&h.length===0&&a.push(v),y}for(var i=!1,o=0;o<t.length;o++){var s=t[o],u=n(s);i=i||u}var l=n(e,!0);(i||l)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var Gp={animate:ze.animate(),animation:ze.animation(),animated:ze.animated(),clearQueue:ze.clearQueue(),delay:ze.delay(),delayAnimation:ze.delayAnimation(),stop:ze.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&Dn(function(i){Il(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,o){Il(o,e)},a.beforeRenderPriorities.animations):t()}},Hp={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&qa(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},ln=function(e){return ce(e)?new gt(e):e},wf={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Jn(Hp,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,ln(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,ln(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,ln(t),a),this},once:function(e,t,a){return this.emitter().one(e,ln(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};ze.eventAliasesOn(wf);var Uo={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};Uo.jpeg=Uo.jpg;var bn={layout:function(e){var t=this;if(e==null){Ue("Layout options must be specified to make a layout");return}if(e.name==null){Ue("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){Ue("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;ce(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var o=new n(ge({},e,{cy:t,eles:i}));return o}};bn.createLayout=bn.makeLayout=bn.layout;var Wp={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.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 t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],o=e[i],s=t.getElementById(i);s.data(o)}})}},$p=dr({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Xo={renderTo:function(e,t,a,n){var i=this._private.renderer;return i.renderTo(e,t,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 t=this,a=t.extension("renderer",e.name);if(a==null){Ue("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&&Fe("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=$p(e);n.cy=t,t._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.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)}};Xo.invalidateDimensions=Xo.resize;var wn={collection:function(e,t){return ce(e)?this.$(e):Pr(e)?e.collection():Ge(e)?(t||(t={}),new hr(this,e,t.unique,t.removed)):new hr(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};wn.elements=wn.filter=wn.$;var vr={},ka="t",Kp="f";vr.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i<r.length;i++){var o=r[i],s=e.getContextMeta(o);if(!s.empty){var u=e.getContextStyle(s),l=e.applyContextStyle(s,u,o);o._private.appliedInitStyle?e.updateTransitions(o,l.diffProps):o._private.appliedInitStyle=!0;var v=e.updateStyleHints(o);v&&n.push(o)}}return n};vr.getPropertiesDiff=function(r,e){var t=this,a=t._private.propDiffs=t._private.propDiffs||{},n=r+"-"+e,i=a[n];if(i)return i;for(var o=[],s={},u=0;u<t.length;u++){var l=t[u],v=r[u]===ka,f=e[u]===ka,c=v!==f,d=l.mappedProperties.length>0;if(c||f&&d){var h=void 0;c&&d||c?h=l.properties:d&&(h=l.mappedProperties);for(var y=0;y<h.length;y++){for(var g=h[y],p=g.name,m=!1,b=u+1;b<t.length;b++){var w=t[b],x=e[b]===ka;if(x&&(m=w.properties[g.name]!=null,m))break}!s[p]&&!m&&(s[p]=!0,o.push(p))}}}return a[n]=o,o};vr.getContextMeta=function(r){for(var e=this,t="",a,n=r._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(r);s?t+=ka:t+=Kp}return a=e.getPropertiesDiff(n,t),r._private.styleCxtKey=t,{key:t,diffPropNames:a,empty:a.length===0}};vr.getContextStyle=function(r){var e=r.key,t=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<t.length;i++){var o=t[i],s=e[i]===ka;if(s)for(var u=0;u<o.properties.length;u++){var l=o.properties[u];n[l.name]=l}}return a[e]=n,n};vr.applyContextStyle=function(r,e,t){for(var a=this,n=r.diffPropNames,i={},o=a.types,s=0;s<n.length;s++){var u=n[s],l=e[u],v=t.pstyle(u);if(!l)if(v)v.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(v!==l){if(l.mapped===o.fn&&v!=null&&v.mapping!=null&&v.mapping.value===l.value){var f=v.mapping,c=f.fnValue=l.value(t);if(c===f.prevFnValue)continue}var d=i[u]={prev:v};a.applyParsedProperty(t,l),d.next=t.pstyle(u),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}};vr.updateStyleHints=function(r){var e=r._private,t=this,a=t.propertyGroupNames,n=t.propertyGroupKeys,i=function(X,Y,ae){return t.getPropertiesHash(X,Y,ae)},o=e.styleKey;if(r.removed())return!1;var s=e.group==="nodes",u=r._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var v=n[l];e.styleKeys[v]=[Pt,Xt]}for(var f=function(X,Y){return e.styleKeys[Y][0]=Pa(X,e.styleKeys[Y][0])},c=function(X,Y){return e.styleKeys[Y][1]=Aa(X,e.styleKeys[Y][1])},d=function(X,Y){f(X,Y),c(X,Y)},h=function(X,Y){for(var ae=0;ae<X.length;ae++){var ve=X.charCodeAt(ae);f(ve,Y),c(ve,Y)}},y=2e9,g=function(X){return-128<X&&X<128&&Math.floor(X)!==X?y-(X*1024|0):X},p=0;p<a.length;p++){var m=a[p],b=u[m];if(b!=null){var w=this.properties[m],x=w.type,C=w.groupKey,E=void 0;w.hashOverride!=null?E=w.hashOverride(r,b):b.pfValue!=null&&(E=b.pfValue);var T=w.enums==null?b.value:null,k=E!=null,D=T!=null,A=k||D,P=b.units;if(x.number&&A&&!x.multiple){var B=k?E:T;d(g(B),C),!k&&P!=null&&h(P,C)}else h(b.strValue,C)}}for(var R=[Pt,Xt],M=0;M<n.length;M++){var I=n[M],L=e.styleKeys[I];R[0]=Pa(L[0],R[0]),R[1]=Aa(L[1],R[1])}e.styleKey=nh(R[0],R[1]);var O=e.styleKeys;e.labelDimsKey=at(O.labelDimensions);var G=i(r,["label"],O.labelDimensions);if(e.labelKey=at(G),e.labelStyleKey=at(en(O.commonLabel,G)),!s){var _=i(r,["source-label"],O.labelDimensions);e.sourceLabelKey=at(_),e.sourceLabelStyleKey=at(en(O.commonLabel,_));var N=i(r,["target-label"],O.labelDimensions);e.targetLabelKey=at(N),e.targetLabelStyleKey=at(en(O.commonLabel,N))}if(s){var F=e.styleKeys,Z=F.nodeBody,J=F.nodeBorder,U=F.nodeOutline,j=F.backgroundImage,re=F.compound,ne=F.pie,W=F.stripe,z=[Z,J,U,j,re,ne,W].filter(function(q){return q!=null}).reduce(en,[Pt,Xt]);e.nodeKey=at(z),e.hasPie=ne!=null&&ne[0]!==Pt&&ne[1]!==Xt,e.hasStripe=W!=null&&W[0]!==Pt&&W[1]!==Xt}return o!==e.styleKey};vr.clearStyleHints=function(r){var e=r._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,e.hasStripe=null};vr.applyParsedProperty=function(r,e){var t=this,a=e,n=r._private.style,i,o=t.types,s=t.properties[a.name].type,u=a.bypass,l=n[a.name],v=l&&l.bypass,f=r._private,c="mapping",d=function(Z){return Z==null?null:Z.pfValue!=null?Z.pfValue:Z.value},h=function(){var Z=d(l),J=d(a);t.checkTriggers(r,a.name,Z,J)};if(e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.target().isParent()))&&(a=e=this.parse(e.name,"bezier",u)),a.delete)return n[a.name]=void 0,h(),!0;if(a.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,h(),!0):!1:(h(),!0);if(a.deleteBypass)return l?l.bypass?(n[a.name]=l.bypassed,h(),!0):!1:(h(),!0);var y=function(){Fe("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.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 o.mapData:{for(var g=a.field.split("."),p=f.data,m=0;m<g.length&&p;m++){var b=g[m];p=p[b]}if(p==null)return y(),!1;var w;if(te(p)){var x=a.fieldMax-a.fieldMin;x===0?w=0:w=(p-a.fieldMin)/x}else return Fe("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+p+"` for `"+r.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),s.color){var C=a.valueMin[0],E=a.valueMax[0],T=a.valueMin[1],k=a.valueMax[1],D=a.valueMin[2],A=a.valueMax[2],P=a.valueMin[3]==null?1:a.valueMin[3],B=a.valueMax[3]==null?1:a.valueMax[3],R=[Math.round(C+(E-C)*w),Math.round(T+(k-T)*w),Math.round(D+(A-D)*w),P+(B-P)*w];i={bypass:a.bypass,name:a.name,value:R,strValue:"rgba("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")"}}else if(s.number){var M=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,M,a.bypass,c)}else return!1;if(!i)return y(),!1;i.mapping=a,a=i;break}case o.data:{for(var I=a.field.split("."),L=f.data,O=0;O<I.length&&L;O++){var G=I[O];L=L[G]}if(L!=null&&(i=this.parse(a.name,L,a.bypass,c)),!i)return y(),!1;i.mapping=a,a=i;break}case o.fn:{var _=a.value,N=a.fnValue!=null?a.fnValue:_(r);if(a.prevFnValue=N,N==null)return Fe("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+r.id()+"` is null)"),!1;if(i=this.parse(a.name,N,a.bypass,c),!i)return Fe("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+r.id()+"` is invalid)"),!1;i.mapping=$r(a),a=i;break}case void 0:break;default:return!1}return u?(v?a.bypassed=l.bypassed:a.bypassed=l,n[a.name]=a):v?l.bypassed=a:n[a.name]=a,h(),!0};vr.cleanElements=function(r,e){for(var t=0;t<r.length;t++){var a=r[t];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s];u!=null&&(u.bypass?u.bypassed=null:n[s]=null)}}};vr.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()};vr.updateTransitions=function(r,e){var t=this,a=r._private,n=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,o=r.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var s={},u=!1,l=0;l<n.length;l++){var v=n[l],f=r.pstyle(v),c=e[v];if(c){var d=c.prev,h=d,y=c.next!=null?c.next:f,g=!1,p=void 0,m=1e-6;h&&(te(h.pfValue)&&te(y.pfValue)?(g=y.pfValue-h.pfValue,p=h.pfValue+m*g):te(h.value)&&te(y.value)?(g=y.value-h.value,p=h.value+m*g):Ge(h.value)&&Ge(y.value)&&(g=h.value[0]!==y.value[0]||h.value[1]!==y.value[1]||h.value[2]!==y.value[2],p=h.strValue),g&&(s[v]=y.strValue,this.applyBypass(r,v,p),u=!0))}}if(!u)return;a.transitioning=!0,new ua(function(b){o>0?r.delayAnimation(o).play().promise().then(b):b()}).then(function(){return r.animation({style:s,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)};vr.checkTrigger=function(r,e,t,a,n,i){var o=this.properties[e],s=n(o);r.removed()||s!=null&&s(t,a,r)&&i(o)};vr.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})};vr.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};vr.checkConnectedEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};vr.checkParallelEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};vr.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a),this.checkConnectedEdgesBoundsTrigger(r,e,t,a),this.checkParallelEdgesBoundsTrigger(r,e,t,a)};var Ua={};Ua.applyBypass=function(r,e,t,a){var n=this,i=[],o=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var s=0;s<n.properties.length;s++){var u=n.properties[s],l=u.name,v=this.parse(l,t,!0);v&&i.push(v)}}else if(ce(e)){var f=this.parse(e,t,!0);f&&i.push(f)}else if(Ie(e)){var c=e;a=t;for(var d=Object.keys(c),h=0;h<d.length;h++){var y=d[h],g=c[y];if(g===void 0&&(g=c[Gn(y)]),g!==void 0){var p=this.parse(y,g,!0);p&&i.push(p)}}}else return!1;if(i.length===0)return!1;for(var m=!1,b=0;b<r.length;b++){for(var w=r[b],x={},C=void 0,E=0;E<i.length;E++){var T=i[E];if(a){var k=w.pstyle(T.name);C=x[T.name]={prev:k}}m=this.applyParsedProperty(w,$r(T))||m,a&&(C.next=w.pstyle(T.name))}m&&this.updateStyleHints(w),a&&this.updateTransitions(w,x,o)}return m};Ua.overrideBypass=function(r,e,t){e=os(e);for(var a=0;a<r.length;a++){var n=r[a],i=n._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,t):(i.value=t,i.pfValue!=null&&(i.pfValue=t),s?i.strValue=t[3]==null?"rgb("+t[0]+","+t[1]+","+t[2]+")":"rgba("+t[0]+","+t[1]+","+t[2]+","+t[3]+")":u?i.strValue=t.join(" "):i.strValue=""+t,this.updateStyleHints(n)),this.checkTriggers(n,e,l,t)}};Ua.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};Ua.removeBypasses=function(r,e,t){for(var a=!0,n=0;n<r.length;n++){for(var i=r[n],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],v=i.pstyle(l.name);if(!(!v||!v.bypass)){var f="",c=this.parse(u,f,!0),d=o[l.name]={prev:v};this.applyParsedProperty(i,c),d.next=i.pstyle(l.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,o,a)}};var ws={};ws.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};ws.containerCss=function(r){var e=this._private.cy,t=e.container(),a=e.window();if(a&&t&&a.getComputedStyle)return a.getComputedStyle(t).getPropertyValue(r)};var Kr={};Kr.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};Kr.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var a={},n=0;n<t.properties.length;n++){var i=t.properties[n],o=t.getStylePropertyValue(r,i.name,e);o!=null&&(a[i.name]=o,a[Gn(i.name)]=o)}return a}};Kr.getIndexedStyle=function(r,e,t,a){var n=r.pstyle(e)[t][a];return n??r.cy().style().getDefaultProperty(e)[t][0]};Kr.getStylePropertyValue=function(r,e,t){var a=this;if(r=r[0],r){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,o=r.pstyle(n.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(t&&i.number&&s!=null&&te(s)){var v=r.cy().zoom(),f=function(g){return g*v},c=function(g,p){return f(g)+p},d=Ge(s),h=d?u.every(function(y){return y!=null}):u!=null;return h?d?s.map(function(y,g){return c(y,u[g])}).join(" "):c(s,u):d?s.map(function(y){return ce(y)?y:""+f(y)}).join(" "):""+f(s)}else if(l!=null)return l}return null}};Kr.getAnimationStartStyle=function(r,e){for(var t={},a=0;a<e.length;a++){var n=e[a],i=n.name,o=r.pstyle(i);o!==void 0&&(Ie(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(t[i]=o)}return t};Kr.getPropsList=function(r){var e=this,t=[],a=r,n=e.properties;if(a)for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s],l=n[s]||n[os(s)],v=this.parse(l.name,u);v&&t.push(v)}return t};Kr.getNonDefaultPropertiesHash=function(r,e,t){var a=t.slice(),n,i,o,s,u,l;for(u=0;u<e.length;u++)if(n=e[u],i=r.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=Pa(s,a[0]),a[1]=Aa(s,a[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),a[0]=Pa(s,a[0]),a[1]=Aa(s,a[1]);return a};Kr.getPropertiesHash=Kr.getNonDefaultPropertiesHash;var ri={};ri.appendFromJson=function(r){for(var e=this,t=0;t<r.length;t++){var a=r[t],n=a.selector,i=a.style||a.css,o=Object.keys(i);e.selector(n);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};ri.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};ri.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],a=t.selector,n=t.properties,i={},o=0;o<n.length;o++){var s=n[o];i[s.name]=s.strValue}r.push({selector:a?a.toString():"core",style:i})}return r};var xs={};xs.appendFromString=function(r){var e=this,t=this,a=""+r,n,i,o;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){Fe("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new gt(f);if(c.invalid){Fe("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),s();continue}}var d=v[2],h=!1;i=d;for(var y=[];;){var g=i.match(/^\s*$/);if(g)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Fe("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d),h=!0;break}o=p[0];var m=p[1],b=p[2],w=e.properties[m];if(!w){Fe("Skipping property: Invalid property name in: "+o),u();continue}var x=t.parse(m,b);if(!x){Fe("Skipping property: Invalid property definition in: "+o),u();continue}y.push({name:m,val:b}),u()}if(h){s();break}t.selector(f);for(var C=0;C<y.length;C++){var E=y[C];t.css(E.name,E.val)}s()}return t};xs.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var On=["source","mid-source","target","mid-target"],Lr=function(e,t){if(t!=null){var a=e.pstyle(t+"-arrow-scale");if(a!=null&&a.value!=="inherit")return a.value}return e.pstyle("arrow-scale").value},je={};(function(){var r=tr,e=Nc,t=Fc,a=Vc,n=qc,i=function(z){return"^"+z+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(z){var q=r+"|\\w+|"+e+"|"+t+"|"+a+"|"+n;return"^"+z+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+q+")\\s*\\,\\s*("+q+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];je.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},arrowScale:{number:!0,unitless:!0,min:0,strictMin:!0,enums:["inherit"]},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"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},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},boxSelection:{enums:["contain","overlap","none"]},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"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},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","circle"]},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"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},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"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},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:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,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(z,q){switch(z.length){case 2:return q[0]!=="deg"&&q[0]!=="rad"&&q[1]!=="deg"&&q[1]!=="rad";case 1:return ce(z[0])||q[0]==="deg"||q[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\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(z){var q=z.length;return q===1||q===2||q===4}}};var u={zeroNonZero:function(z,q){return(z==null||q==null)&&z!==q||z==0&&q!=0?!0:z!=0&&q==0},any:function(z,q){return z!=q},emptyNonEmpty:function(z,q){var X=ft(z),Y=ft(q);return X&&!Y||!X&&Y}},l=je.types,v=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],f=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],c=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],d=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],h=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification},{name:"text-metrics",type:l.textMetrics},{name:"box-select-labels",type:l.bool,triggersBounds:u.any}],y=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any},{name:"box-selection",type:l.boxSelection,triggersZOrder:u.any}],g=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:function(z,q,X){return z===q?!1:X.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],p=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-fill",type:l.fill},{name:"overlay-gradient-stop-colors",type:l.colors},{name:"overlay-gradient-stop-positions",type:l.percentages},{name:"overlay-gradient-direction",type:l.gradientDirection},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],m=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-fill",type:l.fill},{name:"underlay-gradient-stop-colors",type:l.colors},{name:"underlay-gradient-stop-positions",type:l.percentages},{name:"underlay-gradient-direction",type:l.gradientDirection},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],b=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],w=function(z,q){return q.value==="label"?-z.poolIndex():q.pfValue},x=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],C=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],E=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],T=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],k=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],D=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:function(z,q){return z===q?!1:z==="bezier"||q==="bezier"}},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],A=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],P=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],B=[];je.pieBackgroundN=16,B.push({name:"pie-size",type:l.sizeMaybePercent}),B.push({name:"pie-hole",type:l.sizeMaybePercent}),B.push({name:"pie-start-angle",type:l.angle});for(var R=1;R<=je.pieBackgroundN;R++)B.push({name:"pie-"+R+"-background-color",type:l.color}),B.push({name:"pie-"+R+"-background-size",type:l.percent}),B.push({name:"pie-"+R+"-background-opacity",type:l.zeroOneNumber});var M=[];je.stripeBackgroundN=16,M.push({name:"stripe-size",type:l.sizeMaybePercent}),M.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var I=1;I<=je.stripeBackgroundN;I++)M.push({name:"stripe-"+I+"-background-color",type:l.color}),M.push({name:"stripe-"+I+"-background-size",type:l.percent}),M.push({name:"stripe-"+I+"-background-opacity",type:l.zeroOneNumber});var L=[];je.arrowPrefixes=On,[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth},{name:"arrow-scale",type:l.arrowScale,triggersBounds:u.any}].forEach(function(W){On.forEach(function(z){var q=z+"-"+W.name,X=W.type,Y=W.triggersBounds;L.push({name:q,type:X,triggersBounds:Y})})},{});var O=je.properties=[].concat(y,b,g,p,m,A,h,d,v,f,c,x,C,E,T,B,M,k,D,L,P),G=je.propertyGroups={behavior:y,transition:b,visibility:g,overlay:p,underlay:m,ghost:A,commonLabel:h,labelDimensions:d,mainLabel:v,sourceLabel:f,targetLabel:c,nodeBody:x,nodeBorder:C,nodeOutline:E,backgroundImage:T,pie:B,stripe:M,compound:k,edgeLine:D,edgeArrow:L,core:P},_=je.propertyGroupNames={},N=je.propertyGroupKeys=Object.keys(G);N.forEach(function(W){_[W]=G[W].map(function(z){return z.name}),G[W].forEach(function(z){return z.groupKey=W})});var F=je.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{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"}];je.propertyNames=O.map(function(W){return W.name});for(var Z=0;Z<O.length;Z++){var J=O[Z];O[J.name]=J}for(var U=0;U<F.length;U++){var j=F[U],re=O[j.pointsTo],ne={name:j.name,alias:!0,pointsTo:re};O.push(ne),O[j.name]=ne}})();je.getDefaultProperty=function(r){return this.getDefaultProperties()[r]};je.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=ge({"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","box-selection":"contain","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-fill":"solid","overlay-gradient-stop-colors":"#999","overlay-gradient-stop-positions":"0%","overlay-gradient-direction":"to-bottom","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-fill":"solid","underlay-gradient-stop-colors":"#999","underlay-gradient-stop-positions":"0%","underlay-gradient-direction":"to-bottom","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","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","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","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%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var v=1;v<=je.pieBackgroundN;v++){var f=l.name.replace("{{i}}",v),c=l.value;u[f]=c}return u},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var v=1;v<=je.stripeBackgroundN;v++){var f=l.name.replace("{{i}}",v),c=l.value;u[f]=c}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","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,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"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"},{name:"arrow-width",value:1},{name:"arrow-scale",value:"inherit"}].reduce(function(u,l){return je.arrowPrefixes.forEach(function(v){var f=v+"-"+l.name,c=l.value;u[f]=c}),u},{})),t={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,o=e[i],s=this.parse(i,o);t[i]=s}}return r.defaultProperties=t,r.defaultProperties};je.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 ti={};ti.parse=function(r,e,t,a){var n=this;if(Ye(e))return n.parseImplWarn(r,e,t,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,o=t?"t":"f",s=""+e,u=Cv(r,s,o,i),l=n.propCache=n.propCache||[],v;return(v=l[u])||(v=l[u]=n.parseImplWarn(r,e,t,a)),(t||a==="mapping")&&(v=$r(v),v&&(v.value=$r(v.value))),v};ti.parseImplWarn=function(r,e,t,a){var n=this.parseImpl(r,e,t,a);return!n&&e!=null&&Fe("The style property `".concat(r,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Fe("The style value of `label` is deprecated for `"+n.name+"`"),n};ti.parseImpl=function(r,e,t,a){var n=this;r=os(r);var i=n.properties[r],o=e,s=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,r=i.name);var u=ce(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(Ye(e))return{name:r,value:e,strValue:"fn",mapped:s.fn,bypass:t};var v,f;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(v=new RegExp(s.data.regex).exec(e))){if(t)return!1;var c=s.data;return{name:r,value:v,strValue:""+e,mapped:c,field:v[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(s.mapData.regex).exec(e))){if(t||l.multiple)return!1;var d=s.mapData;if(!(l.color||l.number))return!1;var h=this.parse(r,f[4]);if(!h||h.mapped)return!1;var y=this.parse(r,f[5]);if(!y||y.mapped)return!1;if(h.pfValue===y.pfValue||h.strValue===y.strValue)return Fe("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+h.strValue+"`"),this.parse(r,h.strValue);if(l.color){var g=h.value,p=y.value,m=g[0]===p[0]&&g[1]===p[1]&&g[2]===p[2]&&(g[3]===p[3]||(g[3]==null||g[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:r,value:f,strValue:""+e,mapped:d,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:h.value,valueMax:y.value,bypass:t}}}if(l.multiple&&a!=="multiple"){var b;if(u?b=e.split(/\s+/):Ge(e)?b=e:b=[e],l.evenMultiple&&b.length%2!==0)return null;for(var w=[],x=[],C=[],E="",T=!1,k=0;k<b.length;k++){var D=n.parse(r,b[k],t,"multiple");T=T||ce(D.value),w.push(D.value),C.push(D.pfValue!=null?D.pfValue:D.value),x.push(D.units),E+=(k>0?" ":"")+D.strValue}return l.validate&&!l.validate(w,x)?null:l.singleEnum&&T?w.length===1&&ce(w[0])?{name:r,value:w[0],strValue:w[0],bypass:t}:null:{name:r,value:w,pfValue:C,strValue:E,bypass:t,units:x}}var A=function(){for(var W=0;W<l.enums.length;W++){var z=l.enums[W];if(z===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(l.number){var P,B="px";if(l.units&&(P=l.units),l.implicitUnits&&(B=l.implicitUnits),!l.unitless)if(u){var R="px|em"+(l.allowPercent?"|\\%":"");P&&(R=P);var M=e.match("^("+tr+")("+R+")?$");M&&(e=M[1],P=M[2]||B)}else(!P||l.implicitUnits)&&(P=B);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,A();if(l.integer&&!Sn(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var I={name:r,value:e,strValue:""+e+(P||""),units:P,bypass:t};return l.unitless||P!=="px"&&P!=="em"?I.pfValue=e:I.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(I.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(I.pfValue=P==="rad"?e:Vh(e)),P==="%"&&(I.pfValue=e/100),I}else if(l.propList){var L=[],O=""+e;if(O!=="none"){for(var G=O.split(/\s*,\s*|\s+/),_=0;_<G.length;_++){var N=G[_].trim();n.properties[N]?L.push(N):Fe("`"+N+"` is not a valid property name")}if(L.length===0)return null}return{name:r,value:L,strValue:L.length===0?"none":L.join(" "),bypass:t}}else if(l.color){var F=pv(e);return F?{name:r,value:F,pfValue:F,strValue:F[3]==null?"rgb("+F[0]+","+F[1]+","+F[2]+")":"rgba("+F[0]+","+F[1]+","+F[2]+","+F[3]+")",bypass:t}:null}else if(l.regex||l.regexes){if(l.enums){var Z=A();if(Z)return Z}for(var J=l.regexes?l.regexes:[l.regex],U=0;U<J.length;U++){var j=new RegExp(J[U]),re=j.exec(e);if(re)return{name:r,value:l.singleRegexMatchValue?re[1]:re,strValue:""+e,bypass:t}}return null}else return l.string?{name:r,value:""+e,strValue:""+e,bypass:t}:l.enums?A():null};var lr=function(e){if(!(this instanceof lr))return new lr(e);if(!is(e)){Ue("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},br=lr.prototype;br.instanceString=function(){return"style"};br.clear=function(){for(var r=this._private,e=r.cy,t=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};br.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};br.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};br.selector=function(r){var e=r==="core"?null:new gt(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};br.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],a=0;a<r.properties.length;a++){var n=r.properties[a],i=t[n.name];i===void 0&&(i=t[Gn(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};br.style=br.css;br.cssRule=function(r,e){var t=this.parse(r,e);if(t){var a=this.length-1;this[a].properties.push(t),this[a].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.name.match(/stripe-(\d+)-background-size/)&&t.value&&(this._private.hasStripe=!0),t.mapped&&this[a].mappedProperties.push(t);var n=!this[a].selector;n&&(this._private.coreStyle[t.name]=t)}return this};br.append=function(r){return hv(r)?r.appendToStyle(this):Ge(r)?this.appendFromJson(r):ce(r)&&this.appendFromString(r),this};lr.fromJson=function(r,e){var t=new lr(r);return t.fromJson(e),t};lr.fromString=function(r,e){return new lr(r).fromString(e)};[vr,Ua,ws,Kr,ri,xs,je,ti].forEach(function(r){ge(br,r)});lr.types=br.types;lr.properties=br.properties;lr.propertyGroups=br.propertyGroups;lr.propertyGroupNames=br.propertyGroupNames;lr.propertyGroupKeys=br.propertyGroupKeys;var Up={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return hv(e)?t.style=e.generateStyle(this):Ge(e)?t.style=lr.fromJson(this,e):ce(e)?t.style=lr.fromString(this,e):t.style=lr(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Xp="single",Nt={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 t=this._private;if(t.selectionType==null&&(t.selectionType=Xp),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.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,t=this._private.pan,a,n,i,o,s;switch(e.length){case 0:return t;case 1:if(ce(e[0]))return a=e[0],t[a];if(Ie(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,te(o)&&(t.x=o),te(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&te(n)&&(t[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var a=arguments,n=this._private.pan,i,o,s,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:Ie(e)&&(s=a[0],u=s.x,l=s.y,te(u)&&(n.x+=u),te(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=t,(i==="x"||i==="y")&&te(o)&&(n[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,t){var a=this.getFitViewport(e,t);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,t){if(te(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(ce(e)){var n=e;e=this.$(n)}else if(Mc(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 Pr(e)||(e=this.mutableElements());if(!(Pr(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),u;if(t=te(t)?t:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((o-2*t)/a.w,(s-2*t)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(a.x1+a.x2))/2,y:(s-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,t){var a=this._private;if(t==null){var n=e;e=n.min,t=n.max}return te(e)&&te(t)&&e<=t?(a.minZoom=e,a.maxZoom=t):te(e)&&t===void 0&&e<=a.maxZoom?a.minZoom=e:te(t)&&e===void 0&&t>=a.minZoom&&(a.maxZoom=t),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 t=this._private,a=t.pan,n=t.zoom,i,o,s=!1;if(t.zoomingEnabled||(s=!0),te(e)?o=e:Ie(e)&&(o=e.level,e.position!=null?i=$n(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(s=!0)),o=o>t.maxZoom?t.maxZoom:o,o=o<t.minZoom?t.minZoom:o,s||!te(o)||o===n||i!=null&&(!te(i.x)||!te(i.y)))return null;if(i!=null){var u=a,l=n,v=o,f={x:-v/l*(i.x-u.x)+i.x,y:-v/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:v,pan:f}}else return{zoomed:!0,panned:!1,zoom:o,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),a=this._private;return t==null||!t.zoomed?this:(a.zoom=t.zoom,t.panned&&(a.pan.x=t.pan.x,a.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,a=!0,n=!0,i=[],o=!1,s=!1;if(!e)return this;if(te(e.zoom)||(a=!1),Ie(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<t.minZoom||u>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=u,i.push("zoom"))}if(n&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;te(l.x)&&(t.pan.x=l.x,s=!1),te(l.y)&&(t.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(ce(e)){var a=e;e=this.mutableElements().filter(a)}else Pr(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),o=this.height();t=t===void 0?this._private.zoom:t;var s={x:(i-t*(n.x1+n.x2))/2,y:(o-t*(n.y1+n.y2))/2};return s}}},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,t=e.container,a=this;return e.sizeCache=e.sizeCache||(t?(function(){var n=a.window().getComputedStyle(t),i=function(s){return parseFloat(n.getPropertyValue(s))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.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,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Nt.centre=Nt.center;Nt.autolockNodes=Nt.autolock;Nt.autoungrabifyNodes=Nt.autoungrabify;var Na={data:ze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Na.attr=Na.data;Na.removeAttr=Na.removeData;var za=function(e){var t=this;e=ge({},e);var a=e.container;a&&!kn(a)&&kn(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=t;var o=rr!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=ge({name:o?"grid":"null"},s.layout),s.renderer=ge({name:o?"canvas":"null"},s.renderer);var u=function(h,y,g){return y!==void 0?y:g!==void 0?g:h},l=this._private={container:a,ready:!1,options:s,elements:new hr(this),listeners:[],aniEles:new hr(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:te(s.zoom)?s.zoom:1,pan:{x:Ie(s.pan)&&te(s.pan.x)?s.pan.x:0,y:Ie(s.pan)&&te(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var v=function(h,y){var g=h.some(Lc);if(g)return ua.all(h).then(y);y(h)};l.styleEnabled&&t.setStyle([]);var f=ge({},s,s.renderer);t.initRenderer(f);var c=function(h,y,g){t.notifications(!1);var p=t.mutableElements();p.length>0&&p.remove(),h!=null&&(Ie(h)||Ge(h))&&t.add(h),t.one("layoutready",function(b){t.notifications(!0),t.emit(b),t.one("load",y),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",g),t.emit("done")});var m=ge({},t._private.options.layout);m.eles=t.elements(),t.layout(m).run()};v([s.style,s.elements],function(d){var h=d[0],y=d[1];l.styleEnabled&&t.style().append(h),c(y,function(){t.startAnimationLoop(),l.ready=!0,Ye(s.ready)&&t.on("ready",s.ready);for(var g=0;g<i.length;g++){var p=i[g];t.on("ready",p)}n&&(n.readies=[]),t.emit("ready")},s.done)})},Nn=za.prototype;ge(Nn,{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 rr;var t=this._private.container.ownerDocument;return t===void 0||t==null?rr:t.defaultView||rr},mount:function(e){if(e!=null){var t=this,a=t._private,n=a.options;return!kn(e)&&kn(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),a.container=e,a.styleEnabled=!0,t.invalidateSize(),t.initRenderer(ge({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),t.startAnimationLoop(),t.style(n.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return $r(this._private.options)},json:function(e){var t=this,a=t._private,n=t.mutableElements(),i=function(w){return t.getElementById(w.id())};if(Ie(e)){if(t.startBatch(),e.elements){var o={},s=function(w,x){for(var C=[],E=[],T=0;T<w.length;T++){var k=w[T];if(!k.data.id){Fe("cy.json() cannot handle elements without an ID attribute");continue}var D=""+k.data.id,A=t.getElementById(D);o[D]=!0,A.length!==0?E.push({ele:A,json:k}):(x&&(k.group=x),C.push(k))}t.add(C);for(var P=0;P<E.length;P++){var B=E[P],R=B.ele,M=B.json;R.json(M)}};if(Ge(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var v=u[l],f=e.elements[v];Ge(f)&&s(f,v)}var c=t.collection();n.filter(function(b){return!o[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&&t.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],h=0;h<d.length;h++){var y=d[h];e[y]!=null&&t[y](e[y])}return t.endBatch(),this}else{var g=!!e,p={};g?p.elements=this.elements().map(function(b){return b.json()}):(p.elements={},n.forEach(function(b){var w=b.group();p.elements[w]||(p.elements[w]=[]),p.elements[w].push(b.json())})),this._private.styleEnabled&&(p.style=t.style().json()),p.data=$r(t.data());var m=a.options;return p.zoomingEnabled=a.zoomingEnabled,p.userZoomingEnabled=a.userZoomingEnabled,p.zoom=a.zoom,p.minZoom=a.minZoom,p.maxZoom=a.maxZoom,p.panningEnabled=a.panningEnabled,p.userPanningEnabled=a.userPanningEnabled,p.pan=$r(a.pan),p.boxSelectionEnabled=a.boxSelectionEnabled,p.renderer=$r(m.renderer),p.hideEdgesOnViewport=m.hideEdgesOnViewport,p.textureOnViewport=m.textureOnViewport,p.wheelSensitivity=m.wheelSensitivity,p.motionBlur=m.motionBlur,p.multiClickDebounceTime=m.multiClickDebounceTime,p}}});Nn.$id=Nn.getElementById;[Op,Gp,wf,Uo,bn,Wp,Xo,wn,Up,Nt,Na].forEach(function(r){ge(Nn,r)});var Yp={fit:!0,directed:!1,direction:"downward",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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},Zp={maximal:!1,acyclic:!1},Ht=function(e){return e.scratch("breadthfirst")},Ol=function(e,t){return e.scratch("breadthfirst",t)};function xf(r){this.options=ge({},Yp,Zp,r)}xf.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,a=t.nodes().filter(function(pe){return pe.isChildless()}),n=t,i=r.directed,o=r.acyclic||r.maximal||r.maximalAdjustments>0,s=!!r.boundingBox,u=yr(s?r.boundingBox:structuredClone(e.extent())),l;if(Pr(r.roots))l=r.roots;else if(Ge(r.roots)){for(var v=[],f=0;f<r.roots.length;f++){var c=r.roots[f],d=e.getElementById(c);v.push(d)}l=e.collection(v)}else if(ce(r.roots))l=e.$(r.roots);else if(i)l=a.roots();else{var h=t.components();l=e.collection();for(var y=function(){var ie=h[g],ye=ie.maxDegree(!1),he=ie.filter(function(Ce){return Ce.degree(!1)===ye});l=l.add(he)},g=0;g<h.length;g++)y()}var p=[],m={},b=function(ie,ye){p[ye]==null&&(p[ye]=[]);var he=p[ye].length;p[ye].push(ie),Ol(ie,{index:he,depth:ye})},w=function(ie,ye){var he=Ht(ie),Ce=he.depth,be=he.index;p[Ce][be]=null,ie.isChildless()&&b(ie,ye)};n.bfs({roots:l,directed:r.directed,visit:function(ie,ye,he,Ce,be){var Ae=ie[0],Re=Ae.id();Ae.isChildless()&&b(Ae,be),m[Re]=!0}});for(var x=[],C=0;C<a.length;C++){var E=a[C];m[E.id()]||x.push(E)}var T=function(ie){for(var ye=p[ie],he=0;he<ye.length;he++){var Ce=ye[he];if(Ce==null){ye.splice(he,1),he--;continue}Ol(Ce,{depth:ie,index:he})}},k=function(ie,ye){for(var he=Ht(ie),Ce=ie.incomers().filter(function(ke){return ke.isNode()&&t.has(ke)}),be=-1,Ae=ie.id(),Re=0;Re<Ce.length;Re++){var Ke=Ce[Re],qe=Ht(Ke);be=Math.max(be,qe.depth)}if(he.depth<=be){if(!r.acyclic&&ye[Ae])return null;var _e=be+1;return w(ie,_e),ye[Ae]=_e,!0}return!1};if(i&&o){var D=[],A={},P=function(ie){return D.push(ie)},B=function(){return D.shift()};for(a.forEach(function(pe){return D.push(pe)});D.length>0;){var R=B(),M=k(R,A);if(M)R.outgoers().filter(function(pe){return pe.isNode()&&t.has(pe)}).forEach(P);else if(M===null){Fe("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(r.avoidOverlap)for(var L=0;L<a.length;L++){var O=a[L],G=O.layoutDimensions(r),_=G.w,N=G.h;I=Math.max(I,_,N)}var F={},Z=function(ie){if(F[ie.id()])return F[ie.id()];for(var ye=Ht(ie).depth,he=ie.neighborhood(),Ce=0,be=0,Ae=0;Ae<he.length;Ae++){var Re=he[Ae];if(!(Re.isEdge()||Re.isParent()||!a.has(Re))){var Ke=Ht(Re);if(Ke!=null){var qe=Ke.index,_e=Ke.depth;if(!(qe==null||_e==null)){var ke=p[_e].length;_e<ye&&(Ce+=qe/ke,be++)}}}}return be=Math.max(1,be),Ce=Ce/be,be===0&&(Ce=0),F[ie.id()]=Ce,Ce},J=function(ie,ye){var he=Z(ie),Ce=Z(ye),be=he-Ce;return be===0?gv(ie.id(),ye.id()):be};r.depthSort!==void 0&&(J=r.depthSort);for(var U=p.length,j=0;j<U;j++)p[j].sort(J),T(j);for(var re=[],ne=0;ne<x.length;ne++)re.push(x[ne]);var W=function(){for(var ie=0;ie<U;ie++)T(ie)};re.length&&(p.unshift(re),U=p.length,W());for(var z=0,q=0;q<U;q++)z=Math.max(p[q].length,z);var X={x:u.x1+u.w/2,y:u.y1+u.h/2},Y=a.reduce(function(pe,ie){return(function(ye){return{w:pe.w===-1?ye.w:(pe.w+ye.w)/2,h:pe.h===-1?ye.h:(pe.h+ye.h)/2}})(ie.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ae=Math.max(U===1?0:s?(u.h-r.padding*2-Y.h)/(U-1):(u.h-r.padding*2-Y.h)/(U+1),I),ve=p.reduce(function(pe,ie){return Math.max(pe,ie.length)},0),Ne=function(ie){var ye=Ht(ie),he=ye.depth,Ce=ye.index;if(r.circle){var be=Math.min(u.w/2/U,u.h/2/U);be=Math.max(be,I);var Ae=be*he+be-(U>0&&p[0].length<=3?be/2:0),Re=2*Math.PI/p[he].length*Ce;return he===0&&p[0].length===1&&(Ae=1),{x:X.x+Ae*Math.cos(Re),y:X.y+Ae*Math.sin(Re)}}else{var Ke=p[he].length,qe=Math.max(Ke===1?0:s?(u.w-r.padding*2-Y.w)/((r.grid?ve:Ke)-1):(u.w-r.padding*2-Y.w)/((r.grid?ve:Ke)+1),I),_e={x:X.x+(Ce+1-(Ke+1)/2)*qe,y:X.y+(he+1-(U+1)/2)*ae};return _e}},Se={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Se).indexOf(r.direction)===-1&&Ue("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Se).join(", ")));var we=function(ie){return uh(Ne(ie),u,Se[r.direction])};return t.nodes().layoutPositions(this,r,we),this};var Qp={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ef(r){this.options=ge({},Qp,r)}Ef.prototype.run=function(){var r=this.options,e=r,t=r.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 o=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),v,f=0,c=0;c<i.length;c++){var d=i[c],h=d.layoutDimensions(e),y=h.w,g=h.h;f=Math.max(f,y,g)}if(te(e.radius)?v=e.radius:i.length<=1?v=0:v=Math.min(o.h,o.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var p=Math.cos(l)-Math.cos(0),m=Math.sin(l)-Math.sin(0),b=Math.sqrt(f*f/(p*p+m*m));v=Math.max(b,v)}var w=function(C,E){var T=e.startAngle+E*l*(n?1:-1),k=v*Math.cos(T),D=v*Math.sin(T),A={x:s.x+k,y:s.y+D};return A};return a.nodes().layoutPositions(this,e,w),this};var Jp={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Cf(r){this.options=ge({},Jp,r)}Cf.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),o=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,v=0;v<i.length;v++){var f=i[v],c=void 0;c=e.concentric(f),u.push({value:c,node:f}),f._private.scratch.concentric=c}i.updateStyle();for(var d=0;d<i.length;d++){var h=i[d],y=h.layoutDimensions(e);l=Math.max(l,y.w,y.h)}u.sort(function(ae,ve){return ve.value-ae.value});for(var g=e.levelWidth(i),p=[[]],m=p[0],b=0;b<u.length;b++){var w=u[b];if(m.length>0){var x=Math.abs(m[0].value-w.value);x>=g&&(m=[],p.push(m))}m.push(w)}var C=l+e.minNodeSpacing;if(!e.avoidOverlap){var E=p.length>0&&p[0].length>1,T=Math.min(o.w,o.h)/2-C,k=T/(p.length+E?1:0);C=Math.min(C,k)}for(var D=0,A=0;A<p.length;A++){var P=p[A],B=e.sweep===void 0?2*Math.PI-2*Math.PI/P.length:e.sweep,R=P.dTheta=B/Math.max(1,P.length-1);if(P.length>1&&e.avoidOverlap){var M=Math.cos(R)-Math.cos(0),I=Math.sin(R)-Math.sin(0),L=Math.sqrt(C*C/(M*M+I*I));D=Math.max(L,D)}P.r=D,D+=C}if(e.equidistant){for(var O=0,G=0,_=0;_<p.length;_++){var N=p[_],F=N.r-G;O=Math.max(O,F)}G=0;for(var Z=0;Z<p.length;Z++){var J=p[Z];Z===0&&(G=J.r),J.r=G,G+=O}}for(var U={},j=0;j<p.length;j++)for(var re=p[j],ne=re.dTheta,W=re.r,z=0;z<re.length;z++){var q=re[z],X=e.startAngle+(t?1:-1)*ne*z,Y={x:s.x+W*Math.cos(X),y:s.y+W*Math.sin(X)};U[q.node.id()]=Y}return n.nodes().layoutPositions(this,e,function(ae){var ve=ae.id();return U[ve]}),this};var Po,jp={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){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 ai(r){this.options=ge({},jp,r),this.options.layout=this;var e=this.options.eles.nodes(),t=this.options.eles.edges(),a=t.filter(function(n){var i=n.source().data("id"),o=n.target().data("id"),s=e.hasElementWithId(i),u=e.hasElementWithId(o);return!s||!u});this.options.eles=this.options.eles.not(a)}ai.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?Po=!0:Po=!1;var a=ey(e,t,r);Po&&ty(a),r.randomize&&ay(a);var n=Jr(),i=function(){ny(a,e,r),r.fit===!0&&e.fit(r.padding)},o=function(c){return!(t.stopped||c>=r.numIter||(iy(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature<r.minTemp))},s=function(){if(r.animate===!0||r.animate===!1)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var c=r.eles.nodes(),d=Sf(a,r,c);c.layoutPositions(t,r,d)}},u=0,l=!0;if(r.animate===!0){var v=function(){for(var c=0;l&&c<r.refresh;)l=o(u),u++,c++;if(!l)zl(a,r),s();else{var d=Jr();d-n>=r.animationThreshold&&i(),Dn(v)}};v()}else{for(;l;)l=o(u),u++;zl(a,r),s()}return this};ai.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};ai.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var ey=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=yr(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=a.eles.components(),l={},v=0;v<u.length;v++)for(var f=u[v],c=0;c<f.length;c++){var d=f[c];l[d.id()]=v}for(var v=0;v<s.nodeSize;v++){var h=i[v],y=h.layoutDimensions(a),g={};g.isLocked=h.locked(),g.id=h.data("id"),g.parentId=h.data("parent"),g.cmptId=l[h.id()],g.children=[],g.positionX=h.position("x"),g.positionY=h.position("y"),g.offsetX=0,g.offsetY=0,g.height=y.w,g.width=y.h,g.maxX=g.positionX+g.width/2,g.minX=g.positionX-g.width/2,g.maxY=g.positionY+g.height/2,g.minY=g.positionY-g.height/2,g.padLeft=parseFloat(h.style("padding")),g.padRight=parseFloat(h.style("padding")),g.padTop=parseFloat(h.style("padding")),g.padBottom=parseFloat(h.style("padding")),g.nodeRepulsion=Ye(a.nodeRepulsion)?a.nodeRepulsion(h):a.nodeRepulsion,s.layoutNodes.push(g),s.idToIndex[g.id]=v}for(var p=[],m=0,b=-1,w=[],v=0;v<s.nodeSize;v++){var h=s.layoutNodes[v],x=h.parentId;x!=null?s.layoutNodes[s.idToIndex[x]].children.push(h.id):(p[++b]=h.id,w.push(h.id))}for(s.graphSet.push(w);m<=b;){var C=p[m++],E=s.idToIndex[C],d=s.layoutNodes[E],T=d.children;if(T.length>0){s.graphSet.push(T);for(var v=0;v<T.length;v++)p[++b]=T[v]}}for(var v=0;v<s.graphSet.length;v++)for(var k=s.graphSet[v],c=0;c<k.length;c++){var D=s.idToIndex[k[c]];s.indexToGraph[D]=v}for(var v=0;v<s.edgeSize;v++){var A=n[v],P={};P.id=A.data("id"),P.sourceId=A.data("source"),P.targetId=A.data("target");var B=Ye(a.idealEdgeLength)?a.idealEdgeLength(A):a.idealEdgeLength,R=Ye(a.edgeElasticity)?a.edgeElasticity(A):a.edgeElasticity,M=s.idToIndex[P.sourceId],I=s.idToIndex[P.targetId],L=s.indexToGraph[M],O=s.indexToGraph[I];if(L!=O){for(var G=ry(P.sourceId,P.targetId,s),_=s.graphSet[G],N=0,g=s.layoutNodes[M];_.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],N++;for(g=s.layoutNodes[I];_.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],N++;B*=N*a.nestingFactor}P.idealLength=B,P.elasticity=R,s.layoutEdges.push(P)}return s},ry=function(e,t,a){var n=Tf(e,t,0,a);return 2>n.count?0:n.graph},Tf=function(e,t,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:a};for(var o=0,s=0;s<i.length;s++){var u=i[s],l=n.idToIndex[u],v=n.layoutNodes[l].children;if(v.length!==0){var f=n.indexToGraph[n.idToIndex[v[0]]],c=Tf(e,t,f,n);if(c.count!==0)if(c.count===1){if(o++,o===2)break}else return c}}return{count:o,graph:a}},ty,ay=function(e,t){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*a,o.positionY=Math.random()*n)}},Sf=function(e,t,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(a.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(t.boundingBox){var l=i.w===0?.5:(u.positionX-i.x1)/i.w,v=i.h===0?.5:(u.positionY-i.y1)/i.h;return{x:n.x1+l*n.w,y:n.y1+v*n.h}}else return{x:u.positionX,y:u.positionY}}},ny=function(e,t,a){var n=a.layout,i=a.eles.nodes(),o=Sf(e,a,i);i.positions(o),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},iy=function(e,t,a){oy(e,t),ly(e),vy(e,t),fy(e),cy(e)},oy=function(e,t){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];sy(s,l,e,t)}},Nl=function(e){return-e+2*e*Math.random()},sy=function(e,t,a,n){var i=e.cmptId,o=t.cmptId;if(!(i!==o&&!a.isCompound)){var s=t.positionX-e.positionX,u=t.positionY-e.positionY,l=1;s===0&&u===0&&(s=Nl(l),u=Nl(l));var v=uy(e,t,s,u);if(v>0)var f=n.nodeOverlap*v,c=Math.sqrt(s*s+u*u),d=f*s/c,h=f*u/c;else var y=zn(e,s,u),g=zn(t,-1*s,-1*u),p=g.x-y.x,m=g.y-y.y,b=p*p+m*m,c=Math.sqrt(b),f=(e.nodeRepulsion+t.nodeRepulsion)/b,d=f*p/c,h=f*m/c;e.isLocked||(e.offsetX-=d,e.offsetY-=h),t.isLocked||(t.offsetX+=d,t.offsetY+=h)}},uy=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var o=e.maxY-t.minY;else var o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},zn=function(e,t,a){var n=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=a/t,l=o/s,v={};return t===0&&0<a||t===0&&0>a?(v.x=n,v.y=i+o/2,v):0<t&&-1*l<=u&&u<=l?(v.x=n+s/2,v.y=i+s*a/2/t,v):0>t&&-1*l<=u&&u<=l?(v.x=n-s/2,v.y=i-s*a/2/t,v):0<a&&(u<=-1*l||u>=l)?(v.x=n+o*t/2/a,v.y=i+o/2,v):(0>a&&(u<=-1*l||u>=l)&&(v.x=n-o*t/2/a,v.y=i-o/2),v)},ly=function(e,t){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],o=e.layoutNodes[i],s=e.idToIndex[n.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,v=u.positionY-o.positionY;if(!(l===0&&v===0)){var f=zn(o,l,v),c=zn(u,-1*l,-1*v),d=c.x-f.x,h=c.y-f.y,y=Math.sqrt(d*d+h*h),g=Math.pow(n.idealLength-y,2)/n.elasticity;if(y!==0)var p=g*d/y,m=g*h/y;else var p=0,m=0;o.isLocked||(o.offsetX+=p,o.offsetY+=m),u.isLocked||(u.offsetX-=p,u.offsetY-=m)}}},vy=function(e,t){if(t.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],o=i.length;if(n===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],v=e.layoutNodes[e.idToIndex[l.parentId]],s=v.positionX,u=v.positionY;for(var f=0;f<o;f++){var c=e.layoutNodes[e.idToIndex[i[f]]];if(!c.isLocked){var d=s-c.positionX,h=u-c.positionY,y=Math.sqrt(d*d+h*h);if(y>a){var g=t.gravity*d/y,p=t.gravity*h/y;c.offsetX+=g,c.offsetY+=p}}}}},fy=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var o=a[n++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var v=u.offsetX,f=u.offsetY,c=0;c<l.length;c++){var d=e.layoutNodes[e.idToIndex[l[c]]];d.offsetX+=v,d.offsetY+=f,a[++i]=l[c]}u.offsetX=0,u.offsetY=0}}},cy=function(e,t){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=hy(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,kf(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)}},hy=function(e,t,a){var n=Math.sqrt(e*e+t*t);if(n>a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},kf=function(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.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 kf(n,t)}},zl=function(e,t){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var o=a[i],s=o.cmptId,u=n[s]=n[s]||[];u.push(o)}for(var l=0,i=0;i<n.length;i++){var v=n[i];if(v){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var f=0;f<v.length;f++){var c=v[f];v.x1=Math.min(v.x1,c.positionX-c.width/2),v.x2=Math.max(v.x2,c.positionX+c.width/2),v.y1=Math.min(v.y1,c.positionY-c.height/2),v.y2=Math.max(v.y2,c.positionY+c.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,l+=v.w*v.h}}n.sort(function(m,b){return b.w*b.h-m.w*m.h});for(var d=0,h=0,y=0,g=0,p=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var v=n[i];if(v){for(var f=0;f<v.length;f++){var c=v[f];c.isLocked||(c.positionX+=d-v.x1,c.positionY+=h-v.y1)}d+=v.w+t.componentSpacing,y+=v.w+t.componentSpacing,g=Math.max(g,v.h),y>p&&(h+=g+t.componentSpacing,d=0,y=0,g=0)}}},dy={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Df(r){this.options=ge({},dy,r)}Df.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(Z){return{x:i.x1,y:i.y1}});else{var o=n.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),v=function(J){if(J==null)return Math.min(u,l);var U=Math.min(u,l);U==u?u=J:l=J},f=function(J){if(J==null)return Math.max(u,l);var U=Math.max(u,l);U==u?u=J:l=J},c=e.rows,d=e.cols!=null?e.cols:e.columns;if(c!=null&&d!=null)u=c,l=d;else if(c!=null&&d==null)u=c,l=Math.ceil(o/u);else if(c==null&&d!=null)l=d,u=Math.ceil(o/l);else if(l*u>o){var h=v(),y=f();(h-1)*y>=o?v(h-1):(y-1)*h>=o&&f(y-1)}else for(;l*u<o;){var g=v(),p=f();(p+1)*g>=o?f(p+1):v(g+1)}var m=i.w/l,b=i.h/u;if(e.condense&&(m=0,b=0),e.avoidOverlap)for(var w=0;w<n.length;w++){var x=n[w],C=x._private.position;(C.x==null||C.y==null)&&(C.x=0,C.y=0);var E=x.layoutDimensions(e),T=e.avoidOverlapPadding,k=E.w+T,D=E.h+T;m=Math.max(m,k),b=Math.max(b,D)}for(var A={},P=function(J,U){return!!A["c-"+J+"-"+U]},B=function(J,U){A["c-"+J+"-"+U]=!0},R=0,M=0,I=function(){M++,M>=l&&(M=0,R++)},L={},O=0;O<n.length;O++){var G=n[O],_=e.position(G);if(_&&(_.row!==void 0||_.col!==void 0)){var N={row:_.row,col:_.col};if(N.col===void 0)for(N.col=0;P(N.row,N.col);)N.col++;else if(N.row===void 0)for(N.row=0;P(N.row,N.col);)N.row++;L[G.id()]=N,B(N.row,N.col)}}var F=function(J,U){var j,re;if(J.locked()||J.isParent())return!1;var ne=L[J.id()];if(ne)j=ne.col*m+m/2+i.x1,re=ne.row*b+b/2+i.y1;else{for(;P(R,M);)I();j=M*m+m/2+i.x1,re=R*b+b/2+i.y1,B(R,M),I()}return{x:j,y:re}};n.layoutPositions(this,e,F)}return this};var gy={ready:function(){},stop:function(){}};function Es(r){this.options=ge({},gy,r)}Es.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this};Es.prototype.stop=function(){return this};var py={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Bf(r){this.options=ge({},py,r)}Bf.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),a=Ye(r.positions);function n(i){if(r.positions==null)return Ih(i.position());if(a)return r.positions(i);var o=r.positions[i._private.data.id];return o??null}return t.layoutPositions(this,r,function(i,o){var s=n(i);return i.locked()||s==null?!1:s}),this};var yy={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Pf(r){this.options=ge({},yy,r)}Pf.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,a=yr(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(o,s){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return t.nodes().layoutPositions(this,r,n),this};var my=[{name:"breadthfirst",impl:xf},{name:"circle",impl:Ef},{name:"concentric",impl:Cf},{name:"cose",impl:ai},{name:"grid",impl:Df},{name:"null",impl:Es},{name:"preset",impl:Bf},{name:"random",impl:Pf}];function Af(r){this.options=r,this.notifications=0}var Fl=function(){},Vl=function(){throw new Error("A headless instance can not render images")};Af.prototype={recalculateRenderedStyle:Fl,notify:function(){this.notifications++},init:Fl,isHeadless:function(){return!0},getAllInBox:function(){return[]},hitTestAt:function(){return[]},png:Vl,jpg:Vl};var Cs={};Cs.arrowShapeWidth=.3;Cs.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(l,v,f,c,d,h,y){var g=d.x-f/2-y,p=d.x+f/2+y,m=d.y-f/2-y,b=d.y+f/2+y,w=g<=l&&l<=p&&m<=v&&v<=b;return w},a=function(l,v,f,c,d){var h=l*Math.cos(c)-v*Math.sin(c),y=l*Math.sin(c)+v*Math.cos(c),g=h*f,p=y*f,m=g+d.x,b=p+d.y;return{x:m,y:b}},n=function(l,v,f,c){for(var d=[],h=0;h<l.length;h+=2){var y=l[h],g=l[h+1];d.push(a(y,g,v,f,c))}return d},i=function(l){for(var v=[],f=0;f<l.length;f++){var c=l[f];v.push(c.x,c.y)}return v},o=function(l,v){return l.pstyle("width").pfValue*Lr(l,v)*2},s=function(l,v){ce(v)&&(v=r[v]),r[l]=ge({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(c,d,h,y,g,p){var m=i(n(this.points,h+2*p,y,g)),b=kr(c,d,m);return b},roughCollide:t,draw:function(c,d,h,y){var g=n(this.points,d,h,y);e.arrowShapeImpl("polygon")(c,g)},spacing:function(c,d){return 0},gap:o},v)};s("none",{collide:Pn,roughCollide:Pn,draw:ls,spacing:Zs,gap:Zs}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(l,v,f,c,d){var h=n(this.points,v,f,c),y=this.controlPoint,g=a(y[0],y[1],v,f,c);e.arrowShapeImpl(this.name)(l,h,g)},gap:function(l,v){return o(l,v)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,v,f,c,d,h,y){var g=i(n(this.points,f+2*y,c,d)),p=i(n(this.pointsTee,f+2*y,c,d)),m=kr(l,v,g)||kr(l,v,p);return m},draw:function(l,v,f,c,d){var h=n(this.points,v,f,c),y=n(this.pointsTee,v,f,c);e.arrowShapeImpl(this.name)(l,h,y)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,v,f,c,d,h,y){var g=d,p=Math.pow(g.x-l,2)+Math.pow(g.y-v,2)<=Math.pow((f+2*y)*this.radius,2),m=i(n(this.points,f+2*y,c,d));return kr(l,v,m)||p},draw:function(l,v,f,c,d){var h=n(this.pointsTr,v,f,c);e.arrowShapeImpl(this.name)(l,h,c.x,c.y,this.radius*v)},spacing:function(l,v){return e.getArrowWidth(l.pstyle("width").pfValue,Lr(l,v))*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,v){var f=this.baseCrossLinePts.slice(),c=v/l,d=3,h=5;return f[d]=f[d]-c,f[h]=f[h]-c,f},collide:function(l,v,f,c,d,h,y){var g=i(n(this.points,f+2*y,c,d)),p=i(n(this.crossLinePts(f,h),f+2*y,c,d)),m=kr(l,v,g)||kr(l,v,p);return m},draw:function(l,v,f,c,d){var h=n(this.points,v,f,c),y=n(this.crossLinePts(v,d),v,f,c);e.arrowShapeImpl(this.name)(l,h,y)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l,v){return o(l,v)*.525}}),s("circle",{radius:.15,collide:function(l,v,f,c,d,h,y){var g=d,p=Math.pow(g.x-l,2)+Math.pow(g.y-v,2)<=Math.pow((f+2*y)*this.radius,2);return p},draw:function(l,v,f,c,d){e.arrowShapeImpl(this.name)(l,c.x,c.y,this.radius*v)},spacing:function(l,v){return e.getArrowWidth(l.pstyle("width").pfValue,Lr(l,v))*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l,v){return 1},gap:function(l,v){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l,v){return l.pstyle("width").pfValue*Lr(l,v)}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l,v){return .95*l.pstyle("width").pfValue*Lr(l,v)}})};var Or={};Or.projectIntoViewport=function(r,e){var t=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],o=a[4],s=t.pan(),u=t.zoom(),l=((r-n)/o-s.x)/u,v=((e-i)/o-s.y)/u;return[l,v]};Or.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),a=function(p){return parseFloat(t.getPropertyValue(p))},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")},o=r.clientWidth,s=r.clientHeight,u=n.left+n.right,l=n.top+n.bottom,v=i.left+i.right,f=e.width/(o+v),c=o-u,d=s-l,h=e.left+n.left+i.left,y=e.top+n.top+i.top;return this.containerBB=[h,y,c,d,f]};Or.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Or.getLabelHitPolygon=function(r,e,t){var a=r._private,n=e?e+"-":"";r.boundingBox();var i=a.labelBounds[e||"main"];if(!i)return null;var o=pr(a.rscratch,"labelX",e),s=pr(a.rscratch,"labelY",e),u=pr(a.rscratch,"labelAngle",e),l=r.pstyle(n+"text-margin-x").pfValue,v=r.pstyle(n+"text-margin-y").pfValue;return Vv(i,o,s,u,l,v,t)};Or.checkLabelHitAt=function(r,e,t,a,n){var i=a?a+"-":"",o=r.pstyle(i+"label").value,s=r.pstyle("text-events").strValue==="yes";if(!s||!o)return!1;var u=this.getLabelHitPolygon(r,a,n);if(!u)return!1;for(var l=[],v=0;v<u.length;v++)l.push(u[v].x,u[v].y);return kr(e,t,l)};Or.checkNodeHitAt=function(r,e,t,a){var n=this,i=r.outerWidth()+2*a,o=r.outerHeight()+2*a,s=r.position();if(s.x-i/2<=e&&e<=s.x+i/2&&s.y-o/2<=t&&t<=s.y+o/2){var u=r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,l=n.nodeShapes[n.getNodeShape(r)];return l.checkPoint(e,t,0,i,o,s.x,s.y,u,r._private.rscratch)}return!1};Or.checkEdgeHitAt=function(r,e,t,a){var n=this,i=r._private,o=i.rscratch,s=r.pstyle("width").pfValue,u=s/2+a,l=u*u,v=u*2,f;if(o.edgeType==="segments"||o.edgeType==="straight"||o.edgeType==="haystack"){for(var c=o.allpts,d=0;d+3<c.length;d+=2)if(Lv(e,t,c[d],c[d+1],c[d+2],c[d+3],v)&&l>(f=Nv(e,t,c[d],c[d+1],c[d+2],c[d+3])))return{sqDist:f}}else if(o.edgeType==="bezier"||o.edgeType==="multibezier"||o.edgeType==="self"||o.edgeType==="compound"){for(var h=o.allpts,y=0;y+5<h.length;y+=4)if(Iv(e,t,h[y],h[y+1],h[y+2],h[y+3],h[y+4],h[y+5],v)&&l>(f=Ov(e,t,h[y],h[y+1],h[y+2],h[y+3],h[y+4],h[y+5])))return{sqDist:f}}for(var g=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}],p=0;p<g.length;p++){var m=g[p],b=n.arrowShapes[r.pstyle(m.name+"-arrow-shape").value],w=s,x=n.getArrowWidth(s,Lr(r,m.name));if(b.roughCollide(e,t,x,m.angle,{x:m.x,y:m.y},w,a)&&b.collide(e,t,x,m.angle,{x:m.x,y:m.y},w,a))return{sqDist:null}}return null};Or.hitTestAt=function(r,e,t,a){for(var n=this,i=n.cy.zoom(),o=a||{},s=o.isTouch,u=o.includeBody!==!1,l=o.includeMainLabels!==!1,v=o.includeSourceLabels!==!1,f=o.includeTargetLabels!==!1,c=(s?8:2)/i,d=(s?8:2)/i,h=(s?24:8)/i,y=new Set,g=0;g<t.length;g++)y.add(t[g]._private.data.id);for(var p=n.getCachedZSortedEles().interactive,m=[],b=p.length-1;b>=0;b--){var w=p[b];if(y.has(w._private.data.id)){var x=!1;w.isNode()?(u&&(x=n.checkNodeHitAt(w,r,e,c)),!x&&l&&(x=n.checkLabelHitAt(w,r,e,null,d))):(u&&(x=n.checkEdgeHitAt(w,r,e,h)!=null),!x&&l&&(x=n.checkLabelHitAt(w,r,e,null,d)),!x&&v&&(x=n.checkLabelHitAt(w,r,e,"source",d)),!x&&f&&(x=n.checkLabelHitAt(w,r,e,"target",d))),x&&m.push(w)}}return m};Or.findNearestElement=function(r,e,t,a){return this.findNearestElements(r,e,t,a)[0]};Or.findNearestElements=function(r,e,t,a){var n=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),v=(a?24:8)/u,f=(a?8:2)/u,c=(a?8:2)/u,d=1/0,h,y;t&&(o=o.interactive);function g(C,E){if(C.isNode()){if(y)return;y=C,s.push(C)}if(C.isEdge()&&(E==null||E<d))if(h){if(h.pstyle("z-compound-depth").value===C.pstyle("z-compound-depth").value&&h.pstyle("z-compound-depth").value===C.pstyle("z-compound-depth").value){for(var T=0;T<s.length;T++)if(s[T].isEdge()){s[T]=C,h=C,d=E??d;break}}}else s.push(C),h=C,d=E??d}function p(C){if(i.checkNodeHitAt(C,r,e,f))return g(C,0),!0}function m(C){var E=C._private,T=E.rscratch,k=C.pstyle("width").pfValue,D=k/2+v,A=D*D,P=D*2,I=E.source,L=E.target,B;if(T.edgeType==="segments"||T.edgeType==="straight"||T.edgeType==="haystack"){for(var R=T.allpts,M=0;M+3<R.length;M+=2)if(Lv(r,e,R[M],R[M+1],R[M+2],R[M+3],P)&&A>(B=Nv(r,e,R[M],R[M+1],R[M+2],R[M+3])))return g(C,B),!0}else if(T.edgeType==="bezier"||T.edgeType==="multibezier"||T.edgeType==="self"||T.edgeType==="compound"){for(var R=T.allpts,M=0;M+5<T.allpts.length;M+=4)if(Iv(r,e,R[M],R[M+1],R[M+2],R[M+3],R[M+4],R[M+5],P)&&A>(B=Ov(r,e,R[M],R[M+1],R[M+2],R[M+3],R[M+4],R[M+5])))return g(C,B),!0}for(var I=I||E.source,L=L||E.target,O=[{name:"source",x:T.arrowStartX,y:T.arrowStartY,angle:T.srcArrowAngle},{name:"target",x:T.arrowEndX,y:T.arrowEndY,angle:T.tgtArrowAngle},{name:"mid-source",x:T.midX,y:T.midY,angle:T.midsrcArrowAngle},{name:"mid-target",x:T.midX,y:T.midY,angle:T.midtgtArrowAngle}],M=0;M<O.length;M++){var G=O[M],_=i.arrowShapes[C.pstyle(G.name+"-arrow-shape").value],N=C.pstyle("width").pfValue,F=n.getArrowWidth(k,Lr(C,G.name));if(_.roughCollide(r,e,F,G.angle,{x:G.x,y:G.y},N,v)&&_.collide(r,e,F,G.angle,{x:G.x,y:G.y},N,v))return g(C),!0}l&&s.length>0&&(p(I),p(L))}function b(C,E){if(n.checkLabelHitAt(C,r,e,E,c))return g(C),!0}for(var w=o.length-1;w>=0;w--){var x=o[w];x.isNode()?p(x)||b(x):m(x)||b(x)||b(x,"source")||b(x,"target")}return s};Or.getAllInBox=function(r,e,t,a){var n=this,i=this.getCachedZSortedEles().interactive,o=this.cy.zoom(),s=2/o,u=[],l=Math.min(r,t),v=Math.max(r,t),f=Math.min(e,a),c=Math.max(e,a);r=l,t=v,e=f,a=c;var d=yr({x1:r,y1:e,x2:t,y2:a}),h=[{x:d.x1,y:d.y1},{x:d.x2,y:d.y1},{x:d.x2,y:d.y2},{x:d.x1,y:d.y2}],y=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function g(Y,ae){return n.getLabelHitPolygon(Y,ae,s)}function p(Y,ae,ve,Ne){function Se(we,pe,ie){return(ie.y-we.y)*(pe.x-we.x)>(pe.y-we.y)*(ie.x-we.x)}return Se(Y,ve,Ne)!==Se(ae,ve,Ne)&&Se(Y,ae,ve)!==Se(Y,ae,Ne)}for(var m=0;m<i.length;m++){var b=i[m];if(b.isNode()){var w=b,x=w.pstyle("text-events").strValue==="yes",C=w.pstyle("box-selection").strValue,E=w.pstyle("box-select-labels").strValue==="yes";if(C==="none")continue;var T=(C==="overlap"||E)&&x,k=w.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:T});if(C==="contain"){var D=!1;if(E&&x){var A=g(w);A&&Sa(A,h)&&(u.push(w),D=!0)}!D&&Rv(d,k)&&u.push(w)}else if(C==="overlap"&&cs(d,k)){var P=w.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),B=[{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}];if(Sa(B,h))u.push(w);else{var R=g(w);R&&Sa(R,h)&&u.push(w)}}}else{var M=b,I=M._private,L=I.rscratch,O=M.pstyle("box-selection").strValue;if(O==="none")continue;if(O==="contain"){if(L.startX!=null&&L.startY!=null&&!Rt(d,L.startX,L.startY)||L.endX!=null&&L.endY!=null&&!Rt(d,L.endX,L.endY))continue;if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"||L.edgeType==="segments"||L.edgeType==="haystack"){for(var G=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts,_=!0,N=0;N<G.length;N++)if(!au(d,G[N])){_=!1;break}_&&u.push(M)}else L.edgeType==="straight"&&u.push(M)}else if(O==="overlap"){var F=!1;if(L.startX!=null&&L.startY!=null&&L.endX!=null&&L.endY!=null&&(Rt(d,L.startX,L.startY)||Rt(d,L.endX,L.endY)))u.push(M),F=!0;else if(!F&&L.edgeType==="haystack"){for(var Z=I.rstyle.haystackPts,J=0;J<Z.length;J++)if(au(d,Z[J])){u.push(M),F=!0;break}}if(!F){var U=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts;if((!U||U.length<2)&&L.edgeType==="straight"&&L.startX!=null&&L.startY!=null&&L.endX!=null&&L.endY!=null&&(U=[{x:L.startX,y:L.startY},{x:L.endX,y:L.endY}]),!U||U.length<2)continue;for(var j=0;j<U.length-1;j++){for(var re=U[j],ne=U[j+1],W=0;W<y.length;W++){var z=er(y[W],2),q=z[0],X=z[1];if(p(re,ne,q,X)){u.push(M),F=!0;break}}if(F)break}}}}}return u};var Fn={};Fn.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,v,f,c,d,p,m;if(t?(v=e.haystackPts[0],f=e.haystackPts[1],c=e.haystackPts[2],d=e.haystackPts[3]):(v=e.arrowStartX,f=e.arrowStartY,c=e.arrowEndX,d=e.arrowEndY),p=e.midX,m=e.midY,i)u=v-e.segpts[0],l=f-e.segpts[1];else if(n||o||s||a){var h=e.allpts,y=ur(h[0],h[2],h[4],.1),g=ur(h[1],h[3],h[5],.1);u=v-y,l=f-g}else u=v-p,l=f-m;e.srcArrowAngle=rn(u,l);var p=e.midX,m=e.midY;if(t&&(p=(v+c)/2,m=(f+d)/2),u=c-v,l=d-f,i){var h=e.allpts;if(h.length/2%2===0){var b=h.length/2,w=b-2;u=h[b]-h[w],l=h[b+1]-h[w+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var b=h.length/2-1,w=b-2;u=h[b]-h[w],l=h[b+1]-h[w+1]}}else if(n||o||s){var h=e.allpts,x=e.ctrlpts,C,E,T,k;if(x.length/2%2===0){var D=h.length/2-1,A=D+2,P=A+2;C=ur(h[D],h[A],h[P],0),E=ur(h[D+1],h[A+1],h[P+1],0),T=ur(h[D],h[A],h[P],1e-4),k=ur(h[D+1],h[A+1],h[P+1],1e-4)}else{var A=h.length/2-1,D=A-2,P=A+2;C=ur(h[D],h[A],h[P],.4999),E=ur(h[D+1],h[A+1],h[P+1],.4999),T=ur(h[D],h[A],h[P],.5),k=ur(h[D+1],h[A+1],h[P+1],.5)}u=T-C,l=k-E}if(e.midtgtArrowAngle=rn(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var h=e.allpts;if(h.length/2%2!==0){if(!e.isRound){var b=h.length/2-1,B=b+2;u=-(h[B]-h[b]),l=-(h[B+1]-h[b+1])}}}if(e.midsrcArrowAngle=rn(u,l),i)u=c-e.segpts[e.segpts.length-2],l=d-e.segpts[e.segpts.length-1];else if(n||o||s||a){var h=e.allpts,R=h.length,y=ur(h[R-6],h[R-4],h[R-2],.9),g=ur(h[R-5],h[R-3],h[R-1],.9);u=c-y,l=d-g}else u=c-p,l=d-m;e.tgtArrowAngle=rn(u,l)};Fn.getArrowWidth=Fn.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},a=t[r+", "+e];return a||(a=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=a,a)};var Yo,Zo,Hr={},Rr={},ql,_l,At,xn,Zr,St,Bt,_r,Wt,vn,Rf,Mf,Qo,Jo,Gl,Hl=function(e,t,a){a.x=t.x-e.x,a.y=t.y-e.y,a.len=Math.sqrt(a.x*a.x+a.y*a.y),a.nx=a.x/a.len,a.ny=a.y/a.len,a.ang=Math.atan2(a.ny,a.nx)},by=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},wy=function(e,t,a,n,i){if(e!==Gl?Hl(t,e,Hr):by(Rr,Hr),Hl(t,a,Rr),ql=Hr.nx*Rr.ny-Hr.ny*Rr.nx,_l=Hr.nx*Rr.nx-Hr.ny*-Rr.ny,Zr=Math.asin(Math.max(-1,Math.min(1,ql))),Math.abs(Zr)<1e-6){Yo=t.x,Zo=t.y,Bt=Wt=0;return}At=1,xn=!1,_l<0?Zr<0?Zr=Math.PI+Zr:(Zr=Math.PI-Zr,At=-1,xn=!0):Zr>0&&(At=-1,xn=!0),t.radius!==void 0?Wt=t.radius:Wt=n,St=Zr/2,vn=Math.min(Hr.len/2,Rr.len/2),i?(_r=Math.abs(Math.cos(St)*Wt/Math.sin(St)),_r>vn?(_r=vn,Bt=Math.abs(_r*Math.sin(St)/Math.cos(St))):Bt=Wt):(_r=Math.min(vn,Wt),Bt=Math.abs(_r*Math.sin(St)/Math.cos(St))),Qo=t.x+Rr.nx*_r,Jo=t.y+Rr.ny*_r,Yo=Qo-Rr.ny*Bt*At,Zo=Jo+Rr.nx*Bt*At,Rf=t.x+Hr.nx*_r,Mf=t.y+Hr.ny*_r,Gl=t};function Lf(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Ts(r,e,t,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(wy(r,e,t,a,n),{cx:Yo,cy:Zo,radius:Bt,startX:Rf,startY:Mf,stopX:Qo,stopY:Jo,startAngle:Hr.ang+Math.PI/2*At,endAngle:Rr.ang-Math.PI/2*At,counterClockwise:xn})}var Fa=.01,xy=Math.sqrt(2*Fa),wr={};wr.findMidptPtsEtc=function(r,e){var t=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,o=r.pstyle("source-endpoint"),s=r.pstyle("target-endpoint"),u=o.units!=null&&s.units!=null,l=function(x,C,E,T){var k=T-C,D=E-x,A=Math.sqrt(D*D+k*k);return{x:-k/A,y:D/A}},v=r.pstyle("edge-distances").value;switch(v){case"node-position":i=t;break;case"intersection":i=a;break;case"endpoints":{if(u){var f=this.manualEndptToPx(r.source()[0],o),c=er(f,2),d=c[0],h=c[1],y=this.manualEndptToPx(r.target()[0],s),g=er(y,2),p=g[0],m=g[1],b={x1:d,y1:h,x2:p,y2:m};n=l(d,h,p,m),i=b}else Fe("Edge ".concat(r.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}};wr.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],a=t._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 o=a.source,s=a.target,u=o.position(),l=s.position(),v=o.width(),f=s.width(),c=o.height(),d=s.height(),h=t.pstyle("haystack-radius").value,y=h/2;n.haystackPts=n.allpts=[n.source.x*v*y+u.x,n.source.y*c*y+u.y,n.target.x*f*y+l.x,n.target.y*d*y+l.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(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}};wr.findSegmentsPoints=function(r,e){var t=r._private.rscratch,a=r.pstyle("segment-weights"),n=r.pstyle("segment-distances"),i=r.pstyle("segment-radii"),o=r.pstyle("radius-type"),s=Math.min(a.pfValue.length,n.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var v=0;v<s;v++){var f=a.pfValue[v],c=n.pfValue[v],d=1-f,h=f,y=this.findMidptPtsEtc(r,e),g=y.midptPts,p=y.vectorNormInverse,m={x:g.x1*d+g.x2*h,y:g.y1*d+g.y2*h};t.segpts.push(m.x+p.x*c,m.y+p.y*c),t.radii.push(i.pfValue[v]!==void 0?i.pfValue[v]:u),t.isArcRadius.push((o.pfValue[v]!==void 0?o.pfValue[v]:l)==="arc-radius")}};wr.findLoopPoints=function(r,e,t,a){var n=r._private.rscratch,i=e.dirCounts,o=e.srcPos,s=r.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=r.pstyle("loop-direction").pfValue,v=r.pstyle("loop-sweep").pfValue,f=r.pstyle("control-point-step-size").pfValue;n.edgeType="self";var c=t,d=f;a&&(c=0,d=u);var h=l-Math.PI/2,y=h-v/2,g=h+v/2,p=l+"_"+v;c=i[p]===void 0?i[p]=0:++i[p],n.ctrlpts=[o.x+Math.cos(y)*1.4*d*(c/3+1),o.y+Math.sin(y)*1.4*d*(c/3+1),o.x+Math.cos(g)*1.4*d*(c/3+1),o.y+Math.sin(g)*1.4*d*(c/3+1)]};wr.findCompoundLoopPoints=function(r,e,t,a){var n=r._private.rscratch;n.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,v=e.tgtH,f=r.pstyle("control-point-step-size").pfValue,c=r.pstyle("control-point-distances"),d=c?c.pfValue[0]:void 0,h=t,y=f;a&&(h=0,y=d);var g=50,p={x:i.x-s/2,y:i.y-u/2},m={x:o.x-l/2,y:o.y-v/2},b={x:Math.min(p.x,m.x),y:Math.min(p.y,m.y)},w=.5,x=Math.max(w,Math.log(s*Fa)),C=Math.max(w,Math.log(l*Fa));n.ctrlpts=[b.x,b.y-(1+Math.pow(g,1.12)/100)*y*(h/3+1)*x,b.x-(1+Math.pow(g,1.12)/100)*y*(h/3+1)*C,b.y]};wr.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};wr.findBezierPoints=function(r,e,t,a,n){var i=r._private.rscratch,o=r.pstyle("control-point-step-size").pfValue,s=r.pstyle("control-point-distances"),u=r.pstyle("control-point-weights"),l=s&&u?Math.min(s.value.length,u.value.length):1,v=s?s.pfValue[0]:void 0,f=u.value[0],c=a;i.edgeType=c?"multibezier":"bezier",i.ctrlpts=[];for(var d=0;d<l;d++){var h=(.5-e.eles.length/2+t)*o*(n?-1:1),y=void 0,g=An(h);c&&(v=s?s.pfValue[d]:o,f=u.value[d]),a?y=v:y=v!==void 0?g*v:void 0;var p=y!==void 0?y:h,m=1-f,b=f,w=this.findMidptPtsEtc(r,e),x=w.midptPts,C=w.vectorNormInverse,E={x:x.x1*m+x.x2*b,y:x.y1*m+x.y2*b};i.ctrlpts.push(E.x+C.x*p,E.y+C.y*p)}};wr.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var a="vertical",n="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",v=e.posPts,f=e.srcW,c=e.srcH,d=e.tgtW,h=e.tgtH,y=r.pstyle("edge-distances").value,g=y!=="node-position",p=r.pstyle("taxi-direction").value,m=p,b=r.pstyle("taxi-turn"),w=b.units==="%",x=b.pfValue,C=x<0,E=r.pstyle("taxi-turn-min-distance").pfValue,T=g?(f+d)/2:0,k=g?(c+h)/2:0,D=v.x2-v.x1,A=v.y2-v.y1,P=function(Q,S){return Q>0?Math.max(Q-S,0):Math.min(Q+S,0)},B=P(D,T),R=P(A,k),M=function(Q,S,V,$){if(!g)return(Q+S)/2;var H=An(S-Q),K=Q+H*V/2,de=S-H*$/2;return H*(de-K)>=0?(K+de)/2:(Q+S)/2},I=!1;m===l?p=Math.abs(B)>Math.abs(R)?n:a:m===u||m===s?(p=a,I=!0):(m===i||m===o)&&(p=n,I=!0);var L=p===a,O=L?R:B,G=L?A:D,_=An(G),N=!1;!(I&&(w||C))&&(m===s&&G<0||m===u&&G>0||m===i&&G>0||m===o&&G<0)&&(_*=-1,O=_*Math.abs(O),N=!0);var F;if(w){var Z=x<0?1+x:x;F=Z*O}else{var J=x<0?O:0;F=J+x*_}var U=function(Q){return Math.abs(Q)<E||Math.abs(Q)>=Math.abs(O)},j=U(F),re=U(Math.abs(O)-Math.abs(F)),ne=j||re;if(ne&&!N)if(L){var W=Math.abs(G)<=c/2,z=Math.abs(D)<=d/2;if(W){var q=M(v.x1,v.x2,f,d),X=v.y1,Y=v.y2;t.segpts=[q,X,q,Y]}else if(z){var ae=M(v.y1,v.y2,c,h),ve=v.x1,Ne=v.x2;t.segpts=[ve,ae,Ne,ae]}else t.segpts=[v.x1,v.y2]}else{var Se=Math.abs(G)<=f/2,we=Math.abs(A)<=h/2;if(Se){var pe=M(v.y1,v.y2,c,h),ie=v.x1,ye=v.x2;t.segpts=[ie,pe,ye,pe]}else if(we){var he=M(v.x1,v.x2,f,d),Ce=v.y1,be=v.y2;t.segpts=[he,Ce,he,be]}else t.segpts=[v.x2,v.y1]}else if(L){var Ae=v.y1+F+(g?c/2*_:0),Re=v.x1,Ke=v.x2;t.segpts=[Re,Ae,Ke,Ae]}else{var qe=v.x1+F+(g?f/2*_:0),_e=v.y1,ke=v.y2;t.segpts=[qe,_e,qe,ke]}if(t.isRound){var le=r.pstyle("taxi-radius").value,xe=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(le),t.isArcRadius=new Array(t.segpts.length/2).fill(xe)}};wr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,v=e.tgtShape,f=e.srcCornerRadius,c=e.tgtCornerRadius,d=e.srcRs,h=e.tgtRs,y=!te(t.startX)||!te(t.startY),g=!te(t.arrowStartX)||!te(t.arrowStartY),p=!te(t.endX)||!te(t.endY),m=!te(t.arrowEndX)||!te(t.arrowEndY),b=3,w=r.pstyle("width").pfValue,x=b*this.getArrowWidth(w,Lr(r,"source"))*this.arrowShapeWidth,C=b*this.getArrowWidth(w,Lr(r,"target"))*this.arrowShapeWidth,E=It({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),T=E<x,k=!1;if(y||g||T){k=!0;var D={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},A=Math.sqrt(D.x*D.x+D.y*D.y),P={x:D.x/A,y:D.y/A},B=Math.max(i,o),R={x:t.ctrlpts[0]+P.x*2*B,y:t.ctrlpts[1]+P.y*2*B},M=l.intersectLine(a.x,a.y,i,o,R.x,R.y,0,f,d);T?(t.ctrlpts[0]=t.ctrlpts[0]+P.x*(x-E),t.ctrlpts[1]=t.ctrlpts[1]+P.y*(x-E)):(t.ctrlpts[0]=M[0]+P.x*x,t.ctrlpts[1]=M[1]+P.y*x)}var I=It({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),L=I<C;if(p||m||L){k=!0;var O={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},G=Math.sqrt(O.x*O.x+O.y*O.y),_={x:O.x/G,y:O.y/G},N=Math.max(i,o),F={x:t.ctrlpts[0]+_.x*2*N,y:t.ctrlpts[1]+_.y*2*N},Z=v.intersectLine(n.x,n.y,s,u,F.x,F.y,0,c,h);L?(t.ctrlpts[0]=t.ctrlpts[0]+_.x*(C-I),t.ctrlpts[1]=t.ctrlpts[1]+_.y*(C-I)):(t.ctrlpts[0]=Z[0]+_.x*C,t.ctrlpts[1]=Z[1]+_.y*C)}k&&this.findEndpoints(r)}};wr.storeAllpts=function(r){var e=r._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 t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+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=ur(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=ur(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.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(Ts({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var v=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[v],e.midY=e.segpts[v+1];else{var f={x:e.segpts[v],y:e.segpts[v+1]},c=e.roundCorners[v/2];if(c.radius===0){var d={x:e.segpts[v+2],y:e.segpts[v+3]};e.midX=f.x,e.midY=f.y,e.midVector=[f.y-d.y,d.x-f.x]}else{var h=[f.x-c.cx,f.y-c.cy],y=c.radius/Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2));h=h.map(function(g){return g*y}),e.midX=c.cx+h[0],e.midY=c.cy+h[1],e.midVector=h}}}}};wr.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||te(e.startX)&&te(e.startY)&&te(e.endX)&&te(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Fe("Edge `"+r.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."))};wr.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,a=t.cy,n=a.hasCompoundNodes(),i=new Qr,o=function(k,D){return[].concat(Tn(k),[D?1:0]).join("-")},s=[],u=[],l=0;l<r.length;l++){var v=r[l],f=v._private,c=v.pstyle("curve-style").value;if(!(v.removed()||!v.takesUpSpace())){if(c==="haystack"){u.push(v);continue}var d=c==="unbundled-bezier"||st(c,"segments")||c==="straight"||c==="straight-triangle"||st(c,"taxi"),h=c==="unbundled-bezier"||c==="bezier",y=f.source,g=f.target,p=y.poolIndex(),m=g.poolIndex(),b=[p,m].sort(),w=o(b,d),x=i.get(w);x==null&&(x={eles:[]},s.push({pairId:b,edgeIsUnbundled:d}),i.set(w,x)),x.eles.push(v),d&&(x.hasUnbundled=!0),h&&(x.hasBezier=!0)}}for(var C=function(){var k=s[E],D=k.pairId,A=k.edgeIsUnbundled,P=o(D,A),B=i.get(P),R;if(!B.hasUnbundled){var M=B.eles[0].parallelEdges().filter(function(le){return le.isBundledBezier()});vs(B.eles),M.forEach(function(le){return B.eles.push(le)}),B.eles.sort(function(le,xe){return le.poolIndex()-xe.poolIndex()})}var I=B.eles[0],L=I.source(),O=I.target();if(L.poolIndex()>O.poolIndex()){var G=L;L=O,O=G}var _=B.srcPos=L.position(),N=B.tgtPos=O.position(),F=B.srcW=L.outerWidth(),Z=B.srcH=L.outerHeight(),J=B.tgtW=O.outerWidth(),U=B.tgtH=O.outerHeight(),j=B.srcShape=t.nodeShapes[e.getNodeShape(L)],re=B.tgtShape=t.nodeShapes[e.getNodeShape(O)],ne=B.srcCornerRadius=L.pstyle("corner-radius").value==="auto"?"auto":L.pstyle("corner-radius").pfValue,W=B.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,z=B.tgtRs=O._private.rscratch,q=B.srcRs=L._private.rscratch;B.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var X=0;X<B.eles.length;X++){var Y=B.eles[X],ae=Y[0]._private.rscratch,ve=Y.pstyle("curve-style").value,Ne=ve==="unbundled-bezier"||st(ve,"segments")||st(ve,"taxi"),Se=!L.same(Y.source());if(!B.calculatedIntersection&&L!==O&&(B.hasBezier||B.hasUnbundled)){B.calculatedIntersection=!0;var we=j.intersectLine(_.x,_.y,F,Z,N.x,N.y,0,ne,q),pe=B.srcIntn=we,ie=re.intersectLine(N.x,N.y,J,U,_.x,_.y,0,W,z),ye=B.tgtIntn=ie,he=B.intersectionPts={x1:we[0],x2:ie[0],y1:we[1],y2:ie[1]},Ce=B.posPts={x1:_.x,x2:N.x,y1:_.y,y2:N.y},be=ie[1]-we[1],Ae=ie[0]-we[0],Re=Math.sqrt(Ae*Ae+be*be);te(Re)&&Re>=xy||(Re=Math.sqrt(Math.max(Ae*Ae,Fa)+Math.max(be*be,Fa)));var Ke=B.vector={x:Ae,y:be},qe=B.vectorNorm={x:Ke.x/Re,y:Ke.y/Re},_e={x:-qe.y,y:qe.x};B.nodesOverlap=!te(Re)||re.checkPoint(we[0],we[1],0,J,U,N.x,N.y,W,z)||j.checkPoint(ie[0],ie[1],0,F,Z,_.x,_.y,ne,q),B.vectorNormInverse=_e,R={nodesOverlap:B.nodesOverlap,dirCounts:B.dirCounts,calculatedIntersection:!0,hasBezier:B.hasBezier,hasUnbundled:B.hasUnbundled,eles:B.eles,srcPos:N,srcRs:z,tgtPos:_,tgtRs:q,srcW:J,srcH:U,tgtW:F,tgtH:Z,srcIntn:ye,tgtIntn:pe,srcShape:re,tgtShape:j,posPts:{x1:Ce.x2,y1:Ce.y2,x2:Ce.x1,y2:Ce.y1},intersectionPts:{x1:he.x2,y1:he.y2,x2:he.x1,y2:he.y1},vector:{x:-Ke.x,y:-Ke.y},vectorNorm:{x:-qe.x,y:-qe.y},vectorNormInverse:{x:-_e.x,y:-_e.y}}}var ke=Se?R:B;ae.nodesOverlap=ke.nodesOverlap,ae.srcIntn=ke.srcIntn,ae.tgtIntn=ke.tgtIntn,ae.isRound=ve.startsWith("round"),n&&(L.isParent()||L.isChild()||O.isParent()||O.isChild())&&(L.parents().anySame(O)||O.parents().anySame(L)||L.same(O)&&L.isParent())?e.findCompoundLoopPoints(Y,ke,X,Ne):L===O?e.findLoopPoints(Y,ke,X,Ne):ve.endsWith("segments")?e.findSegmentsPoints(Y,ke):ve.endsWith("taxi")?e.findTaxiPoints(Y,ke):ve==="straight"||!Ne&&B.eles.length%2===1&&X===Math.floor(B.eles.length/2)?e.findStraightEdgePoints(Y):e.findBezierPoints(Y,ke,X,Ne,Se),e.findEndpoints(Y),e.tryToCorrectInvalidPoints(Y,ke),e.checkForInvalidEdgeWarning(Y),e.storeAllpts(Y),e.storeEdgeProjections(Y),e.calculateArrowAngles(Y),e.recalculateEdgeLabelProjections(Y),e.calculateLabelAngles(Y)}},E=0;E<s.length;E++)C();this.findHaystackPoints(u)}};function If(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var a=r[t],n=r[t+1];e.push({x:a,y:n})}return e}}wr.getSegmentPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="segments")return If(e.segpts)};wr.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return If(e.ctrlpts)};wr.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var Xa={};Xa.manualEndptToPx=function(r,e){var t=this,a=r.position(),n=r.outerWidth(),i=r.outerHeight(),o=r._private.rscratch;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 u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(n,i),v=[a.x+Math.cos(u)*l,a.y+Math.sin(u)*l];return t.nodeShapes[this.getNodeShape(r)].intersectLine(a.x,a.y,n,i,v[0],v[1],0,r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,o)}};Xa.findEndpoints=function(r){var e,t,a,n,i=this,o,s=r.source()[0],u=r.target()[0],l=s.position(),v=u.position(),f=r.pstyle("target-arrow-shape").value,c=r.pstyle("source-arrow-shape").value,d=r.pstyle("target-distance-from-node").pfValue,h=r.pstyle("source-distance-from-node").pfValue,y=s._private.rscratch,g=u._private.rscratch,p=r.pstyle("curve-style").value,m=r._private.rscratch,b=m.edgeType,w=st(p,"taxi"),x=b==="self"||b==="compound",C=b==="bezier"||b==="multibezier"||x,E=b!=="bezier",T=b==="straight"||b==="segments",k=b==="segments",D=C||E||T,A=x||w,P=r.pstyle("source-endpoint"),B=A?"outside-to-node":P.value,R=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,M=r.pstyle("target-endpoint"),I=A?"outside-to-node":M.value,L=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;m.srcManEndpt=P,m.tgtManEndpt=M;var O,G,_,N,F=(e=(M==null||(t=M.pfValue)===null||t===void 0?void 0:t.length)===2?M.pfValue:null)!==null&&e!==void 0?e:[0,0],Z=(a=(P==null||(n=P.pfValue)===null||n===void 0?void 0:n.length)===2?P.pfValue:null)!==null&&a!==void 0?a:[0,0];if(C){var J=[m.ctrlpts[0],m.ctrlpts[1]],U=E?[m.ctrlpts[m.ctrlpts.length-2],m.ctrlpts[m.ctrlpts.length-1]]:J;O=U,G=J}else if(T){var j=k?m.segpts.slice(0,2):[v.x+F[0],v.y+F[1]],re=k?m.segpts.slice(m.segpts.length-2):[l.x+Z[0],l.y+Z[1]];O=re,G=j}if(I==="inside-to-node")o=[v.x,v.y];else if(M.units)o=this.manualEndptToPx(u,M);else if(I==="outside-to-line")o=m.tgtIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?_=O:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(_=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(v.x,v.y,u.outerWidth(),u.outerHeight(),_[0],_[1],0,L,g),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var ne=u._private.rscratch,W=ne.labelWidth,z=ne.labelHeight,q=ne.labelX,X=ne.labelY,Y=W/2,ae=z/2,ve=u.pstyle("text-valign").value;ve=oa(ve),ve==="top"?X-=ae:ve==="bottom"&&(X+=ae);var Ne=u.pstyle("text-halign").value;Ne=ia(Ne),Ne==="left"?q-=Y:Ne==="right"&&(q+=Y);var Se=La(_[0],_[1],[q-Y,X-ae,q+Y,X-ae,q+Y,X+ae,q-Y,X+ae],v.x,v.y);if(Se.length>0){var we=l,pe=Dt(we,Yt(o)),ie=Dt(we,Yt(Se)),ye=pe;if(ie<pe&&(o=Se,ye=ie),Se.length>2){var he=Dt(we,{x:Se[2],y:Se[3]});he<ye&&(o=[Se[2],Se[3]])}}}var Ce=tn(o,O,i.arrowShapes[f].spacing(r,"target")+d),be=tn(o,O,i.arrowShapes[f].gap(r,"target")+d);if(m.endX=be[0],m.endY=be[1],m.arrowEndX=Ce[0],m.arrowEndY=Ce[1],B==="inside-to-node")o=[l.x,l.y];else if(P.units)o=this.manualEndptToPx(s,P);else if(B==="outside-to-line")o=m.srcIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?N=G:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(N=[v.x,v.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),N[0],N[1],0,R,y),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var Ae=s._private.rscratch,Re=Ae.labelWidth,Ke=Ae.labelHeight,qe=Ae.labelX,_e=Ae.labelY,ke=Re/2,le=Ke/2,xe=s.pstyle("text-valign").value;xe=oa(xe),xe==="top"?_e-=le:xe==="bottom"&&(_e+=le);var Ee=s.pstyle("text-halign").value;Ee=ia(Ee),Ee==="left"?qe-=ke:Ee==="right"&&(qe+=ke);var Q=La(N[0],N[1],[qe-ke,_e-le,qe+ke,_e-le,qe+ke,_e+le,qe-ke,_e+le],l.x,l.y);if(Q.length>0){var S=v,V=Dt(S,Yt(o)),$=Dt(S,Yt(Q)),H=V;if($<V&&(o=[Q[0],Q[1]],H=$),Q.length>2){var K=Dt(S,{x:Q[2],y:Q[3]});K<H&&(o=[Q[2],Q[3]])}}}var de=tn(o,G,i.arrowShapes[c].spacing(r,"source")+h),ee=tn(o,G,i.arrowShapes[c].gap(r,"source")+h);m.startX=ee[0],m.startY=ee[1],m.arrowStartX=de[0],m.arrowStartY=de[1],D&&(!te(m.startX)||!te(m.startY)||!te(m.endX)||!te(m.endY)?m.badLine=!0:m.badLine=!1)};Xa.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),e.edgeType==="haystack"?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}};Xa.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),e.edgeType==="haystack"?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}};var Ss={};function Ey(r,e,t){for(var a=function(l,v,f,c){return ur(l,v,f,c)},n=e._private,i=n.rstyle.bezierPts,o=0;o<r.bezierProjPcts.length;o++){var s=r.bezierProjPcts[o];i.push({x:a(t[0],t[2],t[4],s),y:a(t[1],t[3],t[5],s)})}}Ss.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,a=t.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<t.allpts.length;n+=4)Ey(this,r,t.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<t.allpts.length;n+=2)i.push({x:t.allpts[n],y:t.allpts[n+1]});else if(a==="haystack"){var o=t.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}for(var s=r.pstyle("width").pfValue,u=e.rstyle.arrowWidths=e.rstyle.arrowWidths||{},l=0,v=0;v<On.length;v++){var f=On[v],c=Lr(r,f);u[f]=this.getArrowWidth(s,c)*this.arrowShapeWidth,c>l&&(l=c)}e.rstyle.arrowWidth=this.getArrowWidth(s,l)*this.arrowShapeWidth};Ss.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Ur={};Ur.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!ft(e)){var t,a,n=r._private,i=r.width(),o=r.height(),s=r.padding(),u=r.position(),l=r.pstyle("text-halign").strValue,v=r.pstyle("text-valign").strValue,f=n.rscratch,c=n.rstyle;switch(l){case"left":t=u.x-i/2-s;break;case"left-inside":t=u.x-i/2+s;break;case"right":t=u.x+i/2+s;break;case"right-inside":t=u.x+i/2-s;break;default:t=u.x}switch(v){case"top":a=u.y-o/2-s;break;case"top-inside":a=u.y-o/2+s;break;case"bottom":a=u.y+o/2+s;break;case"bottom-inside":a=u.y+o/2-s;break;default:a=u.y}f.labelX=t,f.labelY=a,c.labelX=t,c.labelY=a,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var Of=function(e,t){var a=Math.atan(t/e);return e===0&&a<0&&(a=a*-1),a},Nf=function(e,t){var a=t.x-e.x,n=t.y-e.y;return Of(a,n)},Cy=function(e,t,a,n){var i=Ma(0,n-.001,1),o=Ma(0,n+.001,1),s=Jt(e,t,a,i),u=Jt(e,t,a,o);return Nf(s,u)};Ur.recalculateEdgeLabelProjections=function(r){var e,t=r._private,a=t.rscratch,n=this,i={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:a.midX,y:a.midY};var o=function(f,c,d){Wr(t.rscratch,f,c,d),Wr(t.rstyle,f,c,d)};o("labelX",null,e.x),o("labelY",null,e.y);var s=Of(a.midDispX,a.midDispY);o("labelAutoAngle",null,s);var u=function(){if(u.cache)return u.cache;for(var f=[],c=0;c+5<a.allpts.length;c+=4){var d={x:a.allpts[c],y:a.allpts[c+1]},h={x:a.allpts[c+2],y:a.allpts[c+3]},y={x:a.allpts[c+4],y:a.allpts[c+5]};f.push({p0:d,p1:h,p2:y,startDist:0,length:0,segments:[]})}var g=t.rstyle.bezierPts,p=n.bezierProjPcts.length;function m(E,T,k,D,A){var P=It(T,k),B=E.segments[E.segments.length-1],R={p0:T,p1:k,t0:D,t1:A,startDist:B?B.startDist+B.length:0,length:P};E.segments.push(R),E.length+=P}for(var b=0;b<f.length;b++){var w=f[b],x=f[b-1];x&&(w.startDist=x.startDist+x.length),m(w,w.p0,g[b*p],0,n.bezierProjPcts[0]);for(var C=0;C<p-1;C++)m(w,g[b*p+C],g[b*p+C+1],n.bezierProjPcts[C],n.bezierProjPcts[C+1]);m(w,g[b*p+p-1],w.p2,n.bezierProjPcts[p-1],1)}return u.cache=f},l=function(f){var c,d=f==="source";if(i[f]){var h=r.pstyle(f+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var y=u(),g,p=0,m=0,b=0;b<y.length;b++){for(var w=y[d?b:y.length-1-b],x=0;x<w.segments.length;x++){var C=w.segments[d?x:w.segments.length-1-x],E=b===y.length-1&&x===w.segments.length-1;if(p=m,m+=C.length,m>=h||E){g={cp:w,segment:C};break}}if(g)break}var T=g.cp,k=g.segment,D=(h-p)/k.length,A=k.t1-k.t0,P=d?k.t0+A*D:k.t1-A*D;P=Ma(0,P,1),e=Jt(T.p0,T.p1,T.p2,P),c=Cy(T.p0,T.p1,T.p2,P);break}case"straight":case"segments":case"haystack":{for(var B=0,R,M,I,L,O=a.allpts.length,G=0;G+3<O&&(d?(I={x:a.allpts[G],y:a.allpts[G+1]},L={x:a.allpts[G+2],y:a.allpts[G+3]}):(I={x:a.allpts[O-2-G],y:a.allpts[O-1-G]},L={x:a.allpts[O-4-G],y:a.allpts[O-3-G]}),R=It(I,L),M=B,B+=R,!(B>=h));G+=2);var _=h-M,N=_/R;N=Ma(0,N,1),e=_h(I,L,N),c=Nf(I,L);break}}o("labelX",f,e.x),o("labelY",f,e.y),o("labelAutoAngle",f,c)}};l("source"),l("target"),this.applyLabelDimensions(r)}};Ur.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Ur.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=Lt(a,r._private.labelDimsKey);if(pr(t.rscratch,"prefixedLabelDimsKey",e)!==n){Wr(t.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(r,a),o=r.pstyle("line-height").pfValue,s=r.pstyle("font-size").pfValue,u=r.pstyle("text-wrap").strValue,l=pr(t.rscratch,"labelWrapCachedLines",e)||[],v=u!=="wrap"?1:Math.max(l.length,1),f=s*o,c=i.width,d=i.height+(v-1)*(o-1)*s;Wr(t.rstyle,"labelWidth",e,c),Wr(t.rscratch,"labelWidth",e,c),Wr(t.rstyle,"labelHeight",e,d),Wr(t.rscratch,"labelHeight",e,d),Wr(t.rscratch,"labelLineHeight",e,f),Wr(t.rscratch,"labelActualDescent",e,i.labelActualDescent)}};Ur.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,o=function(Z,J){return J?(Wr(t.rscratch,Z,e,J),J):pr(t.rscratch,Z,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var s=r.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="​",v=n.split(`
5
+ `),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,d=c==="anywhere",h=[],y=/[\s\u200b]+|$/g,g=0;g<v.length;g++){var p=v[g],m=this.calculateLabelDimensions(r,p),b=m.width;if(d){var w=p.split("").join(l);p=w}if(b>f){var x=p.matchAll(y),C="",E=0,T=Dr(x),k;try{for(T.s();!(k=T.n()).done;){var D=k.value,A=D[0],P=p.substring(E,D.index);E=D.index+A.length;var B=C.length===0?P:C+P+A,R=this.calculateLabelDimensions(r,B),M=R.width;M<=f?C+=P+A:(C&&h.push(C),C=P+A)}}catch(F){T.e(F)}finally{T.f()}C.match(/^[\s\u200b]+$/)||h.push(C)}else h.push(p)}o("labelWrapCachedLines",h),n=o("labelWrapCachedText",h.join(`
6
+ `)),o("labelWrapKey",u)}else if(s==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,L="",O="…",G=!1;if(this.calculateLabelDimensions(r,n).width<I)return n;for(var _=0;_<n.length;_++){var N=this.calculateLabelDimensions(r,L+n[_]+O).width;if(N>I)break;L+=n[_],_===n.length-1&&(G=!0)}return G||(L+=O),L}return n};Ur.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;return e==="auto"?r.isNode()?op(t):"center":e};Ur.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,o=r.pstyle("font-style").strValue,s=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,v=r.pstyle("text-metrics").strValue||"font",f=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=n.createElement("canvas"),c=this.labelCalcCanvasContext=f.getContext("2d");var d=f.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}c.font="".concat(o," ").concat(l," ").concat(s,"px ").concat(u);for(var h=0,y=0,g=e.split(`
7
+ `),p=g.length,m=0,b=0,w=0;w<p;w++){var x=g[w],C=c.measureText(x),E=Math.ceil(C.width),T=s;v==="glyph"&&(w===0&&(b=C.actualBoundingBoxAscent),w===p-1&&(m=C.actualBoundingBoxDescent)),h=Math.max(E,h),y+=T}return v==="glyph"&&(y-=s-b-m),h+=i,y+=i,{width:h,height:y,labelActualAscent:b,labelActualDescent:m}};Ur.calculateLabelAngle=function(r,e){var t=r._private,a=t.rscratch,n=r.isEdge(),i=e?e+"-":"",o=r.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:n&&s==="autorotate"?a.labelAutoAngle:s==="autorotate"?0:o.pfValue};Ur.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),a=r._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(r),t&&(n.sourceLabelAngle=e.calculateLabelAngle(r,"source"),n.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var zf={},Wl=28,$l=!1;zf.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Wl||r.height()<Wl))return $l||(Fe("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),$l=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var a=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return t};var ni={};ni.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,a=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u],v=l._private,f=v.rstyle;f.clean=!1,f.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(o){var s=o.target;a(s)}).on("style.* background.*",function(o){var s=o.target;a(s,!1)});var n=function(o){if(o){var s=t.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],v=l._private.rstyle;l.isNode()&&!v.cleanConnected&&(a(l.connectedEdges()),v.cleanConnected=!0)}if(s)for(var f=0;f<s.length;f++){var c=s[f];c(o,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){n(!0)},t.beforeRender(n,t.beforeRenderPriorities.eleCalcs)};ni.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};ni.recalculateRenderedStyle=function(r,e){var t=function(w){return w._private.rstyle.cleanConnected};if(r.length!==0){var a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var o=r[i],s=o._private,u=s.rstyle;o.isEdge()&&(!t(o.source())||!t(o.target()))&&(u.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(b){return!b._private.rstyle.clean&&b.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(o):a.push(o),u.clean=!0)}for(var l=0;l<n.length;l++){var v=n[l],f=v._private,c=f.rstyle,d=v.position();this.recalculateNodeLabelProjection(v),c.nodeX=d.x,c.nodeY=d.y,c.nodeW=v.pstyle("width").pfValue,c.nodeH=v.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var h=0;h<a.length;h++){var y=a[h],g=y._private,p=g.rstyle,m=g.rscratch;p.srcX=m.arrowStartX,p.srcY=m.arrowStartY,p.tgtX=m.arrowEndX,p.tgtY=m.arrowEndY,p.midX=m.midX,p.midY=m.midY,p.labelAngle=m.labelAngle,p.sourceLabelAngle=m.sourceLabelAngle,p.targetLabelAngle=m.targetLabelAngle}}}};var ii={};ii.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var a=r[t],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?r.drag.push(a):r.nondrag.push(a)}for(var t=0;t<e.length;t++){var a=e[t];r.drag.push(a)}}};ii.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};ii.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(mf),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Ff={};[Or,Fn,wr,Xa,Ss,Ur,zf,ni,ii].forEach(function(r){ge(Ff,r)});var Vf={};Vf.getCachedImage=function(r,e,t){var a=this,n=a.imageCache=a.imageCache||{},i=n[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=n[r]=n[r]||{};var o=i.image=new Image;o.addEventListener("load",t),o.addEventListener("error",function(){o.error=!0});var s="data:",u=r.substring(0,s.length).toLowerCase()===s;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=r,o};var qf=function(e,t){var a=e[0];!a||a._private.grabbed===t||(a._private.grabbed=t,e.updateStyle(!1))},Ty=function(e){qf(e,!0)},Sy=function(e){qf(e,!1)},fa={};fa.registerBinding=function(r,e,t,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],o=0;o<r.length;o++){var s=r[o];if(s!==void 0){var u=this.binder(s);i.push(u.on.apply(u,n))}}return i}var u=this.binder(r);return u.on.apply(u,n)};fa.binder=function(r){var e=this,t=e.cy.window(),a=r===t||r===t.document||r===t.document.body||Rc(r);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});t.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=n}var o=function(u,l,v){var f=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(f[2]={capture:v??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:f}),(r.addEventListener||r.on).apply(r,f),this};return{on:o,addEventListener:o,addListener:o,bind:o}};fa.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};fa.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};fa.load=function(){var r=this,e=r.cy.window(),t=function(S){return S.selected()},a=function(S){var V=S.getRootNode();if(V&&V.nodeType===11&&V.host!==void 0)return V},n=function(S,V,$,H){S==null&&(S=r.cy);for(var K=0;K<V.length;K++){var de=V[K];S.emit({originalEvent:$,type:de,position:H})}},i=function(S){return S.shiftKey||S.metaKey||S.ctrlKey},o=function(S,V){var $=!0;if(r.cy.hasCompoundNodes()&&S&&S.pannable())for(var H=0;V&&H<V.length;H++){var S=V[H];if(S.isNode()&&S.isParent()&&!S.pannable()){$=!1;break}}else $=!0;return $},s=function(S){S[0]._private.rscratch.inDragLayer=!0},u=function(S){S[0]._private.rscratch.inDragLayer=!1},l=function(S){S[0]._private.rscratch.isGrabTarget=!0},v=function(S){S[0]._private.rscratch.isGrabTarget=!1},f=function(S,V){var $=V.addToList,H=$.has(S);!H&&S.grabbable()&&!S.locked()&&($.merge(S),Ty(S))},c=function(S,V){if(S.cy().hasCompoundNodes()&&!(V.inDragLayer==null&&V.addToList==null)){var $=S.descendants();V.inDragLayer&&($.forEach(s),$.connectedEdges().forEach(s)),V.addToList&&f($,V)}},d=function(S,V){V=V||{};var $=S.cy().hasCompoundNodes();V.inDragLayer&&(S.forEach(s),S.neighborhood().stdFilter(function(H){return!$||H.isEdge()}).forEach(s)),V.addToList&&S.forEach(function(H){f(H,V)}),c(S,V),g(S,{inDragLayer:V.inDragLayer}),r.updateCachedGrabbedEles()},h=d,y=function(S){S&&(r.getCachedZSortedEles().forEach(function(V){Sy(V),u(V),v(V)}),r.updateCachedGrabbedEles())},g=function(S,V){if(!(V.inDragLayer==null&&V.addToList==null)&&S.cy().hasCompoundNodes()){var $=S.ancestors().orphans();if(!$.same(S)){var H=$.descendants().spawnSelf().merge($).unmerge(S).unmerge(S.descendants()),K=H.connectedEdges();V.inDragLayer&&(K.forEach(s),H.forEach(s)),V.addToList&&H.forEach(function(de){f(de,V)})}}},p=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},m=typeof MutationObserver<"u",b=typeof ResizeObserver<"u";m?(r.removeObserver=new MutationObserver(function(Q){for(var S=0;S<Q.length;S++){var V=Q[S],$=V.removedNodes;if($)for(var H=0;H<$.length;H++){var K=$[H];if(K===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(Q){r.destroy()});var w=Wa(function(){r.cy.resize()},100);m&&(r.styleObserver=new MutationObserver(w),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",w),b&&(r.resizeObserver=new ResizeObserver(w),r.resizeObserver.observe(r.container));var x=function(S,V){for(;S!=null;)V(S),S=S.parentNode},C=function(){r.invalidateContainerClientCoordsCache()};x(r.container,function(Q){r.registerBinding(Q,"transitionend",C),r.registerBinding(Q,"animationend",C),r.registerBinding(Q,"scroll",C)}),r.registerBinding(r.container,"contextmenu",function(Q){Q.preventDefault()});var E=function(){return r.selection[4]!==0},T=function(S){for(var V=r.findContainerClientCoords(),$=V[0],H=V[1],K=V[2],de=V[3],ee=S.touches?S.touches:[S],fe=!1,ue=0;ue<ee.length;ue++){var me=ee[ue];if($<=me.clientX&&me.clientX<=$+K&&H<=me.clientY&&me.clientY<=H+de){fe=!0;break}}if(!fe)return!1;for(var Me=r.container,Pe=S.target,se=Pe.parentNode,Te=!1;se;){if(se===Me){Te=!0;break}se=se.parentNode}return!!Te};r.registerBinding(r.container,"mousedown",function(S){if(T(S)&&!(r.hoverData.which===1&&S.which!==1)){S.preventDefault(),p(),r.hoverData.capture=!0,r.hoverData.which=S.which;var V=r.cy,$=[S.clientX,S.clientY],H=r.projectIntoViewport($[0],$[1]),K=r.selection,de=r.findNearestElements(H[0],H[1],!0,!1),ee=de[0],fe=r.dragData.possibleDragElements;r.hoverData.mdownPos=H,r.hoverData.mdownGPos=$;var ue=function(De){return{originalEvent:S,type:De,position:{x:H[0],y:H[1]}}},me=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var De=r.hoverData.down;De?De.emit(ue("taphold")):V.emit(ue("taphold"))}},r.tapholdDuration)};if(S.which==3){r.hoverData.cxtStarted=!0;var Me={originalEvent:S,type:"cxttapstart",position:{x:H[0],y:H[1]}};ee?(ee.activate(),ee.emit(Me),r.hoverData.down=ee):V.emit(Me),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(S.which==1){ee&&ee.activate();{if(ee!=null&&r.nodeIsGrabbable(ee)){var Pe=function(De){De.emit(ue("grab"))};if(l(ee),!ee.selected())fe=r.dragData.possibleDragElements=V.collection(),h(ee,{addToList:fe}),ee.emit(ue("grabon")).emit(ue("grab"));else{fe=r.dragData.possibleDragElements=V.collection();var se=V.$(function(Te){return Te.isNode()&&Te.selected()&&r.nodeIsGrabbable(Te)});d(se,{addToList:fe}),ee.emit(ue("grabon")),se.forEach(Pe)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=ee,r.hoverData.downs=de,r.hoverData.downTime=new Date().getTime()}n(ee,["mousedown","tapstart","vmousedown"],S,{x:H[0],y:H[1]}),ee==null?(K[4]=1,r.data.bgActivePosistion={x:H[0],y:H[1]},r.redrawHint("select",!0),r.redraw()):ee.pannable()&&(K[4]=1),me()}K[0]=K[2]=H[0],K[1]=K[3]=H[1]}},!1);var k=a(r.container);r.registerBinding([e,k],"mousemove",function(S){var V=r.hoverData.capture;if(!(!V&&!T(S))){var $=!1,H=r.cy,K=H.zoom(),de=[S.clientX,S.clientY],ee=r.projectIntoViewport(de[0],de[1]),fe=r.hoverData.mdownPos,ue=r.hoverData.mdownGPos,me=r.selection,Me=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(Me=r.findNearestElement(ee[0],ee[1],!0,!1));var Pe=r.hoverData.last,se=r.hoverData.down,Te=[ee[0]-me[2],ee[1]-me[3]],De=r.dragData.possibleDragElements,He;if(ue){var Qe=de[0]-ue[0],Br=Qe*Qe,Je=de[1]-ue[1],ir=Je*Je,fr=Br+ir;r.hoverData.isOverThresholdDrag=He=fr>=r.desktopTapThreshold2}var Cr=i(S);He&&(r.hoverData.tapholdCancelled=!0);var tt=function(){var Ar=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Ar.length===0?(Ar.push(Te[0]),Ar.push(Te[1])):(Ar[0]+=Te[0],Ar[1]+=Te[1])};$=!0,n(Me,["mousemove","vmousemove","tapdrag"],S,{x:ee[0],y:ee[1]});var or=function(Ar){return{originalEvent:S,type:Ar,position:{x:ee[0],y:ee[1]}}},Ct=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||H.emit(or("boxstart")),me[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(He){var Yr=or("cxtdrag");se?se.emit(Yr):H.emit(Yr),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Me!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(or("cxtdragout")),r.hoverData.cxtOver=Me,Me&&Me.emit(or("cxtdragover")))}}else if(r.hoverData.dragging){if($=!0,H.panningEnabled()&&H.userPanningEnabled()){var Vt;if(r.hoverData.justStartedPan){var Qa=r.hoverData.mdownPos;Vt={x:(ee[0]-Qa[0])*K,y:(ee[1]-Qa[1])*K},r.hoverData.justStartedPan=!1}else Vt={x:Te[0]*K,y:Te[1]*K};H.panBy(Vt),H.emit(or("dragpan")),r.hoverData.dragged=!0}ee=r.projectIntoViewport(S.clientX,S.clientY)}else if(me[4]==1&&(se==null||se.pannable())){if(He){if(!r.hoverData.dragging&&H.boxSelectionEnabled()&&(Cr||!H.panningEnabled()||!H.userPanningEnabled()))Ct();else if(!r.hoverData.selecting&&H.panningEnabled()&&H.userPanningEnabled()){var Tt=o(se,r.hoverData.downs);Tt&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,me[4]=0,r.data.bgActivePosistion=Yt(fe),r.redrawHint("select",!0),r.redraw())}se&&se.pannable()&&se.active()&&se.unactivate()}}else{if(se&&se.pannable()&&se.active()&&se.unactivate(),(!se||!se.grabbed())&&Me!=Pe&&(Pe&&n(Pe,["mouseout","tapdragout"],S,{x:ee[0],y:ee[1]}),Me&&n(Me,["mouseover","tapdragover"],S,{x:ee[0],y:ee[1]}),r.hoverData.last=Me),se)if(He){if(H.boxSelectionEnabled()&&Cr)se&&se.grabbed()&&(y(De),se.emit(or("freeon")),De.emit(or("free")),r.dragData.didDrag&&(se.emit(or("dragfreeon")),De.emit(or("dragfree")))),Ct();else if(se&&se.grabbed()&&r.nodeIsDraggable(se)){var Tr=!r.dragData.didDrag;Tr&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||d(De,{inDragLayer:!0});var sr={x:0,y:0};if(te(Te[0])&&te(Te[1])&&(sr.x+=Te[0],sr.y+=Te[1],Tr)){var Sr=r.hoverData.dragDelta;Sr&&te(Sr[0])&&te(Sr[1])&&(sr.x+=Sr[0],sr.y+=Sr[1])}r.hoverData.draggingEles=!0,De.silentShift(sr).emit(or("position")).emit(or("drag")),r.redrawHint("drag",!0),r.redraw()}}else tt();$=!0}if(me[2]=ee[0],me[3]=ee[1],$)return S.stopPropagation&&S.stopPropagation(),S.preventDefault&&S.preventDefault(),!1}},!1);var D,A,P;r.registerBinding(e,"mouseup",function(S){if(!(r.hoverData.which===1&&S.which!==1&&r.hoverData.capture)){var V=r.hoverData.capture;if(V){r.hoverData.capture=!1;var $=r.cy,H=r.projectIntoViewport(S.clientX,S.clientY),K=r.selection,de=r.findNearestElement(H[0],H[1],!0,!1),ee=r.dragData.possibleDragElements,fe=r.hoverData.down,ue=i(S);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,fe&&fe.unactivate();var me=function(Qe){return{originalEvent:S,type:Qe,position:{x:H[0],y:H[1]}}};if(r.hoverData.which===3){var Me=me("cxttapend");if(fe?fe.emit(Me):$.emit(Me),!r.hoverData.cxtDragged){var Pe=me("cxttap");fe?fe.emit(Pe):$.emit(Pe)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(n(de,["mouseup","tapend","vmouseup"],S,{x:H[0],y:H[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(n(fe,["click","tap","vclick"],S,{x:H[0],y:H[1]}),A=!1,S.timeStamp-P<=$.multiClickDebounceTime()?(D&&clearTimeout(D),A=!0,P=null,n(fe,["dblclick","dbltap","vdblclick"],S,{x:H[0],y:H[1]})):(D=setTimeout(function(){A||n(fe,["oneclick","onetap","voneclick"],S,{x:H[0],y:H[1]})},$.multiClickDebounceTime()),P=S.timeStamp)),fe==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(S)&&($.$(t).unselect(["tapunselect"]),ee.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=ee=$.collection()),de==fe&&!r.dragData.didDrag&&!r.hoverData.selecting&&de!=null&&de._private.selectable&&(r.hoverData.dragging||($.selectionType()==="additive"||ue?de.selected()?de.unselect(["tapunselect"]):de.select(["tapselect"]):ue||($.$(t).unmerge(de).unselect(["tapunselect"]),de.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var se=$.collection(r.getAllInBox(K[0],K[1],K[2],K[3]));r.redrawHint("select",!0),se.length>0&&r.redrawHint("eles",!0),$.emit(me("boxend"));var Te=function(Qe){return Qe.selectable()&&!Qe.selected()};$.selectionType()==="additive"||ue||$.$(t).unmerge(se).unselect(),se.emit(me("box")).stdFilter(Te).select().emit(me("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!K[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var De=fe&&fe.grabbed();y(ee),De&&(fe.emit(me("freeon")),ee.emit(me("free")),r.dragData.didDrag&&(fe.emit(me("dragfreeon")),ee.emit(me("dragfree"))))}}K[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var B=[],R=4,M,I=1e5,L,O=4,G=8,_=15,N=null,F=function(S){for(var V=Math.abs(S[0]),$=1;$<S.length;$++)if(Math.abs(S[$])!==V)return!1;return!0},Z=function(S){var V=!1,$=S.deltaY;if($==null&&(S.wheelDeltaY!=null?$=S.wheelDeltaY/4:S.wheelDelta!=null&&($=S.wheelDelta/4)),$!==0){if(M==null)if(B.length>=R){M=!1;var H=B;if(H[0]>=5){var K;F(H)?K=H[0]:K=eu(H),K>1&&(M=!0,I=K,L=K)}}else B.push(Math.abs($)),V=!0;var de=!1;if(M){var ee=Math.abs($);if(de=ru(ee,I),!de)if(ee<Math.min(L/G,_))N=null;else if(!Sn(ee)&&ru(I,ee))I=ee,N=null,de=!0;else if(ee===N){var fe=eu([I,ee]);I=fe*O>=L?fe:ee,N=null,de=!0}else N=ee,V=Sn(ee)||ee>I}if(!r.scrollingPage){var ue=r.cy,me=ue.zoom(),Me=ue.pan(),Pe=r.projectIntoViewport(S.clientX,S.clientY),se=[Pe[0]*me+Me.x,Pe[1]*me+Me.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||E()){S.preventDefault();return}if(ue.panningEnabled()&&ue.userPanningEnabled()&&ue.zoomingEnabled()&&ue.userZoomingEnabled()){S.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var Te;V&&Math.abs($)>5&&($=An($)*5),Te=$/-250,de&&(Te/=I,Te*=3),Te=Te*r.wheelSensitivity;var De=S.deltaMode===1;De&&(Te*=33);var He=ue.zoom()*Math.pow(10,Te);S.type==="gesturechange"&&(He=r.gestureStartZoom*S.scale),ue.zoom({level:He,renderedPosition:{x:se[0],y:se[1]}}),ue.emit({type:S.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:S,position:{x:Pe[0],y:Pe[1]}})}}}};r.registerBinding(r.container,"wheel",Z,!0),r.registerBinding(e,"scroll",function(S){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(S){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||S.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(Q){r.hasTouchStarted||Z(Q)},!0),r.registerBinding(r.container,"mouseout",function(S){var V=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseout",position:{x:V[0],y:V[1]}})},!1),r.registerBinding(r.container,"mouseover",function(S){var V=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseover",position:{x:V[0],y:V[1]}})},!1);var J,U,j,re,ne,W,z,q,X,Y,ae,ve,Ne,Se=function(S,V,$,H){return Math.sqrt(($-S)*($-S)+(H-V)*(H-V))},we=function(S,V,$,H){return($-S)*($-S)+(H-V)*(H-V)},pe;r.registerBinding(r.container,"touchstart",pe=function(S){if(r.hasTouchStarted=!0,!!T(S)){p(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var V=r.cy,$=r.touchData.now,H=r.touchData.earlier;if(S.touches[0]){var K=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);$[0]=K[0],$[1]=K[1]}if(S.touches[1]){var K=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);$[2]=K[0],$[3]=K[1]}if(S.touches[2]){var K=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);$[4]=K[0],$[5]=K[1]}var de=function(Cr){return{originalEvent:S,type:Cr,position:{x:$[0],y:$[1]}}};if(S.touches[1]){r.touchData.singleTouchMoved=!0,y(r.dragData.touchDragEles);var ee=r.findContainerClientCoords();X=ee[0],Y=ee[1],ae=ee[2],ve=ee[3],J=S.touches[0].clientX-X,U=S.touches[0].clientY-Y,j=S.touches[1].clientX-X,re=S.touches[1].clientY-Y,Ne=0<=J&&J<=ae&&0<=j&&j<=ae&&0<=U&&U<=ve&&0<=re&&re<=ve;var fe=V.pan(),ue=V.zoom();ne=Se(J,U,j,re),W=we(J,U,j,re),z=[(J+j)/2,(U+re)/2],q=[(z[0]-fe.x)/ue,(z[1]-fe.y)/ue];var me=200,Me=me*me;if(W<Me&&!S.touches[2]){var Pe=r.findNearestElement($[0],$[1],!0,!0),se=r.findNearestElement($[2],$[3],!0,!0);Pe&&Pe.isNode()?(Pe.activate().emit(de("cxttapstart")),r.touchData.start=Pe):se&&se.isNode()?(se.activate().emit(de("cxttapstart")),r.touchData.start=se):V.emit(de("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(S.touches[2])V.boxSelectionEnabled()&&S.preventDefault();else if(!S.touches[1]){if(S.touches[0]){var Te=r.findNearestElements($[0],$[1],!0,!0),De=Te[0];if(De!=null&&(De.activate(),r.touchData.start=De,r.touchData.starts=Te,r.nodeIsGrabbable(De))){var He=r.dragData.touchDragEles=V.collection(),Qe=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),De.selected()?(Qe=V.$(function(fr){return fr.selected()&&r.nodeIsGrabbable(fr)}),d(Qe,{addToList:He})):h(De,{addToList:He}),l(De),De.emit(de("grabon")),Qe?Qe.forEach(function(fr){fr.emit(de("grab"))}):De.emit(de("grab"))}n(De,["touchstart","tapstart","vmousedown"],S,{x:$[0],y:$[1]}),De==null&&(r.data.bgActivePosistion={x:K[0],y:K[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&n(r.touchData.start,["taphold"],S,{x:$[0],y:$[1]})},r.tapholdDuration)}}if(S.touches.length>=1){for(var Br=r.touchData.startPosition=[null,null,null,null,null,null],Je=0;Je<$.length;Je++)Br[Je]=H[Je]=$[Je];var ir=S.touches[0];r.touchData.startGPosition=[ir.clientX,ir.clientY]}}},!1);var ie;r.registerBinding(e,"touchmove",ie=function(S){var V=r.touchData.capture;if(!(!V&&!T(S))){var $=r.selection,H=r.cy,K=r.touchData.now,de=r.touchData.earlier,ee=H.zoom();if(S.touches[0]){var fe=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);K[0]=fe[0],K[1]=fe[1]}if(S.touches[1]){var fe=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);K[2]=fe[0],K[3]=fe[1]}if(S.touches[2]){var fe=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);K[4]=fe[0],K[5]=fe[1]}var ue=function(yc){return{originalEvent:S,type:yc,position:{x:K[0],y:K[1]}}},me=r.touchData.startGPosition,Me;if(V&&S.touches[0]&&me){for(var Pe=[],se=0;se<K.length;se++)Pe[se]=K[se]-de[se];var Te=S.touches[0].clientX-me[0],De=Te*Te,He=S.touches[0].clientY-me[1],Qe=He*He,Br=De+Qe;Me=Br>=r.touchTapThreshold2}if(V&&r.touchData.cxt){S.preventDefault();var Je=S.touches[0].clientX-X,ir=S.touches[0].clientY-Y,fr=S.touches[1].clientX-X,Cr=S.touches[1].clientY-Y,tt=we(Je,ir,fr,Cr),or=tt/W,Ct=150,Yr=Ct*Ct,Vt=1.5,Qa=Vt*Vt;if(or>=Qa||tt>=Yr){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Tt=ue("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(Tt),r.touchData.start=null):H.emit(Tt)}}if(V&&r.touchData.cxt){var Tt=ue("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(Tt):H.emit(Tt),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var Tr=r.findNearestElement(K[0],K[1],!0,!0);(!r.touchData.cxtOver||Tr!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(ue("cxtdragout")),r.touchData.cxtOver=Tr,Tr&&Tr.emit(ue("cxtdragover")))}else if(V&&S.touches[2]&&H.boxSelectionEnabled())S.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||H.emit(ue("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,$[4]=1,!$||$.length===0||$[0]===void 0?($[0]=(K[0]+K[2]+K[4])/3,$[1]=(K[1]+K[3]+K[5])/3,$[2]=(K[0]+K[2]+K[4])/3+1,$[3]=(K[1]+K[3]+K[5])/3+1):($[2]=(K[0]+K[2]+K[4])/3,$[3]=(K[1]+K[3]+K[5])/3),r.redrawHint("select",!0),r.redraw();else if(V&&S.touches[1]&&!r.touchData.didSelect&&H.zoomingEnabled()&&H.panningEnabled()&&H.userZoomingEnabled()&&H.userPanningEnabled()){S.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var sr=r.dragData.touchDragEles;if(sr){r.redrawHint("drag",!0);for(var Sr=0;Sr<sr.length;Sr++){var ha=sr[Sr]._private;ha.grabbed=!1,ha.rscratch.inDragLayer=!1}}var Ar=r.touchData.start,Je=S.touches[0].clientX-X,ir=S.touches[0].clientY-Y,fr=S.touches[1].clientX-X,Cr=S.touches[1].clientY-Y,Ps=Se(Je,ir,fr,Cr),uc=Ps/ne;if(Ne){var lc=Je-J,vc=ir-U,fc=fr-j,cc=Cr-re,hc=(lc+fc)/2,dc=(vc+cc)/2,da=H.zoom(),oi=da*uc,Ja=H.pan(),As=q[0]*da+Ja.x,Rs=q[1]*da+Ja.y,gc={x:-oi/da*(As-Ja.x-hc)+As,y:-oi/da*(Rs-Ja.y-dc)+Rs};if(Ar&&Ar.active()){var sr=r.dragData.touchDragEles;y(sr),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Ar.unactivate().emit(ue("freeon")),sr&&sr.emit(ue("free")),r.dragData.didDrag&&(Ar.emit(ue("dragfreeon")),sr&&sr.emit(ue("dragfree")))}H.viewport({zoom:oi,pan:gc,cancelOnFailedZoom:!0}),H.emit(ue("pinchzoom")),ne=Ps,J=Je,U=ir,j=fr,re=Cr,r.pinching=!0}if(S.touches[0]){var fe=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);K[0]=fe[0],K[1]=fe[1]}if(S.touches[1]){var fe=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);K[2]=fe[0],K[3]=fe[1]}if(S.touches[2]){var fe=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);K[4]=fe[0],K[5]=fe[1]}}else if(S.touches[0]&&!r.touchData.didSelect){var Nr=r.touchData.start,si=r.touchData.last,Tr;if(!r.hoverData.draggingEles&&!r.swipePanning&&(Tr=r.findNearestElement(K[0],K[1],!0,!0)),V&&Nr!=null&&S.preventDefault(),V&&Nr!=null&&r.nodeIsDraggable(Nr))if(Me){var sr=r.dragData.touchDragEles,Ms=!r.dragData.didDrag;Ms&&d(sr,{inDragLayer:!0}),r.dragData.didDrag=!0;var ga={x:0,y:0};if(te(Pe[0])&&te(Pe[1])&&(ga.x+=Pe[0],ga.y+=Pe[1],Ms)){r.redrawHint("eles",!0);var zr=r.touchData.dragDelta;zr&&te(zr[0])&&te(zr[1])&&(ga.x+=zr[0],ga.y+=zr[1])}r.hoverData.draggingEles=!0,sr.silentShift(ga).emit(ue("position")).emit(ue("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==de[0]&&r.touchData.startPosition[1]==de[1]&&r.redrawHint("eles",!0),r.redraw()}else{var zr=r.touchData.dragDelta=r.touchData.dragDelta||[];zr.length===0?(zr.push(Pe[0]),zr.push(Pe[1])):(zr[0]+=Pe[0],zr[1]+=Pe[1])}if(n(Nr||Tr,["touchmove","tapdrag","vmousemove"],S,{x:K[0],y:K[1]}),(!Nr||!Nr.grabbed())&&Tr!=si&&(si&&si.emit(ue("tapdragout")),Tr&&Tr.emit(ue("tapdragover"))),r.touchData.last=Tr,V)for(var Sr=0;Sr<K.length;Sr++)K[Sr]&&r.touchData.startPosition[Sr]&&Me&&(r.touchData.singleTouchMoved=!0);if(V&&(Nr==null||Nr.pannable())&&H.panningEnabled()&&H.userPanningEnabled()){var pc=o(Nr,r.touchData.starts);pc&&(S.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=Yt(r.touchData.startPosition)),r.swipePanning?(H.panBy({x:Pe[0]*ee,y:Pe[1]*ee}),H.emit(ue("dragpan"))):Me&&(r.swipePanning=!0,H.panBy({x:Te*ee,y:He*ee}),H.emit(ue("dragpan")),Nr&&(Nr.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var fe=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);K[0]=fe[0],K[1]=fe[1]}}for(var se=0;se<K.length;se++)de[se]=K[se];V&&S.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var ye;r.registerBinding(e,"touchcancel",ye=function(S){var V=r.touchData.start;r.touchData.capture=!1,V&&V.unactivate()});var he,Ce,be,Ae;if(r.registerBinding(e,"touchend",he=function(S){var V=r.touchData.start,$=r.touchData.capture;if($)S.touches.length===0&&(r.touchData.capture=!1),S.preventDefault();else return;var H=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var K=r.cy,de=K.zoom(),ee=r.touchData.now,fe=r.touchData.earlier;if(S.touches[0]){var ue=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);ee[0]=ue[0],ee[1]=ue[1]}if(S.touches[1]){var ue=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);ee[2]=ue[0],ee[3]=ue[1]}if(S.touches[2]){var ue=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);ee[4]=ue[0],ee[5]=ue[1]}var me=function(Yr){return{originalEvent:S,type:Yr,position:{x:ee[0],y:ee[1]}}};V&&V.unactivate();var Me;if(r.touchData.cxt){if(Me=me("cxttapend"),V?V.emit(Me):K.emit(Me),!r.touchData.cxtDragged){var Pe=me("cxttap");V?V.emit(Pe):K.emit(Pe)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!S.touches[2]&&K.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var se=K.collection(r.getAllInBox(H[0],H[1],H[2],H[3]));H[0]=void 0,H[1]=void 0,H[2]=void 0,H[3]=void 0,H[4]=0,r.redrawHint("select",!0),K.emit(me("boxend"));var Te=function(Yr){return Yr.selectable()&&!Yr.selected()};se.emit(me("box")).stdFilter(Te).select().emit(me("boxselect")),se.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(V?.unactivate(),S.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!S.touches[1]){if(!S.touches[0]){if(!S.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var De=r.dragData.touchDragEles;if(V!=null){var He=V._private.grabbed;y(De),r.redrawHint("drag",!0),r.redrawHint("eles",!0),He&&(V.emit(me("freeon")),De.emit(me("free")),r.dragData.didDrag&&(V.emit(me("dragfreeon")),De.emit(me("dragfree")))),n(V,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]}),V.unactivate(),r.touchData.start=null}else{var Qe=r.findNearestElement(ee[0],ee[1],!0,!0);n(Qe,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]})}var Br=r.touchData.startPosition[0]-ee[0],Je=Br*Br,ir=r.touchData.startPosition[1]-ee[1],fr=ir*ir,Cr=Je+fr,tt=Cr*de*de;r.touchData.singleTouchMoved||(V||K.$(":selected").unselect(["tapunselect"]),n(V,["tap","vclick"],S,{x:ee[0],y:ee[1]}),Ce=!1,S.timeStamp-Ae<=K.multiClickDebounceTime()?(be&&clearTimeout(be),Ce=!0,Ae=null,n(V,["dbltap","vdblclick"],S,{x:ee[0],y:ee[1]})):(be=setTimeout(function(){Ce||n(V,["onetap","voneclick"],S,{x:ee[0],y:ee[1]})},K.multiClickDebounceTime()),Ae=S.timeStamp)),V!=null&&!r.dragData.didDrag&&V._private.selectable&&tt<r.touchTapThreshold2&&!r.pinching&&(K.selectionType()==="single"?(K.$(t).unmerge(V).unselect(["tapunselect"]),V.select(["tapselect"])):V.selected()?V.unselect(["tapunselect"]):V.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var or=0;or<ee.length;or++)fe[or]=ee[or];r.dragData.didDrag=!1,S.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),S.touches.length<2&&(S.touches.length===1&&(r.touchData.startGPosition=[S.touches[0].clientX,S.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent>"u"){var Re=[],Ke=function(S){return{clientX:S.clientX,clientY:S.clientY,force:1,identifier:S.pointerId,pageX:S.pageX,pageY:S.pageY,radiusX:S.width/2,radiusY:S.height/2,screenX:S.screenX,screenY:S.screenY,target:S.target}},qe=function(S){return{event:S,touch:Ke(S)}},_e=function(S){Re.push(qe(S))},ke=function(S){for(var V=0;V<Re.length;V++){var $=Re[V];if($.event.pointerId===S.pointerId){Re.splice(V,1);return}}},le=function(S){var V=Re.filter(function($){return $.event.pointerId===S.pointerId})[0];V.event=S,V.touch=Ke(S)},xe=function(S){S.touches=Re.map(function(V){return V.touch})},Ee=function(S){return S.pointerType==="mouse"||S.pointerType===4};r.registerBinding(r.container,"pointerdown",function(Q){Ee(Q)||(Q.preventDefault(),_e(Q),xe(Q),pe(Q))}),r.registerBinding(r.container,"pointerup",function(Q){Ee(Q)||(ke(Q),xe(Q),he(Q))}),r.registerBinding(r.container,"pointercancel",function(Q){Ee(Q)||(ke(Q),xe(Q),ye(Q))}),r.registerBinding(r.container,"pointermove",function(Q){Ee(Q)||(Q.preventDefault(),le(Q),xe(Q),ie(Q))})}};var et={};et.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(a,n,i,o,s,u){this.renderer.nodeShapeImpl("polygon",a,n,i,o,s,this.points)},intersectLine:function(a,n,i,o,s,u,l,v){return La(s,u,this.points,a,n,i/2,o/2,l)},checkPoint:function(a,n,i,o,s,u,l,v){return jr(a,n,this.points,u,l,o,s,[0,-1],i)},hasMiterBounds:r!=="rectangle",miterBounds:function(a,n,i,o,s,u){return Uh(this.points,a,n,i,o,s)}}};et.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,o,s,u){return Qh(i,o,e,t,a/2+s,n/2+s)},checkPoint:function(e,t,a,n,i,o,s,u){return Mt(e,t,n,i,o,s,a)}}};et.generateRoundPolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(a,n,i,o,s,u,l){if(u[l]!==void 0&&u[l+"-cx"]===a&&u[l+"-cy"]===n&&u[l+"-w"]===i&&u[l+"-h"]===o&&u[l+"-corner-radius"]===s)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=a,u[l+"-cy"]=n,u[l+"-w"]=i,u[l+"-h"]=o,u[l+"-corner-radius"]=s;var v=i/2,f=o/2;s=s==="auto"?Fv(i,o):s;for(var c=new Array(e.length/2),d=0;d<e.length/2;d++)c[d]={x:a+v*e[d*2],y:n+f*e[d*2+1]};var h,y,g,p,m=c.length;for(y=c[m-1],h=0;h<m;h++)g=c[h%m],p=c[(h+1)%m],u[l][h]=Ts(y,g,p,s),y=g,g=p;return u[l]},draw:function(a,n,i,o,s,u,l){this.renderer.nodeShapeImpl("round-polygon",a,n,i,o,s,this.points,this.getOrCreateCorners(n,i,o,s,u,l,"drawCorners"))},intersectLine:function(a,n,i,o,s,u,l,v,f){return jh(s,u,this.points,a,n,i,o,l,this.getOrCreateCorners(a,n,i,o,v,f,"corners"))},checkPoint:function(a,n,i,o,s,u,l,v,f){return Zh(a,n,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,v,f,"corners"))}}};et.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:xr(4,0),draw:function(e,t,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i,this.points,o)},intersectLine:function(e,t,a,n,i,o,s,u){return Mv(i,o,e,t,a,n,s,u)},checkPoint:function(e,t,a,n,i,o,s,u){var l=n/2,v=i/2;u=u==="auto"?dt(n,i):u,u=Math.min(l,v,u);var f=u*2;return!!(jr(e,t,this.points,o,s,n,i-f,[0,-1],a)||jr(e,t,this.points,o,s,n-f,i,[0,-1],a)||Mt(e,t,f,f,o-l+u,s-v+u,a)||Mt(e,t,f,f,o+l-u,s-v+u,a)||Mt(e,t,f,f,o+l-u,s+v-u,a)||Mt(e,t,f,f,o-l+u,s+v-u,a))}}};et.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:hs(),points:xr(4,0),draw:function(e,t,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i,null,o)},generateCutTrianglePts:function(e,t,a,n,i){var o=i==="auto"?this.cornerLength:i,s=t/2,u=e/2,l=a-u,v=a+u,f=n-s,c=n+s;return{topLeft:[l,f+o,l+o,f,l+o,f+o],topRight:[v-o,f,v,f+o,v-o,f+o],bottomRight:[v,c-o,v-o,c,v-o,c-o],bottomLeft:[l+o,c,l,c-o,l+o,c-o]}},intersectLine:function(e,t,a,n,i,o,s,u){var l=this.generateCutTrianglePts(a+2*s,n+2*s,e,t,u),v=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return La(i,o,v,e,t)},checkPoint:function(e,t,a,n,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(jr(e,t,this.points,o,s,n,i-2*l,[0,-1],a)||jr(e,t,this.points,o,s,n-2*l,i,[0,-1],a))return!0;var v=this.generateCutTrianglePts(n,i,o,s);return kr(e,t,v.topLeft)||kr(e,t,v.topRight)||kr(e,t,v.bottomRight)||kr(e,t,v.bottomLeft)}}};et.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:xr(4,0),draw:function(e,t,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,o,s,u){var l=.15,v=.5,f=.85,c=this.generateBarrelBezierPts(a+2*s,n+2*s,e,t),d=function(g){var p=Jt({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},l),m=Jt({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},v),b=Jt({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},f);return[g[0],g[1],p.x,p.y,m.x,m.y,b.x,b.y,g[4],g[5]]},h=[].concat(d(c.topLeft),d(c.topRight),d(c.bottomRight),d(c.bottomLeft));return La(i,o,h,e,t)},generateBarrelBezierPts:function(e,t,a,n){var i=t/2,o=e/2,s=a-o,u=a+o,l=n-i,v=n+i,f=qo(e,t),c=f.heightOffset,d=f.widthOffset,h=f.ctrlPtOffsetPct*e,y={topLeft:[s,l+c,s+h,l,s+d,l],topRight:[u-d,l,u-h,l,u,l+c],bottomRight:[u,v-c,u-h,v,u-d,v],bottomLeft:[s+d,v,s+h,v,s,v-c]};return y.topLeft.isTop=!0,y.topRight.isTop=!0,y.bottomLeft.isBottom=!0,y.bottomRight.isBottom=!0,y},checkPoint:function(e,t,a,n,i,o,s,u){var l=qo(n,i),v=l.heightOffset,f=l.widthOffset;if(jr(e,t,this.points,o,s,n,i-2*v,[0,-1],a)||jr(e,t,this.points,o,s,n-2*f,i,[0,-1],a))return!0;for(var c=this.generateBarrelBezierPts(n,i,o,s),d=function(T,k,D){var A=D[4],P=D[2],B=D[0],R=D[5],M=D[1],I=Math.min(A,B),L=Math.max(A,B),O=Math.min(R,M),G=Math.max(R,M);if(I<=T&&T<=L&&O<=k&&k<=G){var _=ed(A,P,B),N=Xh(_[0],_[1],_[2],T),F=N.filter(function(Z){return 0<=Z&&Z<=1});if(F.length>0)return F[0]}return null},h=Object.keys(c),y=0;y<h.length;y++){var g=h[y],p=c[g],m=d(e,t,p);if(m!=null){var b=p[5],w=p[3],x=p[1],C=ur(b,w,x,m);if(p.isTop&&C<=t||p.isBottom&&t<=C)return!0}}return!1}}};et.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:xr(4,0),draw:function(e,t,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i,this.points,o)},intersectLine:function(e,t,a,n,i,o,s,u){var l=e-(a/2+s),v=t-(n/2+s),f=v,c=e+(a/2+s),d=ut(i,o,e,t,l,v,c,f,!1);return d.length>0?d:Mv(i,o,e,t,a,n,s,u)},checkPoint:function(e,t,a,n,i,o,s,u){u=u==="auto"?dt(n,i):u;var l=2*u;if(jr(e,t,this.points,o,s,n,i-l,[0,-1],a)||jr(e,t,this.points,o,s,n-l,i,[0,-1],a))return!0;var v=n/2+2*a,f=i/2+2*a,c=[o-v,s-f,o-v,s,o+v,s,o+v,s-f];return!!(kr(e,t,c)||Mt(e,t,l,l,o+n/2-u,s+i/2-u,a)||Mt(e,t,l,l,o-n/2+u,s+i/2-u,a))}}};et.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",xr(3,0)),this.generateRoundPolygon("round-triangle",xr(3,0)),this.generatePolygon("rectangle",xr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",xr(5,0)),this.generateRoundPolygon("round-pentagon",xr(5,0)),this.generatePolygon("hexagon",xr(6,0)),this.generateRoundPolygon("round-hexagon",xr(6,0)),this.generatePolygon("heptagon",xr(7,0)),this.generateRoundPolygon("round-heptagon",xr(7,0)),this.generatePolygon("octagon",xr(8,0)),this.generateRoundPolygon("round-octagon",xr(8,0));var a=new Array(20);{var n=Vo(5,0),i=Vo(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=i[s*2],a[s*4+3]=i[s*2+1]}a=zv(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}r.makePolygon=function(l){var v=l.join("$"),f="polygon-"+v,c;return(c=this[f])?c:e.generatePolygon(f,l)}};var Ya={};Ya.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Ya.redraw=function(r){r=r||Dv();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r};Ya.beforeRender=function(r,e){if(!this.destroyed){e==null&&Ue("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(a,n){return n.priority-a.priority})}};var Kl=function(e,t,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(t,a)};Ya.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function(n){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){r.requestedFrame=!1,Kl(r,!0,n);var i=Jr();r.render(r.renderOptions);var o=r.lastDrawTime=Jr();r.averageRedrawTime===void 0&&(r.averageRedrawTime=o-i),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var s=o-i;r.redrawTotalTime+=s,r.lastRedrawTime=s,r.averageRedrawTime=r.averageRedrawTime/2+s/2}else Kl(r,!1,n);r.skipFrame=!1,Dn(t)}};Dn(t)}};var ky=function(e){this.init(e)},_f=ky,ca=_f.prototype;ca.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];ca.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=n.getElementById(o)!=null;if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!u){var l=n.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}var v=a.getComputedStyle(t),f=v.getPropertyValue("position");f==="static"&&Fe("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=r.showFps,e.debug=r.debug,e.webgl=r.webgl,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=te(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};ca.notify=function(r,e){var t=this,a=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&a.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),r==="gc"&&t.redrawHint("gc",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};ca.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],a=t,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}};ca.isHeadless=function(){return!1};[Cs,Ff,Vf,fa,et,Ya].forEach(function(r){ge(ca,r)});var Ao=1e3/60,Gf={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=Wa(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(l,v){var f=Jr(),c=n.averageRedrawTime,d=n.lastRedrawTime,h=[],y=n.cy.extent(),g=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var p=Jr(),m=p-f,b=p-v;if(d<Ao){var w=Ao-(l?c:0);if(b>=e.deqFastCost*w)break}else if(l){if(m>=e.deqCost*d||m>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*Ao)break;var x=e.deq(a,g,y);if(x.length>0)for(var C=0;C<x.length;C++)h.push(x[C]);else break}h.length>0&&(e.onDeqd(a,h),!l&&e.shouldRedraw(a,h,g,y)&&i())},s=e.priority||ls;n.beforeRender(o,s(a))}}}},Dy=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pn;mt(this,r),this.idsByKey=new Qr,this.keyForId=new Qr,this.cachesByLvl=new Qr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return bt(r,[{key:"getIdsFor",value:function(t){t==null&&Ue("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new ht,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Qr,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Ul=25,fn=50,En=-4,jo=3,Hf=7.99,By=8,Py=1024,Ay=1024,Ry=1024,My=.2,Ly=.8,Iy=10,Oy=.15,Ny=.1,zy=.9,Fy=.9,Vy=100,qy=1,Qt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},_y=dr({getKey:null,doesEleInvalidateKey:Pn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Tv,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ta=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=_y(t);ge(a,n),a.lookup=new Dy(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},nr=Ta.prototype;nr.reasons=Qt;nr.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};nr.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a};nr.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new $a(function(t,a){return a.reqs-t.reqs});return e};nr.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};nr.getElement=function(r,e,t,a,n){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(fs(s*t))),a<En)a=En;else if(s>=Hf||a>jo)return null;var l=Math.pow(2,a),v=e.h*l,f=e.w*l,c=o.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,c))return null;var d=u.get(r,a);if(d&&d.invalidated&&(d.invalidated=!1,d.texture.invalidatedWidth-=d.width),d)return d;var h;if(v<=Ul?h=Ul:v<=fn?h=fn:h=Math.ceil(v/fn)*fn,v>Ry||f>Ay)return null;var y=i.getTextureQueue(h),g=y[y.length-2],p=function(){return i.recycleTexture(h,f)||i.addTexture(h,f)};g||(g=y[y.length-1]),g||(g=p()),g.width-g.usedWidth<f&&(g=p());for(var m=function(I){return I&&I.scaledLabelShown===c},b=n&&n===Qt.dequeue,w=n&&n===Qt.highQuality,x=n&&n===Qt.downscale,C,E=a+1;E<=jo;E++){var T=u.get(r,E);if(T){C=T;break}}var k=C&&C.level===a+1?C:null,D=function(){g.context.drawImage(k.texture.canvas,k.x,0,k.width,k.height,g.usedWidth,0,f,v)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,f,h),m(k))D();else if(m(C))if(w){for(var A=C.level;A>a;A--)k=i.getElement(r,e,t,A,Qt.downscale);D()}else return i.queueElement(r,C.level-1),C;else{var P;if(!b&&!w&&!x)for(var B=a-1;B>=En;B--){var R=u.get(r,B);if(R){P=R;break}}if(m(P))return i.queueElement(r,a),P;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,r,e,c,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return d={x:g.usedWidth,texture:g,level:a,scale:l,width:f,height:v,scaledLabelShown:c},g.usedWidth+=Math.ceil(f+By),g.eleCaches.push(d),u.set(r,a,d),i.checkTextureFullness(g),d};nr.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])};nr.invalidateElement=function(r){var e=this,t=e.lookup,a=[],n=t.isInvalid(r);if(n){for(var i=En;i<=jo;i++){var o=t.getForCachedKey(r,i);o&&a.push(o)}var s=t.invalidate(r);if(s)for(var u=0;u<a.length;u++){var l=a[u],v=l.texture;v.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(v)}e.removeFromQueue(r)}};nr.checkTextureUtility=function(r){r.invalidatedWidth>=My*r.width&&this.retireTexture(r)};nr.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>Ly&&r.fullnessChecks>=Iy?ct(t,r):r.fullnessChecks++};nr.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;ct(a,r),r.retired=!0;for(var i=r.eleCaches,o=0;o<i.length;o++){var s=i[o];n.deleteCache(s.key,s.level)}vs(i);var u=e.getRetiredTextureQueue(t);u.push(r)};nr.addTexture=function(r,e){var t=this,a=t.getTextureQueue(r),n={};return a.push(n),n.eleCaches=[],n.height=r,n.width=Math.max(Py,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=t.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};nr.recycleTexture=function(r,e){for(var t=this,a=t.getTextureQueue(r),n=t.getRetiredTextureQueue(r),i=0;i<n.length;i++){var o=n[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,vs(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),ct(n,o),a.push(o),o}};nr.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),o=n[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(r),o.reqs++,a.updateItem(o);else{var s={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(s),n[i]=s}};nr.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<qy&&t.size()>0;o++){var s=t.pop(),u=s.key,l=s.eles[0],v=i.hasCache(l,s.level);if(a[u]=null,v)continue;n.push(s);var f=e.getBoundingBox(l);e.getElement(l,f,r,s.level,Qt.dequeue)}return n};nr.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=us,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))};nr.onDequeue=function(r){this.onDequeues.push(r)};nr.offDequeue=function(r){ct(this.onDequeues,r)};nr.setupDequeueing=Gf.setupDequeueing({deqRedrawThreshold:Vy,deqCost:Oy,deqAvgCost:Ny,deqNoDrawCost:zy,deqFastCost:Fy,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(t)}},shouldRedraw:function(e,t,a,n){for(var i=0;i<t.length;i++)for(var o=t[i].eles,s=0;s<o.length;s++){var u=o[s].boundingBox();if(cs(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Gy=1,Da=-4,Vn=2,Hy=3.99,Wy=50,$y=50,Ky=.15,Uy=.1,Xy=.9,Yy=.9,Zy=1,Xl=250,Qy=4e3*4e3,Yl=32767,Jy=!0,Wf=function(e){var t=this,a=t.renderer=e,n=a.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Jr()-2*Xl,t.skipping=!1,t.eleTxrDeqs=n.collection(),t.scheduleElementRefinement=Wa(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},$y),a.beforeRender(function(o,s){s-t.lastInvalidationTime<=Xl?t.skipping=!0:t.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(s,u){return u.reqs-s.reqs};t.layersQueue=new $a(i),t.setupDequeueing()},gr=Wf.prototype,Zl=0,jy=Math.pow(2,53)-1;gr.makeLayer=function(r,e){var t=Math.pow(2,e),a=Math.ceil(r.w*t),n=Math.ceil(r.h*t),i=this.renderer.makeOffscreenCanvas(a,n),o={id:Zl=++Zl%jy,bb:r,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(t,t),s.translate(u,l),o};gr.getLayers=function(r,e,t){var a=this,n=a.renderer,i=n.cy,o=i.zoom(),s=a.firstGet;if(a.firstGet=!1,t==null){if(t=Math.ceil(fs(o*e)),t<Da)t=Da;else if(o>=Hy||t>Vn)return null}a.validateLayersElesOrdering(t,r);var u=a.layersByLevel,l=Math.pow(2,t),v=u[t]=u[t]||[],f,c=a.levelIsComplete(t,r),d,h=function(){var D=function(M){if(a.validateLayersElesOrdering(M,r),a.levelIsComplete(M,r))return d=u[M],!0},A=function(M){if(!d)for(var I=t+M;Da<=I&&I<=Vn&&!D(I);I+=M);};A(1),A(-1);for(var P=v.length-1;P>=0;P--){var B=v[P];B.invalid&&ct(v,B)}};if(!c)h();else return v;var y=function(){if(!f){f=yr();for(var D=0;D<r.length;D++)Wh(f,r[D].boundingBox())}return f},g=function(D){D=D||{};var A=D.after;y();var P=Math.ceil(f.w*l),B=Math.ceil(f.h*l);if(P>Yl||B>Yl)return null;var R=P*B;if(R>Qy)return null;var M=a.makeLayer(f,t);if(A!=null){var I=v.indexOf(A)+1;v.splice(I,0,M)}else(D.insert===void 0||D.insert)&&v.unshift(M);return M};if(a.skipping&&!s)return null;for(var p=null,m=r.length/Gy,b=!s,w=0;w<r.length;w++){var x=r[w],C=x._private.rscratch,E=C.imgLayerCaches=C.imgLayerCaches||{},T=E[t];if(T){p=T;continue}if((!p||p.eles.length>=m||!Rv(p.bb,x.boundingBox()))&&(p=g({insert:!0,after:p}),!p))return null;d||b?a.queueLayer(p,x):a.drawEleInLayer(p,x,t,e),p.eles.push(x),E[t]=p}return d||(b?null:v)};gr.getEleLevelForLayerLevel=function(r,e){return r};gr.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,o=r.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,t,Jy),i.setImgSmoothing(o,!0))};gr.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i<a.length;i++){var o=a[i];if(o.reqs>0||o.invalid)return!1;n+=o.eles.length}return n===e.length};gr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var a=0;a<t.length;a++){for(var n=t[a],i=-1,o=0;o<e.length;o++)if(n.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(n);continue}for(var s=i,o=0;o<n.eles.length;o++)if(n.eles[o]!==e[s+o]){this.invalidateLayer(n);break}}};gr.updateElementsInLayers=function(r,e){for(var t=this,a=qa(r[0]),n=0;n<r.length;n++)for(var i=a?null:r[n],o=a?r[n]:r[n].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=Da;l<=Vn;l++){var v=u[l];v&&(i&&t.getEleLevelForLayerLevel(v.level)!==i.level||e(v,o,i))}};gr.haveLayers=function(){for(var r=this,e=!1,t=Da;t<=Vn;t++){var a=r.layersByLevel[t];if(a&&a.length>0){e=!0;break}}return e};gr.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Jr(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))};gr.invalidateLayer=function(r){if(this.lastInvalidationTime=Jr(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];ct(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n<t.length;n++){var i=t[n]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};gr.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(a,n,i){var o=a.replacement;if(o||(o=a.replacement=e.makeLayer(a.bb,a.level),o.replaces=a,o.eles=a.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};gr.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()};gr.queueLayer=function(r,e){var t=this,a=t.layersQueue,n=r.elesQueue,i=n.hasId=n.hasId||{};if(!r.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}r.reqs?(r.reqs++,a.updateItem(r)):(r.reqs=1,a.push(r))}};gr.dequeue=function(r){for(var e=this,t=e.layersQueue,a=[],n=0;n<Zy&&t.size()!==0;){var i=t.peek();if(i.replacement){t.pop();continue}if(i.replaces&&i!==i.replaces.replacement){t.pop();continue}if(i.invalid){t.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,r),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a};gr.applyLayerReplacement=function(r){var e=this,t=e.layersByLevel[r.level],a=r.replaces,n=t.indexOf(a);if(!(n<0||a.invalid)){t[n]=r;for(var i=0;i<r.eles.length;i++){var o=r.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[r.level]=r)}e.requestRedraw()}};gr.requestRedraw=Wa(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);gr.setupDequeueing=Gf.setupDequeueing({deqRedrawThreshold:Wy,deqCost:Ky,deqAvgCost:Uy,deqNoDrawCost:Xy,deqFastCost:Yy,deq:function(e,t){return e.dequeue(t)},onDeqd:ls,shouldRedraw:Tv,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var $f={},Ql;function em(r,e){for(var t=0;t<e.length;t++){var a=e[t];r.lineTo(a.x,a.y)}}function rm(r,e,t){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,a.x,a.y)}function Jl(r,e,t){r.beginPath&&r.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];r.lineTo(i.x,i.y)}var o=t,s=t[0];r.moveTo(s.x,s.y);for(var n=1;n<o.length;n++){var i=o[n];r.lineTo(i.x,i.y)}r.closePath&&r.closePath()}function tm(r,e,t,a,n){r.beginPath&&r.beginPath(),r.arc(t,a,n,0,Math.PI*2,!1);var i=e,o=i[0];r.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];r.lineTo(u.x,u.y)}r.closePath&&r.closePath()}function am(r,e,t,a){r.arc(e,t,a,0,Math.PI*2,!1)}$f.arrowShapeImpl=function(r){return(Ql||(Ql={polygon:em,"triangle-backcurve":rm,"triangle-tee":Jl,"circle-triangle":tm,"triangle-cross":Jl,circle:am}))[r]};var Xr={};Xr.drawElement=function(r,e,t,a,n,i){var o=this;e.isNode()?o.drawNode(r,e,t,a,n,i):o.drawEdge(r,e,t,a,n,i)};Xr.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};Xr.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};Xr.drawCachedElementPortion=function(r,e,t,a,n,i,o,s){var u=this,l=t.getBoundingBox(e);if(!(l.w===0||l.h===0)){var v=t.getElement(e,l,a,n,i);if(v!=null){var f=s(u,e);if(f===0)return;var c=o(u,e),d=l.x1,h=l.y1,y=l.w,g=l.h,p,m,b,w,x;if(c!==0){var C=t.getRotationPoint(e);b=C.x,w=C.y,r.translate(b,w),r.rotate(c),x=u.getImgSmoothing(r),x||u.setImgSmoothing(r,!0);var E=t.getRotationOffset(e);p=E.x,m=E.y}else p=d,m=h;var T;f!==1&&(T=r.globalAlpha,r.globalAlpha=T*f),r.drawImage(v.texture.canvas,v.x,0,v.width,v.height,p,m,y,g),f!==1&&(r.globalAlpha=T),c!==0&&(r.rotate(-c),r.translate(-b,-w),x||u.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var nm=function(){return 0},im=function(e,t){return e.getTextAngle(t,null)},om=function(e,t){return e.getTextAngle(t,"source")},sm=function(e,t){return e.getTextAngle(t,"target")},um=function(e,t){return t.effectiveOpacity()},Ro=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Xr.drawCachedElement=function(r,e,t,a,n,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,v=s.slbTxrCache,f=s.tlbTxrCache,c=e.boundingBox(),d=i===!0?u.reasons.highQuality:null;if(!(c.w===0||c.h===0||!e.visible())&&(!a||cs(c,a))){var h=e.isEdge(),y=e.element()._private.rscratch.badLine;o.drawElementUnderlay(r,e),o.drawCachedElementPortion(r,e,u,t,n,d,nm,um),(!h||!y)&&o.drawCachedElementPortion(r,e,l,t,n,d,im,Ro),h&&!y&&(o.drawCachedElementPortion(r,e,v,t,n,d,om,Ro),o.drawCachedElementPortion(r,e,f,t,n,d,sm,Ro)),o.drawElementOverlay(r,e)}};Xr.drawElements=function(r,e){for(var t=this,a=0;a<e.length;a++){var n=e[a];t.drawElement(r,n)}};Xr.drawCachedElements=function(r,e,t,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];n.drawCachedElement(r,o,t,a)}};Xr.drawCachedNodes=function(r,e,t,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&n.drawCachedElement(r,o,t,a)}};Xr.drawLayeredElements=function(r,e,t,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,t);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||r.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(r,e,t,a)};var rt={};rt.drawEdge=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;t&&(u=t,r.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,v=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,d=e.pstyle("width").pfValue,h=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,g=e.pstyle("line-outline-color").value,p=l*v,m=l*v,b=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;f==="straight-triangle"?(o.eleStrokeStyle(r,e,M),o.drawEdgeTrianglePath(e,r,s.allpts)):(r.lineWidth=d,r.lineCap=h,o.eleStrokeStyle(r,e,M),o.drawEdgePath(e,r,s.allpts,c),r.lineCap="butt")},w=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(r.lineWidth=d+y,r.lineCap=h,y>0)o.colorStrokeStyle(r,g,M);else{r.lineCap="butt";return}f==="straight-triangle"?o.drawEdgeTrianglePath(e,r,s.allpts):(o.drawEdgePath(e,r,s.allpts,c),r.lineCap="butt")},x=function(){n&&o.drawEdgeOverlay(r,e)},C=function(){n&&o.drawEdgeUnderlay(r,e)},E=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;o.drawArrowheads(r,e,M)},T=function(){o.drawElementText(r,e,null,a)};r.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var D=e.pstyle("ghost-offset-x").pfValue,A=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,B=p*P;r.translate(D,A),b(B),E(B),r.translate(-D,-A)}else w();C(),b(),E(),x(),T(),t&&r.translate(u.x1,u.y1)}};var Kf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){var n;if(a.visible()){var i=a.pstyle("".concat(e,"-opacity")).value;if(i!==0){var o=this,s=o.usePaths(),u=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,v=2*l;t.lineWidth=v,u.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round";var f=(n=a.pstyle("".concat(e,"-fill")))===null||n===void 0?void 0:n.value;if(f==="linear-gradient"||f==="radial-gradient"){var c=o.createGradientStyleFor(t,e,a,f,i);if(c)t.strokeStyle=c;else{var d=a.pstyle("".concat(e,"-color")).value;o.colorStrokeStyle(t,d,i)}}else{var h=a.pstyle("".concat(e,"-color")).value;o.colorStrokeStyle(t,h,i)}o.drawEdgePath(a,t,u.allpts,"solid")}}}};rt.drawEdgeOverlay=Kf("overlay");rt.drawEdgeUnderlay=Kf("underlay");rt.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,v=r.pstyle("line-dash-offset").pfValue;if(u){var f=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===f;c?(o=e=n.pathCache,s=!0):(o=e=new Path2D,n.pathCacheKey=f,n.pathCache=o)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=v;break;case"solid":i.setLineDash([]);break}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<t.length;d+=4)e.quadraticCurveTo(t[d],t[d+1],t[d+2],t[d+3]);break;case"straight":case"haystack":for(var h=2;h+1<t.length;h+=2)e.lineTo(t[h],t[h+1]);break;case"segments":if(n.isRound){var y=Dr(n.roundCorners),g;try{for(y.s();!(g=y.n()).done;){var p=g.value;Lf(e,p)}}catch(b){y.e(b)}finally{y.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var m=2;m+1<t.length;m+=2)e.lineTo(t[m],t[m+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};rt.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var a=r.pstyle("width").pfValue,n=0;n+1<t.length;n+=2){var i=[t[n+2]-t[n],t[n+3]-t[n+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(t[n]-u[0],t[n+1]-u[1]),e.lineTo(t[n]+u[0],t[n+1]+u[1]),e.lineTo(t[n+2],t[n+3]),e.closePath(),e.fill()}};rt.drawArrowheads=function(r,e,t){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(r,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,t),n||this.drawArrowhead(r,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,t)};rt.drawArrowhead=function(r,e,t,a,n,i,o){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(t+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",v=e.pstyle(t+"-arrow-fill").value,f=e.pstyle("width").pfValue,c=e.pstyle(t+"-arrow-width"),d=c.value==="match-line"?f:c.pfValue;c.units==="%"&&(d*=f);var h=e.pstyle("opacity").value;o===void 0&&(o=h);var y=r.globalCompositeOperation;(o!==1||v==="hollow")&&(r.globalCompositeOperation="destination-out",s.colorFillStyle(r,[255,255,255],1),s.colorStrokeStyle(r,[255,255,255],1),s.drawArrowShape(e,r,l,f,u,d,a,n,i,t),r.globalCompositeOperation=y);var g=e.pstyle(t+"-arrow-color").value;s.colorFillStyle(r,g,o),s.colorStrokeStyle(r,g,o),s.drawArrowShape(e,r,v,f,u,d,a,n,i,t)}}};rt.drawArrowShape=function(r,e,t,a,n,i,o,s,u,l){var v=this,f=this.usePaths()&&n!=="triangle-cross",c=!1,d,h=e,y={x:o,y:s},g=v.arrowShapes[n],p=Lr(r,l),m=this.getArrowWidth(a,p);if(f){var b=v.arrowPathCache=v.arrowPathCache||[],w=Lt(n),x=b[w];x!=null?(d=e=x,c=!0):(d=e=new Path2D,b[w]=d)}c||(e.beginPath&&e.beginPath(),f?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,m,u,y,a),e.closePath&&e.closePath()),e=h,f&&(e.translate(o,s),e.rotate(u),e.scale(m,m)),(t==="filled"||t==="both")&&(f?e.fill(d):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=i/(f?m:1),e.lineJoin="miter",f?e.stroke(d):e.stroke()),f&&(e.scale(1/m,1/m),e.rotate(-u),e.translate(-o,-s))};var ks={};ks.safeDrawImage=function(r,e,t,a,n,i,o,s,u,l){if(!(n<=0||i<=0||u<=0||l<=0))try{r.drawImage(e,t,a,n,i,o,s,u,l)}catch(v){Fe(v)}};ks.drawInscribedImage=function(r,e,t,a,n){var i=this,o=t.position(),s=o.x,u=o.y,l=t.cy().style(),v=l.getIndexedStyle.bind(l),f=v(t,"background-fit","value",a),c=v(t,"background-repeat","value",a),d=t.width(),h=t.height(),y=t.padding()*2,g=d+(v(t,"background-width-relative-to","value",a)==="inner"?0:y),p=h+(v(t,"background-height-relative-to","value",a)==="inner"?0:y),m=t._private.rscratch,b=v(t,"background-clip","value",a),w=b==="node",x=v(t,"background-image-opacity","value",a)*n,C=v(t,"background-image-smoothing","value",a),E=t.pstyle("corner-radius").value;E!=="auto"&&(E=t.pstyle("corner-radius").pfValue);var T=e.width||e.cachedW,k=e.height||e.cachedH;(T==null||k==null)&&(document.body.appendChild(e),T=e.cachedW=e.width||e.offsetWidth,k=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var D=T,A=k;if(v(t,"background-width","value",a)!=="auto"&&(v(t,"background-width","units",a)==="%"?D=v(t,"background-width","pfValue",a)*g:D=v(t,"background-width","pfValue",a)),v(t,"background-height","value",a)!=="auto"&&(v(t,"background-height","units",a)==="%"?A=v(t,"background-height","pfValue",a)*p:A=v(t,"background-height","pfValue",a)),!(D===0||A===0)){if(f==="contain"){var P=Math.min(g/D,p/A);D*=P,A*=P}else if(f==="cover"){var P=Math.max(g/D,p/A);D*=P,A*=P}var B=s-g/2,R=v(t,"background-position-x","units",a),M=v(t,"background-position-x","pfValue",a);R==="%"?B+=(g-D)*M:B+=M;var I=v(t,"background-offset-x","units",a),L=v(t,"background-offset-x","pfValue",a);I==="%"?B+=(g-D)*L:B+=L;var O=u-p/2,G=v(t,"background-position-y","units",a),_=v(t,"background-position-y","pfValue",a);G==="%"?O+=(p-A)*_:O+=_;var N=v(t,"background-offset-y","units",a),F=v(t,"background-offset-y","pfValue",a);N==="%"?O+=(p-A)*F:O+=F,m.pathCache&&(B-=s,O-=u,s=0,u=0);var Z=r.globalAlpha;r.globalAlpha=x;var J=i.getImgSmoothing(r),U=!1;if(C==="no"&&J?(i.setImgSmoothing(r,!1),U=!0):C==="yes"&&!J&&(i.setImgSmoothing(r,!0),U=!0),c==="no-repeat")w&&(r.save(),m.pathCache?r.clip(m.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,s,u,g,p,E,m),r.clip())),i.safeDrawImage(r,e,0,0,T,k,B,O,D,A),w&&r.restore();else{var j=r.createPattern(e,c);r.fillStyle=j,i.nodeShapes[i.getNodeShape(t)].draw(r,s,u,g,p,E,m),r.translate(B,O),r.fill(),r.translate(-B,-O)}r.globalAlpha=Z,U&&i.setImgSmoothing(r,J)}};var Ft={};Ft.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(fs(t*a));e=Math.pow(2,n)}var i=r.pstyle("font-size").pfValue*e,o=r.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};Ft.drawElementText=function(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e),l=e.pstyle("text-metrics").strValue==="glyph";r.textAlign=u,r.textBaseline=l?"alphabetic":"bottom"}else{var v=e.element()._private.rscratch.badLine,f=e.pstyle("label"),c=e.pstyle("source-label"),d=e.pstyle("target-label");if(v||(!f||!f.value)&&(!c||!c.value)&&(!d||!d.value))return;r.textAlign="center",r.textBaseline="bottom"}var h=!t,y;t&&(y=t,r.translate(-y.x1,-y.y1)),n==null?(o.drawText(r,e,null,h,i),e.isEdge()&&(o.drawText(r,e,"source",h,i),o.drawText(r,e,"target",h,i))):o.drawText(r,e,n,h,i),t&&r.translate(y.x1,y.y1)};Ft.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e};Ft.setupTextStyle=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;r.font=a+" "+o+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,l,s),this.colorStrokeStyle(r,v,u)};function lm(r,e,t,a,n){var i=Math.min(a,n),o=i/2,s=e+a/2,u=t+n/2;r.beginPath(),r.arc(s,u,o,0,Math.PI*2),r.closePath()}function jl(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,a/2,n/2);r.beginPath(),r.moveTo(e+o,t),r.lineTo(e+a-o,t),r.quadraticCurveTo(e+a,t,e+a,t+o),r.lineTo(e+a,t+n-o),r.quadraticCurveTo(e+a,t+n,e+a-o,t+n),r.lineTo(e+o,t+n),r.quadraticCurveTo(e,t+n,e,t+n-o),r.lineTo(e,t+o),r.quadraticCurveTo(e,t,e+o,t),r.closePath()}Ft.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",o=r.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=pr(n,"labelAngle",e);t=r.isEdge()?s:0}else o.strValue==="none"?t=0:t=o.pfValue;return t};Ft.drawText=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=n?e.effectiveOpacity():1;if(!(n&&(s===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=pr(o,"labelX",t),l=pr(o,"labelY",t),v,f,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,n);var d=t?t+"-":"",h=pr(o,"labelWidth",t),y=pr(o,"labelHeight",t),g=pr(o,"labelActualDescent",t),p=e.pstyle(d+"text-margin-x").pfValue,m=e.pstyle(d+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,x=e.pstyle("text-valign").value;b&&(w="center",x="center"),u+=p,l+=m;var C;a?C=this.getTextAngle(e,t):C=0,C!==0&&(v=u,f=l,r.translate(v,f),r.rotate(C),u=0,l=0);var E=ia(w),T=oa(x);switch(T){case"top":break;case"center":l+=y/2;break;case"bottom":l+=y;break}var k=e.pstyle("text-background-opacity").value,D=e.pstyle("text-border-opacity").value,A=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,B=e.pstyle("text-background-shape").strValue,R=B==="round-rectangle"||B==="roundrectangle",M=B==="circle",I=2;if(k>0||A>0&&D>0){var L=r.fillStyle,O=r.strokeStyle,G=r.lineWidth,_=e.pstyle("text-background-color").value,N=e.pstyle("text-border-color").value,F=e.pstyle("text-border-style").value,Z=k>0,J=A>0&&D>0,U=u-P;switch(E){case"left":U-=h;break;case"center":U-=h/2;break}var j=l-y-P,re=h+2*P,ne=y+2*P;if(Z&&this.colorFillStyle(r,_,k*s),J&&(this.colorStrokeStyle(r,N,D*s),r.lineWidth=A,r.setLineDash))switch(F){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=A/4,r.setLineDash([]);break;default:r.setLineDash([]);break}if(R?(r.beginPath(),jl(r,U,j,re,ne,I)):M?(r.beginPath(),lm(r,U,j,re,ne)):(r.beginPath(),r.rect(U,j,re,ne)),Z&&r.fill(),J&&r.stroke(),J&&F==="double"){var W=A/2;r.beginPath(),R?jl(r,U+W,j+W,re-2*W,ne-2*W,I):r.rect(U+W,j+W,re-2*W,ne-2*W),r.stroke()}r.fillStyle=L,r.strokeStyle=O,r.lineWidth=G,r.setLineDash&&r.setLineDash([])}var z=2*e.pstyle("text-outline-width").pfValue;if(z>0&&(r.lineWidth=z),l-=g,e.pstyle("text-wrap").value==="wrap"){var q=pr(o,"labelWrapCachedLines",t),X=pr(o,"labelLineHeight",t),Y=h/2,ae=this.getLabelJustification(e);switch(ae==="auto"||(E==="left"?ae==="left"?u+=-h:ae==="center"&&(u+=-Y):E==="center"?ae==="left"?u+=-Y:ae==="right"&&(u+=Y):E==="right"&&(ae==="center"?u+=Y:ae==="right"&&(u+=h))),T){case"top":l-=(q.length-1)*X;break;case"center":case"bottom":l-=(q.length-1)*X;break}for(var ve=0;ve<q.length;ve++)z>0&&r.strokeText(q[ve],u,l),r.fillText(q[ve],u,l),l+=X}else z>0&&r.strokeText(c,u,l),r.fillText(c,u,l);C!==0&&(r.rotate(-C),r.translate(-v,-f))}}};var xt={};xt.drawNode=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,u,l=e._private,v=l.rscratch,f=e.position();if(!(!te(f.x)||!te(f.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,d=o.usePaths(),h,y=!1,g=e.padding();s=e.width()+2*g,u=e.height()+2*g;var p;t&&(p=t,r.translate(-p.x1,-p.y1));for(var m=e.pstyle("background-image"),b=m.value,w=new Array(b.length),x=new Array(b.length),C=0,E=0;E<b.length;E++){var T=b[E],k=w[E]=T!=null&&T!=="none";if(k){var D=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",E);C++,x[E]=o.getCachedImage(T,D,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var A=e.pstyle("background-blacken").value,P=e.pstyle("border-width").pfValue,B=e.pstyle("background-opacity").value*c,R=e.pstyle("border-color").value,M=e.pstyle("border-style").value,I=e.pstyle("border-join").value,L=e.pstyle("border-cap").value,O=e.pstyle("border-position").value,G=e.pstyle("border-dash-pattern").pfValue,_=e.pstyle("border-dash-offset").pfValue,N=e.pstyle("border-opacity").value*c,F=e.pstyle("outline-width").pfValue,Z=e.pstyle("outline-color").value,J=e.pstyle("outline-style").value,U=e.pstyle("outline-opacity").value*c,j=e.pstyle("outline-offset").value,re=e.pstyle("corner-radius").value;re!=="auto"&&(re=e.pstyle("corner-radius").pfValue);var ne=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;o.eleFillStyle(r,e,le)},W=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;o.colorStrokeStyle(r,R,le)},z=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U;o.colorStrokeStyle(r,Z,le)},q=function(le,xe,Ee,Q){var S=o.nodePathCache=o.nodePathCache||[],V=Cv(Ee==="polygon"?Ee+","+Q.join(","):Ee,""+xe,""+le,""+re),$=S[V],H,K=!1;return $!=null?(H=$,K=!0,v.pathCache=H):(H=new Path2D,S[V]=v.pathCache=H),{path:H,cacheHit:K}},X=e.pstyle("shape").strValue,Y=e.pstyle("shape-polygon-points").pfValue;if(d){r.translate(f.x,f.y);var ae=q(s,u,X,Y);h=ae.path,y=ae.cacheHit}var ve=function(){if(!y){var le=f;d&&(le={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(h||r,le.x,le.y,s,u,re,v)}d?r.fill(h):r.fill()},Ne=function(){for(var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ee=l.backgrounding,Q=0,S=0;S<x.length;S++)if(w[S]){var V=e.cy().style().getIndexedStyle(e,"background-image-containment","value",S);if(xe&&V==="over"||!xe&&V==="inside"){Q++;continue}w[S]&&x[S].complete&&!x[S].error&&(Q++,o.drawInscribedImage(r,x[S],e,S,le))}l.backgrounding=Q!==C,Ee!==l.backgrounding&&e.updateStyle(!1)},Se=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;o.hasPie(e)&&(o.drawPie(r,e,xe),le&&(d||o.nodeShapes[o.getNodeShape(e)].draw(r,f.x,f.y,s,u,re,v)))},we=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;o.hasStripe(e)&&(r.save(),d?r.clip(v.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(r,f.x,f.y,s,u,re,v),r.clip()),o.drawStripe(r,e,xe),r.restore(),le&&(d||o.nodeShapes[o.getNodeShape(e)].draw(r,f.x,f.y,s,u,re,v)))},pe=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,xe=(A>0?A:-A)*le,Ee=A>0?0:255;A!==0&&(o.colorFillStyle(r,[Ee,Ee,Ee],xe),d?r.fill(h):r.fill())},ie=function(){if(P>0){if(r.lineWidth=P,r.lineCap=L,r.lineJoin=I,r.setLineDash)switch(M){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(G),r.lineDashOffset=_;break;case"solid":case"double":r.setLineDash([]);break}if(O!=="center"){if(r.save(),r.lineWidth*=2,O==="inside")d?r.clip(h):r.clip();else{var le=new Path2D;le.rect(-s/2-P,-u/2-P,s+2*P,u+2*P),le.addPath(h),r.clip(le,"evenodd")}d?r.stroke(h):r.stroke(),r.restore()}else d?r.stroke(h):r.stroke();if(M==="double"){r.lineWidth=P/3;var xe=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",d?r.stroke(h):r.stroke(),r.globalCompositeOperation=xe}r.setLineDash&&r.setLineDash([])}},ye=function(){if(F>0){if(r.lineWidth=F,r.lineCap="butt",r.setLineDash)switch(J){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var le=f;d&&(le={x:0,y:0});var xe=o.getNodeShape(e),Ee=P;O==="inside"&&(Ee=0),O==="outside"&&(Ee*=2);var Q=(s+Ee+(F+j))/s,S=(u+Ee+(F+j))/u,V=s*Q,$=u*S,H=o.nodeShapes[xe].points,K;if(d){var de=q(V,$,xe,H);K=de.path}if(xe==="ellipse")o.drawEllipsePath(K||r,le.x,le.y,V,$);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(xe)){var ee=0,fe=0,ue=0;xe==="round-diamond"?ee=(Ee+j+F)*1.4:xe==="round-heptagon"?(ee=(Ee+j+F)*1.075,ue=-(Ee/2+j+F)/35):xe==="round-hexagon"?ee=(Ee+j+F)*1.12:xe==="round-pentagon"?(ee=(Ee+j+F)*1.13,ue=-(Ee/2+j+F)/15):xe==="round-tag"?(ee=(Ee+j+F)*1.12,fe=(Ee/2+F+j)*.07):xe==="round-triangle"&&(ee=(Ee+j+F)*(Math.PI/2),ue=-(Ee+j/2+F)/Math.PI),ee!==0&&(Q=(s+ee)/s,V=s*Q,["round-hexagon","round-tag"].includes(xe)||(S=(u+ee)/u,$=u*S)),re=re==="auto"?Fv(V,$):re;for(var me=V/2,Me=$/2,Pe=re+(Ee+F+j)/2,se=new Array(H.length/2),Te=new Array(H.length/2),De=0;De<H.length/2;De++)se[De]={x:le.x+fe+me*H[De*2],y:le.y+ue+Me*H[De*2+1]};var He,Qe,Br,Je,ir=se.length;for(Qe=se[ir-1],He=0;He<ir;He++)Br=se[He%ir],Je=se[(He+1)%ir],Te[He]=Ts(Qe,Br,Je,Pe),Qe=Br,Br=Je;o.drawRoundPolygonPath(K||r,le.x+fe,le.y+ue,s*Q,u*S,H,Te)}else if(["roundrectangle","round-rectangle"].includes(xe))re=re==="auto"?dt(V,$):re,o.drawRoundRectanglePath(K||r,le.x,le.y,V,$,re+(Ee+F+j)/2);else if(["cutrectangle","cut-rectangle"].includes(xe))re=re==="auto"?hs():re,o.drawCutRectanglePath(K||r,le.x,le.y,V,$,null,re+(Ee+F+j)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(xe))re=re==="auto"?dt(V,$):re,o.drawBottomRoundRectanglePath(K||r,le.x,le.y,V,$,re+(Ee+F+j)/2);else if(xe==="barrel")o.drawBarrelPath(K||r,le.x,le.y,V,$);else if(xe.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(xe)){var fr=(Ee+F+j)/s;H=Rn(Mn(H,fr)),o.drawPolygonPath(K||r,le.x,le.y,s,u,H)}else{var Cr=(Ee+F+j)/s;H=Rn(Mn(H,-Cr)),o.drawPolygonPath(K||r,le.x,le.y,s,u,H)}if(d?r.stroke(K):r.stroke(),J==="double"){r.lineWidth=Ee/3;var tt=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",d?r.stroke(K):r.stroke(),r.globalCompositeOperation=tt}r.setLineDash&&r.setLineDash([])}},he=function(){n&&o.drawNodeOverlay(r,e,f,s,u)},Ce=function(){n&&o.drawNodeUnderlay(r,e,f,s,u)},be=function(){o.drawElementText(r,e,null,a)},Ae=e.pstyle("ghost").value==="yes";if(Ae){var Re=e.pstyle("ghost-offset-x").pfValue,Ke=e.pstyle("ghost-offset-y").pfValue,qe=e.pstyle("ghost-opacity").value,_e=qe*c;r.translate(Re,Ke),z(),ye(),ne(qe*B),ve(),Ne(_e,!0),W(qe*N),ie(),Se(A!==0||P!==0),we(A!==0||P!==0),Ne(_e,!1),pe(_e),r.translate(-Re,-Ke)}d&&r.translate(-f.x,-f.y),Ce(),d&&r.translate(f.x,f.y),z(),ye(),ne(),ve(),Ne(c,!0),W(),ie(),Se(A!==0||P!==0),we(A!==0||P!==0),Ne(c,!1),pe(),d&&r.translate(-f.x,-f.y),be(),he(),t&&r.translate(p.x1,p.y1)}};var Uf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a,n,i,o){var s=this;if(a.visible()){var u=a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-opacity")).value,v=a.pstyle("".concat(e,"-shape")).value,f=a.pstyle("".concat(e,"-corner-radius")).value;if(l>0){var c;if(n=n||a.position(),i==null||o==null){var d=a.padding();i=a.width()+2*d,o=a.height()+2*d}var h=(c=a.pstyle("".concat(e,"-fill")))===null||c===void 0?void 0:c.value;if(h==="linear-gradient"||h==="radial-gradient"){var y=s.createGradientStyleFor(t,e,a,h,l);if(y)t.fillStyle=y;else{var g=a.pstyle("".concat(e,"-color")).value;s.colorFillStyle(t,g,l)}}else{var p=a.pstyle("".concat(e,"-color")).value;s.colorFillStyle(t,p,l)}s.nodeShapes[v].draw(t,n.x,n.y,i+u*2,o+u*2,f),t.fill()}}}};xt.drawNodeOverlay=Uf("overlay");xt.drawNodeUnderlay=Uf("underlay");xt.hasPie=function(r){return r=r[0],r._private.hasPie};xt.hasStripe=function(r){return r=r[0],r._private.hasStripe};xt.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,v=e.width(),f=e.height(),c=Math.min(v,f)/2,d,h=0,y=this.usePaths();if(y&&(u=0,l=0),i.units==="%"?c=c*i.pfValue:i.pfValue!==void 0&&(c=i.pfValue/2),o.units==="%"?d=c*o.pfValue:o.pfValue!==void 0&&(d=o.pfValue/2),!(d>=c))for(var g=1;g<=n.pieBackgroundN;g++){var p=e.pstyle("pie-"+g+"-background-size").value,m=e.pstyle("pie-"+g+"-background-color").value,b=e.pstyle("pie-"+g+"-background-opacity").value*t,w=p/100;w+h>1&&(w=1-h);var x=1.5*Math.PI+2*Math.PI*h;x+=s;var C=2*Math.PI*w,E=x+C;p===0||h>=1||h+w>1||(d===0?(r.beginPath(),r.moveTo(u,l),r.arc(u,l,c,x,E),r.closePath()):(r.beginPath(),r.arc(u,l,c,x,E),r.arc(u,l,d,E,x,!0),r.closePath()),this.colorFillStyle(r,m,b),r.fill(),h+=w)}};xt.drawStripe=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,o=a.y,s=e.width(),u=e.height(),l=0,v=this.usePaths();r.save();var f=e.pstyle("stripe-direction").value,c=e.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var d=s,h=u;c.units==="%"?(d=d*c.pfValue,h=h*c.pfValue):c.pfValue!==void 0&&(d=c.pfValue,h=c.pfValue),v&&(i=0,o=0),o-=d/2,i-=h/2;for(var y=1;y<=n.stripeBackgroundN;y++){var g=e.pstyle("stripe-"+y+"-background-size").value,p=e.pstyle("stripe-"+y+"-background-color").value,m=e.pstyle("stripe-"+y+"-background-opacity").value*t,b=g/100;b+l>1&&(b=1-l),!(g===0||l>=1||l+b>1)&&(r.beginPath(),r.rect(i,o+h*l,d,h*b),r.closePath(),this.colorFillStyle(r,p,m),r.fill(),l+=b)}r.restore()};var Er={},vm=100,fm=function(e){return e[3]==null?1:e[3]},Ds=function(e,t){return fm(e)*t};Er.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};Er.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===r){t=!1;break}return t&&(a={context:r},e.push(a)),a};Er.createGradientStyleFor=function(r,e,t,a,n){var i,o=this.usePaths(),s=t.pstyle(e+"-gradient-stop-colors").value,u=t.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(t.isEdge()){var l=t.sourceEndpoint(),v=t.targetEndpoint(),f=t.midpoint(),c=It(l,f),d=It(v,f);i=r.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(c,d))}else{var h=o&&e==="background"?{x:0,y:0}:t.position(),y=t.paddedWidth(),g=t.paddedHeight();i=r.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(y,g))}else if(t.isEdge()){var p=t.sourceEndpoint(),m=t.targetEndpoint();i=r.createLinearGradient(p.x,p.y,m.x,m.y)}else{var b=o&&e==="background"?{x:0,y:0}:t.position(),w=t.paddedWidth(),x=t.paddedHeight(),C=w/2,E=x/2,T=t.pstyle(e+"-gradient-direction").value;switch(T){case"to-bottom":i=r.createLinearGradient(b.x,b.y-E,b.x,b.y+E);break;case"to-top":i=r.createLinearGradient(b.x,b.y+E,b.x,b.y-E);break;case"to-left":i=r.createLinearGradient(b.x+C,b.y,b.x-C,b.y);break;case"to-right":i=r.createLinearGradient(b.x-C,b.y,b.x+C,b.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(b.x-C,b.y-E,b.x+C,b.y+E);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(b.x-C,b.y+E,b.x+C,b.y-E);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(b.x+C,b.y-E,b.x-C,b.y+E);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(b.x+C,b.y+E,b.x-C,b.y-E);break}}if(!i)return null;for(var k=u.length===s.length,D=s.length,A=0;A<D;A++){var P=Ds(s[A],n);i.addColorStop(k?u[A]:A/(D-1),"rgba("+s[A][0]+","+s[A][1]+","+s[A][2]+","+P+")")}return i};Er.gradientFillStyle=function(r,e,t,a){var n=this.createGradientStyleFor(r,"background",e,t,a);if(!n)return null;r.fillStyle=n};Er.colorFillStyle=function(r,e,t){r.fillStyle="rgba("+e[0]+","+e[1]+","+e[2]+","+Ds(e,t)+")"};Er.eleFillStyle=function(r,e,t){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(r,e,a,t);else{var n=e.pstyle("background-color").value;this.colorFillStyle(r,n,t)}};Er.gradientStrokeStyle=function(r,e,t,a){var n=this.createGradientStyleFor(r,"line",e,t,a);if(!n)return null;r.strokeStyle=n};Er.colorStrokeStyle=function(r,e,t){r.strokeStyle="rgba("+e[0]+","+e[1]+","+e[2]+","+Ds(e,t)+")"};Er.eleStrokeStyle=function(r,e,t){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(r,e,a,t);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(r,n,t)}};Er.matchCanvasSize=function(r){var e=this,t=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=n*o,l=i*o,v;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var f=t.canvasContainer;f.style.width=n+"px",f.style.height=i+"px";for(var c=0;c<e.CANVAS_LAYERS;c++)v=t.canvases[c],v.width=u,v.height=l,v.style.width=n+"px",v.style.height=i+"px";for(var c=0;c<e.BUFFER_COUNT;c++)v=t.bufferCanvases[c],v.width=u,v.height=l,v.style.width=n+"px",v.style.height=i+"px";e.textureMult=1,o<=1&&(v=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,v.width=u*e.textureMult,v.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=o}};Er.renderTo=function(r,e,t,a){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:a})};Er.clearCanvas=function(){var r=this,e=r.data;function t(a){a.clearRect(0,0,r.canvasWidth,r.canvasHeight)}t(e.contexts[r.NODE]),t(e.contexts[r.DRAG])};Er.render=function(r){var e=this;r=r||Dv();var t=e.cy,a=r.forcedContext,n=r.drawAllLayers,i=r.drawOnlyNodeLayer,o=r.forcedZoom,s=r.forcedPan,u=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,l=e.data,v=l.canvasNeedsRedraw,f=e.textureOnViewport&&!a&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),c=r.motionBlur!==void 0?r.motionBlur:e.motionBlur,d=e.motionBlurPxRatio,h=t.hasCompoundNodes(),y=e.hoverData.draggingEles,g=!!(e.hoverData.selecting||e.touchData.selecting);c=c&&!a&&e.motionBlurEnabled&&!g;var p=c;a||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!a&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),c&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(p=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!f&&(v[e.NODE]=!0,v[e.SELECT_BOX]=!0);var m=t.style(),b=t.zoom(),w=o!==void 0?o:b,x=t.pan(),C={x:x.x,y:x.y},E={zoom:b,pan:{x:x.x,y:x.y}},T=e.prevViewport,k=T===void 0||E.zoom!==T.zoom||E.pan.x!==T.pan.x||E.pan.y!==T.pan.y;!k&&!(y&&!h)&&(e.motionBlurPxRatio=1),s&&(C=s),w*=u,C.x*=u,C.y*=u;var D=e.getCachedZSortedEles();function A(W,z,q,X,Y){var ae=W.globalCompositeOperation;W.globalCompositeOperation="destination-out",e.colorFillStyle(W,[255,255,255],e.motionBlurTransparency),W.fillRect(z,q,X,Y),W.globalCompositeOperation=ae}function P(W,z){var q,X,Y,ae;!e.clearingMotionBlur&&(W===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||W===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(q={x:x.x*d,y:x.y*d},X=b*d,Y=e.canvasWidth*d,ae=e.canvasHeight*d):(q=C,X=w,Y=e.canvasWidth,ae=e.canvasHeight),W.setTransform(1,0,0,1,0,0),z==="motionBlur"?A(W,0,0,Y,ae):!a&&(z===void 0||z)&&W.clearRect(0,0,Y,ae),n||(W.translate(q.x,q.y),W.scale(X,X)),s&&W.translate(s.x,s.y),o&&W.scale(o,o)}if(f||(e.textureDrawLastFrame=!1),f){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var B=e.data.bufferContexts[e.TEXTURE_BUFFER];B.setTransform(1,0,0,1,0,0),B.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:B,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var E=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}v[e.DRAG]=!1,v[e.NODE]=!1;var R=l.contexts[e.NODE],M=e.textureCache.texture,E=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),c?A(R,0,0,E.width,E.height):R.clearRect(0,0,E.width,E.height);var I=m.core("outside-texture-bg-color").value,L=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,I,L),R.fillRect(0,0,E.width,E.height);var b=t.zoom();P(R,!1),R.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/u,E.height/E.zoom/u),R.drawImage(M,E.mpan.x,E.mpan.y,E.width/E.zoom/u,E.height/E.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var O=t.extent(),G=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),_=e.hideEdgesOnViewport&&G,N=[];if(N[e.NODE]=!v[e.NODE]&&c&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,N[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),N[e.DRAG]=!v[e.DRAG]&&c&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,N[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),v[e.NODE]||n||i||N[e.NODE]){var F=c&&!N[e.NODE]&&d!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),Z=c&&!F?"motionBlur":void 0;P(R,Z),_?e.drawCachedNodes(R,D.nondrag,u,O):e.drawLayeredElements(R,D.nondrag,u,O),e.debug&&e.drawDebugPoints(R,D.nondrag),!n&&!c&&(v[e.NODE]=!1)}if(!i&&(v[e.DRAG]||n||N[e.DRAG])){var F=c&&!N[e.DRAG]&&d!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);P(R,c&&!F?"motionBlur":void 0),_?e.drawCachedNodes(R,D.drag,u,O):e.drawCachedElements(R,D.drag,u,O),e.debug&&e.drawDebugPoints(R,D.drag),!n&&!c&&(v[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,P),c&&d!==1){var J=l.contexts[e.NODE],U=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],j=l.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(z,q,X){z.setTransform(1,0,0,1,0,0),X||!p?z.clearRect(0,0,e.canvasWidth,e.canvasHeight):A(z,0,0,e.canvasWidth,e.canvasHeight);var Y=d;z.drawImage(q,0,0,e.canvasWidth*Y,e.canvasHeight*Y,0,0,e.canvasWidth,e.canvasHeight)};(v[e.NODE]||N[e.NODE])&&(ne(J,U,N[e.NODE]),v[e.NODE]=!1),(v[e.DRAG]||N[e.DRAG])&&(ne(j,re,N[e.DRAG]),v[e.DRAG]=!1)}e.prevViewport=E,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),c&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!f,e.mbFrames=0,v[e.NODE]=!0,v[e.DRAG]=!0,e.redraw()},vm)),a||t.emit("render")};var ba;Er.drawSelectionRectangle=function(r,e){var t=this,a=t.cy,n=t.data,i=a.style(),o=r.drawOnlyNodeLayer,s=r.drawAllLayers,u=n.canvasNeedsRedraw,l=r.forcedContext;if(t.showFps||!o&&u[t.SELECT_BOX]&&!s){var v=l||n.contexts[t.SELECT_BOX];if(e(v),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var f=t.cy.zoom(),c=i.core("selection-box-border-width").value/f;v.lineWidth=c,v.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",v.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),c>0&&(v.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",v.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(n.bgActivePosistion&&!t.hoverData.selecting){var f=t.cy.zoom(),d=n.bgActivePosistion;v.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",v.beginPath(),v.arc(d.x,d.y,i.core("active-bg-size").pfValue/f,0,2*Math.PI),v.fill()}var h=t.lastRedrawTime;if(t.showFps&&h){h=Math.round(h);var y=Math.round(1e3/h),g="1 frame = "+h+" ms = "+y+" fps";if(v.setTransform(1,0,0,1,0,0),v.fillStyle="rgba(255, 0, 0, 0.75)",v.strokeStyle="rgba(255, 0, 0, 0.75)",v.font="30px Arial",!ba){var p=v.measureText(g);ba=p.actualBoundingBoxAscent}v.fillText(g,0,ba);var m=60;v.strokeRect(0,ba+10,250,20),v.fillRect(0,ba+10,250*Math.min(y/m,1),20)}s||(u[t.SELECT_BOX]=!1)}};function ev(r,e,t){var a=r.createShader(e);if(r.shaderSource(a,t),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a));return a}function cm(r,e,t){var a=ev(r,r.VERTEX_SHADER,e),n=ev(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,a),r.attachShader(i,n),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function hm(r,e,t){t===void 0&&(t=e);var a=r.makeOffscreenCanvas(e,t),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function Bs(r){var e=r.pixelRatio,t=r.cy.zoom(),a=r.cy.pan();return{zoom:t*e,pan:{x:a.x*e,y:a.y*e}}}function dm(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function gm(r,e,t,a,n){var i=a*t+e.x,o=n*t+e.y;return o=Math.round(r.canvasHeight-o),[i,o]}function pm(r,e){return e.picking?!0:r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function ym(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function kt(r,e,t){var a=r[0]/255,n=r[1]/255,i=r[2]/255,o=(r[3]==null?1:r[3])*e,s=t||new Array(4);return s[0]=a*o,s[1]=n*o,s[2]=i*o,s[3]=o,s}function $t(r,e){var t=e||new Array(4);return t[0]=(r>>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function mm(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function bm(r,e){var t=r.createTexture();return t.buffer=function(a){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,a),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function Xf(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function Yf(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function wm(r,e,t,a,n,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*a,n);case r.INT:return new Int32Array(t.buffer,i*a,n)}}function xm(r,e,t,a){var n=Xf(r,e),i=er(n,2),o=i[0],s=i[1],u=Yf(r,s,a),l=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,u,r.STATIC_DRAW),s===r.FLOAT?r.vertexAttribPointer(t,o,s,!1,0,0):s===r.INT&&r.vertexAttribIPointer(t,o,s,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),l}function Gr(r,e,t,a){var n=Xf(r,t),i=er(n,3),o=i[0],s=i[1],u=i[2],l=Yf(r,s,e*o),v=o*u,f=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,e*v,r.DYNAMIC_DRAW),r.enableVertexAttribArray(a),s===r.FLOAT?r.vertexAttribPointer(a,o,s,!1,v,0):s===r.INT&&r.vertexAttribIPointer(a,o,s,v,0),r.vertexAttribDivisor(a,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var c=new Array(e),d=0;d<e;d++)c[d]=wm(r,s,l,v,o,d);return f.dataArray=l,f.stride=v,f.size=o,f.getView=function(h){return c[h]},f.setPoint=function(h,y,g){var p=c[h];p[0]=y,p[1]=g},f.bufferSubData=function(h){r.bindBuffer(r.ARRAY_BUFFER,f),h?r.bufferSubData(r.ARRAY_BUFFER,0,l,0,h*o):r.bufferSubData(r.ARRAY_BUFFER,0,l)},f}function Em(r,e,t){for(var a=9,n=new Float32Array(e*a),i=new Array(e),o=0;o<e;o++){var s=o*a*4;i[o]=new Float32Array(n.buffer,s,a)}var u=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,n.byteLength,r.DYNAMIC_DRAW);for(var l=0;l<3;l++){var v=t+l;r.enableVertexAttribArray(v),r.vertexAttribPointer(v,3,r.FLOAT,!1,36,l*12),r.vertexAttribDivisor(v,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),u.getMatrixView=function(f){return i[f]},u.setData=function(f,c){i[c].set(f,0)},u.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferSubData(r.ARRAY_BUFFER,0,n)},u}function Cm(r){var e=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,e);var t=r.createTexture();return r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),r.bindFramebuffer(r.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(a,n){r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,a,n,0,r.RGBA,r.UNSIGNED_BYTE,null)},e}var rv=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});function Mo(){var r=new rv(9);return rv!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function tv(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function Tm(r,e,t){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],v=e[7],f=e[8],c=t[0],d=t[1],h=t[2],y=t[3],g=t[4],p=t[5],m=t[6],b=t[7],w=t[8];return r[0]=c*a+d*o+h*l,r[1]=c*n+d*s+h*v,r[2]=c*i+d*u+h*f,r[3]=y*a+g*o+p*l,r[4]=y*n+g*s+p*v,r[5]=y*i+g*u+p*f,r[6]=m*a+b*o+w*l,r[7]=m*n+b*s+w*v,r[8]=m*i+b*u+w*f,r}function Cn(r,e,t){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],v=e[7],f=e[8],c=t[0],d=t[1];return r[0]=a,r[1]=n,r[2]=i,r[3]=o,r[4]=s,r[5]=u,r[6]=c*a+d*o+l,r[7]=c*n+d*s+v,r[8]=c*i+d*u+f,r}function av(r,e,t){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],v=e[7],f=e[8],c=Math.sin(t),d=Math.cos(t);return r[0]=d*a+c*o,r[1]=d*n+c*s,r[2]=d*i+c*u,r[3]=d*o-c*a,r[4]=d*s-c*n,r[5]=d*u-c*i,r[6]=l,r[7]=v,r[8]=f,r}function es(r,e,t){var a=t[0],n=t[1];return r[0]=a*e[0],r[1]=a*e[1],r[2]=a*e[2],r[3]=n*e[3],r[4]=n*e[4],r[5]=n*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function Sm(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}var km=(function(){function r(e,t,a,n){mt(this,r),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=t,this.texRows=a,this.texHeight=Math.floor(t/a),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=n(e,t,t),this.scratch=n(e,t,this.texHeight,"scratch")}return bt(r,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(t){var a=t.w,n=t.h,i=this.texHeight,o=this.texSize,s=i/n,u=a*s,l=n*s;return u>o&&(s=o/a,u=a*s,l=n*s),{scale:s,texW:u,texH:l}}},{key:"draw",value:function(t,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,u=this.texHeight,l=this.getScale(a),v=l.scale,f=l.texW,c=l.texH,d=function(b,w){if(n&&w){var x=w.context,C=b.x,E=b.row,T=C,k=u*E;x.save(),x.translate(T,k),x.scale(v,v),n(x,a),x.restore()}},h=[null,null],y=function(){d(i.freePointer,i.canvas),h[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:f,h:c},h[1]={x:i.freePointer.x+f,y:i.freePointer.row*u,w:0,h:c},i.freePointer.x+=f,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},g=function(){var b=i.scratch,w=i.canvas;b.clear(),d({x:0,row:0},b);var x=o-i.freePointer.x,C=f-x,E=u;{var T=i.freePointer.x,k=i.freePointer.row*u,D=x;w.context.drawImage(b,0,0,D,E,T,k,D,E),h[0]={x:T,y:k,w:D,h:c}}{var A=x,P=(i.freePointer.row+1)*u,B=C;w&&w.context.drawImage(b,A,0,B,E,0,P,B,E),h[1]={x:0,y:P,w:B,h:c}}i.freePointer.x=C,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+f<=o)y();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(p(),y()):this.enableWrapping?g():(p(),y())}return this.keyToLocation.set(t,h),this.needsBuffer=!0,h}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(t),o=i.texW;return this.freePointer.x+o>a?this.freePointer.row<n-1:!0}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=bm(t,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),Dm=(function(){function r(e,t,a,n){mt(this,r),this.r=e,this.texSize=t,this.texRows=a,this.createTextureCanvas=n,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return bt(r,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var t=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas;return new km(t,a,n,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas,o=Math.floor(a/n);this.scratch=i(t,a,o,"scratch")}return this.scratch}},{key:"draw",value:function(t,a,n){var i=this.styleKeyToAtlas.get(t);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(a))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(t,a,n),this.styleKeyToAtlas.set(t,i)),i}},{key:"getAtlas",value:function(t){return this.styleKeyToAtlas.get(t)}},{key:"hasAtlas",value:function(t){return this.styleKeyToAtlas.has(t)}},{key:"markKeyForGC",value:function(t){this.markedKeys.add(t)}},{key:"gc",value:function(){var t=this,a=this.markedKeys;if(a.size===0){console.log("nothing to garbage collect");return}var n=[],i=new Map,o=null,s=Dr(this.atlases),u;try{var l=function(){var f=u.value,c=f.getKeys(),d=Bm(a,c);if(d.size===0)return n.push(f),c.forEach(function(x){return i.set(x,f)}),1;o||(o=t._createAtlas(),n.push(o));var h=Dr(c),y;try{for(h.s();!(y=h.n()).done;){var g=y.value;if(!d.has(g)){var p=f.getOffsets(g),m=er(p,2),b=m[0],w=m[1];o.canFit({w:b.w+w.w,h:b.h})||(o.lock(),o=t._createAtlas(),n.push(o)),f.canvas&&(t._copyTextureToNewAtlas(g,f,o),i.set(g,o))}}}catch(x){h.e(x)}finally{h.f()}f.dispose()};for(s.s();!(u=s.n()).done;)l()}catch(v){s.e(v)}finally{s.f()}this.atlases=n,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(t,a,n){var i=a.getOffsets(t),o=er(i,2),s=o[0],u=o[1];if(u.w===0)n.draw(t,s,function(c){c.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var l=this._getScratchCanvas();l.clear(),l.context.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),l.context.drawImage(a.canvas,u.x,u.y,u.w,u.h,s.w,0,u.w,u.h);var v=s.w+u.w,f=s.h;n.draw(t,{w:v,h:f},function(c){c.drawImage(l,0,0,v,f,0,0,v,f)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function Bm(r,e){return r.intersection?r.intersection(e):new Set(Tn(r).filter(function(t){return e.has(t)}))}var Pm=(function(){function r(e,t){mt(this,r),this.r=e,this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return bt(r,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,a){var n=this.globalOptions,i=n.webglTexSize,o=n.createTextureCanvas,s=a.texRows,u=this._cacheScratchCanvas(o),l=new Dm(this.r,i,s,u);this.collections.set(t,l)}},{key:"addRenderType",value:function(t,a){var n=a.collection;if(!this.collections.has(n))throw new Error("invalid atlas collection name '".concat(n,"'"));var i=this.collections.get(n),o=ge({type:t,atlasCollection:i},a);this.renderTypes.set(t,o)}},{key:"getRenderTypeOpts",value:function(t){return this.renderTypes.get(t)}},{key:"getAtlasCollection",value:function(t){return this.collections.get(t)}},{key:"_cacheScratchCanvas",value:function(t){var a=-1,n=-1,i=null;return function(o,s,u,l){return l?((!i||s!=a||u!=n)&&(a=s,n=u,i=t(o,s,u)),i):t(o,s,u)}}},{key:"_key",value:function(t,a){return"".concat(t,"-").concat(a)}},{key:"invalidate",value:function(t){var a=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,o=i===void 0?!1:i,s=n.filterEle,u=s===void 0?function(){return!0}:s,l=n.filterType,v=l===void 0?function(){return!0}:l,f=!1,c=!1,d=Dr(t),h;try{for(d.s();!(h=d.n()).done;){var y=h.value;if(u(y)){var g=Dr(this.renderTypes.values()),p;try{var m=function(){var w=p.value,x=w.type;if(v(x)){var C=a.collections.get(w.collection),E=w.getKey(y),T=Array.isArray(E)?E:[E];if(o)T.forEach(function(P){return C.markKeyForGC(P)}),c=!0;else{var k=w.getID?w.getID(y):y.id(),D=a._key(x,k),A=a.typeAndIdToKey.get(D);A!==void 0&&!ym(T,A)&&(f=!0,a.typeAndIdToKey.delete(D),A.forEach(function(P){return C.markKeyForGC(P)}))}}};for(g.s();!(p=g.n()).done;)m()}catch(b){g.e(b)}finally{g.f()}}}}catch(b){d.e(b)}finally{d.f()}return c&&(this.gc(),f=!1),f}},{key:"gc",value:function(){var t=Dr(this.collections.values()),a;try{for(t.s();!(a=t.n()).done;){var n=a.value;n.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,a,n,i){var o=this.renderTypes.get(a),s=this.collections.get(o.collection),u=!1,l=s.draw(i,n,function(c){o.drawClipped?(c.save(),c.beginPath(),c.rect(0,0,n.w,n.h),c.clip(),o.drawElement(c,t,n,!0,!0),c.restore()):o.drawElement(c,t,n,!0,!0),u=!0});if(u){var v=o.getID?o.getID(t):t.id(),f=this._key(a,v);this.typeAndIdToKey.has(f)?this.typeAndIdToKey.get(f).push(i):this.typeAndIdToKey.set(f,[i])}return l}},{key:"getAtlasInfo",value:function(t,a){var n=this,i=this.renderTypes.get(a),o=i.getKey(t),s=Array.isArray(o)?o:[o];return s.map(function(u){var l=i.getBoundingBox(t,u),v=n.getOrCreateAtlas(t,a,l,u),f=v.getOffsets(u),c=er(f,2),d=c[0],h=c[1];return{atlas:v,tex:d,tex1:d,tex2:h,bb:l}})}},{key:"getDebugInfo",value:function(){var t=[],a=Dr(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=er(n.value,2),o=i[0],s=i[1],u=s.getCounts(),l=u.keyCount,v=u.atlasCount;t.push({type:o,keyCount:l,atlasCount:v})}}catch(f){a.e(f)}finally{a.f()}return t}}])})(),Am=(function(){function r(e){mt(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return bt(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var a=this.batchAtlases.indexOf(t);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),a=this.batchAtlases.length-1}return a}}])})(),Rm=`
8
+ float circleSD(vec2 p, float r) {
9
+ return distance(vec2(0), p) - r; // signed distance
10
+ }
11
+ `,Mm=`
12
+ float rectangleSD(vec2 p, vec2 b) {
13
+ vec2 d = abs(p)-b;
14
+ return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
15
+ }
16
+ `,Lm=`
17
+ float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
18
+ cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
19
+ cr.x = (p.y > 0.0) ? cr.x : cr.y;
20
+ vec2 q = abs(p) - b + cr.x;
21
+ return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
22
+ }
23
+ `,Im=`
24
+ float ellipseSD(vec2 p, vec2 ab) {
25
+ p = abs( p ); // symmetry
26
+
27
+ // find root with Newton solver
28
+ vec2 q = ab*(p-ab);
29
+ float w = (q.x<q.y)? 1.570796327 : 0.0;
30
+ for( int i=0; i<5; i++ ) {
31
+ vec2 cs = vec2(cos(w),sin(w));
32
+ vec2 u = ab*vec2( cs.x,cs.y);
33
+ vec2 v = ab*vec2(-cs.y,cs.x);
34
+ w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
35
+ }
36
+
37
+ // compute final point and distance
38
+ float d = length(p-ab*vec2(cos(w),sin(w)));
39
+
40
+ // return signed distance
41
+ return (dot(p/ab,p/ab)>1.0) ? d : -d;
42
+ }
43
+ `,Ba={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},qn={IGNORE:1,USE_BB:2},Lo=0,nv=1,iv=2,Io=3,Kt=4,cn=5,wa=6,xa=7,Om=(function(){function r(e,t,a){mt(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=hm,this.atlasManager=new Pm(e,a),this.batchManager=new Am(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ba.SCREEN),this.pickingProgram=this._createShaderProgram(Ba.PICKING),this.vao=this._createVAO()}return bt(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(s){return s===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#version 300 es
44
+ precision highp float;
45
+
46
+ uniform mat3 uPanZoomMatrix;
47
+ uniform int uAtlasSize;
48
+
49
+ // instanced
50
+ in vec2 aPosition; // a vertex from the unit square
51
+
52
+ in mat3 aTransform; // used to transform verticies, eg into a bounding box
53
+ in int aVertType; // the type of thing we are rendering
54
+
55
+ // the z-index that is output when using picking mode
56
+ in vec4 aIndex;
57
+
58
+ // For textures
59
+ in int aAtlasId; // which shader unit/atlas to use
60
+ in vec4 aTex; // x/y/w/h of texture in atlas
61
+
62
+ // for edges
63
+ in vec4 aPointAPointB;
64
+ in vec4 aPointCPointD;
65
+ in vec2 aLineWidth; // also used for node border width
66
+
67
+ // simple shapes
68
+ in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
69
+ in vec4 aColor; // also used for edges
70
+ in vec4 aBorderColor; // aLineWidth is used for border width
71
+
72
+ // output values passed to the fragment shader
73
+ out vec2 vTexCoord;
74
+ out vec4 vColor;
75
+ out vec2 vPosition;
76
+ // flat values are not interpolated
77
+ flat out int vAtlasId;
78
+ flat out int vVertType;
79
+ flat out vec2 vTopRight;
80
+ flat out vec2 vBotLeft;
81
+ flat out vec4 vCornerRadius;
82
+ flat out vec4 vBorderColor;
83
+ flat out vec2 vBorderWidth;
84
+ flat out vec4 vIndex;
85
+
86
+ void main(void) {
87
+ int vid = gl_VertexID;
88
+ vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
89
+
90
+ if(aVertType == `.concat(Lo,`) {
91
+ float texX = aTex.x; // texture coordinates
92
+ float texY = aTex.y;
93
+ float texW = aTex.z;
94
+ float texH = aTex.w;
95
+
96
+ if(vid == 1 || vid == 2 || vid == 4) {
97
+ texX += texW;
98
+ }
99
+ if(vid == 2 || vid == 4 || vid == 5) {
100
+ texY += texH;
101
+ }
102
+
103
+ float d = float(uAtlasSize);
104
+ vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
105
+
106
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
107
+ }
108
+ else if(aVertType == `).concat(Kt," || aVertType == ").concat(xa,`
109
+ || aVertType == `).concat(cn," || aVertType == ").concat(wa,`) { // simple shapes
110
+
111
+ // the bounding box is needed by the fragment shader
112
+ vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
113
+ vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
114
+ vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
115
+
116
+ // calculations are done in the fragment shader, just pass these along
117
+ vColor = aColor;
118
+ vCornerRadius = aCornerRadius;
119
+ vBorderColor = aBorderColor;
120
+ vBorderWidth = aLineWidth;
121
+
122
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
123
+ }
124
+ else if(aVertType == `).concat(nv,`) {
125
+ vec2 source = aPointAPointB.xy;
126
+ vec2 target = aPointAPointB.zw;
127
+
128
+ // adjust the geometry so that the line is centered on the edge
129
+ position.y = position.y - 0.5;
130
+
131
+ // stretch the unit square into a long skinny rectangle
132
+ vec2 xBasis = target - source;
133
+ vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
134
+ vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
135
+
136
+ gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
137
+ vColor = aColor;
138
+ }
139
+ else if(aVertType == `).concat(iv,`) {
140
+ vec2 pointA = aPointAPointB.xy;
141
+ vec2 pointB = aPointAPointB.zw;
142
+ vec2 pointC = aPointCPointD.xy;
143
+ vec2 pointD = aPointCPointD.zw;
144
+
145
+ // adjust the geometry so that the line is centered on the edge
146
+ position.y = position.y - 0.5;
147
+
148
+ vec2 p0, p1, p2, pos;
149
+ if(position.x == 0.0) { // The left side of the unit square
150
+ p0 = pointA;
151
+ p1 = pointB;
152
+ p2 = pointC;
153
+ pos = position;
154
+ } else { // The right side of the unit square, use same approach but flip the geometry upside down
155
+ p0 = pointD;
156
+ p1 = pointC;
157
+ p2 = pointB;
158
+ pos = vec2(0.0, -position.y);
159
+ }
160
+
161
+ vec2 p01 = p1 - p0;
162
+ vec2 p12 = p2 - p1;
163
+ vec2 p21 = p1 - p2;
164
+
165
+ // Find the normal vector.
166
+ vec2 tangent = normalize(normalize(p12) + normalize(p01));
167
+ vec2 normal = vec2(-tangent.y, tangent.x);
168
+
169
+ // Find the vector perpendicular to p0 -> p1.
170
+ vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
171
+
172
+ // Determine the bend direction.
173
+ float sigma = sign(dot(p01 + p21, normal));
174
+ float width = aLineWidth[0];
175
+
176
+ if(sign(pos.y) == -sigma) {
177
+ // This is an intersecting vertex. Adjust the position so that there's no overlap.
178
+ vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
179
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
180
+ } else {
181
+ // This is a non-intersecting vertex. Treat it like a mitre join.
182
+ vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
183
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
184
+ }
185
+
186
+ vColor = aColor;
187
+ }
188
+ else if(aVertType == `).concat(Io,` && vid < 3) {
189
+ // massage the first triangle into an edge arrow
190
+ if(vid == 0)
191
+ position = vec2(-0.15, -0.3);
192
+ if(vid == 1)
193
+ position = vec2( 0.0, 0.0);
194
+ if(vid == 2)
195
+ position = vec2( 0.15, -0.3);
196
+
197
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
198
+ vColor = aColor;
199
+ }
200
+ else {
201
+ gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
202
+ }
203
+
204
+ vAtlasId = aAtlasId;
205
+ vVertType = aVertType;
206
+ vIndex = aIndex;
207
+ }
208
+ `),i=this.batchManager.getIndexArray(),o=`#version 300 es
209
+ precision highp float;
210
+
211
+ // declare texture unit for each texture atlas in the batch
212
+ `.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(`
213
+ `),`
214
+
215
+ uniform vec4 uBGColor;
216
+ uniform float uZoom;
217
+
218
+ in vec2 vTexCoord;
219
+ in vec4 vColor;
220
+ in vec2 vPosition; // model coordinates
221
+
222
+ flat in int vAtlasId;
223
+ flat in vec4 vIndex;
224
+ flat in int vVertType;
225
+ flat in vec2 vTopRight;
226
+ flat in vec2 vBotLeft;
227
+ flat in vec4 vCornerRadius;
228
+ flat in vec4 vBorderColor;
229
+ flat in vec2 vBorderWidth;
230
+
231
+ out vec4 outColor;
232
+
233
+ `).concat(Rm,`
234
+ `).concat(Mm,`
235
+ `).concat(Lm,`
236
+ `).concat(Im,`
237
+
238
+ vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
239
+ return vec4(
240
+ top.rgb + (bot.rgb * (1.0 - top.a)),
241
+ top.a + (bot.a * (1.0 - top.a))
242
+ );
243
+ }
244
+
245
+ vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
246
+ // scale to the zoom level so that borders don't look blurry when zoomed in
247
+ // note 1.5 is an aribitrary value chosen because it looks good
248
+ return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
249
+ }
250
+
251
+ void main(void) {
252
+ if(vVertType == `).concat(Lo,`) {
253
+ // look up the texel from the texture unit
254
+ `).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(`
255
+ else `),`
256
+ }
257
+ else if(vVertType == `).concat(Io,`) {
258
+ // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
259
+ outColor = blend(vColor, uBGColor);
260
+ outColor.a = 1.0; // make opaque, masks out line under arrow
261
+ }
262
+ else if(vVertType == `).concat(Kt,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
263
+ outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
264
+ }
265
+ else if(vVertType == `).concat(Kt," || vVertType == ").concat(xa,`
266
+ || vVertType == `).concat(cn," || vVertType == ").concat(wa,`) { // use SDF
267
+
268
+ float outerBorder = vBorderWidth[0];
269
+ float innerBorder = vBorderWidth[1];
270
+ float borderPadding = outerBorder * 2.0;
271
+ float w = vTopRight.x - vBotLeft.x - borderPadding;
272
+ float h = vTopRight.y - vBotLeft.y - borderPadding;
273
+ vec2 b = vec2(w/2.0, h/2.0); // half width, half height
274
+ vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
275
+
276
+ float d; // signed distance
277
+ if(vVertType == `).concat(Kt,`) {
278
+ d = rectangleSD(p, b);
279
+ } else if(vVertType == `).concat(xa,` && w == h) {
280
+ d = circleSD(p, b.x); // faster than ellipse
281
+ } else if(vVertType == `).concat(xa,`) {
282
+ d = ellipseSD(p, b);
283
+ } else {
284
+ d = roundRectangleSD(p, b, vCornerRadius.wzyx);
285
+ }
286
+
287
+ // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
288
+ // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
289
+ if(d > 0.0) {
290
+ if(d > outerBorder) {
291
+ discard;
292
+ } else {
293
+ outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
294
+ }
295
+ } else {
296
+ if(d > innerBorder) {
297
+ vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
298
+ vec4 innerBorderColor = blend(vBorderColor, vColor);
299
+ outColor = distInterp(innerBorderColor, outerColor, d);
300
+ }
301
+ else {
302
+ vec4 outerColor;
303
+ if(innerBorder == 0.0 && outerBorder == 0.0) {
304
+ outerColor = vec4(0);
305
+ } else if(innerBorder == 0.0) {
306
+ outerColor = vBorderColor;
307
+ } else {
308
+ outerColor = blend(vBorderColor, vColor);
309
+ }
310
+ outColor = distInterp(vColor, outerColor, d - innerBorder);
311
+ }
312
+ }
313
+ }
314
+ else {
315
+ outColor = vColor;
316
+ }
317
+
318
+ `).concat(t.picking?`if(outColor.a == 0.0) discard;
319
+ else outColor = vIndex;`:"",`
320
+ }
321
+ `),s=cm(a,n,o);s.aPosition=a.getAttribLocation(s,"aPosition"),s.aIndex=a.getAttribLocation(s,"aIndex"),s.aVertType=a.getAttribLocation(s,"aVertType"),s.aTransform=a.getAttribLocation(s,"aTransform"),s.aAtlasId=a.getAttribLocation(s,"aAtlasId"),s.aTex=a.getAttribLocation(s,"aTex"),s.aPointAPointB=a.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=a.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=a.getAttribLocation(s,"aLineWidth"),s.aColor=a.getAttribLocation(s,"aColor"),s.aCornerRadius=a.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=a.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=a.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=a.getUniformLocation(s,"uAtlasSize"),s.uBGColor=a.getUniformLocation(s,"uBGColor"),s.uZoom=a.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)s.uTextures.push(a.getUniformLocation(s,"uTexture".concat(u)));return s}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var a=this.maxInstances,n=this.gl,i=this.program,o=n.createVertexArray();return n.bindVertexArray(o),xm(n,"vec2",i.aPosition,t),this.transformBuffer=Em(n,a,i.aTransform),this.indexBuffer=Gr(n,a,"vec4",i.aIndex),this.vertTypeBuffer=Gr(n,a,"int",i.aVertType),this.atlasIdBuffer=Gr(n,a,"int",i.aAtlasId),this.texBuffer=Gr(n,a,"vec4",i.aTex),this.pointAPointBBuffer=Gr(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Gr(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=Gr(n,a,"vec2",i.aLineWidth),this.colorBuffer=Gr(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=Gr(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=Gr(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),o}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(a){return st(a,"Buffer")}).map(function(a){return t[a]})),this._buffers}},{key:"startFrame",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ba.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(n);if(this._isVisible(t,s)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var u=s.getTexPickingMode(t);if(u===qn.IGNORE)return;if(u==qn.USE_BB){this.drawPickingRectangle(t,a,n);return}}var l=i.getAtlasInfo(t,n),v=Dr(l),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,d=c.atlas,h=c.tex1,y=c.tex2;o.canAddToCurrentBatch(d)||this.endBatch();for(var g=o.getAtlasIndexForBatch(d),p=0,m=[[h,!0],[y,!1]];p<m.length;p++){var b=er(m[p],2),w=b[0],x=b[1];if(w.w!=0){var C=this.instanceCount;this.vertTypeBuffer.getView(C)[0]=Lo;var E=this.indexBuffer.getView(C);$t(a,E);var T=this.atlasIdBuffer.getView(C);T[0]=g;var k=this.texBuffer.getView(C);k[0]=w.x,k[1]=w.y,k[2]=w.w,k[3]=w.h;var D=this.transformBuffer.getMatrixView(C);this.setTransformMatrix(t,D,s,c,x),this.instanceCount++,x||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(A){v.e(A)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(n.shapeProps&&n.shapeProps.padding&&(s=t.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,v=i.tex2,f=l.w/(l.w+v.w);o||(f=1-f);var c=this._getAdjustedBB(u,s,o,f);this._applyTransformMatrix(a,c,n,t)}else{var d=n.getBoundingBox(t),h=this._getAdjustedBB(d,s,!0,1);this._applyTransformMatrix(a,h,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var o,s;tv(t);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),v=l.x,f=l.y;Cn(t,t,[v,f]),av(t,t,u);var c=n.getRotationOffset(i);o=c.x+(a.xOffset||0),s=c.y+(a.yOffset||0)}else o=a.x1,s=a.y1;Cn(t,t,[o,s]),es(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var o=t.x1,s=t.y1,u=t.w,l=t.h,v=t.yOffset;a&&(o-=a,s-=a,u+=2*a,l+=2*a);var f=0,c=u*i;return n&&i<1?u=c:!n&&i<1&&(f=u-c,o+=f,u=c),{x1:o,y1:s,w:u,h:l,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=Kt;var s=this.indexBuffer.getView(o);$t(a,s);var u=this.colorBuffer.getView(o);kt([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var o=i.shapeProps,s=this._getVertTypeForShape(t,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(t,this.renderTarget)){this.drawTexture(t,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=s,s===cn||s===wa){var l=i.getBoundingBox(t),v=this._getCornerRadius(t,o.radius,l),f=this.cornerRadiusBuffer.getView(u);f[0]=v,f[1]=v,f[2]=v,f[3]=v,s===wa&&(f[0]=0,f[2]=0)}var c=this.indexBuffer.getView(u);$t(a,c);var d=this.renderTarget.picking?1:n==="node-body"?t.effectiveOpacity():1,h=this.renderTarget.picking?1:t.pstyle(o.opacity).value*d,y=t.pstyle(o.color).value,g=this.colorBuffer.getView(u);kt(y,h,g);var p=this.lineWidthBuffer.getView(u);if(p[0]=0,p[1]=0,o.border){var m=t.pstyle("border-width").value;if(m>0){var b=t.pstyle("border-color").value,w=d*t.pstyle("border-opacity").value,x=this.borderColorBuffer.getView(u);kt(b,w,x);var C=t.pstyle("border-position").value;if(C==="inside")p[0]=0,p[1]=-m;else if(C==="outside")p[0]=m,p[1]=0;else{var E=m/2;p[0]=E,p[1]=-E}}}var T=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(t,T,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,a){var n=t.pstyle(a).value;switch(n){case"rectangle":return Kt;case"ellipse":return xa;case"roundrectangle":case"round-rectangle":return cn;case"bottom-round-rectangle":return wa;default:return}}},{key:"_getCornerRadius",value:function(t,a,n){var i=n.w,o=n.h;if(t.pstyle(a).value==="auto")return dt(i,o);var s=t.pstyle(a).pfValue,u=i/2,l=o/2;return Math.min(s,l,u)}},{key:"drawEdgeArrow",value:function(t,a,n){if(t.visible()){var i=t._private.rscratch,o,s,u;if(n==="source"?(o=i.arrowStartX,s=i.arrowStartY,u=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(u)||u==null)){var l=t.pstyle(n+"-arrow-shape").value;if(l!=="none"){var v=t.pstyle(n+"-arrow-color").value,f=t.pstyle("opacity").value,c=t.pstyle("line-opacity").value,d=f*c,h=t.pstyle("width").pfValue,y=Lr(t,n),g=this.r.getArrowWidth(h,y),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);tv(m),Cn(m,m,[o,s]),es(m,m,[g,g]),av(m,m,u),this.vertTypeBuffer.getView(p)[0]=Io;var b=this.indexBuffer.getView(p);$t(a,b);var w=this.colorBuffer.getView(p);kt(v,d,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,a){if(t.visible()){var n=this._getEdgePoints(t);if(n){var i=t.pstyle("opacity").value,o=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,u=t.pstyle("line-color").value,l=i*o;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=nv;var f=this.indexBuffer.getView(v);$t(a,f);var c=this.colorBuffer.getView(v);kt(u,l,c);var d=this.lineWidthBuffer.getView(v);d[0]=s;var h=this.pointAPointBBuffer.getView(v);h[0]=n[0],h[1]=n[1],h[2]=n[2],h[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y<n.length-2;y+=2){var g=this.instanceCount;this.vertTypeBuffer.getView(g)[0]=iv;var p=this.indexBuffer.getView(g);$t(a,p);var m=this.colorBuffer.getView(g);kt(u,l,m);var b=this.lineWidthBuffer.getView(g);b[0]=s;var w=n[y-2],x=n[y-1],C=n[y],E=n[y+1],T=n[y+2],k=n[y+3],D=n[y+4],A=n[y+5];y==0&&(w=2*C-T+.001,x=2*E-k+.001),y==n.length-4&&(D=2*T-C+.001,A=2*k-E+.001);var P=this.pointAPointBBuffer.getView(g);P[0]=w,P[1]=x,P[2]=C,P[3]=E;var B=this.pointCPointDBuffer.getView(g);B[0]=T,B[1]=k,B[2]=D,B[3]=A,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var a=t._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var a=t._private.rscratch;if(this._isValidEdge(t)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(t){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,a){if(t.length==4)return t;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=t[0],n[1]=t[1];else if(i==a)n[i*2]=t[t.length-2],n[i*2+1]=t[t.length-1];else{var o=i/a;this._setCurvePoint(t,o,n,i*2)}return n}},{key:"_setCurvePoint",value:function(t,a,n,i){if(t.length<=2)n[i]=t[0],n[i+1]=t[1];else{for(var o=Array(t.length-2),s=0;s<o.length;s+=2){var u=(1-a)*t[s]+a*t[s+2],l=(1-a)*t[s+1]+a*t[s+3];o[s]=u,o[s+1]=l}return this._setCurvePoint(o,a,n,i)}}},{key:"endBatch",value:function(){var t=this.gl,a=this.vao,n=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(o),t.bindVertexArray(a);var s=Dr(this.buffers),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.bufferSubData(i)}}catch(h){s.e(h)}finally{s.f()}for(var v=this.batchManager.getAtlases(),f=0;f<v.length;f++)v[f].bufferIfNeeded(t);for(var c=0;c<v.length;c++)t.activeTexture(t.TEXTURE0+c),t.bindTexture(t.TEXTURE_2D,v[c].texture),t.uniform1i(o.uTextures[c],c);t.uniform1f(o.uZoom,dm(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var d=kt(this.bgColor,1);t.uniform4fv(o.uBGColor,d),t.drawArraysInstanced(t.TRIANGLES,0,n,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:v.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),a=t.reduce(function(o,s){return o+s.atlasCount},0),n=this.batchDebugInfo,i=n.reduce(function(o,s){return o+s.count},0);return{atlasInfo:t,totalAtlases:a,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:i}}}])})(),Zf={};Zf.initWebgl=function(r,e){var t=this,a=t.data.contexts[t.WEBGL];r.bgColor=Nm(t),r.webglTexSize=Math.min(r.webglTexSize,a.getParameter(a.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=Cm(a),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new Om(t,a,r);var n=function(f){return function(c){return t.getTextAngle(c,f)}},i=function(f){return function(c){var d=c.pstyle(f);return d&&d.value}},o=function(f){return function(c){return c.pstyle("".concat(f,"-opacity")).value>0}},s=function(f){var c=f.pstyle("text-events").strValue==="yes";return c?qn.USE_BB:qn.IGNORE},u=function(f){var c=f.position(),d=c.x,h=c.y,y=f.outerWidth(),g=f.outerHeight();return{w:y,h:g,x1:d-y/2,y1:h-g/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:pm,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:Oo(e.getLabelKey,null),getBoundingBox:No(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:Oo(e.getSourceLabelKey,"source"),getBoundingBox:No(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:Oo(e.getTargetLabelKey,"target"),getBoundingBox:No(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=Wa(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(v,f){var c=!1;f&&f.length>0&&(c|=t.drawing.invalidate(f)),c&&l()}),zm(t)};function Nm(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return pv(t)}function Qf(r,e){var t=r._private.rscratch;return pr(t,"labelWrapCachedLines",e)||[]}var Oo=function(e,t){return function(a){var n=e(a),i=Qf(a,t);return i.length>1?i.map(function(o,s){return"".concat(n,"_").concat(s)}):n}},No=function(e,t){return function(a,n){var i=e(a);if(typeof n=="string"){var o=n.indexOf("_");if(o>0){var s=Number(n.substring(o+1)),u=Qf(a,t),l=i.h/u.length,v=l*s,f=i.y1+v;return{x1:i.x1,w:i.w,y1:f,h:l,yOffset:v}}}return i}};function zm(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>Hf?(Fm(r),e.call(r,i)):(Vm(r),jf(r,i,Ba.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,o,s,u){return $m(r,i,o)};{var a=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){a.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var n=r.notify;r.notify=function(i,o){n.call(r,i,o),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(o,{type:"node-body"})}}}function Fm(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Vm(r){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,r.canvasWidth,r.canvasHeight),a.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function qm(r){var e=r.canvasWidth,t=r.canvasHeight,a=Bs(r),n=a.pan,i=a.zoom,o=Mo();Cn(o,o,[n.x,n.y]),es(o,o,[i,i]);var s=Mo();Sm(s,e,t);var u=Mo();return Tm(u,s,o),u}function Jf(r,e){var t=r.canvasWidth,a=r.canvasHeight,n=Bs(r),i=n.pan,o=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,a),e.translate(i.x,i.y),e.scale(o,o)}function _m(r,e){r.drawSelectionRectangle(e,function(t){return Jf(r,t)})}function Gm(r){var e=r.data.contexts[r.NODE];e.save(),Jf(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Hm(r){var e=function(n,i,o){for(var s=n.atlasManager.getAtlasCollection(i),u=r.data.contexts[r.NODE],l=s.atlases,v=0;v<l.length;v++){var f=l[v],c=f.canvas;if(c){var d=c.width,h=c.height,y=d*v,g=c.height*o,p=.4;u.save(),u.scale(p,p),u.drawImage(c,y,g),u.strokeStyle="black",u.rect(y,g,d,h),u.stroke(),u.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function Wm(r,e,t,a,n){var i,o,s,u,l=Bs(r),v=l.pan,f=l.zoom;{var c=gm(r,v,f,e,t),d=er(c,2),h=d[0],y=d[1],g=6;i=h-g/2,o=y-g/2,s=g,u=g}if(s===0||u===0)return[];var p=r.data.contexts[r.WEBGL];p.bindFramebuffer(p.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(p.viewport(0,0,p.canvas.width,p.canvas.height),jf(r,null,Ba.PICKING),r.pickingFrameBuffer.needsDraw=!1);var m=s*u,b=new Uint8Array(m*4);p.readPixels(i,o,s,u,p.RGBA,p.UNSIGNED_BYTE,b),p.bindFramebuffer(p.FRAMEBUFFER,null);for(var w=new Set,x=0;x<m;x++){var C=b.slice(x*4,x*4+4),E=mm(C)-1;E>=0&&w.add(E)}return w}function $m(r,e,t){var a=Wm(r,e,t),n=r.getCachedZSortedEles(),i,o,s=Dr(a),u;try{for(s.s();!(u=s.n()).done;){var l=u.value,v=n[l];if(!i&&v.isNode()&&(i=v),!o&&v.isEdge()&&(o=v),i&&o)break}}catch(f){s.e(f)}finally{s.f()}return[i,o].filter(Boolean)}function zo(r,e,t){var a=r.drawing;e+=1,t.isNode()?(a.drawNode(t,e,"node-underlay"),a.drawNode(t,e,"node-body"),a.drawTexture(t,e,"label"),a.drawNode(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"label"),a.drawTexture(t,e,"edge-source-label"),a.drawTexture(t,e,"edge-target-label"))}function jf(r,e,t){var a;r.webglDebug&&(a=performance.now());var n=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&_m(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var o=r.data.contexts[r.WEBGL];t.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=qm(r),u=r.getCachedZSortedEles();if(i=u.length,n.startFrame(s,t),t.screen){for(var l=0;l<u.nondrag.length;l++)zo(r,l,u.nondrag[l]);for(var v=0;v<u.drag.length;v++)zo(r,v,u.drag[v])}else if(t.picking)for(var f=0;f<u.length;f++)zo(r,f,u[f]);n.endFrame(),t.screen&&r.webglDebugShowAtlases&&(Gm(r),Hm(r)),t.screen&&(r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1)}if(r.webglDebug){var c=performance.now(),d=!1,h=Math.ceil(c-a),y=n.getDebugInfo(),g=["".concat(i," elements"),"".concat(y.totalInstances," instances"),"".concat(y.batchCount," batches"),"".concat(y.totalAtlases," atlases"),"".concat(y.wrappedCount," wrapped textures"),"".concat(y.simpleCount," simple shapes")].join(", ");if(d)console.log("WebGL (".concat(t.name,") - time ").concat(h,"ms, ").concat(g));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(h,"ms")),console.log("Totals:"),console.log(" ".concat(g)),console.log("Texture Atlases Used:");var p=y.atlasInfo,m=Dr(p),b;try{for(m.s();!(b=m.n()).done;){var w=b.value;console.log(" ".concat(w.type,": ").concat(w.keyCount," keys, ").concat(w.atlasCount," atlases"))}}catch(x){m.e(x)}finally{m.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,n.gc())}var Et={};Et.drawPolygonPath=function(r,e,t,a,n,i){var o=a/2,s=n/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var u=1;u<i.length/2;u++)r.lineTo(e+o*i[u*2],t+s*i[u*2+1]);r.closePath()};Et.drawRoundPolygonPath=function(r,e,t,a,n,i,o){o.forEach(function(s){return Lf(r,s)}),r.closePath()};Et.drawRoundRectanglePath=function(r,e,t,a,n,i){var o=a/2,s=n/2,u=i==="auto"?dt(a,n):Math.min(i,s,o);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+o,t-s,e+o,t,u),r.arcTo(e+o,t+s,e,t+s,u),r.arcTo(e-o,t+s,e-o,t,u),r.arcTo(e-o,t-s,e,t-s,u),r.lineTo(e,t-s),r.closePath()};Et.drawBottomRoundRectanglePath=function(r,e,t,a,n,i){var o=a/2,s=n/2,u=i==="auto"?dt(a,n):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+o,t-s),r.lineTo(e+o,t),r.arcTo(e+o,t+s,e,t+s,u),r.arcTo(e-o,t+s,e-o,t,u),r.lineTo(e-o,t-s),r.lineTo(e,t-s),r.closePath()};Et.drawCutRectanglePath=function(r,e,t,a,n,i,o){var s=a/2,u=n/2,l=o==="auto"?hs():o;r.beginPath&&r.beginPath(),r.moveTo(e-s+l,t-u),r.lineTo(e+s-l,t-u),r.lineTo(e+s,t-u+l),r.lineTo(e+s,t+u-l),r.lineTo(e+s-l,t+u),r.lineTo(e-s+l,t+u),r.lineTo(e-s,t+u-l),r.lineTo(e-s,t-u+l),r.closePath()};Et.drawBarrelPath=function(r,e,t,a,n){var i=a/2,o=n/2,s=e-i,u=e+i,l=t-o,v=t+o,f=qo(a,n),c=f.widthOffset,d=f.heightOffset,h=f.ctrlPtOffsetPct*c;r.beginPath&&r.beginPath(),r.moveTo(s,l+d),r.lineTo(s,v-d),r.quadraticCurveTo(s+h,v,s+c,v),r.lineTo(u-c,v),r.quadraticCurveTo(u-h,v,u,v-d),r.lineTo(u,l+d),r.quadraticCurveTo(u-h,l,u-c,l),r.lineTo(s+c,l),r.quadraticCurveTo(s+h,l,s,l+d),r.closePath()};var ov=Math.sin(0),sv=Math.cos(0),rs={},ts={},ec=Math.PI/40;for(var Ut=0*Math.PI;Ut<2*Math.PI;Ut+=ec)rs[Ut]=Math.sin(Ut),ts[Ut]=Math.cos(Ut);Et.drawEllipsePath=function(r,e,t,a,n){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,a/2,n/2,0,0,2*Math.PI);else for(var i,o,s=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=ec)i=e-s*rs[l]*ov+s*ts[l]*sv,o=t+u*ts[l]*ov+u*rs[l]*sv,l===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var Za={};Za.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};Za.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),a=t.boundingBox(),n=this.findContainerClientCoords(),i=r.full?Math.ceil(a.w):n[2],o=r.full?Math.ceil(a.h):n[3],s=te(r.maxWidth)||te(r.maxHeight),u=this.getPixelRatio(),l=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,l=r.scale;else if(s){var v=1/0,f=1/0;te(r.maxWidth)&&(v=l*r.maxWidth/i),te(r.maxHeight)&&(f=l*r.maxHeight/o),l=Math.min(v,f),i*=l,o*=l}s||(i*=u,o*=u,l*=u);var c=document.createElement("canvas");c.width=i,c.height=o,c.style.width=i+"px",c.style.height=o+"px";var d=c.getContext("2d");if(i>0&&o>0){d.clearRect(0,0,i,o),d.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(r.full)d.translate(-a.x1*l,-a.y1*l),d.scale(l,l),this.drawElements(d,h);else{var y=e.pan(),g={x:y.x*l,y:y.y*l};l*=e.zoom(),d.translate(g.x,g.y),d.scale(l,l),this.drawElements(d,h)}d.setTransform(1,0,0,1,0,0),r.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=r.bg,d.fillRect(0,0,i,o))}return c};function Km(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return new Blob([a],{type:e})}function uv(r){var e=r.indexOf(",");return r.substr(e+1)}function rc(r,e,t){var a=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new ua(function(n,i){try{e.toBlob(function(o){o!=null?n(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return Km(uv(a()),t);case"base64":return uv(a());default:return a()}}Za.png=function(r){return rc(r,this.bufferCanvasImage(r),"image/png")};Za.jpg=function(r){return rc(r,this.bufferCanvasImage(r),"image/jpeg")};var tc={};tc.nodeShapeImpl=function(r,e,t,a,n,i,o,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,a,n,i);case"polygon":return this.drawPolygonPath(e,t,a,n,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,a,n,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,a,n,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,a,n,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,a,n,i,s);case"barrel":return this.drawBarrelPath(e,t,a,n,i)}};var Um=ac,Be=ac.prototype;Be.CANVAS_LAYERS=3;Be.SELECT_BOX=0;Be.DRAG=1;Be.NODE=2;Be.WEBGL=3;Be.CANVAS_TYPES=["2d","2d","2d","webgl2"];Be.BUFFER_COUNT=3;Be.TEXTURE_BUFFER=0;Be.MOTIONBLUR_BUFFER_NODE=1;Be.MOTIONBLUR_BUFFER_DRAG=2;function ac(r){var e=this,t=e.cy.window(),a=t.document;r.webgl&&(Be.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Be.CANVAS_LAYERS),contexts:new Array(Be.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Be.CANVAS_LAYERS),bufferCanvases:new Array(Be.BUFFER_COUNT),bufferContexts:new Array(Be.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.style[n]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Ic()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<Be.CANVAS_LAYERS;l++){var v=e.data.canvases[l]=a.createElement("canvas"),f=Be.CANVAS_TYPES[l];e.data.contexts[l]=v.getContext(f),e.data.contexts[l]||Ue("Could not create canvas of type "+f),Object.keys(u).forEach(function(W){v.style[W]=u[W]}),v.style.position="absolute",v.setAttribute("data-id","layer"+l),v.style.zIndex=String(Be.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(v),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Be.NODE].setAttribute("data-id","layer"+Be.NODE+"-node"),e.data.canvases[Be.SELECT_BOX].setAttribute("data-id","layer"+Be.SELECT_BOX+"-selectbox"),e.data.canvases[Be.DRAG].setAttribute("data-id","layer"+Be.DRAG+"-drag"),e.data.canvases[Be.WEBGL]&&e.data.canvases[Be.WEBGL].setAttribute("data-id","layer"+Be.WEBGL+"-webgl");for(var l=0;l<Be.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=a.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var c=yr(),d=function(z){return{x:(z.x1+z.x2)/2,y:(z.y1+z.y2)/2}},h=function(z){return{x:-z.w/2,y:-z.h/2}},y=function(z){var q=z[0]._private,X=q.oldBackgroundTimestamp===q.backgroundTimestamp;return!X},g=function(z){return z[0]._private.nodeKey},p=function(z){return z[0]._private.labelStyleKey},m=function(z){return z[0]._private.sourceLabelStyleKey},b=function(z){return z[0]._private.targetLabelStyleKey},w=function(z,q,X,Y,ae){return e.drawElement(z,q,X,!1,!1,ae)},x=function(z,q,X,Y,ae){return e.drawElementText(z,q,X,Y,"main",ae)},C=function(z,q,X,Y,ae){return e.drawElementText(z,q,X,Y,"source",ae)},E=function(z,q,X,Y,ae){return e.drawElementText(z,q,X,Y,"target",ae)},T=function(z){return z.boundingBox(),z[0]._private.bodyBounds},k=function(z){return z.boundingBox(),z[0]._private.labelBounds.main||c},D=function(z){return z.boundingBox(),z[0]._private.labelBounds.source||c},A=function(z){return z.boundingBox(),z[0]._private.labelBounds.target||c},P=function(z,q){return q},B=function(z){return d(T(z))},R=function(z,q,X){var Y=z?z+"-":"";return{x:q.x+X.pstyle(Y+"text-margin-x").pfValue,y:q.y+X.pstyle(Y+"text-margin-y").pfValue}},M=function(z,q,X){var Y=z[0]._private.rscratch;return{x:Y[q],y:Y[X]}},I=function(z){return R("",M(z,"labelX","labelY"),z)},L=function(z){return R("source",M(z,"sourceLabelX","sourceLabelY"),z)},O=function(z){return R("target",M(z,"targetLabelX","targetLabelY"),z)},G=function(z){return h(T(z))},_=function(z){return h(D(z))},N=function(z){return h(A(z))},F=function(z){var q=k(z),X=h(k(z));if(z.isNode()){switch(ia(z.pstyle("text-halign").value)){case"left":X.x=-q.w-(q.leftPad||0);break;case"right":X.x=-(q.rightPad||0);break}switch(oa(z.pstyle("text-valign").value)){case"top":X.y=-q.h-(q.topPad||0);break;case"bottom":X.y=-(q.botPad||0);break}}return X},Z=e.data.eleTxrCache=new Ta(e,{getKey:g,doesEleInvalidateKey:y,drawElement:w,getBoundingBox:T,getRotationPoint:B,getRotationOffset:G,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),J=e.data.lblTxrCache=new Ta(e,{getKey:p,drawElement:x,getBoundingBox:k,getRotationPoint:I,getRotationOffset:F,isVisible:P}),U=e.data.slbTxrCache=new Ta(e,{getKey:m,drawElement:C,getBoundingBox:D,getRotationPoint:L,getRotationOffset:_,isVisible:P}),j=e.data.tlbTxrCache=new Ta(e,{getKey:b,drawElement:E,getBoundingBox:A,getRotationPoint:O,getRotationOffset:N,isVisible:P}),re=e.data.lyrTxrCache=new Wf(e);e.onUpdateEleCalcs(function(z,q){Z.invalidateElements(q),J.invalidateElements(q),U.invalidateElements(q),j.invalidateElements(q),re.invalidateElements(q);for(var X=0;X<q.length;X++){var Y=q[X]._private;Y.oldBackgroundTimestamp=Y.backgroundTimestamp}});var ne=function(z){for(var q=0;q<z.length;q++)re.enqueueElementRefinement(z[q].ele)};Z.onDequeue(ne),J.onDequeue(ne),U.onDequeue(ne),j.onDequeue(ne),r.webgl&&e.initWebgl(r,{getStyleKey:g,getLabelKey:p,getSourceLabelKey:m,getTargetLabelKey:b,drawElement:w,drawLabel:x,drawSourceLabel:C,drawTargetLabel:E,getElementBox:T,getLabelBox:k,getSourceLabelBox:D,getTargetLabelBox:A,getElementRotationPoint:B,getElementRotationOffset:G,getLabelRotationPoint:I,getSourceLabelRotationPoint:L,getTargetLabelRotationPoint:O,getLabelRotationOffset:F,getSourceLabelRotationOffset:_,getTargetLabelRotationOffset:N})}Be.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[Be.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[Be.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[Be.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var Xm=typeof Path2D<"u";Be.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};Be.usePaths=function(){return Xm&&this.pathsEnabled};Be.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};Be.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};Be.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":ar(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var a=this.cy.window(),n=a.document;t=n.createElement("canvas"),t.width=r,t.height=e}return t};[$f,Xr,rt,ks,Ft,xt,Er,Zf,Et,Za,tc].forEach(function(r){ge(Be,r)});var Ym=[{name:"null",impl:Af},{name:"base",impl:_f},{name:"canvas",impl:Um}],Zm=[{type:"layout",extensions:my},{type:"renderer",extensions:Ym}],nc={},ic={};function oc(r,e,t){var a=t,n=function(T){Fe("Can not register `"+e+"` for `"+r+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(za.prototype[e])return n(e);za.prototype[e]=t}else if(r==="collection"){if(hr.prototype[e])return n(e);hr.prototype[e]=t}else if(r==="layout"){for(var i=function(T){this.options=T,t.call(this,T),Ie(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var v=t.prototype.stop;o.stop=function(){var E=this.options;if(E&&E.animate){var T=this.animations;if(T)for(var k=0;k<T.length;k++)T[k].stop()}return v?v.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var f=function(T){return T._private.cy},c={addEventFields:function(T,k){k.layout=T,k.cy=f(T),k.target=T},bubble:function(){return!0},parent:function(T){return f(T)}};ge(o,{createEmitter:function(){return this._private.emitter=new Jn(c,this),this},emitter:function(){return this._private.emitter},on:function(T,k){return this.emitter().on(T,k),this},one:function(T,k){return this.emitter().one(T,k),this},once:function(T,k){return this.emitter().one(T,k),this},removeListener:function(T,k){return this.emitter().removeListener(T,k),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(T,k){return this.emitter().emit(T,k),this}}),ze.eventAliasesOn(o),a=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var d=sc("renderer","base"),h=d.prototype,y=t,g=t.prototype,p=function(){d.apply(this,arguments),y.apply(this,arguments)},m=p.prototype;for(var b in h){var w=h[b],x=g[b]!=null;if(x)return n(b);m[b]=w}for(var C in g)m[C]=g[C];h.clientFunctions.forEach(function(E){m[E]=m[E]||function(){Ue("Renderer does not implement `renderer."+E+"()` on its prototype")}}),a=p}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Ue(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return yv({map:nc,keys:[r,e],value:a})}function sc(r,e){return mv({map:nc,keys:[r,e]})}function Qm(r,e,t,a,n){return yv({map:ic,keys:[r,e,t,a],value:n})}function Jm(r,e,t,a){return mv({map:ic,keys:[r,e,t,a]})}var as=function(){if(arguments.length===2)return sc.apply(null,arguments);if(arguments.length===3)return oc.apply(null,arguments);if(arguments.length===4)return Jm.apply(null,arguments);if(arguments.length===5)return Qm.apply(null,arguments);Ue("Invalid extension access syntax")};za.prototype.extension=as;Zm.forEach(function(r){r.extensions.forEach(function(e){oc(r.type,e.name,e.impl)})});var _n=function(){if(!(this instanceof _n))return new _n;this.length=0},zt=_n.prototype;zt.instanceString=function(){return"stylesheet"};zt.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};zt.css=function(r,e){var t=this.length-1;if(ce(r))this[t].properties.push({name:r,value:e});else if(Ie(r))for(var a=r,n=Object.keys(a),i=0;i<n.length;i++){var o=n[i],s=a[o];if(s!=null){var u=lr.properties[o]||lr.properties[Gn(o)];if(u!=null){var l=u.name,v=s;this[t].properties.push({name:l,value:v})}}}return this};zt.style=zt.css;zt.generateStyle=function(r){var e=new lr(r);return this.appendToStyle(e)};zt.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],a=t.selector,n=t.properties;r.selector(a);for(var i=0;i<n.length;i++){var o=n[i];r.css(o.name,o.value)}}return r};var jm="3.35.0",sa=function(e){if(e===void 0&&(e={}),Ie(e))return new za(e);if(ce(e))return as.apply(as,arguments)};sa.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(sa),r.apply(null,e),this};sa.warnings=function(r){return Sv(r)};sa.version=jm;sa.stylesheet=sa.Stylesheet=_n;export{sa as c};