@templmf/temp-solf-lmf 0.0.93 → 0.0.95

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 (571) hide show
  1. package/@antv/algorithm@0.1.26/es2022/algorithm.mjs +3 -0
  2. package/@antv/algorithm@^0.1.26 +5 -0
  3. package/@antv/component@2.1.7/es2022/component.mjs +15 -0
  4. package/@antv/component@2.1.7/es2022/esm/animation.mjs +3 -0
  5. package/@antv/component@2.1.7/es2022/esm/core.mjs +3 -0
  6. package/@antv/component@2.1.7/es2022/esm/ui/axis/utils.mjs +3 -0
  7. package/@antv/component@2.1.7/es2022/esm/util/layout.mjs +3 -0
  8. package/@antv/component@^2.1.7 +11 -0
  9. package/@antv/event-emitter@0.1.3/es2022/event-emitter.mjs +3 -0
  10. package/@antv/event-emitter@^0.1.3 +3 -0
  11. package/@antv/g-camera-api@2.0.41/es2022/g-camera-api.mjs +15 -0
  12. package/@antv/g-canvas@2.0.48/es2022/g-canvas.mjs +18 -0
  13. package/@antv/g-canvas@^2.0.48 +6 -0
  14. package/@antv/g-dom-mutation-observer-api@2.0.38/es2022/g-dom-mutation-observer-api.mjs +15 -0
  15. package/@antv/g-lite@2.3.2/es2022/g-lite.mjs +22 -0
  16. package/@antv/g-math@3.0.1/es2022/g-math.mjs +17 -0
  17. package/@antv/g-plugin-canvas-path-generator@2.1.22/es2022/g-plugin-canvas-path-generator.mjs +16 -0
  18. package/@antv/g-plugin-canvas-picker@2.1.27/es2022/g-plugin-canvas-picker.mjs +20 -0
  19. package/@antv/g-plugin-canvas-renderer@2.3.3/es2022/g-plugin-canvas-renderer.mjs +17 -0
  20. package/@antv/g-plugin-dom-interaction@2.1.27/es2022/g-plugin-dom-interaction.mjs +15 -0
  21. package/@antv/g-plugin-dragndrop@2.0.38/es2022/g-plugin-dragndrop.mjs +18 -0
  22. package/@antv/g-plugin-dragndrop@^2.0.38 +4 -0
  23. package/@antv/g-plugin-html-renderer@2.1.27/es2022/g-plugin-html-renderer.mjs +15 -0
  24. package/@antv/g-plugin-image-loader@2.1.26/es2022/g-plugin-image-loader.mjs +19 -0
  25. package/@antv/g-web-animations-api@2.1.28/es2022/g-web-animations-api.mjs +17 -0
  26. package/@antv/g6@5.1.1/es2022/g6.mjs +125 -0
  27. package/@antv/g@6.1.28/es2022/g.mjs +15 -0
  28. package/@antv/g@^6.1.11 +6 -0
  29. package/@antv/g@^6.1.28 +6 -0
  30. package/@antv/graphlib@2.0.4/es2022/graphlib.mjs +3 -0
  31. package/@antv/graphlib@^2.0.4 +3 -0
  32. package/@antv/hierarchy@0.7.1/es2022/hierarchy.mjs +3 -0
  33. package/@antv/hierarchy@^0.7.1 +3 -0
  34. package/@antv/layout@2.0.0/es2022/layout.mjs +20 -0
  35. package/@antv/layout@^2.0.0 +2 -0
  36. package/@antv/scale@^0.4.16 +5 -0
  37. package/@antv/util@3.3.11/es2022/util.mjs +3 -0
  38. package/@antv/util@^2.0.13 +3 -0
  39. package/@antv/util@^3.3.10 +4 -0
  40. package/@antv/util@^3.3.11 +4 -0
  41. package/@antv/util@^3.3.5 +4 -0
  42. package/animate.css@4.1.1/animate.css +4072 -0
  43. package/bubblesets-js@2.3.4/es2022/bubblesets-js.mjs +4 -0
  44. package/echarts +8 -0
  45. package/echarts@6.0.0/es2022/echarts.mjs +3 -0
  46. package/echarts@6.0.0/es2022/lib/animation/basicTransition.mjs +3 -0
  47. package/echarts@6.0.0/es2022/lib/animation/customGraphicKeyframeAnimation.mjs +3 -0
  48. package/echarts@6.0.0/es2022/lib/animation/customGraphicTransition.mjs +3 -0
  49. package/echarts@6.0.0/es2022/lib/animation/morphTransitionHelper.mjs +3 -0
  50. package/echarts@6.0.0/es2022/lib/animation/universalTransition.mjs +3 -0
  51. package/echarts@6.0.0/es2022/lib/chart/bar/BarSeries.mjs +3 -0
  52. package/echarts@6.0.0/es2022/lib/chart/bar/BarView.mjs +3 -0
  53. package/echarts@6.0.0/es2022/lib/chart/bar/BaseBarSeries.mjs +3 -0
  54. package/echarts@6.0.0/es2022/lib/chart/bar/PictorialBarSeries.mjs +3 -0
  55. package/echarts@6.0.0/es2022/lib/chart/bar/PictorialBarView.mjs +3 -0
  56. package/echarts@6.0.0/es2022/lib/chart/bar/install.mjs +3 -0
  57. package/echarts@6.0.0/es2022/lib/chart/bar/installPictorialBar.mjs +3 -0
  58. package/echarts@6.0.0/es2022/lib/chart/boxplot/BoxplotSeries.mjs +3 -0
  59. package/echarts@6.0.0/es2022/lib/chart/boxplot/BoxplotView.mjs +3 -0
  60. package/echarts@6.0.0/es2022/lib/chart/boxplot/boxplotLayout.mjs +3 -0
  61. package/echarts@6.0.0/es2022/lib/chart/boxplot/boxplotTransform.mjs +3 -0
  62. package/echarts@6.0.0/es2022/lib/chart/boxplot/install.mjs +3 -0
  63. package/echarts@6.0.0/es2022/lib/chart/boxplot/prepareBoxplotData.mjs +3 -0
  64. package/echarts@6.0.0/es2022/lib/chart/candlestick/CandlestickSeries.mjs +3 -0
  65. package/echarts@6.0.0/es2022/lib/chart/candlestick/CandlestickView.mjs +3 -0
  66. package/echarts@6.0.0/es2022/lib/chart/candlestick/candlestickLayout.mjs +3 -0
  67. package/echarts@6.0.0/es2022/lib/chart/candlestick/candlestickVisual.mjs +3 -0
  68. package/echarts@6.0.0/es2022/lib/chart/candlestick/install.mjs +3 -0
  69. package/echarts@6.0.0/es2022/lib/chart/candlestick/preprocessor.mjs +3 -0
  70. package/echarts@6.0.0/es2022/lib/chart/chord/ChordEdge.mjs +3 -0
  71. package/echarts@6.0.0/es2022/lib/chart/chord/ChordSeries.mjs +3 -0
  72. package/echarts@6.0.0/es2022/lib/chart/chord/ChordView.mjs +3 -0
  73. package/echarts@6.0.0/es2022/lib/chart/chord/install.mjs +3 -0
  74. package/echarts@6.0.0/es2022/lib/chart/custom/CustomView.mjs +3 -0
  75. package/echarts@6.0.0/es2022/lib/chart/custom/customSeriesRegister.mjs +3 -0
  76. package/echarts@6.0.0/es2022/lib/chart/custom/install.mjs +3 -0
  77. package/echarts@6.0.0/es2022/lib/chart/effectScatter/EffectScatterSeries.mjs +3 -0
  78. package/echarts@6.0.0/es2022/lib/chart/effectScatter/EffectScatterView.mjs +3 -0
  79. package/echarts@6.0.0/es2022/lib/chart/effectScatter/install.mjs +3 -0
  80. package/echarts@6.0.0/es2022/lib/chart/funnel/FunnelSeries.mjs +3 -0
  81. package/echarts@6.0.0/es2022/lib/chart/funnel/FunnelView.mjs +3 -0
  82. package/echarts@6.0.0/es2022/lib/chart/funnel/funnelLayout.mjs +3 -0
  83. package/echarts@6.0.0/es2022/lib/chart/funnel/install.mjs +3 -0
  84. package/echarts@6.0.0/es2022/lib/chart/gauge/GaugeSeries.mjs +3 -0
  85. package/echarts@6.0.0/es2022/lib/chart/gauge/GaugeView.mjs +3 -0
  86. package/echarts@6.0.0/es2022/lib/chart/gauge/install.mjs +3 -0
  87. package/echarts@6.0.0/es2022/lib/chart/graph/GraphSeries.mjs +3 -0
  88. package/echarts@6.0.0/es2022/lib/chart/graph/GraphView.mjs +3 -0
  89. package/echarts@6.0.0/es2022/lib/chart/graph/adjustEdge.mjs +3 -0
  90. package/echarts@6.0.0/es2022/lib/chart/graph/categoryFilter.mjs +3 -0
  91. package/echarts@6.0.0/es2022/lib/chart/graph/categoryVisual.mjs +3 -0
  92. package/echarts@6.0.0/es2022/lib/chart/graph/circularLayout.mjs +3 -0
  93. package/echarts@6.0.0/es2022/lib/chart/graph/createView.mjs +3 -0
  94. package/echarts@6.0.0/es2022/lib/chart/graph/edgeVisual.mjs +3 -0
  95. package/echarts@6.0.0/es2022/lib/chart/graph/forceHelper.mjs +3 -0
  96. package/echarts@6.0.0/es2022/lib/chart/graph/forceLayout.mjs +3 -0
  97. package/echarts@6.0.0/es2022/lib/chart/graph/graphHelper.mjs +3 -0
  98. package/echarts@6.0.0/es2022/lib/chart/graph/install.mjs +3 -0
  99. package/echarts@6.0.0/es2022/lib/chart/graph/simpleLayout.mjs +3 -0
  100. package/echarts@6.0.0/es2022/lib/chart/graph/simpleLayoutHelper.mjs +3 -0
  101. package/echarts@6.0.0/es2022/lib/chart/heatmap/HeatmapLayer.mjs +3 -0
  102. package/echarts@6.0.0/es2022/lib/chart/heatmap/HeatmapSeries.mjs +3 -0
  103. package/echarts@6.0.0/es2022/lib/chart/heatmap/HeatmapView.mjs +3 -0
  104. package/echarts@6.0.0/es2022/lib/chart/heatmap/install.mjs +3 -0
  105. package/echarts@6.0.0/es2022/lib/chart/helper/EffectLine.mjs +3 -0
  106. package/echarts@6.0.0/es2022/lib/chart/helper/EffectSymbol.mjs +3 -0
  107. package/echarts@6.0.0/es2022/lib/chart/helper/LargeLineDraw.mjs +3 -0
  108. package/echarts@6.0.0/es2022/lib/chart/helper/Line.mjs +3 -0
  109. package/echarts@6.0.0/es2022/lib/chart/helper/LineDraw.mjs +3 -0
  110. package/echarts@6.0.0/es2022/lib/chart/helper/LinePath.mjs +3 -0
  111. package/echarts@6.0.0/es2022/lib/chart/helper/Polyline.mjs +3 -0
  112. package/echarts@6.0.0/es2022/lib/chart/helper/Symbol.mjs +3 -0
  113. package/echarts@6.0.0/es2022/lib/chart/helper/SymbolDraw.mjs +3 -0
  114. package/echarts@6.0.0/es2022/lib/chart/helper/createClipPathFromCoordSys.mjs +3 -0
  115. package/echarts@6.0.0/es2022/lib/chart/helper/createRenderPlanner.mjs +3 -0
  116. package/echarts@6.0.0/es2022/lib/chart/helper/createSeriesData.mjs +3 -0
  117. package/echarts@6.0.0/es2022/lib/chart/helper/createSeriesDataSimply.mjs +3 -0
  118. package/echarts@6.0.0/es2022/lib/chart/helper/enableAriaDecalForTree.mjs +3 -0
  119. package/echarts@6.0.0/es2022/lib/chart/helper/labelHelper.mjs +3 -0
  120. package/echarts@6.0.0/es2022/lib/chart/helper/multipleGraphEdgeHelper.mjs +3 -0
  121. package/echarts@6.0.0/es2022/lib/chart/helper/treeHelper.mjs +3 -0
  122. package/echarts@6.0.0/es2022/lib/chart/helper/whiskerBoxCommon.mjs +3 -0
  123. package/echarts@6.0.0/es2022/lib/chart/line/LineSeries.mjs +3 -0
  124. package/echarts@6.0.0/es2022/lib/chart/line/LineView.mjs +3 -0
  125. package/echarts@6.0.0/es2022/lib/chart/line/helper.mjs +3 -0
  126. package/echarts@6.0.0/es2022/lib/chart/line/install.mjs +3 -0
  127. package/echarts@6.0.0/es2022/lib/chart/line/lineAnimationDiff.mjs +3 -0
  128. package/echarts@6.0.0/es2022/lib/chart/line/poly.mjs +3 -0
  129. package/echarts@6.0.0/es2022/lib/chart/lines/LinesSeries.mjs +3 -0
  130. package/echarts@6.0.0/es2022/lib/chart/lines/LinesView.mjs +3 -0
  131. package/echarts@6.0.0/es2022/lib/chart/lines/install.mjs +3 -0
  132. package/echarts@6.0.0/es2022/lib/chart/lines/linesLayout.mjs +3 -0
  133. package/echarts@6.0.0/es2022/lib/chart/lines/linesVisual.mjs +3 -0
  134. package/echarts@6.0.0/es2022/lib/chart/map/MapSeries.mjs +3 -0
  135. package/echarts@6.0.0/es2022/lib/chart/map/MapView.mjs +3 -0
  136. package/echarts@6.0.0/es2022/lib/chart/map/install.mjs +3 -0
  137. package/echarts@6.0.0/es2022/lib/chart/map/mapDataStatistic.mjs +3 -0
  138. package/echarts@6.0.0/es2022/lib/chart/map/mapSymbolLayout.mjs +3 -0
  139. package/echarts@6.0.0/es2022/lib/chart/parallel/ParallelSeries.mjs +3 -0
  140. package/echarts@6.0.0/es2022/lib/chart/parallel/ParallelView.mjs +3 -0
  141. package/echarts@6.0.0/es2022/lib/chart/parallel/install.mjs +3 -0
  142. package/echarts@6.0.0/es2022/lib/chart/parallel/parallelVisual.mjs +3 -0
  143. package/echarts@6.0.0/es2022/lib/chart/pie/PieSeries.mjs +3 -0
  144. package/echarts@6.0.0/es2022/lib/chart/pie/PieView.mjs +3 -0
  145. package/echarts@6.0.0/es2022/lib/chart/pie/install.mjs +3 -0
  146. package/echarts@6.0.0/es2022/lib/chart/pie/pieLayout.mjs +3 -0
  147. package/echarts@6.0.0/es2022/lib/chart/radar/RadarSeries.mjs +3 -0
  148. package/echarts@6.0.0/es2022/lib/chart/radar/RadarView.mjs +3 -0
  149. package/echarts@6.0.0/es2022/lib/chart/radar/backwardCompat.mjs +3 -0
  150. package/echarts@6.0.0/es2022/lib/chart/radar/install.mjs +3 -0
  151. package/echarts@6.0.0/es2022/lib/chart/radar/radarLayout.mjs +3 -0
  152. package/echarts@6.0.0/es2022/lib/chart/sankey/SankeySeries.mjs +3 -0
  153. package/echarts@6.0.0/es2022/lib/chart/sankey/SankeyView.mjs +3 -0
  154. package/echarts@6.0.0/es2022/lib/chart/sankey/install.mjs +3 -0
  155. package/echarts@6.0.0/es2022/lib/chart/sankey/sankeyLayout.mjs +3 -0
  156. package/echarts@6.0.0/es2022/lib/chart/sankey/sankeyVisual.mjs +3 -0
  157. package/echarts@6.0.0/es2022/lib/chart/scatter/ScatterSeries.mjs +3 -0
  158. package/echarts@6.0.0/es2022/lib/chart/scatter/install.mjs +3 -0
  159. package/echarts@6.0.0/es2022/lib/chart/scatter/jitterLayout.mjs +3 -0
  160. package/echarts@6.0.0/es2022/lib/chart/sunburst/SunburstPiece.mjs +3 -0
  161. package/echarts@6.0.0/es2022/lib/chart/sunburst/SunburstSeries.mjs +3 -0
  162. package/echarts@6.0.0/es2022/lib/chart/sunburst/SunburstView.mjs +3 -0
  163. package/echarts@6.0.0/es2022/lib/chart/sunburst/install.mjs +3 -0
  164. package/echarts@6.0.0/es2022/lib/chart/sunburst/sunburstAction.mjs +3 -0
  165. package/echarts@6.0.0/es2022/lib/chart/sunburst/sunburstLayout.mjs +3 -0
  166. package/echarts@6.0.0/es2022/lib/chart/sunburst/sunburstVisual.mjs +3 -0
  167. package/echarts@6.0.0/es2022/lib/chart/themeRiver/ThemeRiverSeries.mjs +3 -0
  168. package/echarts@6.0.0/es2022/lib/chart/themeRiver/ThemeRiverView.mjs +3 -0
  169. package/echarts@6.0.0/es2022/lib/chart/themeRiver/install.mjs +3 -0
  170. package/echarts@6.0.0/es2022/lib/chart/themeRiver/themeRiverLayout.mjs +3 -0
  171. package/echarts@6.0.0/es2022/lib/chart/tree/TreeSeries.mjs +3 -0
  172. package/echarts@6.0.0/es2022/lib/chart/tree/TreeView.mjs +3 -0
  173. package/echarts@6.0.0/es2022/lib/chart/tree/install.mjs +3 -0
  174. package/echarts@6.0.0/es2022/lib/chart/tree/layoutHelper.mjs +3 -0
  175. package/echarts@6.0.0/es2022/lib/chart/tree/treeAction.mjs +3 -0
  176. package/echarts@6.0.0/es2022/lib/chart/tree/treeVisual.mjs +3 -0
  177. package/echarts@6.0.0/es2022/lib/chart/treemap/Breadcrumb.mjs +3 -0
  178. package/echarts@6.0.0/es2022/lib/chart/treemap/TreemapSeries.mjs +3 -0
  179. package/echarts@6.0.0/es2022/lib/chart/treemap/TreemapView.mjs +3 -0
  180. package/echarts@6.0.0/es2022/lib/chart/treemap/install.mjs +3 -0
  181. package/echarts@6.0.0/es2022/lib/chart/treemap/treemapLayout.mjs +3 -0
  182. package/echarts@6.0.0/es2022/lib/chart/treemap/treemapVisual.mjs +3 -0
  183. package/echarts@6.0.0/es2022/lib/component/aria/install.mjs +3 -0
  184. package/echarts@6.0.0/es2022/lib/component/aria/preprocessor.mjs +3 -0
  185. package/echarts@6.0.0/es2022/lib/component/axis/AngleAxisView.mjs +3 -0
  186. package/echarts@6.0.0/es2022/lib/component/axis/AxisBuilder.mjs +3 -0
  187. package/echarts@6.0.0/es2022/lib/component/axis/CartesianAxisView.mjs +3 -0
  188. package/echarts@6.0.0/es2022/lib/component/axis/ParallelAxisView.mjs +3 -0
  189. package/echarts@6.0.0/es2022/lib/component/axis/RadiusAxisView.mjs +3 -0
  190. package/echarts@6.0.0/es2022/lib/component/axis/SingleAxisView.mjs +3 -0
  191. package/echarts@6.0.0/es2022/lib/component/axis/axisAction.mjs +3 -0
  192. package/echarts@6.0.0/es2022/lib/component/axis/axisBreakHelper.mjs +3 -0
  193. package/echarts@6.0.0/es2022/lib/component/axis/axisBreakHelperImpl.mjs +3 -0
  194. package/echarts@6.0.0/es2022/lib/component/axis/axisSplitHelper.mjs +3 -0
  195. package/echarts@6.0.0/es2022/lib/component/axis/installBreak.mjs +3 -0
  196. package/echarts@6.0.0/es2022/lib/component/axis/parallelAxisAction.mjs +3 -0
  197. package/echarts@6.0.0/es2022/lib/component/axisPointer/AxisPointerModel.mjs +3 -0
  198. package/echarts@6.0.0/es2022/lib/component/axisPointer/AxisPointerView.mjs +3 -0
  199. package/echarts@6.0.0/es2022/lib/component/axisPointer/BaseAxisPointer.mjs +3 -0
  200. package/echarts@6.0.0/es2022/lib/component/axisPointer/CartesianAxisPointer.mjs +3 -0
  201. package/echarts@6.0.0/es2022/lib/component/axisPointer/PolarAxisPointer.mjs +3 -0
  202. package/echarts@6.0.0/es2022/lib/component/axisPointer/SingleAxisPointer.mjs +3 -0
  203. package/echarts@6.0.0/es2022/lib/component/axisPointer/axisTrigger.mjs +3 -0
  204. package/echarts@6.0.0/es2022/lib/component/axisPointer/findPointFromSeries.mjs +3 -0
  205. package/echarts@6.0.0/es2022/lib/component/axisPointer/globalListener.mjs +3 -0
  206. package/echarts@6.0.0/es2022/lib/component/axisPointer/install.mjs +3 -0
  207. package/echarts@6.0.0/es2022/lib/component/axisPointer/modelHelper.mjs +3 -0
  208. package/echarts@6.0.0/es2022/lib/component/axisPointer/viewHelper.mjs +3 -0
  209. package/echarts@6.0.0/es2022/lib/component/brush/BrushModel.mjs +3 -0
  210. package/echarts@6.0.0/es2022/lib/component/brush/BrushView.mjs +3 -0
  211. package/echarts@6.0.0/es2022/lib/component/brush/install.mjs +3 -0
  212. package/echarts@6.0.0/es2022/lib/component/brush/preprocessor.mjs +3 -0
  213. package/echarts@6.0.0/es2022/lib/component/brush/selector.mjs +3 -0
  214. package/echarts@6.0.0/es2022/lib/component/brush/visualEncoding.mjs +3 -0
  215. package/echarts@6.0.0/es2022/lib/component/calendar/install.mjs +3 -0
  216. package/echarts@6.0.0/es2022/lib/component/dataZoom/DataZoomModel.mjs +3 -0
  217. package/echarts@6.0.0/es2022/lib/component/dataZoom/InsideZoomModel.mjs +3 -0
  218. package/echarts@6.0.0/es2022/lib/component/dataZoom/InsideZoomView.mjs +3 -0
  219. package/echarts@6.0.0/es2022/lib/component/dataZoom/SliderZoomModel.mjs +3 -0
  220. package/echarts@6.0.0/es2022/lib/component/dataZoom/SliderZoomView.mjs +3 -0
  221. package/echarts@6.0.0/es2022/lib/component/dataZoom/dataZoomAction.mjs +3 -0
  222. package/echarts@6.0.0/es2022/lib/component/dataZoom/dataZoomProcessor.mjs +3 -0
  223. package/echarts@6.0.0/es2022/lib/component/dataZoom/helper.mjs +3 -0
  224. package/echarts@6.0.0/es2022/lib/component/dataZoom/history.mjs +3 -0
  225. package/echarts@6.0.0/es2022/lib/component/dataZoom/install.mjs +3 -0
  226. package/echarts@6.0.0/es2022/lib/component/dataZoom/installCommon.mjs +3 -0
  227. package/echarts@6.0.0/es2022/lib/component/dataZoom/installDataZoomInside.mjs +3 -0
  228. package/echarts@6.0.0/es2022/lib/component/dataZoom/installDataZoomSlider.mjs +3 -0
  229. package/echarts@6.0.0/es2022/lib/component/dataZoom/roams.mjs +3 -0
  230. package/echarts@6.0.0/es2022/lib/component/dataset/install.mjs +3 -0
  231. package/echarts@6.0.0/es2022/lib/component/geo/GeoView.mjs +3 -0
  232. package/echarts@6.0.0/es2022/lib/component/geo/install.mjs +3 -0
  233. package/echarts@6.0.0/es2022/lib/component/graphic/GraphicModel.mjs +3 -0
  234. package/echarts@6.0.0/es2022/lib/component/graphic/GraphicView.mjs +3 -0
  235. package/echarts@6.0.0/es2022/lib/component/graphic/install.mjs +3 -0
  236. package/echarts@6.0.0/es2022/lib/component/grid/install.mjs +3 -0
  237. package/echarts@6.0.0/es2022/lib/component/grid/installSimple.mjs +3 -0
  238. package/echarts@6.0.0/es2022/lib/component/helper/BrushTargetManager.mjs +3 -0
  239. package/echarts@6.0.0/es2022/lib/component/helper/MapDraw.mjs +3 -0
  240. package/echarts@6.0.0/es2022/lib/component/helper/RoamController.mjs +3 -0
  241. package/echarts@6.0.0/es2022/lib/component/helper/brushHelper.mjs +3 -0
  242. package/echarts@6.0.0/es2022/lib/component/helper/cursorHelper.mjs +3 -0
  243. package/echarts@6.0.0/es2022/lib/component/helper/interactionMutex.mjs +3 -0
  244. package/echarts@6.0.0/es2022/lib/component/helper/listComponent.mjs +3 -0
  245. package/echarts@6.0.0/es2022/lib/component/helper/sliderMove.mjs +3 -0
  246. package/echarts@6.0.0/es2022/lib/component/helper/thumbnailBridge.mjs +3 -0
  247. package/echarts@6.0.0/es2022/lib/component/legend/LegendModel.mjs +3 -0
  248. package/echarts@6.0.0/es2022/lib/component/legend/LegendView.mjs +4 -0
  249. package/echarts@6.0.0/es2022/lib/component/legend/ScrollableLegendModel.mjs +3 -0
  250. package/echarts@6.0.0/es2022/lib/component/legend/ScrollableLegendView.mjs +3 -0
  251. package/echarts@6.0.0/es2022/lib/component/legend/install.mjs +3 -0
  252. package/echarts@6.0.0/es2022/lib/component/legend/installLegendPlain.mjs +3 -0
  253. package/echarts@6.0.0/es2022/lib/component/legend/installLegendScroll.mjs +3 -0
  254. package/echarts@6.0.0/es2022/lib/component/legend/legendAction.mjs +4 -0
  255. package/echarts@6.0.0/es2022/lib/component/legend/legendFilter.mjs +3 -0
  256. package/echarts@6.0.0/es2022/lib/component/legend/scrollableLegendAction.mjs +3 -0
  257. package/echarts@6.0.0/es2022/lib/component/marker/MarkAreaModel.mjs +3 -0
  258. package/echarts@6.0.0/es2022/lib/component/marker/MarkAreaView.mjs +3 -0
  259. package/echarts@6.0.0/es2022/lib/component/marker/MarkLineModel.mjs +3 -0
  260. package/echarts@6.0.0/es2022/lib/component/marker/MarkLineView.mjs +3 -0
  261. package/echarts@6.0.0/es2022/lib/component/marker/MarkPointModel.mjs +3 -0
  262. package/echarts@6.0.0/es2022/lib/component/marker/MarkPointView.mjs +3 -0
  263. package/echarts@6.0.0/es2022/lib/component/marker/MarkerModel.mjs +3 -0
  264. package/echarts@6.0.0/es2022/lib/component/marker/MarkerView.mjs +3 -0
  265. package/echarts@6.0.0/es2022/lib/component/marker/checkMarkerInSeries.mjs +3 -0
  266. package/echarts@6.0.0/es2022/lib/component/marker/installMarkArea.mjs +3 -0
  267. package/echarts@6.0.0/es2022/lib/component/marker/installMarkLine.mjs +3 -0
  268. package/echarts@6.0.0/es2022/lib/component/marker/installMarkPoint.mjs +3 -0
  269. package/echarts@6.0.0/es2022/lib/component/marker/markerHelper.mjs +3 -0
  270. package/echarts@6.0.0/es2022/lib/component/matrix/MatrixView.mjs +3 -0
  271. package/echarts@6.0.0/es2022/lib/component/matrix/install.mjs +3 -0
  272. package/echarts@6.0.0/es2022/lib/component/parallel/ParallelView.mjs +3 -0
  273. package/echarts@6.0.0/es2022/lib/component/parallel/install.mjs +3 -0
  274. package/echarts@6.0.0/es2022/lib/component/polar/install.mjs +3 -0
  275. package/echarts@6.0.0/es2022/lib/component/radar/RadarView.mjs +3 -0
  276. package/echarts@6.0.0/es2022/lib/component/radar/install.mjs +3 -0
  277. package/echarts@6.0.0/es2022/lib/component/singleAxis/install.mjs +3 -0
  278. package/echarts@6.0.0/es2022/lib/component/thumbnail/ThumbnailBridgeImpl.mjs +3 -0
  279. package/echarts@6.0.0/es2022/lib/component/thumbnail/ThumbnailModel.mjs +3 -0
  280. package/echarts@6.0.0/es2022/lib/component/thumbnail/ThumbnailView.mjs +3 -0
  281. package/echarts@6.0.0/es2022/lib/component/thumbnail/install.mjs +3 -0
  282. package/echarts@6.0.0/es2022/lib/component/timeline/SliderTimelineModel.mjs +3 -0
  283. package/echarts@6.0.0/es2022/lib/component/timeline/SliderTimelineView.mjs +3 -0
  284. package/echarts@6.0.0/es2022/lib/component/timeline/TimelineAxis.mjs +3 -0
  285. package/echarts@6.0.0/es2022/lib/component/timeline/TimelineModel.mjs +3 -0
  286. package/echarts@6.0.0/es2022/lib/component/timeline/TimelineView.mjs +3 -0
  287. package/echarts@6.0.0/es2022/lib/component/timeline/install.mjs +3 -0
  288. package/echarts@6.0.0/es2022/lib/component/timeline/preprocessor.mjs +3 -0
  289. package/echarts@6.0.0/es2022/lib/component/timeline/timelineAction.mjs +3 -0
  290. package/echarts@6.0.0/es2022/lib/component/title/install.mjs +3 -0
  291. package/echarts@6.0.0/es2022/lib/component/toolbox/ToolboxModel.mjs +3 -0
  292. package/echarts@6.0.0/es2022/lib/component/toolbox/ToolboxView.mjs +3 -0
  293. package/echarts@6.0.0/es2022/lib/component/toolbox/feature/Brush.mjs +3 -0
  294. package/echarts@6.0.0/es2022/lib/component/toolbox/feature/DataView.mjs +20 -0
  295. package/echarts@6.0.0/es2022/lib/component/toolbox/feature/DataZoom.mjs +3 -0
  296. package/echarts@6.0.0/es2022/lib/component/toolbox/feature/MagicType.mjs +3 -0
  297. package/echarts@6.0.0/es2022/lib/component/toolbox/feature/Restore.mjs +3 -0
  298. package/echarts@6.0.0/es2022/lib/component/toolbox/feature/SaveAsImage.mjs +3 -0
  299. package/echarts@6.0.0/es2022/lib/component/toolbox/featureManager.mjs +3 -0
  300. package/echarts@6.0.0/es2022/lib/component/toolbox/install.mjs +3 -0
  301. package/echarts@6.0.0/es2022/lib/component/tooltip/TooltipHTMLContent.mjs +3 -0
  302. package/echarts@6.0.0/es2022/lib/component/tooltip/TooltipRichContent.mjs +3 -0
  303. package/echarts@6.0.0/es2022/lib/component/tooltip/TooltipView.mjs +5 -0
  304. package/echarts@6.0.0/es2022/lib/component/tooltip/helper.mjs +3 -0
  305. package/echarts@6.0.0/es2022/lib/component/tooltip/install.mjs +3 -0
  306. package/echarts@6.0.0/es2022/lib/component/tooltip/seriesFormatTooltip.mjs +3 -0
  307. package/echarts@6.0.0/es2022/lib/component/tooltip/tooltipMarkup.mjs +9 -0
  308. package/echarts@6.0.0/es2022/lib/component/transform/install.mjs +3 -0
  309. package/echarts@6.0.0/es2022/lib/component/transform/sortTransform.mjs +3 -0
  310. package/echarts@6.0.0/es2022/lib/component/visualMap/ContinuousView.mjs +3 -0
  311. package/echarts@6.0.0/es2022/lib/component/visualMap/PiecewiseModel.mjs +3 -0
  312. package/echarts@6.0.0/es2022/lib/component/visualMap/PiecewiseView.mjs +3 -0
  313. package/echarts@6.0.0/es2022/lib/component/visualMap/VisualMapModel.mjs +3 -0
  314. package/echarts@6.0.0/es2022/lib/component/visualMap/VisualMapView.mjs +3 -0
  315. package/echarts@6.0.0/es2022/lib/component/visualMap/helper.mjs +3 -0
  316. package/echarts@6.0.0/es2022/lib/component/visualMap/install.mjs +3 -0
  317. package/echarts@6.0.0/es2022/lib/component/visualMap/installCommon.mjs +3 -0
  318. package/echarts@6.0.0/es2022/lib/component/visualMap/installVisualMapContinuous.mjs +3 -0
  319. package/echarts@6.0.0/es2022/lib/component/visualMap/installVisualMapPiecewise.mjs +3 -0
  320. package/echarts@6.0.0/es2022/lib/component/visualMap/preprocessor.mjs +3 -0
  321. package/echarts@6.0.0/es2022/lib/component/visualMap/visualEncoding.mjs +3 -0
  322. package/echarts@6.0.0/es2022/lib/component/visualMap/visualMapAction.mjs +3 -0
  323. package/echarts@6.0.0/es2022/lib/coord/Axis.mjs +3 -0
  324. package/echarts@6.0.0/es2022/lib/coord/CoordinateSystem.mjs +3 -0
  325. package/echarts@6.0.0/es2022/lib/coord/View.mjs +3 -0
  326. package/echarts@6.0.0/es2022/lib/coord/axisAlignTicks.mjs +3 -0
  327. package/echarts@6.0.0/es2022/lib/coord/axisCommonTypes.mjs +3 -0
  328. package/echarts@6.0.0/es2022/lib/coord/axisHelper.mjs +3 -0
  329. package/echarts@6.0.0/es2022/lib/coord/axisModelCreator.mjs +3 -0
  330. package/echarts@6.0.0/es2022/lib/coord/axisTickLabelBuilder.mjs +3 -0
  331. package/echarts@6.0.0/es2022/lib/coord/calendar/CalendarModel.mjs +3 -0
  332. package/echarts@6.0.0/es2022/lib/coord/calendar/prepareCustom.mjs +3 -0
  333. package/echarts@6.0.0/es2022/lib/coord/cartesian/Axis2D.mjs +3 -0
  334. package/echarts@6.0.0/es2022/lib/coord/cartesian/AxisModel.mjs +3 -0
  335. package/echarts@6.0.0/es2022/lib/coord/cartesian/Cartesian.mjs +3 -0
  336. package/echarts@6.0.0/es2022/lib/coord/cartesian/Cartesian2D.mjs +3 -0
  337. package/echarts@6.0.0/es2022/lib/coord/cartesian/Grid.mjs +3 -0
  338. package/echarts@6.0.0/es2022/lib/coord/cartesian/GridModel.mjs +3 -0
  339. package/echarts@6.0.0/es2022/lib/coord/cartesian/cartesianAxisHelper.mjs +3 -0
  340. package/echarts@6.0.0/es2022/lib/coord/cartesian/legacyContainLabel.mjs +3 -0
  341. package/echarts@6.0.0/es2022/lib/coord/cartesian/prepareCustom.mjs +3 -0
  342. package/echarts@6.0.0/es2022/lib/coord/geo/Geo.mjs +3 -0
  343. package/echarts@6.0.0/es2022/lib/coord/geo/GeoJSONResource.mjs +4 -0
  344. package/echarts@6.0.0/es2022/lib/coord/geo/GeoModel.mjs +3 -0
  345. package/echarts@6.0.0/es2022/lib/coord/geo/GeoSVGResource.mjs +4 -0
  346. package/echarts@6.0.0/es2022/lib/coord/geo/Region.mjs +3 -0
  347. package/echarts@6.0.0/es2022/lib/coord/geo/fix/diaoyuIsland.mjs +3 -0
  348. package/echarts@6.0.0/es2022/lib/coord/geo/fix/nanhai.mjs +3 -0
  349. package/echarts@6.0.0/es2022/lib/coord/geo/fix/textCoord.mjs +3 -0
  350. package/echarts@6.0.0/es2022/lib/coord/geo/geoCreator.mjs +3 -0
  351. package/echarts@6.0.0/es2022/lib/coord/geo/geoSourceManager.mjs +3 -0
  352. package/echarts@6.0.0/es2022/lib/coord/geo/parseGeoJson.mjs +3 -0
  353. package/echarts@6.0.0/es2022/lib/coord/geo/prepareCustom.mjs +3 -0
  354. package/echarts@6.0.0/es2022/lib/coord/matrix/Matrix.mjs +3 -0
  355. package/echarts@6.0.0/es2022/lib/coord/matrix/MatrixBodyCorner.mjs +3 -0
  356. package/echarts@6.0.0/es2022/lib/coord/matrix/MatrixDim.mjs +3 -0
  357. package/echarts@6.0.0/es2022/lib/coord/matrix/MatrixModel.mjs +3 -0
  358. package/echarts@6.0.0/es2022/lib/coord/matrix/matrixCoordHelper.mjs +3 -0
  359. package/echarts@6.0.0/es2022/lib/coord/parallel/AxisModel.mjs +3 -0
  360. package/echarts@6.0.0/es2022/lib/coord/parallel/Parallel.mjs +3 -0
  361. package/echarts@6.0.0/es2022/lib/coord/parallel/ParallelModel.mjs +3 -0
  362. package/echarts@6.0.0/es2022/lib/coord/parallel/parallelCreator.mjs +3 -0
  363. package/echarts@6.0.0/es2022/lib/coord/parallel/parallelPreprocessor.mjs +3 -0
  364. package/echarts@6.0.0/es2022/lib/coord/polar/AngleAxis.mjs +3 -0
  365. package/echarts@6.0.0/es2022/lib/coord/polar/AxisModel.mjs +3 -0
  366. package/echarts@6.0.0/es2022/lib/coord/polar/Polar.mjs +3 -0
  367. package/echarts@6.0.0/es2022/lib/coord/polar/PolarModel.mjs +3 -0
  368. package/echarts@6.0.0/es2022/lib/coord/polar/RadiusAxis.mjs +3 -0
  369. package/echarts@6.0.0/es2022/lib/coord/polar/polarCreator.mjs +3 -0
  370. package/echarts@6.0.0/es2022/lib/coord/polar/prepareCustom.mjs +3 -0
  371. package/echarts@6.0.0/es2022/lib/coord/radar/Radar.mjs +3 -0
  372. package/echarts@6.0.0/es2022/lib/coord/radar/RadarModel.mjs +3 -0
  373. package/echarts@6.0.0/es2022/lib/coord/scaleRawExtentInfo.mjs +3 -0
  374. package/echarts@6.0.0/es2022/lib/coord/single/AxisModel.mjs +3 -0
  375. package/echarts@6.0.0/es2022/lib/coord/single/Single.mjs +3 -0
  376. package/echarts@6.0.0/es2022/lib/coord/single/SingleAxis.mjs +3 -0
  377. package/echarts@6.0.0/es2022/lib/coord/single/prepareCustom.mjs +3 -0
  378. package/echarts@6.0.0/es2022/lib/coord/single/singleAxisHelper.mjs +3 -0
  379. package/echarts@6.0.0/es2022/lib/coord/single/singleCreator.mjs +3 -0
  380. package/echarts@6.0.0/es2022/lib/core/CoordinateSystem.mjs +3 -0
  381. package/echarts@6.0.0/es2022/lib/core/ExtensionAPI.mjs +3 -0
  382. package/echarts@6.0.0/es2022/lib/core/Scheduler.mjs +3 -0
  383. package/echarts@6.0.0/es2022/lib/core/echarts.mjs +3 -0
  384. package/echarts@6.0.0/es2022/lib/core/impl.mjs +3 -0
  385. package/echarts@6.0.0/es2022/lib/core/lifecycle.mjs +3 -0
  386. package/echarts@6.0.0/es2022/lib/core/locale.mjs +3 -0
  387. package/echarts@6.0.0/es2022/lib/core/task.mjs +3 -0
  388. package/echarts@6.0.0/es2022/lib/data/DataDiffer.mjs +3 -0
  389. package/echarts@6.0.0/es2022/lib/data/DataStore.mjs +3 -0
  390. package/echarts@6.0.0/es2022/lib/data/OrdinalMeta.mjs +3 -0
  391. package/echarts@6.0.0/es2022/lib/data/SeriesData.mjs +3 -0
  392. package/echarts@6.0.0/es2022/lib/data/SeriesDimensionDefine.mjs +3 -0
  393. package/echarts@6.0.0/es2022/lib/data/Source.mjs +3 -0
  394. package/echarts@6.0.0/es2022/lib/data/helper/SeriesDataSchema.mjs +3 -0
  395. package/echarts@6.0.0/es2022/lib/data/helper/createDimensions.mjs +3 -0
  396. package/echarts@6.0.0/es2022/lib/data/helper/dataProvider.mjs +3 -0
  397. package/echarts@6.0.0/es2022/lib/data/helper/dataStackHelper.mjs +3 -0
  398. package/echarts@6.0.0/es2022/lib/data/helper/dataValueHelper.mjs +3 -0
  399. package/echarts@6.0.0/es2022/lib/data/helper/dimensionHelper.mjs +3 -0
  400. package/echarts@6.0.0/es2022/lib/data/helper/sourceHelper.mjs +3 -0
  401. package/echarts@6.0.0/es2022/lib/data/helper/sourceManager.mjs +3 -0
  402. package/echarts@6.0.0/es2022/lib/data/helper/transform.mjs +3 -0
  403. package/echarts@6.0.0/es2022/lib/export/api/format.mjs +3 -0
  404. package/echarts@6.0.0/es2022/lib/export/api/graphic.mjs +3 -0
  405. package/echarts@6.0.0/es2022/lib/export/api/helper.mjs +3 -0
  406. package/echarts@6.0.0/es2022/lib/export/api/number.mjs +3 -0
  407. package/echarts@6.0.0/es2022/lib/export/api/time.mjs +3 -0
  408. package/echarts@6.0.0/es2022/lib/export/api/util.mjs +3 -0
  409. package/echarts@6.0.0/es2022/lib/export/api.mjs +3 -0
  410. package/echarts@6.0.0/es2022/lib/export/charts.mjs +3 -0
  411. package/echarts@6.0.0/es2022/lib/export/components.mjs +3 -0
  412. package/echarts@6.0.0/es2022/lib/export/core.mjs +3 -0
  413. package/echarts@6.0.0/es2022/lib/export/features.mjs +3 -0
  414. package/echarts@6.0.0/es2022/lib/export/renderers.mjs +3 -0
  415. package/echarts@6.0.0/es2022/lib/extension.mjs +3 -0
  416. package/echarts@6.0.0/es2022/lib/i18n/langEN.mjs +3 -0
  417. package/echarts@6.0.0/es2022/lib/i18n/langZH.mjs +3 -0
  418. package/echarts@6.0.0/es2022/lib/label/LabelManager.mjs +3 -0
  419. package/echarts@6.0.0/es2022/lib/label/installLabelLayout.mjs +3 -0
  420. package/echarts@6.0.0/es2022/lib/label/labelGuideHelper.mjs +3 -0
  421. package/echarts@6.0.0/es2022/lib/label/labelLayoutHelper.mjs +3 -0
  422. package/echarts@6.0.0/es2022/lib/label/labelStyle.mjs +3 -0
  423. package/echarts@6.0.0/es2022/lib/label/sectorLabel.mjs +3 -0
  424. package/echarts@6.0.0/es2022/lib/layout/barGrid.mjs +3 -0
  425. package/echarts@6.0.0/es2022/lib/layout/barPolar.mjs +3 -0
  426. package/echarts@6.0.0/es2022/lib/layout/points.mjs +3 -0
  427. package/echarts@6.0.0/es2022/lib/legacy/dataSelectAction.mjs +3 -0
  428. package/echarts@6.0.0/es2022/lib/loading/default.mjs +3 -0
  429. package/echarts@6.0.0/es2022/lib/model/Component.mjs +3 -0
  430. package/echarts@6.0.0/es2022/lib/model/Global.mjs +3 -0
  431. package/echarts@6.0.0/es2022/lib/model/Model.mjs +3 -0
  432. package/echarts@6.0.0/es2022/lib/model/OptionManager.mjs +3 -0
  433. package/echarts@6.0.0/es2022/lib/model/Series.mjs +3 -0
  434. package/echarts@6.0.0/es2022/lib/model/globalDefault.mjs +3 -0
  435. package/echarts@6.0.0/es2022/lib/model/internalComponentCreator.mjs +3 -0
  436. package/echarts@6.0.0/es2022/lib/model/mixin/areaStyle.mjs +3 -0
  437. package/echarts@6.0.0/es2022/lib/model/mixin/dataFormat.mjs +3 -0
  438. package/echarts@6.0.0/es2022/lib/model/mixin/itemStyle.mjs +3 -0
  439. package/echarts@6.0.0/es2022/lib/model/mixin/lineStyle.mjs +3 -0
  440. package/echarts@6.0.0/es2022/lib/model/mixin/makeStyleMapper.mjs +3 -0
  441. package/echarts@6.0.0/es2022/lib/model/mixin/palette.mjs +3 -0
  442. package/echarts@6.0.0/es2022/lib/model/mixin/textStyle.mjs +3 -0
  443. package/echarts@6.0.0/es2022/lib/model/referHelper.mjs +3 -0
  444. package/echarts@6.0.0/es2022/lib/preprocessor/backwardCompat.mjs +3 -0
  445. package/echarts@6.0.0/es2022/lib/preprocessor/helper/compatStyle.mjs +3 -0
  446. package/echarts@6.0.0/es2022/lib/processor/dataFilter.mjs +3 -0
  447. package/echarts@6.0.0/es2022/lib/processor/dataSample.mjs +3 -0
  448. package/echarts@6.0.0/es2022/lib/processor/negativeDataFilter.mjs +3 -0
  449. package/echarts@6.0.0/es2022/lib/renderer/installCanvasRenderer.mjs +3 -0
  450. package/echarts@6.0.0/es2022/lib/renderer/installSVGRenderer.mjs +3 -0
  451. package/echarts@6.0.0/es2022/lib/scale/Log.mjs +3 -0
  452. package/echarts@6.0.0/es2022/lib/scale/Ordinal.mjs +3 -0
  453. package/echarts@6.0.0/es2022/lib/scale/Scale.mjs +3 -0
  454. package/echarts@6.0.0/es2022/lib/scale/Time.mjs +3 -0
  455. package/echarts@6.0.0/es2022/lib/scale/break.mjs +3 -0
  456. package/echarts@6.0.0/es2022/lib/scale/breakImpl.mjs +3 -0
  457. package/echarts@6.0.0/es2022/lib/scale/helper.mjs +3 -0
  458. package/echarts@6.0.0/es2022/lib/theme/dark.mjs +3 -0
  459. package/echarts@6.0.0/es2022/lib/util/ECEventProcessor.mjs +3 -0
  460. package/echarts@6.0.0/es2022/lib/util/animation.mjs +3 -0
  461. package/echarts@6.0.0/es2022/lib/util/clazz.mjs +3 -0
  462. package/echarts@6.0.0/es2022/lib/util/component.mjs +3 -0
  463. package/echarts@6.0.0/es2022/lib/util/decal.mjs +3 -0
  464. package/echarts@6.0.0/es2022/lib/util/event.mjs +3 -0
  465. package/echarts@6.0.0/es2022/lib/util/graphic.mjs +3 -0
  466. package/echarts@6.0.0/es2022/lib/util/jitter.mjs +3 -0
  467. package/echarts@6.0.0/es2022/lib/util/layout.mjs +3 -0
  468. package/echarts@6.0.0/es2022/lib/util/model.mjs +3 -0
  469. package/echarts@6.0.0/es2022/lib/util/number.mjs +3 -0
  470. package/echarts@6.0.0/es2022/lib/util/states.mjs +3 -0
  471. package/echarts@6.0.0/es2022/lib/util/styleCompat.mjs +3 -0
  472. package/echarts@6.0.0/es2022/lib/util/symbol.mjs +3 -0
  473. package/echarts@6.0.0/es2022/lib/util/time.mjs +3 -0
  474. package/echarts@6.0.0/es2022/lib/util/types.mjs +3 -0
  475. package/echarts@6.0.0/es2022/lib/util/vendor.mjs +3 -0
  476. package/echarts@6.0.0/es2022/lib/view/Chart.mjs +3 -0
  477. package/echarts@6.0.0/es2022/lib/view/Component.mjs +3 -0
  478. package/echarts@6.0.0/es2022/lib/visual/VisualMapping.mjs +3 -0
  479. package/echarts@6.0.0/es2022/lib/visual/aria.mjs +3 -0
  480. package/echarts@6.0.0/es2022/lib/visual/decal.mjs +3 -0
  481. package/echarts@6.0.0/es2022/lib/visual/helper.mjs +3 -0
  482. package/echarts@6.0.0/es2022/lib/visual/style.mjs +3 -0
  483. package/echarts@6.0.0/es2022/lib/visual/tokens.mjs +3 -0
  484. package/echarts@6.0.0/es2022/lib/visual/visualDefault.mjs +3 -0
  485. package/echarts@6.0.0/es2022/lib/visual/visualSolution.mjs +3 -0
  486. package/eventemitter3@^5.0.1 +3 -0
  487. package/gl-matrix@^3.3.0 +2 -0
  488. package/gl-matrix@^3.4.3 +2 -0
  489. package/package.json +1 -1
  490. package/zrender@6.0.0/es2022/lib/Element.mjs +3 -0
  491. package/zrender@6.0.0/es2022/lib/Handler.mjs +3 -0
  492. package/zrender@6.0.0/es2022/lib/Storage.mjs +3 -0
  493. package/zrender@6.0.0/es2022/lib/animation/Animation.mjs +3 -0
  494. package/zrender@6.0.0/es2022/lib/animation/Animator.mjs +3 -0
  495. package/zrender@6.0.0/es2022/lib/animation/cubicEasing.mjs +3 -0
  496. package/zrender@6.0.0/es2022/lib/animation/easing.mjs +3 -0
  497. package/zrender@6.0.0/es2022/lib/animation/requestAnimationFrame.mjs +3 -0
  498. package/zrender@6.0.0/es2022/lib/canvas/dashStyle.mjs +3 -0
  499. package/zrender@6.0.0/es2022/lib/canvas/graphic.mjs +3 -0
  500. package/zrender@6.0.0/es2022/lib/contain/line.mjs +3 -0
  501. package/zrender@6.0.0/es2022/lib/contain/polygon.mjs +3 -0
  502. package/zrender@6.0.0/es2022/lib/contain/quadratic.mjs +3 -0
  503. package/zrender@6.0.0/es2022/lib/contain/text.mjs +4 -0
  504. package/zrender@6.0.0/es2022/lib/contain/util.mjs +3 -0
  505. package/zrender@6.0.0/es2022/lib/contain/windingLine.mjs +3 -0
  506. package/zrender@6.0.0/es2022/lib/core/BoundingRect.mjs +3 -0
  507. package/zrender@6.0.0/es2022/lib/core/Eventful.mjs +3 -0
  508. package/zrender@6.0.0/es2022/lib/core/GestureMgr.mjs +3 -0
  509. package/zrender@6.0.0/es2022/lib/core/LRU.mjs +3 -0
  510. package/zrender@6.0.0/es2022/lib/core/PathProxy.mjs +3 -0
  511. package/zrender@6.0.0/es2022/lib/core/Point.mjs +3 -0
  512. package/zrender@6.0.0/es2022/lib/core/Transformable.mjs +3 -0
  513. package/zrender@6.0.0/es2022/lib/core/WeakMap.mjs +3 -0
  514. package/zrender@6.0.0/es2022/lib/core/bbox.mjs +3 -0
  515. package/zrender@6.0.0/es2022/lib/core/curve.mjs +3 -0
  516. package/zrender@6.0.0/es2022/lib/core/dom.mjs +3 -0
  517. package/zrender@6.0.0/es2022/lib/core/env.mjs +3 -0
  518. package/zrender@6.0.0/es2022/lib/core/event.mjs +3 -0
  519. package/zrender@6.0.0/es2022/lib/core/fourPointsTransform.mjs +3 -0
  520. package/zrender@6.0.0/es2022/lib/core/matrix.mjs +3 -0
  521. package/zrender@6.0.0/es2022/lib/core/platform.mjs +3 -0
  522. package/zrender@6.0.0/es2022/lib/core/timsort.mjs +3 -0
  523. package/zrender@6.0.0/es2022/lib/core/util.mjs +3 -0
  524. package/zrender@6.0.0/es2022/lib/core/vector.mjs +3 -0
  525. package/zrender@6.0.0/es2022/lib/dom/HandlerProxy.mjs +3 -0
  526. package/zrender@6.0.0/es2022/lib/graphic/CompoundPath.mjs +3 -0
  527. package/zrender@6.0.0/es2022/lib/graphic/Displayable.mjs +3 -0
  528. package/zrender@6.0.0/es2022/lib/graphic/Gradient.mjs +3 -0
  529. package/zrender@6.0.0/es2022/lib/graphic/Group.mjs +3 -0
  530. package/zrender@6.0.0/es2022/lib/graphic/Image.mjs +3 -0
  531. package/zrender@6.0.0/es2022/lib/graphic/IncrementalDisplayable.mjs +3 -0
  532. package/zrender@6.0.0/es2022/lib/graphic/LinearGradient.mjs +3 -0
  533. package/zrender@6.0.0/es2022/lib/graphic/Path.mjs +3 -0
  534. package/zrender@6.0.0/es2022/lib/graphic/RadialGradient.mjs +3 -0
  535. package/zrender@6.0.0/es2022/lib/graphic/constants.mjs +3 -0
  536. package/zrender@6.0.0/es2022/lib/graphic/helper/image.mjs +3 -0
  537. package/zrender@6.0.0/es2022/lib/graphic/helper/poly.mjs +3 -0
  538. package/zrender@6.0.0/es2022/lib/graphic/helper/roundRect.mjs +3 -0
  539. package/zrender@6.0.0/es2022/lib/graphic/helper/roundSector.mjs +3 -0
  540. package/zrender@6.0.0/es2022/lib/graphic/helper/smoothBezier.mjs +3 -0
  541. package/zrender@6.0.0/es2022/lib/graphic/helper/subPixelOptimize.mjs +3 -0
  542. package/zrender@6.0.0/es2022/lib/graphic/shape/Arc.mjs +3 -0
  543. package/zrender@6.0.0/es2022/lib/graphic/shape/Circle.mjs +3 -0
  544. package/zrender@6.0.0/es2022/lib/graphic/shape/Ellipse.mjs +3 -0
  545. package/zrender@6.0.0/es2022/lib/graphic/shape/Line.mjs +3 -0
  546. package/zrender@6.0.0/es2022/lib/graphic/shape/Polygon.mjs +3 -0
  547. package/zrender@6.0.0/es2022/lib/graphic/shape/Polyline.mjs +3 -0
  548. package/zrender@6.0.0/es2022/lib/graphic/shape/Rect.mjs +3 -0
  549. package/zrender@6.0.0/es2022/lib/graphic/shape/Ring.mjs +3 -0
  550. package/zrender@6.0.0/es2022/lib/graphic/shape/Sector.mjs +3 -0
  551. package/zrender@6.0.0/es2022/lib/mixin/Draggable.mjs +3 -0
  552. package/zrender@6.0.0/es2022/lib/svg/Painter.mjs +3 -0
  553. package/zrender@6.0.0/es2022/lib/svg/SVGPathRebuilder.mjs +3 -0
  554. package/zrender@6.0.0/es2022/lib/svg/core.mjs +5 -0
  555. package/zrender@6.0.0/es2022/lib/svg/cssAnimation.mjs +3 -0
  556. package/zrender@6.0.0/es2022/lib/svg/cssClassId.mjs +3 -0
  557. package/zrender@6.0.0/es2022/lib/svg/cssEmphasis.mjs +3 -0
  558. package/zrender@6.0.0/es2022/lib/svg/domapi.mjs +3 -0
  559. package/zrender@6.0.0/es2022/lib/svg/graphic.mjs +3 -0
  560. package/zrender@6.0.0/es2022/lib/svg/helper.mjs +4 -0
  561. package/zrender@6.0.0/es2022/lib/svg/mapStyleToAttrs.mjs +3 -0
  562. package/zrender@6.0.0/es2022/lib/svg/patch.mjs +3 -0
  563. package/zrender@6.0.0/es2022/lib/tool/color.mjs +3 -0
  564. package/zrender@6.0.0/es2022/lib/tool/convertPath.mjs +3 -0
  565. package/zrender@6.0.0/es2022/lib/tool/dividePath.mjs +3 -0
  566. package/zrender@6.0.0/es2022/lib/tool/morphPath.mjs +3 -0
  567. package/zrender@6.0.0/es2022/lib/tool/parseSVG.mjs +3 -0
  568. package/zrender@6.0.0/es2022/lib/tool/parseXML.mjs +3 -0
  569. package/zrender@6.0.0/es2022/lib/tool/path.mjs +3 -0
  570. package/zrender@6.0.0/es2022/lib/zrender.mjs +16 -0
  571. package/reactivity@3.5.34/es2022/reactivity.mjs +0 -12
@@ -0,0 +1,20 @@
1
+ /* esm.sh - @antv/layout@2.0.0 */
2
+ var ob=Object.defineProperty;var Bl=(r,e)=>{for(var t in e)ob(r,t,{get:e[t],enumerable:!0})};function Gl(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}function Ne(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{f(i.next(l))}catch(m){s(m)}}function u(l){try{f(i.throw(l))}catch(m){s(m)}}function f(l){l.done?o(l.value):n(l.value).then(a,u)}f((i=i.apply(r,e||[])).next())})}var sb={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow},Xe=class extends Error{constructor(e,t,i){super(e),this.position=t,this.token=i,this.name="ExpressionError"}},me;(function(r){r[r.STRING=0]="STRING",r[r.NUMBER=1]="NUMBER",r[r.BOOLEAN=2]="BOOLEAN",r[r.NULL=3]="NULL",r[r.IDENTIFIER=4]="IDENTIFIER",r[r.OPERATOR=5]="OPERATOR",r[r.FUNCTION=6]="FUNCTION",r[r.DOT=7]="DOT",r[r.BRACKET_LEFT=8]="BRACKET_LEFT",r[r.BRACKET_RIGHT=9]="BRACKET_RIGHT",r[r.PAREN_LEFT=10]="PAREN_LEFT",r[r.PAREN_RIGHT=11]="PAREN_RIGHT",r[r.COMMA=12]="COMMA",r[r.QUESTION=13]="QUESTION",r[r.COLON=14]="COLON",r[r.DOLLAR=15]="DOLLAR"})(me||(me={}));var ab=new Set([32,9,10,13]),ub=new Set([43,45,42,47,37,33,38,124,61,60,62]),fb=new Map([["true",me.BOOLEAN],["false",me.BOOLEAN],["null",me.NULL]]),So=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),cb=new Map([[46,me.DOT],[91,me.BRACKET_LEFT],[93,me.BRACKET_RIGHT],[40,me.PAREN_LEFT],[41,me.PAREN_RIGHT],[44,me.COMMA],[63,me.QUESTION],[58,me.COLON],[36,me.DOLLAR]]),$l=new Map;for(let[r,e]of cb.entries())$l.set(r,{type:e,value:String.fromCharCode(r)});function si(r){return r>=48&&r<=57}function No(r){return r>=97&&r<=122||r>=65&&r<=90||r===95}function Ul(r){return No(r)||si(r)}function lb(r){return ub.has(r)}var Ke;(function(r){r[r.Program=0]="Program",r[r.Literal=1]="Literal",r[r.Identifier=2]="Identifier",r[r.MemberExpression=3]="MemberExpression",r[r.CallExpression=4]="CallExpression",r[r.BinaryExpression=5]="BinaryExpression",r[r.UnaryExpression=6]="UnaryExpression",r[r.ConditionalExpression=7]="ConditionalExpression"})(Ke||(Ke={}));var hb=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),db={type:Ke.Literal,value:null},pb={type:Ke.Literal,value:!0},mb={type:Ke.Literal,value:!1},gb=r=>{let e=0,t=r.length,i=()=>e>=t?null:r[e],n=()=>r[e++],o=m=>{let _=i();return _!==null&&_.type===m},s=m=>m.type===me.OPERATOR?hb.get(m.value)||-1:m.type===me.DOT||m.type===me.BRACKET_LEFT?9:m.type===me.QUESTION?1:-1,a=m=>{let _,g;if(n().type===me.DOT){if(!o(me.IDENTIFIER)){let b=i();throw new Xe("Expected property name",e,b?b.value:"<end of input>")}let w=n();_={type:Ke.Identifier,name:w.value},g=!1}else{if(_=f(0),!o(me.BRACKET_RIGHT)){let w=i();throw new Xe("Expected closing bracket",e,w?w.value:"<end of input>")}n(),g=!0}return{type:Ke.MemberExpression,object:m,property:_,computed:g}},u=()=>{let m=i();if(!m)throw new Xe("Unexpected end of input",e,"<end of input>");if(m.type===me.OPERATOR&&(m.value==="!"||m.value==="-")){n();let _=u();return{type:Ke.UnaryExpression,operator:m.value,argument:_,prefix:!0}}switch(m.type){case me.NUMBER:return n(),{type:Ke.Literal,value:Number(m.value)};case me.STRING:return n(),{type:Ke.Literal,value:m.value};case me.BOOLEAN:return n(),m.value==="true"?pb:mb;case me.NULL:return n(),db;case me.IDENTIFIER:return n(),{type:Ke.Identifier,name:m.value};case me.FUNCTION:return(()=>{let _=n(),g=[];if(!o(me.PAREN_LEFT)){let w=i();throw new Xe("Expected opening parenthesis after function name",e,w?w.value:"<end of input>")}for(n();;){if(o(me.PAREN_RIGHT)){n();break}if(!i()){let b=i();throw new Xe("Expected closing parenthesis",e,b?b.value:"<end of input>")}if(g.length>0){if(!o(me.COMMA)){let b=i();throw new Xe("Expected comma between function arguments",e,b?b.value:"<end of input>")}n()}let w=f(0);g.push(w)}return{type:Ke.CallExpression,callee:{type:Ke.Identifier,name:_.value},arguments:g}})();case me.PAREN_LEFT:{n();let _=f(0);if(!o(me.PAREN_RIGHT)){let g=i();throw new Xe("Expected closing parenthesis",e,g?g.value:"<end of input>")}return n(),_}default:throw new Xe(`Unexpected token: ${m.type}`,e,m.value)}},f=(m=0)=>{let _=u();for(;e<t;){let g=r[e],w=s(g);if(w<=m)break;if(g.type!==me.QUESTION)if(g.type!==me.OPERATOR){if(g.type!==me.DOT&&g.type!==me.BRACKET_LEFT)break;_=a(_)}else{n();let b=f(w);_={type:Ke.BinaryExpression,operator:g.value,left:_,right:b}}else{n();let b=f(0);if(!o(me.COLON)){let y=i();throw new Xe("Expected : in conditional expression",e,y?y.value:"<end of input>")}n();let q=f(0);_={type:Ke.ConditionalExpression,test:_,consequent:b,alternate:q}}}return _},l=f();return{type:Ke.Program,body:l}},_b=(r,e,t)=>{let i=e;t&&(i={...e,context:{...e.context,...t}});let n=o=>{switch(o.type){case Ke.Literal:return(s=>s.value)(o);case Ke.Identifier:return(s=>{if(!(s.name in i.context))throw new Xe(`Undefined variable: ${s.name}`);return i.context[s.name]})(o);case Ke.MemberExpression:return(s=>{let a=n(s.object);if(a==null)throw new Xe("Cannot access property of null or undefined");return a[s.computed?n(s.property):s.property.name]})(o);case Ke.CallExpression:return(s=>{let a=i.functions[s.callee.name];if(!a)throw new Xe(`Undefined function: ${s.callee.name}`);return a(...s.arguments.map((u=>n(u))))})(o);case Ke.BinaryExpression:return(s=>{if(s.operator==="&&"){let f=n(s.left);return f&&n(s.right)}if(s.operator==="||")return n(s.left)||n(s.right);let a=n(s.left),u=n(s.right);switch(s.operator){case"+":return a+u;case"-":return a-u;case"*":return a*u;case"/":return a/u;case"%":return a%u;case"===":return a===u;case"!==":return a!==u;case">":return a>u;case">=":return a>=u;case"<":return a<u;case"<=":return a<=u;default:throw new Xe(`Unknown operator: ${s.operator}`)}})(o);case Ke.UnaryExpression:return(s=>{let a=n(s.argument);if(s.prefix)switch(s.operator){case"!":return!a;case"-":if(typeof a!="number")throw new Xe(`Cannot apply unary - to non-number: ${a}`);return-a;default:throw new Xe(`Unknown operator: ${s.operator}`)}throw new Xe(`Postfix operators are not supported: ${s.operator}`)})(o);case Ke.ConditionalExpression:return(s=>{let a=n(s.test);return n(a?s.consequent:s.alternate)})(o);default:throw new Xe(`Evaluation error: Unsupported node type: ${o.type}`)}};return n(r.body)};function Mo(r){let e=(n=>{let o=n,s=o.length,a=new Array(Math.ceil(s/3)),u=0,f=0;function l(q){let y=f+1;f++;let x="",E=!1;for(;f<s;){let N=o.charCodeAt(f);if(N===q)return E||(x=o.substring(y,f)),f++,{type:me.STRING,value:x};N===92?(E||(x=o.substring(y,f),E=!0),f++,x+=o[f]):E&&(x+=o[f]),f++}throw new Xe(`Unterminated string starting with ${String.fromCharCode(q)}`,f,o.substring(Math.max(0,f-10),f))}function m(){let q=f;for(o.charCodeAt(f)===45&&f++;f<s&&si(o.charCodeAt(f));)f++;if(f<s&&o.charCodeAt(f)===46)for(f++;f<s&&si(o.charCodeAt(f));)f++;let y=o.slice(q,f);return{type:me.NUMBER,value:y}}function _(){f++;let q=f;if(f<s&&No(o.charCodeAt(f)))for(f++;f<s&&Ul(o.charCodeAt(f));)f++;let y=o.slice(q,f);return{type:me.FUNCTION,value:y}}function g(){let q=f++;for(;f<s&&Ul(o.charCodeAt(f));)f++;let y=o.slice(q,f),x=fb.get(y);return x?{type:x,value:y}:{type:me.IDENTIFIER,value:y}}function w(){if(f+2<s){let y=o.substring(f,f+3);if(So.has(y))return f+=3,{type:me.OPERATOR,value:y}}if(f+1<s){let y=o.substring(f,f+2);if(So.has(y))return f+=2,{type:me.OPERATOR,value:y}}let q=o[f];if(So.has(q))return f++,{type:me.OPERATOR,value:q};throw new Xe(`Unknown operator at position ${f}: ${o.substring(f,f+1)}`,f,o.substring(Math.max(0,f-10),f))}for(;f<s;){let q=o.charCodeAt(f);if(b=q,ab.has(b)){f++;continue}let y=$l.get(q);if(y)a[u++]=y,f++;else if(q!==34&&q!==39)if(si(q)||q===45&&f+1<s&&si(o.charCodeAt(f+1)))a[u++]=m();else if(q!==64)if(No(q))a[u++]=g();else{if(!lb(q))throw new Xe(`Unexpected character: ${o[f]}`,f,o.substring(Math.max(0,f-10),f));a[u++]=w()}else a[u++]=_();else a[u++]=l(q)}var b;return u===a.length?a:a.slice(0,u)})(r),t=gb(e),i=((n={},o={})=>({context:n,functions:o}))({},sb);return(n={})=>_b(t,i,n)}function Vl(r,e={}){return Mo(r)(e)}function Io(r,e){if(typeof r!="string")return;let t=r.trim();if(t)try{return Mo(t),Vl(t,e)}catch{return}}function Me(r){return typeof r=="number"}function wt(r){if(!r)return[0,0,0];if(Me(r))return[r,r,r];if(Array.isArray(r)&&r.length===0)return[0,0,0];let[e,t=e,i=e]=r;return[e,t,i]}function Ro(r){return Me(r)?!0:Array.isArray(r)?r.every(e=>Me(e)):!1}function Fe(r){return r==null}function bt(r){return typeof r=="string"}function Ao(r){return typeof r=="function"}function Te(r,e){if(typeof r=="function")return r;if(typeof r=="string"){let t=r;return(...i)=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return Io(t,n)}}return()=>r}function ur(r,e,t="node"){if(Fe(r))return()=>e;if(bt(r)){let i=Te(r,[t]);return n=>{let o=i(n);return Me(o)?o:e}}return Ao(r)?r:Me(r)?()=>r:()=>e}function Tt(r,e=10,t="node"){if(Fe(r))return()=>e;if(bt(r)){let i=Te(r,[t]);return n=>{let o=i(n);return Ro(o)?o:e}}return Ao(r)?r:Me(r)?()=>r:Array.isArray(r)?()=>r:()=>e}var or=(r,e,t=10,i=0)=>{let n=Tt(e,i),o=Tt(r,t);return s=>{let[a,u,f]=wt(o(s)),[l,m,_]=wt(n(s));return[a+l,u+m,f+_]}};function ai(r){var e;return[r.x,r.y,(e=r.z)!==null&&e!==void 0?e:0]}function vb(r){var e;return{x:r[0],y:r[1],z:(e=r[2])!==null&&e!==void 0?e:0}}var ui=class{constructor(e,t={}){this.edgeIdCounter=new Map,this.nodeMap=wb(e.nodes,t.node),this.edgeMap=bb(e.edges||[],t.edge,this.getEdgeId.bind(this))}data(){return{nodes:this.nodeMap,edges:this.edgeMap}}replace(e){this.nodeMap=e.nodes,this.edgeMap=e.edges,this.clearCache()}nodes(){return Array.from(this.nodeMap.values())}node(e){return this.nodeMap.get(e)}nodeAt(e){this.indexNodeCache||this.buildNodeIndexCache();let t=this.indexNodeCache.get(e);return t?this.nodeMap.get(t):void 0}nodeIndexOf(e){var t;return this.nodeIndexCache||this.buildNodeIndexCache(),(t=this.nodeIndexCache.get(e))!==null&&t!==void 0?t:-1}firstNode(){return this.nodeMap.values().next().value}forEachNode(e){let t=0;this.nodeMap.forEach(i=>e(i,t++))}originalNode(e){let t=this.nodeMap.get(e);return t?._original}nodeCount(){return this.nodeMap.size}edges(){return Array.from(this.edgeMap.values())}edge(e){return this.edgeMap.get(e)}firstEdge(){return this.edgeMap.values().next().value}forEachEdge(e){let t=0;this.edgeMap.forEach(i=>e(i,t++))}originalEdge(e){let t=this.edgeMap.get(e);return t?._original}edgeCount(){return this.edgeMap.size}getEdgeId(e){if(e.id)return e.id;let t=`${e.source}-${e.target}`,i=this.edgeIdCounter.get(t)||0,n=i===0?t:`${t}-${i}`;return this.edgeIdCounter.set(t,i+1),n}degree(e,t="both"){this.degreeCache||this.buildDegreeCache();let i=this.degreeCache.get(e);return i?i[t]:0}neighbors(e,t="both"){if((!this.outAdjacencyCache||!this.inAdjacencyCache)&&this.buildAdjacencyCache(),t==="out")return Array.from(this.outAdjacencyCache.get(e)||[]);if(t==="in")return Array.from(this.inAdjacencyCache.get(e)||[]);if(this.bothAdjacencyCache)return Array.from(this.bothAdjacencyCache.get(e)||[]);let i=this.inAdjacencyCache.get(e),n=this.outAdjacencyCache.get(e);if(!i&&!n)return[];if(!i)return Array.from(n);if(!n)return Array.from(i);let o=new Set;return i.forEach(s=>o.add(s)),n.forEach(s=>o.add(s)),Array.from(o)}successors(e){return this.neighbors(e,"out")}predecessors(e){return this.neighbors(e,"in")}setNodeOrder(e){let t=new Map;for(let i of e)t.set(i.id,i);this.nodeMap=t,this.nodeIndexCache=void 0,this.indexNodeCache=void 0}clearCache(){this.degreeCache=void 0,this.inAdjacencyCache=void 0,this.outAdjacencyCache=void 0,this.bothAdjacencyCache=void 0,this.nodeIndexCache=void 0,this.indexNodeCache=void 0}buildDegreeCache(){this.degreeCache=new Map;for(let e of this.edges()){let{source:t,target:i}=e;if(e.source===e.target)continue;this.degreeCache.has(t)||this.degreeCache.set(t,{in:0,out:0,both:0});let n=this.degreeCache.get(e.source);n&&(n.out++,n.both++),this.degreeCache.has(i)||this.degreeCache.set(i,{in:0,out:0,both:0});let o=this.degreeCache.get(e.target);o&&(o.in++,o.both++)}}buildAdjacencyCache(){this.inAdjacencyCache=new Map,this.outAdjacencyCache=new Map;for(let e of this.edges())!this.nodeMap.has(e.source)||!this.nodeMap.has(e.target)||(this.outAdjacencyCache.has(e.source)||this.outAdjacencyCache.set(e.source,new Set),this.outAdjacencyCache.get(e.source).add(e.target),this.inAdjacencyCache.has(e.target)||this.inAdjacencyCache.set(e.target,new Set),this.inAdjacencyCache.get(e.target).add(e.source))}buildNodeIndexCache(){this.nodeIndexCache=new Map,this.indexNodeCache=new Map;let e=0;this.nodeMap.forEach((t,i)=>{this.nodeIndexCache.set(i,e),this.indexNodeCache.set(e,i),e++})}destroy(){this.clearCache(),this.nodeMap.clear(),this.edgeMap.clear(),this.edgeIdCounter.clear()}},yb=["id","x","y","z","vx","vy","vz","fx","fy","fz","parentId"],qb=["id","source","target","points"];function wb(r,e){if(!r)throw new Error("Data.nodes is required");let t=new Map;for(let i of r){let n={_original:i};for(let o of yb){let s=i[o];Fe(s)||(n[o]=s)}if(e){let o=e(i);for(let s in o){let a=o[s];Fe(a)||(n[s]=a)}}if(Fe(n.id))throw new Error("Node is missing id field");t.set(n.id,n)}return t}function bb(r,e,t){let i=new Map;for(let n of r){let o={_original:n};for(let s of qb){let a=n[s];Fe(a)||(o[s]=a)}if(e){let s=e(n);for(let a in s){let u=s[a];Fe(u)||(o[a]=u)}}if(Fe(o.source)||Fe(o.target))throw new Error("Edge is missing source or target field");Fe(o.id)&&(o.id=t?.(n)),i.set(o.id,o)}return i}function xt(r,e,t,i=2){r.forEachNode(n=>{Fe(n.x)&&(n.x=Math.random()*e),Fe(n.y)&&(n.y=Math.random()*t),i===3&&Fe(n.z)&&(n.z=Math.random()*Math.min(e,t))})}var fi=class{constructor(e,t={}){this.graph=new ui(e,t)}export(){return this.graph.data()}replace(e){this.graph.replace(e)}forEachNode(e){this.graph.forEachNode(e)}forEachEdge(e){this.graph.forEachEdge((t,i)=>{t.sourceNode=this.graph.node(t.source),t.targetNode=this.graph.node(t.target),e(t,i)})}destroy(){this.graph.destroy()}};var Kl=Symbol("Comlink.proxy"),xb=Symbol("Comlink.endpoint"),Eb=Symbol("Comlink.releaseProxy"),Oo=Symbol("Comlink.finalizer"),Ui=Symbol("Comlink.thrown"),Yl=r=>typeof r=="object"&&r!==null||typeof r=="function",Sb={canHandle:r=>Yl(r)&&r[Kl],serialize(r){let{port1:e,port2:t}=new MessageChannel;return Zl(r,e),[t,[t]]},deserialize(r){return r.start(),To(r)}},Nb={canHandle:r=>Yl(r)&&Ui in r,serialize({value:r}){let e;return r instanceof Error?e={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:e={isError:!1,value:r},[e,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},Xl=new Map([["proxy",Sb],["throw",Nb]]);function Mb(r,e){for(let t of r)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function Zl(r,e=globalThis,t=["*"]){e.addEventListener("message",function i(n){if(!n||!n.data)return;if(!Mb(t,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}let{id:o,type:s,path:a}=Object.assign({path:[]},n.data),u=(n.data.argumentList||[]).map(Et),f;try{let l=a.slice(0,-1).reduce((_,g)=>_[g],r),m=a.reduce((_,g)=>_[g],r);switch(s){case"GET":f=m;break;case"SET":l[a.slice(-1)[0]]=Et(n.data.value),f=!0;break;case"APPLY":f=m.apply(l,u);break;case"CONSTRUCT":{let _=new m(...u);f=Tb(_)}break;case"ENDPOINT":{let{port1:_,port2:g}=new MessageChannel;Zl(r,g),f=Cb(_,[_])}break;case"RELEASE":f=void 0;break;default:return}}catch(l){f={value:l,[Ui]:0}}Promise.resolve(f).catch(l=>({value:l,[Ui]:0})).then(l=>{let[m,_]=Wi(l);e.postMessage(Object.assign(Object.assign({},m),{id:o}),_),s==="RELEASE"&&(e.removeEventListener("message",i),Ql(e),Oo in r&&typeof r[Oo]=="function"&&r[Oo]())}).catch(l=>{let[m,_]=Wi({value:new TypeError("Unserializable return value"),[Ui]:0});e.postMessage(Object.assign(Object.assign({},m),{id:o}),_)})}),e.start&&e.start()}function Ib(r){return r.constructor.name==="MessagePort"}function Ql(r){Ib(r)&&r.close()}function To(r,e){let t=new Map;return r.addEventListener("message",function(n){let{data:o}=n;if(!o||!o.id)return;let s=t.get(o.id);if(s)try{s(o)}finally{t.delete(o.id)}}),Co(r,t,[],e)}function Gi(r){if(r)throw new Error("Proxy has been released and is not useable")}function Jl(r){return kt(r,new Map,{type:"RELEASE"}).then(()=>{Ql(r)})}var $i=new WeakMap,Vi="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{let e=($i.get(r)||0)-1;$i.set(r,e),e===0&&Jl(r)});function Rb(r,e){let t=($i.get(e)||0)+1;$i.set(e,t),Vi&&Vi.register(r,e,r)}function Ab(r){Vi&&Vi.unregister(r)}function Co(r,e,t=[],i=function(){}){let n=!1,o=new Proxy(i,{get(s,a){if(Gi(n),a===Eb)return()=>{Ab(o),Jl(r),e.clear(),n=!0};if(a==="then"){if(t.length===0)return{then:()=>o};let u=kt(r,e,{type:"GET",path:t.map(f=>f.toString())}).then(Et);return u.then.bind(u)}return Co(r,e,[...t,a])},set(s,a,u){Gi(n);let[f,l]=Wi(u);return kt(r,e,{type:"SET",path:[...t,a].map(m=>m.toString()),value:f},l).then(Et)},apply(s,a,u){Gi(n);let f=t[t.length-1];if(f===xb)return kt(r,e,{type:"ENDPOINT"}).then(Et);if(f==="bind")return Co(r,e,t.slice(0,-1));let[l,m]=Wl(u);return kt(r,e,{type:"APPLY",path:t.map(_=>_.toString()),argumentList:l},m).then(Et)},construct(s,a){Gi(n);let[u,f]=Wl(a);return kt(r,e,{type:"CONSTRUCT",path:t.map(l=>l.toString()),argumentList:u},f).then(Et)}});return Rb(o,r),o}function Ob(r){return Array.prototype.concat.apply([],r)}function Wl(r){let e=r.map(Wi);return[e.map(t=>t[0]),Ob(e.map(t=>t[1]))]}var Hl=new WeakMap;function Cb(r,e){return Hl.set(r,e),r}function Tb(r){return Object.assign(r,{[Kl]:!0})}function Wi(r){for(let[e,t]of Xl)if(t.canHandle(r)){let[i,n]=t.serialize(r);return[{type:"HANDLER",name:e,value:i},n]}return[{type:"RAW",value:r},Hl.get(r)||[]]}function Et(r){switch(r.type){case"HANDLER":return Xl.get(r.name).deserialize(r.value);case"RAW":return r.value}}function kt(r,e,t,i){return new Promise(n=>{let o=kb();e.set(o,n),r.start&&r.start(),r.postMessage(Object.assign({id:o},t),i)})}function kb(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var ci=class{constructor(){this.worker=null,this.workerApi=null}execute(e,t,i){return Ne(this,void 0,void 0,function*(){if(this.worker||(yield this.initWorker()),!this.workerApi)throw new Error("Worker API not initialized");return yield this.workerApi.execute(e,t,i)})}destroy(){this.workerApi&&this.workerApi.destroy(),this.worker&&(this.worker.terminate(),this.worker=null,this.workerApi=null)}initWorker(){return Ne(this,void 0,void 0,function*(){let e=this.resolveWorkerPath(),i=e.includes("/lib/")||e.endsWith(".mjs")?"module":"classic";this.worker=new Worker(e,{type:i}),this.workerApi=To(this.worker)})}resolveWorkerPath(){let e=(()=>{if(typeof document>"u")return null;let t=document.currentScript;if(t?.src)return t.src;let i=document.getElementsByTagName("script");for(let n=i.length-1;n>=0;n--){let o=i[n].src;if(o&&(o.includes("index.js")||o.includes("index.min.js")))return o}return null})();if(e){if(e.includes("index.js")||e.includes("index.min.js")){let n=e.replace(/index(\.min)?\.(m?js)(\?.*)?$/,"worker.js");if(n!==e)return n}let t=e.replace(/\/runtime\/[^/]+\.(m?js)(\?.*)?$/,"/worker.js");if(t!==e)return t;let i=e.replace(/\/[^/]+\.(m?js)(\?.*)?$/,"/worker.js");if(i!==e)return i}return"./worker.js"}};var Ze=class{constructor(e){this.supervisor=null,this.initialOptions=this.mergeOptions(this.getDefaultOptions(),e)}get options(){return this.runtimeOptions||this.initialOptions}mergeOptions(e,t){return Object.assign({},e,t||{})}execute(e,t){return Ne(this,void 0,void 0,function*(){this.runtimeOptions=this.mergeOptions(this.initialOptions,t);let{node:i,edge:n,enableWorker:o}=this.runtimeOptions;this.context=new fi(e,{node:i,edge:n}),this.model=this.context.graph,o&&typeof Worker<"u"?yield this.layoutInWorker(e,this.runtimeOptions):yield this.layout(this.runtimeOptions)})}layoutInWorker(e,t){var i;return Ne(this,void 0,void 0,function*(){try{this.supervisor||(this.supervisor=new ci);let n=yield this.supervisor.execute(this.id,e,t);(i=this.context)===null||i===void 0||i.replace(n)}catch(n){console.error("Layout in worker failed, fallback to main thread layout.",n),yield this.layout(t)}})}forEachNode(e){this.context.forEachNode(e)}forEachEdge(e){this.context.forEachEdge(e)}destroy(){var e;(e=this.context)===null||e===void 0||e.destroy(),this.model=null,this.context=null,this.supervisor&&(this.supervisor.destroy(),this.supervisor=null)}},Br=class extends Ze{};function ko(r){return!!r.tick&&!!r.stop}var He=class{constructor(e={}){this.options=e,this.nodes=new Map,this.edges=new Map,this.inEdges=new Map,this.outEdges=new Map,this.parentMap=new Map,this.childrenMap=new Map,e.tree&&Array.isArray(e.tree)&&e.tree.length>0&&(typeof e.tree[0]=="string"?e.tree.forEach(t=>{this.parentMap.set(t,new Map),this.childrenMap.set(t,new Map)}):(this.attachTreeStructure("default"),this.addTree(e.tree))),e.nodes&&e.nodes.forEach(t=>this.addNode(t)),e.edges&&e.edges.forEach(t=>this.addEdge(t))}addNode(e){this.nodes.has(e.id)||(this.nodes.set(e.id,e),this.inEdges.set(e.id,new Set),this.outEdges.set(e.id,new Set))}addNodes(e){e.forEach(t=>this.addNode(t))}getNode(e){return this.nodes.get(e)}hasNode(e){return this.nodes.has(e)}removeNode(e){if(!this.nodes.has(e))return;let t=Array.from(this.inEdges.get(e)||[]),i=Array.from(this.outEdges.get(e)||[]);t.forEach(n=>this.removeEdge(n)),i.forEach(n=>this.removeEdge(n)),this.nodes.delete(e),this.inEdges.delete(e),this.outEdges.delete(e),this.parentMap.forEach(n=>{n.delete(e)}),this.childrenMap.forEach(n=>{n.delete(e)})}getAllNodes(){return Array.from(this.nodes.values())}addEdge(e){if(!this.nodes.has(e.source)||!this.nodes.has(e.target))throw new Error(`Cannot add edge ${e.id}: source ${e.source} or target ${e.target} does not exist`);this.edges.set(e.id,e),this.outEdges.get(e.source).add(e.id),this.inEdges.get(e.target).add(e.id)}addEdges(e){e.forEach(t=>this.addEdge(t))}getEdge(e){return this.edges.get(e)}hasEdge(e){return this.edges.has(e)}removeEdge(e){var t,i;let n=this.edges.get(e);n&&(this.edges.delete(e),(t=this.outEdges.get(n.source))===null||t===void 0||t.delete(e),(i=this.inEdges.get(n.target))===null||i===void 0||i.delete(e))}getAllEdges(){return Array.from(this.edges.values())}updateEdgeData(e,t){let i=this.edges.get(e);i&&Object.assign(i.data,t)}updateNodeData(e,t){let i=this.nodes.get(e);i&&Object.assign(i.data,t)}getRelatedEdges(e,t="both"){let i=[];if(t==="in"||t==="both"){let n=this.inEdges.get(e);n&&n.forEach(o=>{let s=this.edges.get(o);s&&i.push(s)})}if(t==="out"||t==="both"){let n=this.outEdges.get(e);n&&n.forEach(o=>{let s=this.edges.get(o);s&&i.push(s)})}return i}getSuccessors(e){let t=this.outEdges.get(e);if(!t||t.size===0)return[];let i=[];return t.forEach(n=>{let o=this.edges.get(n);if(o){let s=this.nodes.get(o.target);s&&i.push(s)}}),i.length>0?i:[]}getPredecessors(e){let t=this.inEdges.get(e);if(!t||t.size===0)return[];let i=[];return t.forEach(n=>{let o=this.edges.get(n);if(o){let s=this.nodes.get(o.source);s&&i.push(s)}}),i.length>0?i:[]}getNeighbors(e){let t=this.getSuccessors(e)||[],i=this.getPredecessors(e)||[],n=[...t,...i],o=Array.from(new Map(n.map(s=>[s.id,s])).values());return o.length>0?o:[]}attachTreeStructure(e){this.parentMap.has(e)||(this.parentMap.set(e,new Map),this.childrenMap.set(e,new Map))}addTree(e,t){var i,n;let o=t||((n=(i=this.options.tree)===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"default");this.hasTreeStructure(o)||this.attachTreeStructure(o);let s=Array.isArray(e)?e:[e],a=(u,f)=>{this.addNode({id:u.id,data:u.data}),f!==void 0&&this.setParent(u.id,f,o),u.children&&u.children.length>0&&u.children.forEach(l=>{a(l,u.id)})};s.forEach(u=>a(u))}hasTreeStructure(e){return this.parentMap.has(e)}setParent(e,t,i){var n,o,s;let a=i||((o=(n=this.options.tree)===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:"default");this.parentMap.has(a)||this.attachTreeStructure(a);let u=this.parentMap.get(a),f=this.childrenMap.get(a),l=u.get(e);l!==void 0&&((s=f.get(l))===null||s===void 0||s.delete(e)),u.set(e,t),f.has(t)||f.set(t,new Set),f.get(t).add(e)}getParent(e,t){var i,n;let o=t||((n=(i=this.options.tree)===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"default");this.parentMap.has(o)||this.attachTreeStructure(o);let s=this.parentMap.get(o);if(!s)return;let a=s.get(e);return a===void 0?null:this.nodes.get(a)}getChildren(e,t){var i,n;let o=t||((n=(i=this.options.tree)===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"default"),s=this.childrenMap.get(o);if(!s)return[];let a=s.get(e);return a?Array.from(a).map(u=>this.nodes.get(u)).filter(u=>u!==void 0):[]}getRoots(e){var t,i;let n=e||((i=(t=this.options.tree)===null||t===void 0?void 0:t[0])!==null&&i!==void 0?i:"default"),o=this.parentMap.get(n),s=[];return this.nodes.forEach(a=>{o&&o.get(a.id)!==void 0||s.push(a)}),s}dfsTree(e,t){let i=[e],n=new Set;for(;i.length>0;){let o=i.pop();if(n.has(o))continue;let s=this.getNode(o);if(s){if(n.add(o),t(s)===!0)continue;let u=this.getChildren(o);for(let f=u.length-1;f>=0;f--)n.has(u[f].id)||i.push(u[f].id)}}}};var Pb=(r,e)=>{if(r!=="next"&&r!=="prev")return e},eh=r=>{r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev},rh=class{constructor(){let e={};e.prev=e,e.next=e.prev,this.shortcut=e}dequeue(){let e=this.shortcut,t=e.prev;if(t&&t!==e)return eh(t),t}enqueue(e){let t=this.shortcut;e.prev&&e.next&&eh(e),e.next=t.next,t.next.prev=e,t.next=e,e.prev=t}toString(){let e=[],t=this.shortcut,i=t.prev;for(;i!==t;)e.push(JSON.stringify(i,Pb)),i=i?.prev;return`[${e.join(", ")}]`}};var jo=class extends rh{},jb=()=>1,th=(r,e)=>{var t;if(r.getAllNodes().length<=1)return[];let i=Fb(r,e||jb);return(t=Lb(i.graph,i.buckets,i.zeroIdx).map(o=>r.getRelatedEdges(o.v,"out").filter(({target:s})=>s===o.w)))===null||t===void 0?void 0:t.flat()},Lb=(r,e,t)=>{let i=[],n=e[e.length-1],o=e[0],s;for(;r.getAllNodes().length;){for(;s=o.dequeue();)Po(r,e,t,s);for(;s=n.dequeue();)Po(r,e,t,s);if(r.getAllNodes().length){for(let a=e.length-2;a>0;--a)if(s=e[a].dequeue(),s){i=i.concat(Po(r,e,t,s,!0));break}}}return i},Po=(r,e,t,i,n)=>{var o,s;let a=[];return r.hasNode(i.v)&&((o=r.getRelatedEdges(i.v,"in"))===null||o===void 0||o.forEach(u=>{let f=u.data.weight,l=r.getNode(u.source);n&&a.push({v:u.source,w:u.target,in:0,out:0}),l.data.out===void 0&&(l.data.out=0),l.data.out-=f,Lo(e,t,Object.assign({v:l.id},l.data))}),(s=r.getRelatedEdges(i.v,"out"))===null||s===void 0||s.forEach(u=>{let f=u.data.weight,l=u.target,m=r.getNode(l);m.data.in===void 0&&(m.data.in=0),m.data.in-=f,Lo(e,t,Object.assign({v:m.id},m.data))}),r.removeNode(i.v)),n?a:void 0},Fb=(r,e)=>{let t=new He,i=0,n=0;r.getAllNodes().forEach(u=>{t.addNode({id:u.id,data:{v:u.id,in:0,out:0}})}),r.getAllEdges().forEach(u=>{let f=t.getRelatedEdges(u.source,"out").find(m=>m.target===u.target),l=e?.(u)||1;f?t.updateEdgeData(f?.id,Object.assign(Object.assign({},f.data),{weight:f.data.weight+l})):t.addEdge({id:u.id,source:u.source,target:u.target,data:{weight:l}}),n=Math.max(n,t.getNode(u.source).data.out+=l),i=Math.max(i,t.getNode(u.target).data.in+=l)});let o=[],s=n+i+3;for(let u=0;u<s;u++)o.push(new jo);let a=i+1;return t.getAllNodes().forEach(u=>{Lo(o,a,Object.assign({v:u.id},t.getNode(u.id).data))}),{buckets:o,zeroIdx:a,graph:t}},Lo=(r,e,t)=>{t.out?t.in?r[t.out-t.in+e].enqueue(t):r[r.length-1].enqueue(t):r[0].enqueue(t)};var ih=(r,e)=>{let i=th(r,(n=>o=>o.data.weight||1)());i?.forEach(n=>{let o=n.data;r.removeEdge(n.id),o.forwardName=n.data.name,o.reversed=!0,r.addEdge({id:n.id,source:n.target,target:n.source,data:Object.assign({},o)})})},nh=r=>{r.getAllEdges().forEach(e=>{let t=e.data;if(t.reversed){r.removeEdge(e.id);let i=t.forwardName;delete t.reversed,delete t.forwardName,r.addEdge({id:e.id,source:e.target,target:e.source,data:Object.assign(Object.assign({},t),{forwardName:i})})}})};var zb=(r,e)=>Number(r)-Number(e),Gr=(r,e,t,i)=>{let n;do n=`${i}${Math.random()}`;while(r.hasNode(n));return t.dummy=e,r.addNode({id:n,data:t}),n},oh=r=>{let e=new He;return r.getAllNodes().forEach(t=>{e.addNode(Object.assign({},t))}),r.getAllEdges().forEach(t=>{let i=e.getRelatedEdges(t.source,"out").find(n=>n.target===t.target);i?e.updateEdgeData(i?.id,Object.assign(Object.assign({},i.data),{weight:i.data.weight+t.data.weight||0,minlen:Math.max(i.data.minlen,t.data.minlen||1)})):e.addEdge({id:t.id,source:t.source,target:t.target,data:{weight:t.data.weight||0,minlen:t.data.minlen||1}})}),e},Ki=r=>{let e=new He;return r.getAllNodes().forEach(t=>{r.getChildren(t.id).length||e.addNode(Object.assign({},t))}),r.getAllEdges().forEach(t=>{e.addEdge(t)}),e},sh=(r,e)=>r?.reduce((t,i,n)=>(t[i]=e[n],t),{}),Fo=(r,e)=>{let t=Number(r.x),i=Number(r.y),n=Number(e.x)-t,o=Number(e.y)-i,s=Number(r.width)/2,a=Number(r.height)/2;if(!n&&!o)return{x:0,y:0};let u,f;return Math.abs(o)*s>Math.abs(n)*a?(o<0&&(a=-a),u=a*n/o,f=a):(n<0&&(s=-s),u=s,f=s*o/n),{x:t+u,y:i+f}},et=r=>{let e=[],t=Do(r)+1;for(let i=0;i<t;i++)e.push([]);r.getAllNodes().forEach(i=>{let n=i.data.rank;n!==void 0&&e[n]&&e[n].push(i.id)});for(let i=0;i<t;i++)e[i]=e[i].sort((n,o)=>zb(r.getNode(n).data.order,r.getNode(o).data.order));return e},ah=r=>{let e=r.getAllNodes().filter(i=>i.data.rank!==void 0).map(i=>i.data.rank),t=Math.min(...e);r.getAllNodes().forEach(i=>{i.data.hasOwnProperty("rank")&&t!==1/0&&(i.data.rank-=t)})},uh=(r,e=0)=>{let t=r.getAllNodes(),i=t.filter(a=>a.data.rank!==void 0).map(a=>a.data.rank),n=Math.min(...i),o=[];t.forEach(a=>{let u=(a.data.rank||0)-n;o[u]||(o[u]=[]),o[u].push(a.id)});let s=0;for(let a=0;a<o.length;a++){let u=o[a];u===void 0?a%e!==0&&(s-=1):s&&u?.forEach(f=>{let l=r.getNode(f);l&&(l.data.rank=l.data.rank||0,l.data.rank+=s)})}},zo=(r,e,t,i)=>{let n={width:0,height:0};return Me(t)&&Me(i)&&(n.rank=t,n.order=i),Gr(r,"border",n,e)},Do=r=>{let e;return r.getAllNodes().forEach(t=>{let i=t.data.rank;i!==void 0&&(e===void 0||i>e)&&(e=i)}),e||(e=0),e},fh=(r,e)=>{let t={lhs:[],rhs:[]};return r?.forEach(i=>{e(i)?t.lhs.push(i):t.rhs.push(i)}),t},Pt=(r,e)=>r.reduce((t,i)=>{let n=e(t),o=e(i);return n>o?i:t}),ch=(r,e,t,i,n,o)=>{if(!i.includes(e.id)){i.push(e.id),t||o.push(e.id);let s=n(e.id);s&&s.forEach(a=>ch(r,a,t,i,n,o)),t&&o.push(e.id)}},Bo=(r,e,t,i)=>{let n=Array.isArray(e)?e:[e],o=u=>r.getNeighbors(u),s=[],a=[];return n.forEach(u=>{if(r.hasNode(u.id))ch(r,u,t==="post",a,o,s);else throw new Error(`Graph does not have node: ${u}`)}),s};var hh=r=>{let e=t=>{let i=r.getChildren(t),n=r.getNode(t);if(i?.length&&i.forEach(o=>e(o.id)),n.data.hasOwnProperty("minRank")){n.data.borderLeft=[],n.data.borderRight=[];for(let o=n.data.minRank,s=n.data.maxRank+1;o<s;o+=1)lh(r,"borderLeft","_bl",t,n,o),lh(r,"borderRight","_br",t,n,o)}};r.getRoots().forEach(t=>e(t.id))},lh=(r,e,t,i,n,o)=>{let s={rank:o,borderType:e,width:0,height:0},a=o-n.data.minRank,u=n.data[e][a-1],f=Gr(r,"border",s,t);n.data[e][a]=f,r.setParent(f,i),u&&r.addEdge({id:`e${Math.random()}`,source:u,target:f,data:{weight:1}})};var ph=(r,e)=>{let t=e.toLowerCase();(t==="lr"||t==="rl")&&gh(r)},mh=(r,e)=>{let t=e.toLowerCase();(t==="bt"||t==="rl")&&Db(r),(t==="lr"||t==="rl")&&(Bb(r),gh(r))},gh=r=>{r.getAllNodes().forEach(e=>{dh(e)}),r.getAllEdges().forEach(e=>{dh(e)})},dh=r=>{let e=r.data.width;r.data.width=r.data.height,r.data.height=e},Db=r=>{r.getAllNodes().forEach(e=>{Go(e.data)}),r.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(i=>Go(i)),e.data.hasOwnProperty("y")&&Go(e.data)})},Go=r=>{r?.y&&(r.y=-r.y)},Bb=r=>{r.getAllNodes().forEach(e=>{Uo(e.data)}),r.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(i=>Uo(i)),e.data.hasOwnProperty("x")&&Uo(e.data)})},Uo=r=>{let e=r.x;r.x=r.y,r.y=e};var _h=r=>{let e=Gr(r,"root",{},"_root"),t=Gb(r),i=Math.max(...Object.values(t));Math.abs(i)===1/0&&(i=1);let n=i-1,o=2*n+1;r.getAllEdges().forEach(a=>{a.data.minlen*=o});let s=Ub(r)+1;return r.getRoots().forEach(a=>{vh(r,e,o,s,n,t,a.id)}),{nestingRoot:e,nodeRankFactor:o}},vh=(r,e,t,i,n,o,s)=>{let a=r.getChildren(s);if(!a?.length){s!==e&&r.addEdge({id:`e${Math.random()}`,source:e,target:s,data:{weight:0,minlen:t}});return}let u=zo(r,"_bt"),f=zo(r,"_bb"),l=r.getNode(s);r.setParent(u,s),l.data.borderTop=u,r.setParent(f,s),l.data.borderBottom=f,a?.forEach(m=>{vh(r,e,t,i,n,o,m.id);let _=m.data.borderTop?m.data.borderTop:m.id,g=m.data.borderBottom?m.data.borderBottom:m.id,w=m.data.borderTop?i:2*i,b=_!==g?1:n-o[s]+1;r.addEdge({id:`e${Math.random()}`,source:u,target:_,data:{minlen:b,weight:w,nestingEdge:!0}}),r.addEdge({id:`e${Math.random()}`,source:g,target:f,data:{minlen:b,weight:w,nestingEdge:!0}})}),r.getParent(s)||r.addEdge({id:`e${Math.random()}`,source:e,target:u,data:{weight:0,minlen:n+o[s]}})},Gb=r=>{let e={},t=(i,n)=>{let o=r.getChildren(i);o?.forEach(s=>t(s.id,n+1)),e[i]=n};return r.getRoots().forEach(i=>t(i.id,1)),e},Ub=r=>{let e=0;return r.getAllEdges().forEach(t=>{e+=t.data.weight}),e},yh=(r,e)=>{e&&r.removeNode(e),r.getAllEdges().forEach(t=>{t.data.nestingEdge&&r.removeEdge(t.id)})};var $b="edge",qh="edge-label",wh=(r,e)=>{r.getAllEdges().forEach(t=>Vb(r,t,e))},Vb=(r,e,t)=>{let i=e.source,n=r.getNode(i).data.rank,o=e.target,s=r.getNode(o).data.rank,a=e.data.labelRank;if(s===n+1)return;r.removeEdge(e.id);let u,f,l;for(l=0,++n;n<s;++l,++n)e.data.points=[],f={originalEdge:e,width:0,height:0,rank:n},u=Gr(r,$b,f,"_d"),n===a&&(f.width=e.data.width,f.height=e.data.height,f.dummy=qh,f.labelpos=e.data.labelpos),r.addEdge({id:`e${Math.random()}`,source:i,target:u,data:{weight:e.data.weight}}),l===0&&t.push(u),i=u;r.addEdge({id:`e${Math.random()}`,source:i,target:o,data:{weight:e.data.weight}})},bh=(r,e)=>{e.forEach(t=>{let i=r.getNode(t),{data:n}=i,o=n.originalEdge,s;o&&r.addEdge(o);let a=t;for(;i.data.dummy;)s=r.getSuccessors(a)[0],r.removeNode(a),o.data.points.push({x:i.data.x,y:i.data.y}),i.data.dummy===qh&&(o.data.x=i.data.x,o.data.y=i.data.y,o.data.width=i.data.width,o.data.height=i.data.height),a=s.id,i=r.getNode(a)})};var xh=(r,e,t)=>{let i={},n;t?.forEach(o=>{let s=r.getParent(o),a,u;for(;s;){if(a=r.getParent(s.id),a?(u=i[a.id],i[a.id]=s.id):(u=n,n=s.id),u&&u!==s.id){e.hasNode(u)||e.addNode({id:u,data:{}}),e.hasNode(s.id)||e.addNode({id:s.id,data:{}}),e.hasEdge(`e${u}-${s.id}`)||e.addEdge({id:`e${u}-${s.id}`,source:u,target:s.id,data:{}});return}s=a}})};var Eh=(r,e,t)=>{let i=Wb(r),n=new He;return n.addNode({id:i,data:{}}),r.getAllNodes().forEach(o=>{var s,a;let u=r.getParent(o.id);(o.data.rank===e||o.data.minRank<=e&&e<=o.data.maxRank)&&(n.hasNode(o.id)||n.addNode(Object.assign({},o)),u?.id&&!n.hasNode(u?.id)&&n.addNode(Object.assign({},u)),n.setParent(o.id,u?.id||i),r.getRelatedEdges(o.id,t).forEach(f=>{let l=f.source===o.id?f.target:f.source;n.hasNode(l)||n.addNode(Object.assign({},r.getNode(l)));let m=n.getRelatedEdges(l,"out").find(({target:g})=>g===o.id),_=m!==void 0?m.data.weight:0;m?n.updateEdgeData(m.id,Object.assign(Object.assign({},m.data),{weight:f.data.weight+_})):n.addEdge({id:f.id,source:l,target:o.id,data:{weight:f.data.weight+_}})}),o.data.hasOwnProperty("minRank")&&n.updateNodeData(o.id,Object.assign(Object.assign({},o.data),{borderLeft:[(s=o.data.borderLeft)===null||s===void 0?void 0:s[e-o.data.minRank]],borderRight:[(a=o.data.borderRight)===null||a===void 0?void 0:a[e-o.data.minRank]]})))}),n},Wb=r=>{let e;for(;r.hasNode(e=`_root${Math.random()}`););return e};var Kb=(r,e,t)=>{let i=sh(t,t.map((l,m)=>m)),o=e.map(l=>{let m=r.getRelatedEdges(l,"out").map(_=>({pos:i[_.target]||0,weight:_.data.weight}));return m?.sort((_,g)=>_.pos-g.pos)}).flat().filter(l=>l!==void 0),s=1;for(;s<t.length;)s<<=1;let a=2*s-1;s-=1;let u=Array(a).fill(0,0,a),f=0;return o?.forEach(l=>{if(l){let m=l.pos+s;u[m]+=l.weight;let _=0;for(;m>0;)m%2&&(_+=u[m+1]),m=m-1>>1,u[m]+=l.weight;f+=l.weight*_}}),f},$o=(r,e)=>{let t=0;for(let i=1;i<e?.length;i+=1)t+=Kb(r,e[i-1],e[i]);return t};var Vo=r=>{let e={},t=r.getAllNodes(),i=t.map(f=>{var l;return(l=f.data.rank)!==null&&l!==void 0?l:-1/0}),n=Math.max(...i),o=[];for(let f=0;f<n+1;f++)o.push([]);let s=t.sort((f,l)=>r.getNode(f.id).data.rank-r.getNode(l.id).data.rank),u=s.filter(f=>r.getNode(f.id).data.fixorder!==void 0).sort((f,l)=>r.getNode(f.id).data.fixorder-r.getNode(l.id).data.fixorder);return u?.forEach(f=>{isNaN(r.getNode(f.id).data.rank)||o[r.getNode(f.id).data.rank].push(f.id),e[f.id]=!0}),s?.forEach(f=>r.dfsTree(f.id,l=>{if(e.hasOwnProperty(l.id))return!0;e[l.id]=!0,isNaN(l.data.rank)||o[l.data.rank].push(l.id)})),o};var Sh=(r,e)=>e.map(t=>{let i=r.getRelatedEdges(t,"in");if(!i?.length)return{v:t};let n={sum:0,weight:0};return i?.forEach(o=>{let s=r.getNode(o.source);n.sum+=o.data.weight*s.data.order,n.weight+=o.data.weight}),{v:t,barycenter:n.sum/n.weight,weight:n.weight}});var Nh=(r,e)=>{var t,i,n;let o={};r?.forEach((a,u)=>{o[a.v]={i:u,indegree:0,in:[],out:[],vs:[a.v]};let f=o[a.v];a.barycenter!==void 0&&(f.barycenter=a.barycenter,f.weight=a.weight)}),(t=e.getAllEdges())===null||t===void 0||t.forEach(a=>{let u=o[a.source],f=o[a.target];u!==void 0&&f!==void 0&&(f.indegree++,u.out.push(o[a.target]))});let s=(n=(i=Object.values(o)).filter)===null||n===void 0?void 0:n.call(i,a=>!a.indegree);return Yb(s)},Yb=r=>{var e,t;let i=[],n=u=>f=>{f.merged||(f.barycenter===void 0||u.barycenter===void 0||f.barycenter>=u.barycenter)&&Xb(u,f)},o=u=>f=>{f.in.push(u),--f.indegree===0&&r.push(f)};for(;r?.length;){let u=r.pop();i.push(u),(e=u.in.reverse())===null||e===void 0||e.forEach(f=>n(u)(f)),(t=u.out)===null||t===void 0||t.forEach(f=>o(u)(f))}let s=i.filter(u=>!u.merged),a=["vs","i","barycenter","weight"];return s.map(u=>{let f={};return a?.forEach(l=>{u[l]!==void 0&&(f[l]=u[l])}),f})},Xb=(r,e)=>{var t;let i=0,n=0;r.weight&&(i+=r.barycenter*r.weight,n+=r.weight),e.weight&&(i+=e.barycenter*e.weight,n+=e.weight),r.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(r.vs),r.barycenter=i/n,r.weight=n,r.i=Math.min(e.i,r.i),e.merged=!0};var Ih=(r,e,t,i)=>{let n=fh(r,_=>{let g=_.hasOwnProperty("fixorder")&&!isNaN(_.fixorder);return i?!g&&_.hasOwnProperty("barycenter"):g||_.hasOwnProperty("barycenter")}),o=n.lhs,s=n.rhs.sort((_,g)=>-_.i- -g.i),a=[],u=0,f=0,l=0;o?.sort(Zb(!!e,!!t)),l=Mh(a,s,l),o?.forEach(_=>{var g;l+=(g=_.vs)===null||g===void 0?void 0:g.length,a.push(_.vs),u+=_.barycenter*_.weight,f+=_.weight,l=Mh(a,s,l)});let m={vs:a.flat()};return f&&(m.barycenter=u/f,m.weight=f),m},Mh=(r,e,t)=>{let i=t,n;for(;e.length&&(n=e[e.length-1]).i<=i;)e.pop(),r?.push(n.vs),i++;return i},Zb=(r,e)=>(t,i)=>{if(t.fixorder!==void 0&&i.fixorder!==void 0)return t.fixorder-i.fixorder;if(t.barycenter<i.barycenter)return-1;if(t.barycenter>i.barycenter)return 1;if(e&&t.order!==void 0&&i.order!==void 0){if(t.order<i.order)return-1;if(t.order>i.order)return 1}return r?i.i-t.i:t.i-i.i};var Wo=(r,e,t,i,n,o)=>{var s,a,u,f;let l=r.getChildren(e).map(x=>x.id),m=r.getNode(e),_=m?m.data.borderLeft:void 0,g=m?m.data.borderRight:void 0,w={};_&&(l=l?.filter(x=>x!==_&&x!==g));let b=Sh(r,l||[]);b?.forEach(x=>{var E;if(!((E=r.getChildren(x.v))===null||E===void 0)&&E.length){let N=Wo(r,x.v,t,i,o);w[x.v]=N,N.hasOwnProperty("barycenter")&&Jb(x,N)}});let q=Nh(b,t);Qb(q,w),(s=q.filter(x=>x.vs.length>0))===null||s===void 0||s.forEach(x=>{let E=r.getNode(x.vs[0]);E&&(x.fixorder=E.data.fixorder,x.order=E.data.order)});let y=Ih(q,i,n,o);if(_&&(y.vs=[_,y.vs,g].flat(),!((a=r.getPredecessors(_))===null||a===void 0)&&a.length)){let x=r.getNode(((u=r.getPredecessors(_))===null||u===void 0?void 0:u[0].id)||""),E=r.getNode(((f=r.getPredecessors(g))===null||f===void 0?void 0:f[0].id)||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+x.data.order+E.data.order)/(y.weight+2),y.weight+=2}return y},Qb=(r,e)=>{r?.forEach(t=>{var i;let n=(i=t.vs)===null||i===void 0?void 0:i.map(o=>e[o]?e[o].vs:o);t.vs=n.flat()})},Jb=(r,e)=>{r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight):(r.barycenter=e.barycenter,r.weight=e.weight)};function jt(r){return Array.isArray(r)}var li=function(r){if(typeof r!="object"||r===null)return r;var e;if(jt(r)){e=[];for(var t=0,i=r.length;t<i;t++)typeof r[t]=="object"&&r[t]!=null?e[t]=li(r[t]):e[t]=r[t]}else{e={};for(var n in r)typeof r[n]=="object"&&r[n]!=null?e[n]=li(r[n]):e[n]=r[n]}return e};var Oh=(r,e)=>{let t=Do(r),i=[],n=[];for(let l=1;l<t+1;l++)i.push(l);for(let l=t-1;l>-1;l--)n.push(l);let o=Rh(r,i,"in"),s=Rh(r,n,"out"),a=Vo(r);Ko(r,a);let u=Number.POSITIVE_INFINITY,f;for(let l=0,m=0;m<4;++l,++m){Ah(l%2?o:s,l%4>=2,!1,e),a=et(r);let _=$o(r,a);_<u&&(m=0,f=li(a),u=_)}a=Vo(r),Ko(r,a);for(let l=0,m=0;m<4;++l,++m){Ah(l%2?o:s,l%4>=2,!0,e),a=et(r);let _=$o(r,a);_<u&&(m=0,f=li(a),u=_)}Ko(r,f)},Rh=(r,e,t)=>e.map(i=>Eh(r,i,t)),Ah=(r,e,t,i)=>{let n=new He;r?.forEach(o=>{var s;let a=o.getRoots()[0].id,u=Wo(o,a,n,e,t,i);for(let f=0;f<((s=u.vs)===null||s===void 0?void 0:s.length);f++){let l=o.getNode(u.vs[f]);l&&(l.data.order=f)}xh(o,n,u.vs)})},Ko=(r,e)=>{e?.forEach(t=>{t?.forEach((i,n)=>{r.getNode(i).data.order=n})})};var Ch=(r,e)=>{let i=r.getAllNodes().filter(s=>{var a;return!(!((a=r.getChildren(s.id))===null||a===void 0)&&a.length)}).map(s=>s.data.rank),n=Math.max(...i),o=[];for(let s=0;s<n+1;s++)o[s]=[];e?.forEach(s=>{let a=r.getNode(s);!a||a.data.dummy||isNaN(a.data.rank)||(a.data.fixorder=o[a.data.rank].length,o[a.data.rank].push(s))})};var Hb=r=>{let e={},t=0,i=n=>{let o=t;r.getChildren(n).forEach(s=>i(s.id)),e[n]={low:o,lim:t++}};return r.getRoots().forEach(n=>i(n.id)),e},ex=(r,e,t,i)=>{var n,o;let s=[],a=[],u=Math.min(e[t].low,e[i].low),f=Math.max(e[t].lim,e[i].lim),l,m;l=t;do l=(n=r.getParent(l))===null||n===void 0?void 0:n.id,s.push(l);while(l&&(e[l].low>u||f>e[l].lim));for(m=l,l=i;l&&l!==m;)a.push(l),l=(o=r.getParent(l))===null||o===void 0?void 0:o.id;return{lca:m,path:s.concat(a.reverse())}},Th=(r,e)=>{let t=Hb(r);e.forEach(i=>{var n,o;let s=i,a=r.getNode(s),u=a.data.originalEdge;if(!u)return;let f=ex(r,t,u.source,u.target),l=f.path,m=f.lca,_=0,g=l[_],w=!0;for(;s!==u.target;){if(a=r.getNode(s),w){for(;g!==m&&((n=r.getNode(g))===null||n===void 0?void 0:n.data.maxRank)<a.data.rank;)_++,g=l[_];g===m&&(w=!1)}if(!w){for(;_<l.length-1&&((o=r.getNode(l[_+1]))===null||o===void 0?void 0:o.data.minRank)<=a.data.rank;)_++;g=l[_]}r.hasNode(g)&&r.setParent(s,g),s=r.getSuccessors(s)[0].id}})};var kh=(r,e)=>{let t={},i=(n,o)=>{let s=0,a=0,u=n.length,f=o?.[o?.length-1];return o?.forEach((l,m)=>{var _;let g=rx(r,l),w=g?r.getNode(g.id).data.order:u;(g||l===f)&&((_=o.slice(a,m+1))===null||_===void 0||_.forEach(b=>{var q;(q=r.getPredecessors(b))===null||q===void 0||q.forEach(y=>{var x;let E=r.getNode(y.id),N=E.data.order;(N<s||w<N)&&!(E.data.dummy&&(!((x=r.getNode(b))===null||x===void 0)&&x.data.dummy))&&jh(t,y.id,b)})}),a=m+1,s=w)}),o};return e?.length&&e.reduce(i),t},Ph=(r,e)=>{let t={};function i(a,u,f,l,m){var _,g;let w;for(let b=u;b<f;b++)w=a[b],!((_=r.getNode(w))===null||_===void 0)&&_.data.dummy&&((g=r.getPredecessors(w))===null||g===void 0||g.forEach(q=>{let y=r.getNode(q.id);y.data.dummy&&(y.data.order<l||y.data.order>m)&&jh(t,q.id,w)}))}function n(a){return JSON.stringify(a.slice(1))}function o(a,u){let f=n(a);u.get(f)||(i(...a),u.set(f,!0))}let s=(a,u)=>{let f=-1,l,m=0,_=new Map;return u?.forEach((g,w)=>{var b;if(((b=r.getNode(g))===null||b===void 0?void 0:b.data.dummy)==="border"){let q=r.getPredecessors(g)||[];q.length&&(l=r.getNode(q[0].id).data.order,o([u,m,w,f,l],_),m=w,f=l)}o([u,m,u.length,l,a.length],_)}),u};return e?.length&&e.reduce(s),t},rx=(r,e)=>{var t,i;if(!((t=r.getNode(e))===null||t===void 0)&&t.data.dummy)return(i=r.getPredecessors(e))===null||i===void 0?void 0:i.find(n=>r.getNode(n.id).data.dummy)},jh=(r,e,t)=>{let i=e,n=t;if(i>n){let s=i;i=n,n=s}let o=r[i];o||(r[i]=o={}),o[n]=!0},tx=(r,e,t)=>{let i=e,n=t;if(i>n){let o=e;i=n,n=o}return!!r[i]},Lh=(r,e,t,i)=>{let n={},o={},s={};return e?.forEach(a=>{a?.forEach((u,f)=>{n[u]=u,o[u]=u,s[u]=f})}),e?.forEach(a=>{let u=-1;a?.forEach(f=>{let l=i(f).map(m=>m.id);if(l.length){l=l.sort((_,g)=>s[_]-s[g]);let m=(l.length-1)/2;for(let _=Math.floor(m),g=Math.ceil(m);_<=g;++_){let w=l[_];o[f]===f&&u<s[w]&&!tx(t,f,w)&&(o[w]=f,o[f]=n[f]=n[w],u=s[w])}}})}),{root:n,align:o}},Fh=(r,e,t,i,n,o,s)=>{var a;let u={},f=ix(r,e,t,n,o,s),l=s?"borderLeft":"borderRight",m=(w,b)=>{let q=f.getAllNodes(),y=q.pop(),x={};for(;y;)x[y.id]?w(y.id):(x[y.id]=!0,q.push(y),q=q.concat(b(y.id))),y=q.pop()},_=w=>{u[w]=(f.getRelatedEdges(w,"in")||[]).reduce((b,q)=>Math.max(b,(u[q.source]||0)+q.data.weight),0)},g=w=>{let b=(f.getRelatedEdges(w,"out")||[]).reduce((y,x)=>Math.min(y,(u[x.target]||0)-x.data.weight),Number.POSITIVE_INFINITY),q=r.getNode(w);b!==Number.POSITIVE_INFINITY&&q.data.borderType!==l&&(u[w]=Math.max(u[w],b))};return m(_,f.getPredecessors.bind(f)),m(g,f.getSuccessors.bind(f)),(a=Object.values(i))===null||a===void 0||a.forEach(w=>{u[w]=u[t[w]]}),u},ix=(r,e,t,i,n,o)=>{let s=new He,a=nx(i,n,o);return e?.forEach(u=>{let f;u?.forEach(l=>{let m=t[l];if(s.hasNode(m)||s.addNode({id:m,data:{}}),f){let _=t[f],g=s.getRelatedEdges(_,"out").find(w=>w.target===m);g?s.updateEdgeData(g.id,Object.assign(Object.assign({},g.data),{weight:Math.max(a(r,l,f),g.data.weight||0)})):s.addEdge({id:`e${Math.random()}`,source:_,target:m,data:{weight:Math.max(a(r,l,f),0)}})}f=l})}),s},zh=(r,e)=>Pt(Object.values(e),t=>{var i;let n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return(i=Object.keys(t))===null||i===void 0||i.forEach(s=>{let a=t[s],u=ox(r,s)/2;n=Math.max(a+u,n),o=Math.min(a-u,o)}),n-o});function Dh(r,e){let t=Object.values(e),i=Math.min(...t),n=Math.max(...t);["u","d"].forEach(o=>{["l","r"].forEach(s=>{let a=o+s,u=r[a],f;if(u===e)return;let l=Object.values(u);f=s==="l"?i-Math.min(...l):n-Math.max(...l),f&&(r[a]={},Object.keys(u).forEach(m=>{r[a][m]=u[m]+f}))})})}var Bh=(r,e)=>{let t={};return Object.keys(r.ul).forEach(i=>{if(e)t[i]=r[e.toLowerCase()][i];else{let n=Object.values(r).map(o=>o[i]);t[i]=(n[0]+n[1])/2}}),t},nx=(r,e,t)=>(i,n,o)=>{let s=i.getNode(n),a=i.getNode(o),u=0,f=0;if(u+=s.data.width/2,s.data.hasOwnProperty("labelpos"))switch((s.data.labelpos||"").toLowerCase()){case"l":f=-s.data.width/2;break;case"r":f=s.data.width/2;break}if(f&&(u+=t?f:-f),f=0,u+=(s.data.dummy?e:r)/2,u+=(a.data.dummy?e:r)/2,u+=a.data.width/2,a.data.labelpos)switch((a.data.labelpos||"").toLowerCase()){case"l":f=a.data.width/2;break;case"r":f=-a.data.width/2;break}return f&&(u+=t?f:-f),f=0,u},ox=(r,e)=>r.getNode(e).data.width||0;var sx=(r,e)=>{let{ranksep:t=0}=e||{},i=et(r),n=0;i?.forEach(o=>{let s=o.map(u=>r.getNode(u).data.height),a=Math.max(...s,0);o?.forEach(u=>{r.getNode(u).data.y=n+a/2}),n+=a+t})},ax=(r,e)=>{let{align:t,nodesep:i=0,edgesep:n=0}=e||{},o=et(r),s=Object.assign(kh(r,o),Ph(r,o)),a={},u=[];["u","d"].forEach(l=>{u=l==="u"?o:Object.values(o).reverse(),["l","r"].forEach(m=>{m==="r"&&(u=u.map(b=>Object.values(b).reverse()));let _=(l==="u"?r.getPredecessors:r.getSuccessors).bind(r),g=Lh(r,u,s,_),w=Fh(r,u,g.root,g.align,i,n,m==="r");m==="r"&&Object.keys(w).forEach(b=>w[b]=-w[b]),a[l+m]=w})});let f=zh(r,a);return f&&Dh(a,f),Bh(a,t)},Gh=(r,e)=>{var t;let i=Ki(r);sx(i,e);let n=ax(i,e);(t=Object.keys(n))===null||t===void 0||t.forEach(o=>{i.getNode(o).data.x=n[o]})};var Yi=r=>{let e={},t=i=>{var n;let o=r.getNode(i);if(!o)return 0;if(e[i])return o.data.rank;e[i]=!0;let s;return(n=r.getRelatedEdges(i,"out"))===null||n===void 0||n.forEach(a=>{let u=t(a.target),f=a.data.minlen,l=u-f;l&&(s===void 0||l<s)&&(s=l)}),s||(s=0),o.data.rank=s,s};r.getAllNodes().filter(i=>r.getRelatedEdges(i.id,"in").length===0).forEach(i=>t(i.id))},Uh=r=>{let e={},t,i=s=>{var a;let u=r.getNode(s);if(!u)return 0;if(e[s])return u.data.rank;e[s]=!0;let f;return(a=r.getRelatedEdges(s,"out"))===null||a===void 0||a.forEach(l=>{let m=i(l.target),_=l.data.minlen,g=m-_;g&&(f===void 0||g<f)&&(f=g)}),f||(f=0),(t===void 0||f<t)&&(t=f),u.data.rank=f,f};r.getAllNodes().filter(s=>r.getRelatedEdges(s.id,"in").length===0).forEach(s=>{s&&i(s.id)}),t===void 0&&(t=0);let n={},o=(s,a)=>{var u;let f=r.getNode(s),l=isNaN(f.data.layer)?a:f.data.layer;(f.data.rank===void 0||f.data.rank<l)&&(f.data.rank=l),!n[s]&&(n[s]=!0,(u=r.getRelatedEdges(s,"out"))===null||u===void 0||u.forEach(m=>{o(m.target,l+m.data.minlen)}))};r.getAllNodes().forEach(s=>{let a=s.data;a&&(isNaN(a.layer)?a.rank-=t:o(s.id,a.layer))})},Ur=(r,e)=>r.getNode(e.target).data.rank-r.getNode(e.source).data.rank-e.data.minlen;var $h=r=>{let e=new He({tree:[]}),t=r.getAllNodes()[0],i=r.getAllNodes().length;e.addNode(t);let n,o;for(;ux(e,r)<i;)n=Wh(e,r),o=e.hasNode(n.source)?Ur(r,n):-Ur(r,n),Kh(e,r,o);return e},ux=(r,e)=>{let t=i=>{e.getRelatedEdges(i,"both").forEach(n=>{let o=n.source,s=i===o?n.target:o;!r.hasNode(s)&&!Ur(e,n)&&(r.addNode({id:s,data:{}}),r.addEdge({id:n.id,source:i,target:s,data:{}}),t(s))})};return r.getAllNodes().forEach(i=>t(i.id)),r.getAllNodes().length},Vh=r=>{let e=new He({tree:[]}),t=r.getAllNodes()[0],i=r.getAllNodes().length;e.addNode(t);let n,o;for(;fx(e,r)<i;)n=Wh(e,r),o=e.hasNode(n.source)?Ur(r,n):-Ur(r,n),Kh(e,r,o);return e},fx=(r,e)=>{let t=i=>{var n;(n=e.getRelatedEdges(i,"both"))===null||n===void 0||n.forEach(o=>{let s=o.source,a=i===s?o.target:s;!r.hasNode(a)&&(e.getNode(a).data.layer!==void 0||!Ur(e,o))&&(r.addNode({id:a,data:{}}),r.addEdge({id:o.id,source:i,target:a,data:{}}),t(a))})};return r.getAllNodes().forEach(i=>t(i.id)),r.getAllNodes().length},Wh=(r,e)=>Pt(e.getAllEdges(),t=>r.hasNode(t.source)!==r.hasNode(t.target)?Ur(e,t):1/0),Kh=(r,e,t)=>{r.getAllNodes().forEach(i=>{let n=e.getNode(i.id);n.data.rank||(n.data.rank=0),n.data.rank+=t})};var Xh=r=>{let e=oh(r);Yi(e);let t=$h(e);Qh(t),Zh(t,e);let i,n;for(;i=hx(t);)n=dx(t,e,i),px(t,e,i,n)},Zh=(r,e)=>{let t=Bo(r,r.getAllNodes(),"post");t=t.slice(0,t?.length-1),t.forEach(i=>{cx(r,e,i)})},cx=(r,e,t)=>{let n=r.getNode(t).data.parent,o=r.getRelatedEdges(t,"both").find(s=>s.target===n||s.source===n);o.data.cutvalue=lx(r,e,t)},lx=(r,e,t)=>{let n=r.getNode(t).data.parent,o=!0,s=e.getRelatedEdges(t,"out").find(u=>u.target===n),a=0;return s||(o=!1,s=e.getRelatedEdges(n,"out").find(u=>u.target===t)),a=s.data.weight,e.getRelatedEdges(t,"both").forEach(u=>{let f=u.source===t,l=f?u.target:u.source;if(l!==n){let m=f===o,_=u.data.weight;if(a+=m?_:-_,gx(r,t,l)){let g=r.getRelatedEdges(t,"both").find(w=>w.source===l||w.target===l).data.cutvalue;a+=m?-g:g}}}),a},Qh=(r,e=r.getAllNodes()[0].id)=>{Jh(r,{},1,e)},Jh=(r,e,t,i,n)=>{var o;let s=t,a=t,u=r.getNode(i);return e[i]=!0,(o=r.getNeighbors(i))===null||o===void 0||o.forEach(f=>{e[f.id]||(a=Jh(r,e,a,f.id,i))}),u.data.low=s,u.data.lim=a++,n?u.data.parent=n:delete u.data.parent,a},hx=r=>r.getAllEdges().find(e=>e.data.cutvalue<0),dx=(r,e,t)=>{let i=t.source,n=t.target;e.getRelatedEdges(i,"out").find(l=>l.target===n)||(i=t.target,n=t.source);let o=r.getNode(i),s=r.getNode(n),a=o,u=!1;o.data.lim>s.data.lim&&(a=s,u=!0);let f=e.getAllEdges().filter(l=>u===Yh(r.getNode(l.source),a)&&u!==Yh(r.getNode(l.target),a));return Pt(f,l=>Ur(e,l))},px=(r,e,t,i)=>{let n=r.getRelatedEdges(t.source,"both").find(o=>o.source===t.target||o.target===t.target);n&&r.removeEdge(n.id),r.addEdge({id:`e${Math.random()}`,source:i.source,target:i.target,data:{}}),Qh(r),Zh(r,e),mx(r,e)},mx=(r,e)=>{let t=r.getAllNodes().find(n=>!n.data.parent),i=Bo(r,t,"pre");i=i.slice(1),i.forEach(n=>{let o=r.getNode(n).data.parent,s=e.getRelatedEdges(n,"out").find(u=>u.target===o),a=!1;!s&&e.hasNode(o)&&(s=e.getRelatedEdges(o,"out").find(u=>u.target===n),a=!0),e.getNode(n).data.rank=(e.hasNode(o)&&e.getNode(o).data.rank||0)+(a?s?.data.minlen:-s?.data.minlen)})},gx=(r,e,t)=>r.getRelatedEdges(e,"both").find(i=>i.source===t||i.target===t),Yh=(r,e)=>e.data.low<=r.data.lim&&r.data.lim<=e.data.lim;var ed=(r,e)=>{switch(e){case"network-simplex":vx(r);break;case"tight-tree":Hh(r);break;case"longest-path":_x(r);break;default:Hh(r)}},_x=Yi,Hh=r=>{Uh(r),Vh(r)},vx=r=>{Xh(r)};var id=(r,e)=>{let{edgeLabelSpace:t,keepNodeOrder:i,prevGraph:n,rankdir:o,ranksep:s}=e;!i&&n&&qx(r,n);let a=Nx(r);t&&(e.ranksep=Mx(a,{rankdir:o,ranksep:s}));let u;try{u=yx(a,e)}catch(f){if(f.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
3
+ `,f);return}throw f}return wx(r,a),u},yx=(r,e)=>{let{ranker:t,rankdir:i="tb",nodeOrder:n,keepNodeOrder:o,align:s,nodesep:a=50,edgesep:u=20,ranksep:f=50}=e;jx(r),ih(r);let{nestingRoot:l,nodeRankFactor:m}=_h(r);ed(Ki(r),t),Ix(r),uh(r,m),yh(r,l),ah(r),Rx(r),Ax(r);let _=[];wh(r,_),Th(r,_),hh(r),o&&Ch(r,n),Oh(r,o),Lx(r),ph(r,i),Gh(r,{align:s,nodesep:a,edgesep:u,ranksep:f}),Fx(r),Px(r),bh(r,_),Tx(r),mh(r,i);let{width:g,height:w}=Ox(r);return Cx(r),kx(r),nh(r),{width:g,height:w}},qx=(r,e)=>{r.getAllNodes().forEach(t=>{let i=r.getNode(t.id);if(e.hasNode(t.id)){let n=e.getNode(t.id);i.data.fixorder=n.data._order,delete n.data._order}else delete i.data.fixorder})},wx=(r,e)=>{r.getAllNodes().forEach(t=>{var i;let n=r.getNode(t.id);if(n){let o=e.getNode(t.id);n.data.x=o.data.x,n.data.y=o.data.y,n.data._order=o.data.order,n.data._rank=o.data.rank,!((i=e.getChildren(t.id))===null||i===void 0)&&i.length&&(n.data.width=o.data.width,n.data.height=o.data.height)}}),r.getAllEdges().forEach(t=>{let i=r.getEdge(t.id),n=e.getEdge(t.id);i.data.points=n?n.data.points:[],n&&n.data.hasOwnProperty("x")&&(i.data.x=n.data.x,i.data.y=n.data.y)})},bx=["width","height","layer","fixorder"],xx={width:0,height:0},Ex=["minlen","weight","width","height","labeloffset"],Sx={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Yo=["labelpos"],Nx=r=>{let e=new He({tree:[]});return r.getAllNodes().forEach(t=>{let i=td(r.getNode(t.id).data),n=Object.assign(Object.assign({},xx),i),o=rd(n,bx);e.hasNode(t.id)||e.addNode({id:t.id,data:Object.assign({},o)});let s=r.hasTreeStructure("combo")?r.getParent(t.id,"combo"):r.getParent(t.id);Fe(s)||(e.hasNode(s.id)||e.addNode(Object.assign({},s)),e.setParent(t.id,s.id))}),r.getAllEdges().forEach(t=>{let i=td(r.getEdge(t.id).data),n={};Yo?.forEach(o=>{i[o]!==void 0&&(n[o]=i[o])}),e.addEdge({id:t.id,source:t.source,target:t.target,data:Object.assign({},Sx,rd(i,Ex),n)})}),e},Mx=(r,e)=>{let{ranksep:t=0,rankdir:i}=e;return r.getAllNodes().forEach(n=>{isNaN(n.data.layer)||n.data.layer||(n.data.layer=0)}),r.getAllEdges().forEach(n=>{var o;n.data.minlen*=2,((o=n.data.labelpos)===null||o===void 0?void 0:o.toLowerCase())!=="c"&&(i==="TB"||i==="BT"?n.data.width+=n.data.labeloffset:n.data.height+=n.data.labeloffset)}),t/2},Ix=r=>{r.getAllEdges().forEach(e=>{if(e.data.width&&e.data.height){let t=r.getNode(e.source),i=r.getNode(e.target),n={e,rank:(i.data.rank-t.data.rank)/2+t.data.rank};Gr(r,"edge-proxy",n,"_ep")}})},Rx=r=>{let e=0;return r.getAllNodes().forEach(t=>{var i,n;t.data.borderTop&&(t.data.minRank=(i=r.getNode(t.data.borderTop))===null||i===void 0?void 0:i.data.rank,t.data.maxRank=(n=r.getNode(t.data.borderBottom))===null||n===void 0?void 0:n.data.rank,e=Math.max(e,t.data.maxRank||-1/0))}),e},Ax=r=>{r.getAllNodes().forEach(e=>{e.data.dummy==="edge-proxy"&&(r.getEdge(e.data.e.id).data.labelRank=e.data.rank,r.removeNode(e.id))})},Ox=(r,e)=>{let t,i=0,n,o=0,{marginx:s=0,marginy:a=0}={},u=f=>{if(!f.data)return;let l=f.data.x,m=f.data.y,_=f.data.width,g=f.data.height;!isNaN(l)&&!isNaN(_)&&(t===void 0&&(t=l-_/2),t=Math.min(t,l-_/2),i=Math.max(i,l+_/2)),!isNaN(m)&&!isNaN(g)&&(n===void 0&&(n=m-g/2),n=Math.min(n,m-g/2),o=Math.max(o,m+g/2))};return r.getAllNodes().forEach(f=>{u(f)}),r.getAllEdges().forEach(f=>{f?.data.hasOwnProperty("x")&&u(f)}),t-=s,n-=a,r.getAllNodes().forEach(f=>{f.data.x-=t,f.data.y-=n}),r.getAllEdges().forEach(f=>{var l;(l=f.data.points)===null||l===void 0||l.forEach(m=>{m.x-=t,m.y-=n}),f.data.hasOwnProperty("x")&&(f.data.x-=t),f.data.hasOwnProperty("y")&&(f.data.y-=n)}),{width:i-t+s,height:o-n+a}},Cx=r=>{r.getAllEdges().forEach(e=>{let t=r.getNode(e.source),i=r.getNode(e.target),n,o;e.data.points?(n=e.data.points[0],o=e.data.points[e.data.points.length-1]):(e.data.points=[],n={x:i.data.x,y:i.data.y},o={x:t.data.x,y:t.data.y}),e.data.points.unshift(Fo(t.data,n)),e.data.points.push(Fo(i.data,o))})},Tx=r=>{r.getAllEdges().forEach(e=>{if(e.data.hasOwnProperty("x"))switch((e.data.labelpos==="l"||e.data.labelpos==="r")&&(e.data.width-=e.data.labeloffset),e.data.labelpos){case"l":e.data.x-=e.data.width/2+e.data.labeloffset;break;case"r":e.data.x+=e.data.width/2+e.data.labeloffset;break}})},kx=r=>{r.getAllEdges().forEach(e=>{var t;e.data.reversed&&((t=e.data.points)===null||t===void 0||t.reverse())})},Px=r=>{r.getAllNodes().forEach(e=>{var t,i,n;if(!((t=r.getChildren(e.id))===null||t===void 0)&&t.length){let o=r.getNode(e.id),s=r.getNode(o.data.borderTop),a=r.getNode(o.data.borderBottom),u=r.getNode(o.data.borderLeft[((i=o.data.borderLeft)===null||i===void 0?void 0:i.length)-1]),f=r.getNode(o.data.borderRight[((n=o.data.borderRight)===null||n===void 0?void 0:n.length)-1]);o.data.width=Math.abs(f?.data.x-u?.data.x)||10,o.data.height=Math.abs(a?.data.y-s?.data.y)||10,o.data.x=(u?.data.x||0)+o.data.width/2,o.data.y=(s?.data.y||0)+o.data.height/2}}),r.getAllNodes().forEach(e=>{e.data.dummy==="border"&&r.removeNode(e.id)})},jx=r=>{r.getAllEdges().forEach(e=>{if(e.source===e.target){let t=r.getNode(e.source);t.data.selfEdges||(t.data.selfEdges=[]),t.data.selfEdges.push(e),r.removeEdge(e.id)}})},Lx=r=>{let e=et(r);e?.forEach(t=>{let i=0;t?.forEach((n,o)=>{var s;let a=r.getNode(n);a.data.order=o+i,(s=a.data.selfEdges)===null||s===void 0||s.forEach(u=>{Gr(r,"selfedge",{width:u.data.width,height:u.data.height,rank:a.data.rank,order:o+ ++i,e:u},"_se")}),delete a.data.selfEdges})})},Fx=r=>{r.getAllNodes().forEach(e=>{let t=r.getNode(e.id);if(t.data.dummy==="selfedge"){let i=r.getNode(t.data.e.source),n=i.data.x+i.data.width/2,o=i.data.y,s=t.data.x-n,a=i.data.height/2;r.hasEdge(t.data.e.id)?r.updateEdgeData(t.data.e.id,t.data.e.data):r.addEdge({id:t.data.e.id,source:t.data.e.source,target:t.data.e.target,data:t.data.e.data}),r.removeNode(e.id),t.data.e.data.points=[{x:n+2*s/3,y:o-a},{x:n+5*s/6,y:o-a},{y:o,x:n+s},{x:n+5*s/6,y:o+a},{x:n+2*s/3,y:o+a}],t.data.e.data.x=t.data.x,t.data.e.data.y=t.data.y}})},rd=(r,e)=>{let t={};return e?.forEach(i=>{r[i]!==void 0&&(t[i]=+r[i])}),t},td=(r={})=>{let e={};return Object.keys(r).forEach(t=>{e[t.toLowerCase()]=r[t]}),e};var Xo={nodeSize:10,nodeSpacing:0,rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null},hi=class extends Ze{constructor(){super(...arguments),this.id="antv-dagre"}getDefaultOptions(){return Xo}layout(e){return Ne(this,void 0,void 0,function*(){let{nodeSize:t,nodeSpacing:i,align:n,rankdir:o="TB",ranksep:s,nodesep:a,edgeLabelSpace:u,ranker:f="tight-tree",nodeOrder:l,begin:m,controlPoints:_,radial:g,sortByCombo:w,preset:b,ranksepFunc:q,nodesepFunc:y}=e,x=ur(q,s??50,"node"),E=ur(y,a??50,"node"),N=E,M=x;(o==="LR"||o==="RL")&&(N=x,M=E);let A=new He({tree:[]}),T=this.model.nodes(),j=this.model.edges(),B=or(t,i,Xo.nodeSize,Xo.nodeSpacing);T.forEach(W=>{var H;let se=W._original,fe=B(se),be=M(se),Ee=N(se),ce=fe[0]+2*Ee,Ie=fe[1]+2*be,_e=(H=W.data)===null||H===void 0?void 0:H.layer;Me(_e)?A.addNode({id:W.id,data:{width:ce,height:Ie,layer:_e,originalWidth:fe[0],originalHeight:fe[1]}}):A.addNode({id:W.id,data:{width:ce,height:Ie,originalWidth:fe[0],originalHeight:fe[1]}})}),j.forEach(W=>{A.addEdge({id:W.id,source:W.source,target:W.target,data:{}})}),w&&(A.attachTreeStructure("combo"),T.forEach(W=>{let H=W?.parentId;H!==void 0&&A.hasNode(H)&&A.setParent(W.id,H,"combo")}));let z=null;b?.length&&(z=new He,b.forEach(W=>{z.addNode({id:W.id,data:W.data})})),id(A,{prevGraph:z,edgeLabelSpace:u,keepNodeOrder:!!l,nodeOrder:l||[],acyclicer:"greedy",ranker:f,rankdir:o,nodesep:a,align:n});let U=[0,0];if(m){let W=1/0,H=1/0;A.getAllNodes().forEach(se=>{W>se.data.x&&(W=se.data.x),H>se.data.y&&(H=se.data.y)}),A.getAllEdges().forEach(se=>{var fe;(fe=se.data.points)===null||fe===void 0||fe.forEach(be=>{W>be.x&&(W=be.x),H>be.y&&(H=be.y)})}),U[0]=m[0]-W,U[1]=m[1]-H}let V=o==="LR"||o==="RL";if(!g){let W=new Set,se=o==="BT"||o==="RL"?(ce,Ie)=>Ie-ce:(ce,Ie)=>ce-Ie;A.getAllNodes().forEach(ce=>{ce.data.x=ce.data.x+U[0],ce.data.y=ce.data.y+U[1],W.add(V?ce.data.x:ce.data.y)});let fe=Array.from(W).sort(se),be=V?(ce,Ie)=>ce.x!==Ie.x:(ce,Ie)=>ce.y!==Ie.y,Ee=V?(ce,Ie,_e)=>{let ae=Math.max(Ie.y,_e.y),Re=Math.min(Ie.y,_e.y);return ce.filter(F=>F.y<=ae&&F.y>=Re)}:(ce,Ie,_e)=>{let ae=Math.max(Ie.x,_e.x),Re=Math.min(Ie.x,_e.x);return ce.filter(F=>F.x<=ae&&F.x>=Re)};A.getAllEdges().forEach((ce,Ie)=>{var _e;u&&_&&ce.data.type!=="loop"&&(ce.data.controlPoints=zx((_e=ce.data.points)===null||_e===void 0?void 0:_e.map(({x:ae,y:Re})=>({x:ae+U[0],y:Re+U[1]})),A.getNode(ce.source),A.getNode(ce.target),fe,V,be,Ee))})}this.model.forEachNode(W=>{let H=A.getNode(W.id);if(H){let{x:se,y:fe,width:be,height:Ee,originalWidth:ce,originalHeight:Ie}=H.data,_e=w?A.getChildren(W.id,"combo"):A.getChildren(W.id);if(_e.length>0){let Re=1/0,F=-1/0,P=1/0,X=-1/0;_e.forEach(ve=>{let je=ve.id,Je=A.getNode(je);if(Je?.data){let Ye=Je.data.x,Be=Je.data.y,ye=Je.data.originalWidth||Je.data.width||0,Mr=Je.data.originalHeight||Je.data.height||0;Re=Math.min(Re,Ye-ye/2),F=Math.max(F,Ye+ye/2),P=Math.min(P,Be-Mr/2),X=Math.max(X,Be+Mr/2)}});let Q=20,oe=(F-Re||0)+Q*2,ge=(X-P||0)+Q*2;W.x=(Re+F)/2,W.y=(P+X)/2,W.size=[oe,ge]}else W.x=se,W.y=fe,W.size=[ce,Ie]}}),this.model.forEachEdge(W=>{let H=A.getEdge(W.id);H&&H.data.controlPoints&&(W.points=H.data.controlPoints.map(ai))})})}},zx=(r,e,t,i,n,o,s)=>{let a=r?.slice(1,r.length-1)||[];if(e&&t){let{x:u,y:f}=e.data,{x:l,y:m}=t.data;if(n&&(u=e.data.y,f=e.data.x,l=t.data.y,m=t.data.x),m!==f&&u!==l){let _=i.indexOf(f),g=i[_+1];if(g){let q=a[0],y=n?{x:(f+g)/2,y:q?.y||l}:{x:q?.x||l,y:(f+g)/2};(!q||o(q,y))&&a.unshift(y)}let w=i.indexOf(m),b=Math.abs(w-_);if(b===1)a=s(a,e.data,t.data),a.length||a.push(n?{x:(f+m)/2,y:u}:{x:u,y:(f+m)/2});else if(b>1){let q=i[w-1];if(q){let y=a[a.length-1],x=n?{x:(m+q)/2,y:y?.y||l}:{x:y?.x||u,y:(m+q)/2};(!y||o(y,x))&&a.push(x)}}}}return a};function gr(r,e,t=2){if(r.nodeCount()===1){let n=r.firstNode();n.x=e[0],n.y=e[1],t===3&&(n.z=e[2]||0)}}function Zo(r,e){let t=r.nodes();return t.sort(e),r.setNodeOrder(t),r}function St(r,e="desc"){return Zo(r,(t,i)=>{let n=r.degree(t.id),o=r.degree(i.id);return e==="asc"?n-o:o-n})}function Qo(r){return Zo(r,(e,t)=>{let i=e.id,n=t.id;return typeof i=="number"&&typeof n=="number"?i-n:String(i).localeCompare(String(n))})}function di(r,e){return Zo(r,(t,i)=>{let n=r.originalNode(t.id),o=r.originalNode(i.id);return e(n,o)})}function Xi(r,e=!1){let t=r.nodeCount();if(t===0)return r;let i=r.nodes(),n=[i[0]],o={};o[i[0].id]=!0;let s=0,a=0;return r.forEachNode(u=>{if(a!==0){let f=r.degree(u.id,"both"),l=a<t-1?r.degree(i[a+1].id,"both"):0,m=n[s].id,_=r.neighbors(m,"both").includes(u.id);if((a===t-1||f!==l||_)&&!o[u.id])n.push(u),o[u.id]=!0,s++;else{let g=e?r.successors(m):r.neighbors(m),w=!1;for(let q=0;q<g.length;q++){let y=g[q],x=r.node(y);if(x&&r.degree(y)===r.degree(u.id)&&!o[y]){n.push(x),o[y]=!0,w=!0;break}}let b=0;for(;!w&&(o[i[b].id]||(n.push(i[b]),o[i[b].id]=!0,w=!0),b++,b!==t););}}a++}),r.setNodeOrder(n),r}var Pe=r=>{let{width:e,height:t,center:i}=r,n=e??(typeof window<"u"?window.innerWidth:0),o=t??(typeof window<"u"?window.innerHeight:0),s=i??[n/2,o/2];return{width:n,height:o,center:s}};var Jo={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1,nodeSize:10,nodeSpacing:0},pi=class extends Ze{constructor(){super(...arguments),this.id="circular"}getDefaultOptions(){return Jo}layout(){return Ne(this,void 0,void 0,function*(){let{width:e,height:t,center:i}=Pe(this.options),n=this.model.nodeCount();if(!n||n===1){gr(this.model,i);return}let{ordering:o,nodeSpacing:s,nodeSize:a,endAngle:u=2*Math.PI,startAngle:f=0,divisions:l,angleRatio:m,clockwise:_}=this.options;o==="topology"?Xi(this.model,!1):o==="topology-directed"?Xi(this.model,!0):o==="degree"&&St(this.model,"asc");let{radius:g,startRadius:w,endRadius:b}=this.options,q=this.model.nodes(),y=or(a,s,Jo.nodeSize,Jo.nodeSpacing);if(s){let A=0;for(let T of q)A+=Math.max(...y(T._original));g=A/(2*Math.PI)}else!g&&!w&&!b?g=Math.min(t,e)/2:!w&&b?w=b:w&&!b&&(b=w);let E=(u-f)/n*m,N=Math.ceil(n/l),M=2*Math.PI/l;for(let A=0;A<n;){let T=q[A],j=g;!j&&w!==null&&b!==null&&(j=w+A*(b-w)/(n-1)),j||(j=10+A*100/(n-1));let B=Math.floor(A/N),U=A%N*E+M*B,V=f+U;_||(V=u-U),T.x=i[0]+Math.cos(V)*j,T.y=i[1]+Math.sin(V)*j,A++}})}};var Zi={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"},mi=class extends Ze{constructor(){super(...arguments),this.id="concentric"}getDefaultOptions(){return Zi}layout(){return Ne(this,void 0,void 0,function*(){let{width:e,height:t,center:i}=Pe(this.options),n=this.model.nodeCount();if(!n||n===1){gr(this.model,i);return}let{sortBy:o,maxLevelDiff:s,sweep:a,clockwise:u,equidistant:f,preventOverlap:l,startAngle:m=Zi.startAngle,nodeSize:_,nodeSpacing:g}=this.options,w=!o||o==="degree"?"degree":Te(o,["node"]);if(w==="degree")St(this.model);else{let T=(j,B)=>{let z=w(j),U=w(B);return z===U?0:z>U?-1:1};di(this.model,T)}let b=this.model.nodes(),q=new Map;for(let T of b){let j=w==="degree"?this.model.degree(T.id):w(T._original);q.set(T.id,j)}let y=this.model.firstNode(),x=s||q.get(y.id)/4,E=or(_,g,Zi.nodeSize,Zi.nodeSpacing),N=new Map;for(let T of b)N.set(T.id,Math.max(...E(T._original)));let M=[{nodes:[]}],A=M[0];for(let T=0;T<n;T++){let j=b[T];if(A.nodes.length>0){let B=A.nodes[0],z=Math.abs(q.get(B.id)-q.get(j.id));x&&z>=x&&(A={nodes:[]},M.push(A))}A.nodes.push(j)}for(let T of M){let j=T.nodes.map(B=>N.get(B.id));T.nodeSizes=j,T.maxNodeSize=Math.max(...j)}if(M.forEach(T=>{let j=a===void 0?2*Math.PI-2*Math.PI/T.nodes.length:a;T.dTheta=j/Math.max(1,T.nodes.length-1)}),l){let T=0;for(let j=0;j<M.length;j++){let B=M[j];if(B.nodes.length>1){let z=B.nodeSizes||[],U=0;for(let fe=0;fe<z.length-1;fe++)U=Math.max(U,(z[fe]+z[fe+1])/2);let V=Math.cos(B.dTheta)-Math.cos(0),W=Math.sin(B.dTheta)-Math.sin(0),H=Math.sqrt(V*V+W*W),se=H>0?U/H:0;T=Math.max(se,T)}if(B.r=T,j<M.length-1){let z=M[j+1],U=((B.maxNodeSize||0)+(z.maxNodeSize||0))/2;T+=Math.max(0,U)}}}else{let T=0;M[0].r=0;for(let z=0;z<M.length-1;z++){let U=M[z],V=M[z+1],W=((U.maxNodeSize||0)+(V.maxNodeSize||0))/2;T+=Math.max(0,W),V.r=T}let j=Math.min(e,t)/2,B=1;for(let z of M){let U=z.r||0;if(U<=0)continue;let V=j-(z.maxNodeSize||0);if(V<=0){B=0;break}B=Math.min(B,V/U)}if(B=Math.max(0,Math.min(1,B)),B!==1)for(let z of M)z.r=(z.r||0)*B}if(f){let T=0,j=0;for(let B=0;B<M.length;B++){let U=(M[B].r||0)-j;T=Math.max(T,U)}j=0,M.forEach((B,z)=>{z===0&&(j=B.r||0),B.r=j,j+=T})}M.forEach(T=>{let j=T.dTheta||0,B=T.r||0;T.nodes.forEach((z,U)=>{let V=m+(u?1:-1)*j*U;z.x=i[0]+B*Math.cos(V),z.y=i[1]+B*Math.sin(V)})})})}};var nd=(function(r,e,t){for(var i=0,n=bt(e)?e.split("."):e;r&&i<n.length;)r=r[n[i++]];return r===void 0||i<n.length?t:r});var Qi=(function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"});var od=(function(r,e,t){var i=r,n=bt(e)?e.split("."):e;return n.forEach(function(o,s){s<n.length-1?(Qi(i[o])||(i[o]=Me(n[s+1])?[]:{}),i=i[o]):i[o]=t}),r});function Dx(r,e){let t=String(e).split(".");return nd(r,t)}function Bx(r,e,t){let i=String(e).split(".");od(r,i,t)}function Jr(r,...e){return e.forEach(t=>{t&&Object.keys(t).forEach(i=>{let n=t[i];n!==void 0&&(r[i]=n)})}),r}function sd(){let r=1;return()=>(r=(1664525*r+1013904223)%4294967296)/4294967296}var Lt=0,_i=0,gi=0,ud=1e3,Ji,vi,Hi=0,Nt=0,en=0,yi=typeof performance=="object"&&performance.now?performance:Date,fd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function cd(){return Nt||(fd(Gx),Nt=yi.now()+en)}function Gx(){Nt=0}function Ho(){this._call=this._time=this._next=null}Ho.prototype=qi.prototype={constructor:Ho,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?cd():+t)+(e==null?0:+e),!this._next&&vi!==this&&(vi?vi._next=this:Ji=this,vi=this),this._call=r,this._time=t,es()},stop:function(){this._call&&(this._call=null,this._time=1/0,es())}};function qi(r,e,t){var i=new Ho;return i.restart(r,e,t),i}function Ux(){cd(),++Lt;for(var r=Ji,e;r;)(e=Nt-r._time)>=0&&r._call.call(void 0,e),r=r._next;--Lt}function ad(){Nt=(Hi=yi.now())+en,Lt=_i=0;try{Ux()}finally{Lt=0,Vx(),Nt=0}}function $x(){var r=yi.now(),e=r-Hi;e>ud&&(en-=e,Hi=r)}function Vx(){for(var r,e=Ji,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:Ji=t);vi=r,es(i)}function es(r){if(!Lt){_i&&(_i=clearTimeout(_i));var e=r-Nt;e>24?(r<1/0&&(_i=setTimeout(ad,r-yi.now()-en)),gi&&(gi=clearInterval(gi))):(gi||(Hi=yi.now(),gi=setInterval($x,ud)),Lt=1,fd(ad))}}var Wx={value:()=>{}};function wi(){for(var r=0,e=arguments.length,t={},i;r<e;++r){if(!(i=arguments[r]+"")||i in t||/[\s.]/.test(i))throw new Error("illegal type: "+i);t[i]=[]}return new rn(t)}function rn(r){this._=r}function Kx(r,e){return r.trim().split(/^|\s+/).map(function(t){var i="",n=t.indexOf(".");if(n>=0&&(i=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}rn.prototype=wi.prototype={constructor:rn,on:function(r,e){var t=this._,i=Kx(r+"",t),n,o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((n=(r=i[o]).type)&&(n=Yx(t[n],r.name)))return n;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(r=i[o]).type)t[n]=ld(t[n],r.name,e);else if(e==null)for(n in t)t[n]=ld(t[n],r.name,null);return this},copy:function(){var r={},e=this._;for(var t in e)r[t]=e[t].slice();return new rn(r)},call:function(r,e){if((n=arguments.length-2)>0)for(var t=new Array(n),i=0,n,o;i<n;++i)t[i]=arguments[i+2];if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(o=this._[r],i=0,n=o.length;i<n;++i)o[i].value.apply(e,t)},apply:function(r,e,t){if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(var i=this._[r],n=0,o=i.length;n<o;++n)i[n].value.apply(e,t)}};function Yx(r,e){for(var t=0,i=r.length,n;t<i;++t)if((n=r[t]).name===e)return n.value}function ld(r,e,t){for(var i=0,n=r.length;i<n;++i)if(r[i].name===e){r[i]=Wx,r=r.slice(0,i).concat(r.slice(i+1));break}return t!=null&&r.push({name:e,value:t}),r}function hd(r){return r.x}function dd(r){return r.y}var Xx=10,Zx=Math.PI*(3-Math.sqrt(5));function tn(r){var e,t=1,i=.001,n=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=qi(m),f=wi("tick","end"),l=sd();r==null&&(r=[]);function m(){_(),f.call("tick",e),t<i&&(u.stop(),f.call("end",e))}function _(b){var q,y=r.length,x;b===void 0&&(b=1);for(var E=0;E<b;++E)for(t+=(o-t)*n,a.forEach(function(N){N(t)}),q=0;q<y;++q)x=r[q],x.fx==null?x.x+=x.vx*=s:(x.x=x.fx,x.vx=0),x.fy==null?x.y+=x.vy*=s:(x.y=x.fy,x.vy=0);return e}function g(){for(var b=0,q=r.length,y;b<q;++b){if(y=r[b],y.index=b,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var x=Xx*Math.sqrt(.5+b),E=b*Zx;y.x=x*Math.cos(E),y.y=x*Math.sin(E)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function w(b){return b.initialize&&b.initialize(r,l),b}return g(),e={tick:_,restart:function(){return u.restart(m),e},stop:function(){return u.stop(),e},nodes:function(b){return arguments.length?(r=b,g(),a.forEach(w),e):r},alpha:function(b){return arguments.length?(t=+b,e):t},alphaMin:function(b){return arguments.length?(i=+b,e):i},alphaDecay:function(b){return arguments.length?(n=+b,e):+n},alphaTarget:function(b){return arguments.length?(o=+b,e):o},velocityDecay:function(b){return arguments.length?(s=1-b,e):1-s},randomSource:function(b){return arguments.length?(l=b,a.forEach(w),e):l},force:function(b,q){return arguments.length>1?(q==null?a.delete(b):a.set(b,w(q)),e):a.get(b)},find:function(b,q,y){var x=0,E=r.length,N,M,A,T,j;for(y==null?y=1/0:y*=y,x=0;x<E;++x)T=r[x],N=b-T.x,M=q-T.y,A=N*N+M*M,A<y&&(j=T,y=A);return j},on:function(b,q){return arguments.length>1?(f.on(b,q),e):f.on(b)}}}function ze(r){return function(){return r}}function nn(r){var e=ze(.1),t,i,n;typeof r!="function"&&(r=ze(r==null?0:+r));function o(a){for(var u=0,f=t.length,l;u<f;++u)l=t[u],l.vx+=(n[u]-l.x)*i[u]*a}function s(){if(t){var a,u=t.length;for(i=new Array(u),n=new Array(u),a=0;a<u;++a)i[a]=isNaN(n[a]=+r(t[a],a,t))?0:+e(t[a],a,t)}}return o.initialize=function(a){t=a,s()},o.strength=function(a){return arguments.length?(e=typeof a=="function"?a:ze(+a),s(),o):e},o.x=function(a){return arguments.length?(r=typeof a=="function"?a:ze(+a),s(),o):r},o}function on(r){var e=ze(.1),t,i,n;typeof r!="function"&&(r=ze(r==null?0:+r));function o(a){for(var u=0,f=t.length,l;u<f;++u)l=t[u],l.vy+=(n[u]-l.y)*i[u]*a}function s(){if(t){var a,u=t.length;for(i=new Array(u),n=new Array(u),a=0;a<u;++a)i[a]=isNaN(n[a]=+r(t[a],a,t))?0:+e(t[a],a,t)}}return o.initialize=function(a){t=a,s()},o.strength=function(a){return arguments.length?(e=typeof a=="function"?a:ze(+a),s(),o):e},o.y=function(a){return arguments.length?(r=typeof a=="function"?a:ze(+a),s(),o):r},o}function jr(r){return(r()-.5)*1e-6}function pd(r){let e=+this._x.call(null,r),t=+this._y.call(null,r);return md(this.cover(e,t),e,t,r)}function md(r,e,t,i){if(isNaN(e)||isNaN(t))return r;var n,o=r._root,s={data:i},a=r._x0,u=r._y0,f=r._x1,l=r._y1,m,_,g,w,b,q,y,x;if(!o)return r._root=s,r;for(;o.length;)if((b=e>=(m=(a+f)/2))?a=m:f=m,(q=t>=(_=(u+l)/2))?u=_:l=_,n=o,!(o=o[y=q<<1|b]))return n[y]=s,r;if(g=+r._x.call(null,o.data),w=+r._y.call(null,o.data),e===g&&t===w)return s.next=o,n?n[y]=s:r._root=s,r;do n=n?n[y]=new Array(4):r._root=new Array(4),(b=e>=(m=(a+f)/2))?a=m:f=m,(q=t>=(_=(u+l)/2))?u=_:l=_;while((y=q<<1|b)===(x=(w>=_)<<1|g>=m));return n[x]=o,n[y]=s,r}function gd(r){var e,t,i=r.length,n,o,s=new Array(i),a=new Array(i),u=1/0,f=1/0,l=-1/0,m=-1/0;for(t=0;t<i;++t)isNaN(n=+this._x.call(null,e=r[t]))||isNaN(o=+this._y.call(null,e))||(s[t]=n,a[t]=o,n<u&&(u=n),n>l&&(l=n),o<f&&(f=o),o>m&&(m=o));if(u>l||f>m)return this;for(this.cover(u,f).cover(l,m),t=0;t<i;++t)md(this,s[t],a[t],r[t]);return this}function _d(r,e){if(isNaN(r=+r)||isNaN(e=+e))return this;var t=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(t))n=(t=Math.floor(r))+1,o=(i=Math.floor(e))+1;else{for(var s=n-t||1,a=this._root,u,f;t>r||r>=n||i>e||e>=o;)switch(f=(e<i)<<1|r<t,u=new Array(4),u[f]=a,a=u,s*=2,f){case 0:n=t+s,o=i+s;break;case 1:t=n-s,o=i+s;break;case 2:n=t+s,i=o-s;break;case 3:t=n-s,i=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=t,this._y0=i,this._x1=n,this._y1=o,this}function vd(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}function yd(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function fr(r,e,t,i,n){this.node=r,this.x0=e,this.y0=t,this.x1=i,this.y1=n}function qd(r,e,t){var i,n=this._x0,o=this._y0,s,a,u,f,l=this._x1,m=this._y1,_=[],g=this._root,w,b;for(g&&_.push(new fr(g,n,o,l,m)),t==null?t=1/0:(n=r-t,o=e-t,l=r+t,m=e+t,t*=t);w=_.pop();)if(!(!(g=w.node)||(s=w.x0)>l||(a=w.y0)>m||(u=w.x1)<n||(f=w.y1)<o))if(g.length){var q=(s+u)/2,y=(a+f)/2;_.push(new fr(g[3],q,y,u,f),new fr(g[2],s,y,q,f),new fr(g[1],q,a,u,y),new fr(g[0],s,a,q,y)),(b=(e>=y)<<1|r>=q)&&(w=_[_.length-1],_[_.length-1]=_[_.length-1-b],_[_.length-1-b]=w)}else{var x=r-+this._x.call(null,g.data),E=e-+this._y.call(null,g.data),N=x*x+E*E;if(N<t){var M=Math.sqrt(t=N);n=r-M,o=e-M,l=r+M,m=e+M,i=g.data}}return i}function wd(r){if(isNaN(l=+this._x.call(null,r))||isNaN(m=+this._y.call(null,r)))return this;var e,t=this._root,i,n,o,s=this._x0,a=this._y0,u=this._x1,f=this._y1,l,m,_,g,w,b,q,y;if(!t)return this;if(t.length)for(;;){if((w=l>=(_=(s+u)/2))?s=_:u=_,(b=m>=(g=(a+f)/2))?a=g:f=g,e=t,!(t=t[q=b<<1|w]))return this;if(!t.length)break;(e[q+1&3]||e[q+2&3]||e[q+3&3])&&(i=e,y=q)}for(;t.data!==r;)if(n=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,n?(o?n.next=o:delete n.next,this):e?(o?e[q]=o:delete e[q],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[y]=t:this._root=t),this):(this._root=o,this)}function bd(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}function xd(){return this._root}function Ed(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}function Sd(r){var e=[],t,i=this._root,n,o,s,a,u;for(i&&e.push(new fr(i,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!r(i=t.node,o=t.x0,s=t.y0,a=t.x1,u=t.y1)&&i.length){var f=(o+a)/2,l=(s+u)/2;(n=i[3])&&e.push(new fr(n,f,l,a,u)),(n=i[2])&&e.push(new fr(n,o,l,f,u)),(n=i[1])&&e.push(new fr(n,f,s,a,l)),(n=i[0])&&e.push(new fr(n,o,s,f,l))}return this}function Nd(r){var e=[],t=[],i;for(this._root&&e.push(new fr(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var n=i.node;if(n.length){var o,s=i.x0,a=i.y0,u=i.x1,f=i.y1,l=(s+u)/2,m=(a+f)/2;(o=n[0])&&e.push(new fr(o,s,a,l,m)),(o=n[1])&&e.push(new fr(o,l,a,u,m)),(o=n[2])&&e.push(new fr(o,s,m,l,f)),(o=n[3])&&e.push(new fr(o,l,m,u,f))}t.push(i)}for(;i=t.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Md(r){return r[0]}function Id(r){return arguments.length?(this._x=r,this):this._x}function Rd(r){return r[1]}function Ad(r){return arguments.length?(this._y=r,this):this._y}function Nr(r,e,t){var i=new rs(e??Md,t??Rd,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}function rs(r,e,t,i,n,o){this._x=r,this._y=e,this._x0=t,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}function Od(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}var _r=Nr.prototype=rs.prototype;_r.copy=function(){var r=new rs(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,i;if(!e)return r;if(!e.length)return r._root=Od(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(4)}):e.target[n]=Od(i));return r};_r.add=pd;_r.addAll=gd;_r.cover=_d;_r.data=vd;_r.extent=yd;_r.find=qd;_r.remove=wd;_r.removeAll=bd;_r.root=xd;_r.size=Ed;_r.visit=Sd;_r.visitAfter=Nd;_r.x=Id;_r.y=Ad;function Qx(r){return r.x+r.vx}function Jx(r){return r.y+r.vy}function sn(r){var e,t,i,n=1,o=1;typeof r!="function"&&(r=ze(r==null?1:+r));function s(){for(var f,l=e.length,m,_,g,w,b,q,y=0;y<o;++y)for(m=Nr(e,Qx,Jx).visitAfter(a),f=0;f<l;++f)_=e[f],b=t[_.index],q=b*b,g=_.x+_.vx,w=_.y+_.vy,m.visit(x);function x(E,N,M,A,T){var j=E.data,B=E.r,z=b+B;if(j){if(j.index>_.index){var U=g-j.x-j.vx,V=w-j.y-j.vy,W=U*U+V*V;W<z*z&&(U===0&&(U=jr(i),W+=U*U),V===0&&(V=jr(i),W+=V*V),W=(z-(W=Math.sqrt(W)))/W*n,_.vx+=(U*=W)*(z=(B*=B)/(q+B)),_.vy+=(V*=W)*z,j.vx-=U*(z=1-z),j.vy-=V*z)}return}return N>g+z||A<g-z||M>w+z||T<w-z}}function a(f){if(f.data)return f.r=t[f.data.index];for(var l=f.r=0;l<4;++l)f[l]&&f[l].r>f.r&&(f.r=f[l].r)}function u(){if(e){var f,l=e.length,m;for(t=new Array(l),f=0;f<l;++f)m=e[f],t[m.index]=+r(m,f,e)}}return s.initialize=function(f,l){e=f,i=l,u()},s.iterations=function(f){return arguments.length?(o=+f,s):o},s.strength=function(f){return arguments.length?(n=+f,s):n},s.radius=function(f){return arguments.length?(r=typeof f=="function"?f:ze(+f),u(),s):r},s}function an(){var r,e,t,i,n=ze(-30),o,s=1,a=1/0,u=.81;function f(g){var w,b=r.length,q=Nr(r,hd,dd).visitAfter(m);for(i=g,w=0;w<b;++w)e=r[w],q.visit(_)}function l(){if(r){var g,w=r.length,b;for(o=new Array(w),g=0;g<w;++g)b=r[g],o[b.index]=+n(b,g,r)}}function m(g){var w=0,b,q,y=0,x,E,N;if(g.length){for(x=E=N=0;N<4;++N)(b=g[N])&&(q=Math.abs(b.value))&&(w+=b.value,y+=q,x+=q*b.x,E+=q*b.y);g.x=x/y,g.y=E/y}else{b=g,b.x=b.data.x,b.y=b.data.y;do w+=o[b.data.index];while(b=b.next)}g.value=w}function _(g,w,b,q){if(!g.value)return!0;var y=g.x-e.x,x=g.y-e.y,E=q-w,N=y*y+x*x;if(E*E/u<N)return N<a&&(y===0&&(y=jr(t),N+=y*y),x===0&&(x=jr(t),N+=x*x),N<s&&(N=Math.sqrt(s*N)),e.vx+=y*g.value*i/N,e.vy+=x*g.value*i/N),!0;if(g.length||N>=a)return;(g.data!==e||g.next)&&(y===0&&(y=jr(t),N+=y*y),x===0&&(x=jr(t),N+=x*x),N<s&&(N=Math.sqrt(s*N)));do g.data!==e&&(E=o[g.data.index]*i/N,e.vx+=y*E,e.vy+=x*E);while(g=g.next)}return f.initialize=function(g,w){r=g,t=w,l()},f.strength=function(g){return arguments.length?(n=typeof g=="function"?g:ze(+g),l(),f):n},f.distanceMin=function(g){return arguments.length?(s=g*g,f):Math.sqrt(s)},f.distanceMax=function(g){return arguments.length?(a=g*g,f):Math.sqrt(a)},f.theta=function(g){return arguments.length?(u=g*g,f):Math.sqrt(u)},f}function Hx(r){return r.index}function Cd(r,e){var t=r.get(e);if(!t)throw new Error("node not found: "+e);return t}function un(r){var e=Hx,t=m,i,n=ze(30),o,s,a,u,f,l=1;r==null&&(r=[]);function m(q){return 1/Math.min(a[q.source.index],a[q.target.index])}function _(q){for(var y=0,x=r.length;y<l;++y)for(var E=0,N,M,A,T,j,B,z;E<x;++E)N=r[E],M=N.source,A=N.target,T=A.x+A.vx-M.x-M.vx||jr(f),j=A.y+A.vy-M.y-M.vy||jr(f),B=Math.sqrt(T*T+j*j),B=(B-o[E])/B*q*i[E],T*=B,j*=B,A.vx-=T*(z=u[E]),A.vy-=j*z,M.vx+=T*(z=1-z),M.vy+=j*z}function g(){if(s){var q,y=s.length,x=r.length,E=new Map(s.map((M,A)=>[e(M,A,s),M])),N;for(q=0,a=new Array(y);q<x;++q)N=r[q],N.index=q,typeof N.source!="object"&&(N.source=Cd(E,N.source)),typeof N.target!="object"&&(N.target=Cd(E,N.target)),a[N.source.index]=(a[N.source.index]||0)+1,a[N.target.index]=(a[N.target.index]||0)+1;for(q=0,u=new Array(x);q<x;++q)N=r[q],u[q]=a[N.source.index]/(a[N.source.index]+a[N.target.index]);i=new Array(x),w(),o=new Array(x),b()}}function w(){if(s)for(var q=0,y=r.length;q<y;++q)i[q]=+t(r[q],q,r)}function b(){if(s)for(var q=0,y=r.length;q<y;++q)o[q]=+n(r[q],q,r)}return _.initialize=function(q,y){s=q,f=y,g()},_.links=function(q){return arguments.length?(r=q,g(),_):r},_.id=function(q){return arguments.length?(e=q,_):e},_.iterations=function(q){return arguments.length?(l=+q,_):l},_.strength=function(q){return arguments.length?(t=typeof q=="function"?q:ze(+q),w(),_):t},_.distance=function(q){return arguments.length?(n=typeof q=="function"?q:ze(+q),b(),_):n},_}var fn=(r,e)=>r[e];function Td(){function r(F){return()=>F}let e=F=>F.cluster,t=r(1),i=r(-1),n=r(100),o=r(.1),s=[0,0],a=[],u={},f=[],l=100,m=100,_={none:{x:0,y:0}},g=[],w,b="force",q=!0,y=.1;function x(F){if(!q)return x;w.tick(),j();for(let P=0,X=a.length,Q,oe=F*y;P<X;++P)Q=a[P],Q.vx||(Q.vx=0),Q.vy||(Q.vy=0),Q.vx+=(_[e(Q._original)].x-Q.x)*oe,Q.vy+=(_[e(Q._original)].y-Q.y)*oe}function E(){a&&N()}function N(){if(!a||!a.length)return;let F=a[0];if(e(F._original)===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");let P=M();w=tn(P.nodes).force("x",nn(l).strength(.1)).force("y",on(m).strength(.1)).force("collide",sn(X=>X.r).iterations(4)).force("charge",an().strength(i)).force("links",un(P.nodes.length?P.links:[]).distance(n).strength(o)),g=w.nodes(),j()}function M(){let F=[],P=[],X={},Q=[],oe={},ge=[];return oe=A(a),ge=T(f),Q=Object.keys(oe),Q.forEach((ve,je)=>{let Je=oe[ve];F.push({id:ve,size:Je.count,r:Math.sqrt(Je.sumforceNodeSize/Math.PI)}),X[ve]=je}),ge.forEach(ve=>{let je=fn(ve,"source"),Je=fn(ve,"target"),Ye=X[je],Be=X[Je];Ye!==void 0&&Be!==void 0&&P.push({source:Ye,target:Be,count:ve.count})}),{nodes:F,links:P}}function A(F){let P={};return F.forEach(X=>{let Q=e(X._original);P[Q]||(P[Q]={count:0,sumforceNodeSize:0})}),F.forEach(X=>{let Q=e(X._original),oe=t(X._original),ge=P[Q];ge.count=ge.count+1,ge.sumforceNodeSize=ge.sumforceNodeSize+Math.PI*(oe*oe)*1.3,P[Q]=ge}),P}function T(F){let P={},X=[];return F.forEach(oe=>{let ge=B(oe),ve=0;P[ge]!==void 0&&(ve=P[ge]),ve+=1,P[ge]=ve}),Object.entries(P).forEach(([oe,ge])=>{let ve=oe.split("~")[0],je=oe.split("~")[1];ve!==void 0&&je!==void 0&&X.push({source:ve,target:je,count:ge})}),X}function j(){return _={none:{x:0,y:0}},g.forEach(F=>{_[F.id]={x:F.x-s[0],y:F.y-s[1]}}),_}function B(F){let P=fn(F,"source"),X=fn(F,"target"),Q=e(u[P]._original),oe=e(u[X]._original);return Q<=oe?`${Q}~${oe}`:`${oe}~${Q}`}function z(F){u={},F.forEach(P=>{u[P.id]=P})}function U(F){return arguments.length?(b=F,E(),x):b}function V(F){return arguments.length?typeof F=="string"?(e=P=>P[F],x):(e=F,x):e}function W(F){return arguments.length?(q=F,x):q}function H(F){return arguments.length?(y=F,x):y}function se(F){return arguments.length?(l=F,x):l}function fe(F){return arguments.length?(m=F,x):m}function be(F){return arguments.length?(z(F||[]),a=F||[],x):a}function Ee(F){return arguments.length?(f=F||[],E(),x):f}function ce(F){return arguments.length?(typeof F=="function"?t=F:t=r(+F),E(),x):t}function Ie(F){return arguments.length?(typeof F=="function"?i=F:i=r(+F),E(),x):i}function _e(F){return arguments.length?(typeof F=="function"?n=F:n=r(+F),E(),x):n}function ae(F){return arguments.length?(typeof F=="function"?o=F:o=r(+F),E(),x):o}function Re(F){return arguments.length?(s=F,x):s}return x.initialize=F=>{a=F,E()},x.template=U,x.groupBy=V,x.enableGrouping=W,x.strength=H,x.centerX=se,x.centerY=fe,x.nodes=be,x.links=Ee,x.forceNodeSize=ce,x.nodeSize=x.forceNodeSize,x.forceCharge=Ie,x.forceLinkDistance=_e,x.forceLinkStrength=ae,x.offset=Re,x.getFocis=j,x}var kd=function(r){return typeof r=="object"&&r!==null};var eE={}.toString,cn=function(r,e){return eE.call(r)==="[object "+e+"]"};var bi=function(r){if(!kd(r)||!cn(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e};var rE=5;function tE(r,e){if(Object.hasOwn)return Object.hasOwn(r,e);if(r==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(r),e)}function Pd(r,e,t,i){t=t||0,i=i||rE;for(var n in e)if(tE(e,n)){var o=e[n];o!==null&&bi(o)?(bi(r[n])||(r[n]={}),t<i?Pd(r[n],o,t+1,i):r[n]=e[n]):jt(o)?(r[n]=[],r[n]=r[n].concat(o)):o!==void 0&&(r[n]=o)}}var jd=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var i=0;i<e.length;i+=1)Pd(r,e[i]);return r};function Ld(r,e){var t,i=1;r==null&&(r=0),e==null&&(e=0);function n(){var o,s=t.length,a,u=0,f=0;for(o=0;o<s;++o)a=t[o],u+=a.x,f+=a.y;for(u=(u/s-r)*i,f=(f/s-e)*i,o=0;o<s;++o)a=t[o],a.x-=u,a.y-=f}return n.initialize=function(o){t=o},n.x=function(o){return arguments.length?(r=+o,n):r},n.y=function(o){return arguments.length?(e=+o,n):e},n.strength=function(o){return arguments.length?(i=+o,n):i},n}function Fd(r,e,t){var i,n=ze(.1),o,s;typeof r!="function"&&(r=ze(+r)),e==null&&(e=0),t==null&&(t=0);function a(f){for(var l=0,m=i.length;l<m;++l){var _=i[l],g=_.x-e||1e-6,w=_.y-t||1e-6,b=Math.sqrt(g*g+w*w),q=(s[l]-b)*o[l]*f/b;_.vx+=g*q,_.vy+=w*q}}function u(){if(i){var f,l=i.length;for(o=new Array(l),s=new Array(l),f=0;f<l;++f)s[f]=+r(i[f],f,i),o[f]=isNaN(s[f])?0:+n(i[f],f,i)}}return a.initialize=function(f){i=f,u()},a.strength=function(f){return arguments.length?(n=typeof f=="function"?f:ze(+f),u(),a):n},a.radius=function(f){return arguments.length?(r=typeof f=="function"?f:ze(+f),u(),a):r},a.x=function(f){return arguments.length?(e=+f,a):e},a.y=function(f){return arguments.length?(t=+f,a):t},a}var ts={edgeId:"edge.id",manyBody:{strength:-30},preventOverlap:!1,nodeSize:10,nodeSpacing:0,x:!1,y:!1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10},Mt=class extends Br{getDefaultOptions(){return ts}mergeOptions(e,t){return jd({},e,t)}constructor(e){super(e),this.id="d3-force",this.d3Nodes=[],this.d3Edges=[],this.config={simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}stop(){return this.simulation&&this.simulation.stop(),this}tick(e=1){var t,i;if(this.simulation){for(let n=0;n<e;n++)this.simulation.tick();this.syncPositionsFromD3(),(i=(t=this.options).onTick)===null||i===void 0||i.call(t,this)}return this}restart(e){return this.simulation&&(e!==void 0&&this.simulation.alpha(e),this.simulation.restart()),this}reheat(){return this.restart(1)}getAlpha(){var e,t;return(t=(e=this.simulation)===null||e===void 0?void 0:e.alpha())!==null&&t!==void 0?t:0}setAlpha(e){return this.simulation&&this.simulation.alpha(e),this}getForce(e){var t;return(t=this.simulation)===null||t===void 0?void 0:t.force(e)}force(e,t){return this.simulation&&this.simulation.force(e,t),this}nodes(){var e,t;return(t=(e=this.simulation)===null||e===void 0?void 0:e.nodes())!==null&&t!==void 0?t:[]}find(e,t,i){if(this.simulation)return this.simulation.find(e,t,i)}setFixedPosition(e,t){let i=this.d3Nodes.find(s=>s.id===e),n=this.model.node(e);if(!n||!i)return;let o=["fx","fy","fz"];if(t===null){o.forEach(s=>{delete n[s],delete i[s]});return}t.forEach((s,a)=>{a<o.length&&(typeof s=="number"||s===null)&&(n[o[a]]=s,i[o[a]]=s)})}parseOptions(e){let t=e;return t.iterations===void 0&&(t.link&&t.link.iterations===void 0&&(t.iterations=t.link.iterations),t.collide&&t.collide.iterations===void 0&&(t.iterations=t.collide.iterations)),t}layout(){var e;return Ne(this,void 0,void 0,function*(){let t=this.parseOptions(this.options||{});this.createD3Copies();let i=this.setSimulation(t);return i.nodes(this.d3Nodes),(e=i.force("link"))===null||e===void 0||e.links(this.d3Edges),new Promise(n=>{i.on("end",()=>{this.syncPositionsFromD3(),n()})})})}createD3Copies(){this.d3Nodes=[],this.d3Edges=[],this.model.forEachNode(e=>{this.d3Nodes.push(Object.assign({},e))}),this.model.forEachEdge(e=>{this.d3Edges.push(Object.assign({},e))})}syncPositionsFromD3(){this.d3Nodes.forEach(e=>{let t=this.model.node(e.id);t&&(t.x=e.x,t.y=e.y,e.z!==void 0&&(t.z=e.z),e.fx!==void 0&&(t.fx=e.fx),e.fy!==void 0&&(t.fy=e.fy),e.fz!==void 0&&(t.fz=e.fz),e.vx!==void 0&&(t.vx=e.vx),e.vy!==void 0&&(t.vy=e.vy),e.vz!==void 0&&(t.vz=e.vz))})}initSimulation(){return tn()}setSimulation(e){let t=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=t.on("tick",()=>{var i;this.syncPositionsFromD3(),(i=e.onTick)===null||i===void 0||i.call(e,this)})),Lr(t,this.config.simulationAttrs.map(i=>[i,e[i]])),this.setupForces(t,e),t}setupForces(e,t){this.setupLinkForce(e,t),this.setupManyBodyForce(e,t),this.setupCenterForce(e,t),this.setupCollisionForce(e,t),this.setupXForce(e,t),this.setupYForce(e,t),this.setupRadialForce(e,t),this.setupClusterForce(e,t)}getCenterOptions(e){if(e.center===!1)return;let t=Pe({width:e.width,height:e.height});return Jr({},e.center||{},{x:t.width/2,y:t.height/2,strength:e.centerStrength})}setupCenterForce(e,t){let i=this.getCenterOptions(t);if(i){let n=e.force("center");n||(n=Ld(i.x,i.y),e.force("center",n));let o=[];i.x!==void 0&&o.push(["x",i.x]),i.y!==void 0&&o.push(["y",i.y]),i.strength!==void 0&&o.push(["strength",i.strength]),Lr(n,o)}else e.force("center",null)}getManyBodyOptions(e){if(e.manyBody!==!1)return Jr({},e.manyBody||{},{strength:e.nodeStrength?Te(e.nodeStrength,["node"]):void 0,distanceMin:e.distanceMin,distanceMax:e.distanceMax,theta:e.theta})}setupManyBodyForce(e,t){let i=this.getManyBodyOptions(t);if(i){let n=e.force("charge");n||(n=an(),e.force("charge",n));let o=[];i.strength!==void 0&&o.push(["strength",i.strength]),i.distanceMin!==void 0&&o.push(["distanceMin",i.distanceMin]),i.distanceMax!==void 0&&o.push(["distanceMax",i.distanceMax]),i.theta!==void 0&&o.push(["theta",i.theta]),Lr(n,o)}else e.force("charge",null)}getLinkOptions(e){if(e.link!==!1)return Jr({},e.link||{},{id:e.edgeId?Te(e.edgeId,["edge"]):void 0,distance:e.linkDistance?Te(e.linkDistance,["edge"]):void 0,strength:e.edgeStrength?Te(e.edgeStrength,["edge"]):void 0,iterations:e.edgeIterations})}setupLinkForce(e,t){let i=this.model.edges(),n=this.getLinkOptions(t);if(i.length>0&&n){let o=e.force("link");o||(o=un(),e.force("link",o));let s=[];n.id!==void 0&&s.push(["id",n.id]),n.distance!==void 0&&s.push(["distance",n.distance]),n.strength!==void 0&&s.push(["strength",n.strength]),n.iterations!==void 0&&s.push(["iterations",n.iterations]),Lr(o,s)}else e.force("link",null)}getCollisionOptions(e){if(e.preventOverlap===!1&&(e.collide===!1||e.collide===void 0))return;let t=or(e.nodeSize,e.nodeSpacing,ts.nodeSize,ts.nodeSpacing),i=n=>Math.max(...t(n._original))/2;return Jr({},e.collide||{},{radius:e.collide&&e.collide.radius||i,strength:e.collideStrength,iterations:e.collideIterations})}setupCollisionForce(e,t){let i=this.getCollisionOptions(t);if(i){let n=e.force("collide");n||(n=sn(),e.force("collide",n));let o=[];i.radius!==void 0&&o.push(["radius",i.radius]),i.strength!==void 0&&o.push(["strength",i.strength]),i.iterations!==void 0&&o.push(["iterations",i.iterations]),Lr(n,o)}else e.force("collide",null)}getXForceOptions(e){var t;if(e.x===!1)return;let i=this.getCenterOptions(e);return Jr({},e.x||{},{x:(t=e.forceXPosition)!==null&&t!==void 0?t:i&&i.x,strength:e.forceXStrength})}setupXForce(e,t){let i=this.getXForceOptions(t);if(i){let n=e.force("x");n||(n=nn(),e.force("x",n));let o=[];i.x!==void 0&&o.push(["x",i.x]),i.strength!==void 0&&o.push(["strength",i.strength]),Lr(n,o)}else e.force("x",null)}getYForceOptions(e){var t;if(e.y===!1)return;let i=this.getCenterOptions(e);return Jr({},e.y||{},{y:(t=e.forceYPosition)!==null&&t!==void 0?t:i&&i.y,strength:e.forceYStrength})}setupYForce(e,t){let i=this.getYForceOptions(t);if(i){let n=e.force("y");n||(n=on(),e.force("y",n));let o=[];i.y!==void 0&&o.push(["y",i.y]),i.strength!==void 0&&o.push(["strength",i.strength]),Lr(n,o)}else e.force("y",null)}getRadialOptions(e){var t,i,n;if(e.radial!==void 0||e.radialStrength!==void 0||e.radialRadius!==void 0||e.radialX!==void 0||e.radialY!==void 0){let o=this.getCenterOptions(e);return Jr({},e.radial||{},{strength:e.radialStrength,radius:(t=e.radialRadius)!==null&&t!==void 0?t:100,x:(i=e.radialX)!==null&&i!==void 0?i:o&&o.x,y:(n=e.radialY)!==null&&n!==void 0?n:o&&o.y})}}setupRadialForce(e,t){let i=this.getRadialOptions(t);if(i){let n=e.force("radial");n||(n=Fd(i.radius||100,i.x,i.y),e.force("radial",n));let o=[];i.radius!==void 0&&o.push(["radius",i.radius]),i.strength!==void 0&&o.push(["strength",i.strength]),i.x!==void 0&&o.push(["x",i.x]),i.y!==void 0&&o.push(["y",i.y]),Lr(n,o)}else e.force("radial",null)}setupClusterForce(e,t){let{clustering:i}=t;if(i){let{clusterFociStrength:n,clusterEdgeDistance:o,clusterEdgeStrength:s,clusterNodeStrength:a,clusterNodeSize:u,clusterBy:f}=t,l=this.getCenterOptions(t),m=e.force("group");m||(m=Td(),e.force("group",m)),Lr(m,[["centerX",l&&l.x],["centerY",l&&l.y],["template","force"],["strength",n],["groupBy",f?Te(f,["node"]):void 0],["nodes",this.model.nodes()],["links",this.model.edges()],["forceLinkDistance",o],["forceLinkStrength",s],["forceCharge",a],["forceNodeSize",u]])}else e.force("group",null)}},Lr=(r,e)=>e.reduce((t,[i,n])=>!t[i]||n===void 0?t:t[i].call(r,n),r);function Ae(r){return function(){return r}}function zd(r){var e=Ae(.1),t,i,n;typeof r!="function"&&(r=Ae(r==null?0:+r));function o(a){for(var u=0,f=t.length,l;u<f;++u)l=t[u],l.vz+=(n[u]-l.z)*i[u]*a}function s(){if(t){var a,u=t.length;for(i=new Array(u),n=new Array(u),a=0;a<u;++a)i[a]=isNaN(n[a]=+r(t[a],a,t))?0:+e(t[a],a,t)}}return o.initialize=function(a){t=a,s()},o.strength=function(a){return arguments.length?(e=typeof a=="function"?a:Ae(+a),s(),o):e},o.z=function(a){return arguments.length?(r=typeof a=="function"?a:Ae(+a),s(),o):r},o}function Dd(r){var e=Ae(.1),t,i,n;typeof r!="function"&&(r=Ae(r==null?0:+r));function o(a){for(var u=0,f=t.length,l;u<f;++u)l=t[u],l.vy+=(n[u]-l.y)*i[u]*a}function s(){if(t){var a,u=t.length;for(i=new Array(u),n=new Array(u),a=0;a<u;++a)i[a]=isNaN(n[a]=+r(t[a],a,t))?0:+e(t[a],a,t)}}return o.initialize=function(a){t=a,s()},o.strength=function(a){return arguments.length?(e=typeof a=="function"?a:Ae(+a),s(),o):e},o.y=function(a){return arguments.length?(r=typeof a=="function"?a:Ae(+a),s(),o):r},o}function Bd(r){var e=Ae(.1),t,i,n;typeof r!="function"&&(r=Ae(r==null?0:+r));function o(a){for(var u=0,f=t.length,l;u<f;++u)l=t[u],l.vx+=(n[u]-l.x)*i[u]*a}function s(){if(t){var a,u=t.length;for(i=new Array(u),n=new Array(u),a=0;a<u;++a)i[a]=isNaN(n[a]=+r(t[a],a,t))?0:+e(t[a],a,t)}}return o.initialize=function(a){t=a,s()},o.strength=function(a){return arguments.length?(e=typeof a=="function"?a:Ae(+a),s(),o):e},o.x=function(a){return arguments.length?(r=typeof a=="function"?a:Ae(+a),s(),o):r},o}function Gd(r,e,t,i){var n,o,s=Ae(.1),a,u;typeof r!="function"&&(r=Ae(+r)),e==null&&(e=0),t==null&&(t=0),i==null&&(i=0);function f(m){for(var _=0,g=n.length;_<g;++_){var w=n[_],b=w.x-e||1e-6,q=(w.y||0)-t||1e-6,y=(w.z||0)-i||1e-6,x=Math.sqrt(b*b+q*q+y*y),E=(u[_]-x)*a[_]*m/x;w.vx+=b*E,o>1&&(w.vy+=q*E),o>2&&(w.vz+=y*E)}}function l(){if(n){var m,_=n.length;for(a=new Array(_),u=new Array(_),m=0;m<_;++m)u[m]=+r(n[m],m,n),a[m]=isNaN(u[m])?0:+s(n[m],m,n)}}return f.initialize=function(m,..._){n=m,o=_.find(g=>[1,2,3].includes(g))||2,l()},f.strength=function(m){return arguments.length?(s=typeof m=="function"?m:Ae(+m),l(),f):s},f.radius=function(m){return arguments.length?(r=typeof m=="function"?m:Ae(+m),l(),f):r},f.x=function(m){return arguments.length?(e=+m,f):e},f.y=function(m){return arguments.length?(t=+m,f):t},f.z=function(m){return arguments.length?(i=+m,f):i},f}function vr(r){return(r()-.5)*1e-6}function Ud(r){let e=+this._x.call(null,r);return $d(this.cover(e),e,r)}function $d(r,e,t){if(isNaN(e))return r;var i,n=r._root,o={data:t},s=r._x0,a=r._x1,u,f,l,m,_;if(!n)return r._root=o,r;for(;n.length;)if((l=e>=(u=(s+a)/2))?s=u:a=u,i=n,!(n=n[m=+l]))return i[m]=o,r;if(f=+r._x.call(null,n.data),e===f)return o.next=n,i?i[m]=o:r._root=o,r;do i=i?i[m]=new Array(2):r._root=new Array(2),(l=e>=(u=(s+a)/2))?s=u:a=u;while((m=+l)==(_=+(f>=u)));return i[_]=n,i[m]=o,r}function Vd(r){Array.isArray(r)||(r=Array.from(r));let e=r.length,t=new Float64Array(e),i=1/0,n=-1/0;for(let o=0,s;o<e;++o)isNaN(s=+this._x.call(null,r[o]))||(t[o]=s,s<i&&(i=s),s>n&&(n=s));if(i>n)return this;this.cover(i).cover(n);for(let o=0;o<e;++o)$d(this,t[o],r[o]);return this}function Wd(r){if(isNaN(r=+r))return this;var e=this._x0,t=this._x1;if(isNaN(e))t=(e=Math.floor(r))+1;else{for(var i=t-e||1,n=this._root,o,s;e>r||r>=t;)switch(s=+(r<e),o=new Array(2),o[s]=n,n=o,i*=2,s){case 0:t=e+i;break;case 1:e=t-i;break}this._root&&this._root.length&&(this._root=n)}return this._x0=e,this._x1=t,this}function Kd(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}function Yd(r){return arguments.length?this.cover(+r[0][0]).cover(+r[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function Ir(r,e,t){this.node=r,this.x0=e,this.x1=t}function Xd(r,e){var t,i=this._x0,n,o,s=this._x1,a=[],u=this._root,f,l;for(u&&a.push(new Ir(u,i,s)),e==null?e=1/0:(i=r-e,s=r+e);f=a.pop();)if(!(!(u=f.node)||(n=f.x0)>s||(o=f.x1)<i))if(u.length){var m=(n+o)/2;a.push(new Ir(u[1],m,o),new Ir(u[0],n,m)),(l=+(r>=m))&&(f=a[a.length-1],a[a.length-1]=a[a.length-1-l],a[a.length-1-l]=f)}else{var _=Math.abs(r-+this._x.call(null,u.data));_<e&&(e=_,i=r-_,s=r+_,t=u.data)}return t}function Zd(r){if(isNaN(u=+this._x.call(null,r)))return this;var e,t=this._root,i,n,o,s=this._x0,a=this._x1,u,f,l,m,_;if(!t)return this;if(t.length)for(;;){if((l=u>=(f=(s+a)/2))?s=f:a=f,e=t,!(t=t[m=+l]))return this;if(!t.length)break;e[m+1&1]&&(i=e,_=m)}for(;t.data!==r;)if(n=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,n?(o?n.next=o:delete n.next,this):e?(o?e[m]=o:delete e[m],(t=e[0]||e[1])&&t===(e[1]||e[0])&&!t.length&&(i?i[_]=t:this._root=t),this):(this._root=o,this)}function Qd(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}function Jd(){return this._root}function Hd(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}function ep(r){var e=[],t,i=this._root,n,o,s;for(i&&e.push(new Ir(i,this._x0,this._x1));t=e.pop();)if(!r(i=t.node,o=t.x0,s=t.x1)&&i.length){var a=(o+s)/2;(n=i[1])&&e.push(new Ir(n,a,s)),(n=i[0])&&e.push(new Ir(n,o,a))}return this}function rp(r){var e=[],t=[],i;for(this._root&&e.push(new Ir(this._root,this._x0,this._x1));i=e.pop();){var n=i.node;if(n.length){var o,s=i.x0,a=i.x1,u=(s+a)/2;(o=n[0])&&e.push(new Ir(o,s,u)),(o=n[1])&&e.push(new Ir(o,u,a))}t.push(i)}for(;i=t.pop();)r(i.node,i.x0,i.x1);return this}function tp(r){return r[0]}function ip(r){return arguments.length?(this._x=r,this):this._x}function xi(r,e){var t=new is(e??tp,NaN,NaN);return r==null?t:t.addAll(r)}function is(r,e,t){this._x=r,this._x0=e,this._x1=t,this._root=void 0}function np(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}var yr=xi.prototype=is.prototype;yr.copy=function(){var r=new is(this._x,this._x0,this._x1),e=this._root,t,i;if(!e)return r;if(!e.length)return r._root=np(e),r;for(t=[{source:e,target:r._root=new Array(2)}];e=t.pop();)for(var n=0;n<2;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(2)}):e.target[n]=np(i));return r};yr.add=Ud;yr.addAll=Vd;yr.cover=Wd;yr.data=Kd;yr.extent=Yd;yr.find=Xd;yr.remove=Zd;yr.removeAll=Qd;yr.root=Jd;yr.size=Hd;yr.visit=ep;yr.visitAfter=rp;yr.x=ip;function op(r){let e=+this._x.call(null,r),t=+this._y.call(null,r),i=+this._z.call(null,r);return sp(this.cover(e,t,i),e,t,i,r)}function sp(r,e,t,i,n){if(isNaN(e)||isNaN(t)||isNaN(i))return r;var o,s=r._root,a={data:n},u=r._x0,f=r._y0,l=r._z0,m=r._x1,_=r._y1,g=r._z1,w,b,q,y,x,E,N,M,A,T,j;if(!s)return r._root=a,r;for(;s.length;)if((N=e>=(w=(u+m)/2))?u=w:m=w,(M=t>=(b=(f+_)/2))?f=b:_=b,(A=i>=(q=(l+g)/2))?l=q:g=q,o=s,!(s=s[T=A<<2|M<<1|N]))return o[T]=a,r;if(y=+r._x.call(null,s.data),x=+r._y.call(null,s.data),E=+r._z.call(null,s.data),e===y&&t===x&&i===E)return a.next=s,o?o[T]=a:r._root=a,r;do o=o?o[T]=new Array(8):r._root=new Array(8),(N=e>=(w=(u+m)/2))?u=w:m=w,(M=t>=(b=(f+_)/2))?f=b:_=b,(A=i>=(q=(l+g)/2))?l=q:g=q;while((T=A<<2|M<<1|N)===(j=(E>=q)<<2|(x>=b)<<1|y>=w));return o[j]=s,o[T]=a,r}function ap(r){Array.isArray(r)||(r=Array.from(r));let e=r.length,t=new Float64Array(e),i=new Float64Array(e),n=new Float64Array(e),o=1/0,s=1/0,a=1/0,u=-1/0,f=-1/0,l=-1/0;for(let m=0,_,g,w,b;m<e;++m)isNaN(g=+this._x.call(null,_=r[m]))||isNaN(w=+this._y.call(null,_))||isNaN(b=+this._z.call(null,_))||(t[m]=g,i[m]=w,n[m]=b,g<o&&(o=g),g>u&&(u=g),w<s&&(s=w),w>f&&(f=w),b<a&&(a=b),b>l&&(l=b));if(o>u||s>f||a>l)return this;this.cover(o,s,a).cover(u,f,l);for(let m=0;m<e;++m)sp(this,t[m],i[m],n[m],r[m]);return this}function up(r,e,t){if(isNaN(r=+r)||isNaN(e=+e)||isNaN(t=+t))return this;var i=this._x0,n=this._y0,o=this._z0,s=this._x1,a=this._y1,u=this._z1;if(isNaN(i))s=(i=Math.floor(r))+1,a=(n=Math.floor(e))+1,u=(o=Math.floor(t))+1;else{for(var f=s-i||1,l=this._root,m,_;i>r||r>=s||n>e||e>=a||o>t||t>=u;)switch(_=(t<o)<<2|(e<n)<<1|r<i,m=new Array(8),m[_]=l,l=m,f*=2,_){case 0:s=i+f,a=n+f,u=o+f;break;case 1:i=s-f,a=n+f,u=o+f;break;case 2:s=i+f,n=a-f,u=o+f;break;case 3:i=s-f,n=a-f,u=o+f;break;case 4:s=i+f,a=n+f,o=u-f;break;case 5:i=s-f,a=n+f,o=u-f;break;case 6:s=i+f,n=a-f,o=u-f;break;case 7:i=s-f,n=a-f,o=u-f;break}this._root&&this._root.length&&(this._root=l)}return this._x0=i,this._y0=n,this._z0=o,this._x1=s,this._y1=a,this._z1=u,this}function fp(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}function cp(r){return arguments.length?this.cover(+r[0][0],+r[0][1],+r[0][2]).cover(+r[1][0],+r[1][1],+r[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function Oe(r,e,t,i,n,o,s){this.node=r,this.x0=e,this.y0=t,this.z0=i,this.x1=n,this.y1=o,this.z1=s}function lp(r,e,t,i){var n,o=this._x0,s=this._y0,a=this._z0,u,f,l,m,_,g,w=this._x1,b=this._y1,q=this._z1,y=[],x=this._root,E,N;for(x&&y.push(new Oe(x,o,s,a,w,b,q)),i==null?i=1/0:(o=r-i,s=e-i,a=t-i,w=r+i,b=e+i,q=t+i,i*=i);E=y.pop();)if(!(!(x=E.node)||(u=E.x0)>w||(f=E.y0)>b||(l=E.z0)>q||(m=E.x1)<o||(_=E.y1)<s||(g=E.z1)<a))if(x.length){var M=(u+m)/2,A=(f+_)/2,T=(l+g)/2;y.push(new Oe(x[7],M,A,T,m,_,g),new Oe(x[6],u,A,T,M,_,g),new Oe(x[5],M,f,T,m,A,g),new Oe(x[4],u,f,T,M,A,g),new Oe(x[3],M,A,l,m,_,T),new Oe(x[2],u,A,l,M,_,T),new Oe(x[1],M,f,l,m,A,T),new Oe(x[0],u,f,l,M,A,T)),(N=(t>=T)<<2|(e>=A)<<1|r>=M)&&(E=y[y.length-1],y[y.length-1]=y[y.length-1-N],y[y.length-1-N]=E)}else{var j=r-+this._x.call(null,x.data),B=e-+this._y.call(null,x.data),z=t-+this._z.call(null,x.data),U=j*j+B*B+z*z;if(U<i){var V=Math.sqrt(i=U);o=r-V,s=e-V,a=t-V,w=r+V,b=e+V,q=t+V,n=x.data}}return n}var iE=(r,e,t,i,n,o)=>Math.sqrt((r-i)**2+(e-n)**2+(t-o)**2);function hp(r,e,t,i){let n=[],o=r-i,s=e-i,a=t-i,u=r+i,f=e+i,l=t+i;return this.visit((m,_,g,w,b,q,y)=>{if(!m.length)do{let x=m.data;iE(r,e,t,this._x(x),this._y(x),this._z(x))<=i&&n.push(x)}while(m=m.next);return _>u||g>f||w>l||b<o||q<s||y<a}),n}function dp(r){if(isNaN(_=+this._x.call(null,r))||isNaN(g=+this._y.call(null,r))||isNaN(w=+this._z.call(null,r)))return this;var e,t=this._root,i,n,o,s=this._x0,a=this._y0,u=this._z0,f=this._x1,l=this._y1,m=this._z1,_,g,w,b,q,y,x,E,N,M,A;if(!t)return this;if(t.length)for(;;){if((x=_>=(b=(s+f)/2))?s=b:f=b,(E=g>=(q=(a+l)/2))?a=q:l=q,(N=w>=(y=(u+m)/2))?u=y:m=y,e=t,!(t=t[M=N<<2|E<<1|x]))return this;if(!t.length)break;(e[M+1&7]||e[M+2&7]||e[M+3&7]||e[M+4&7]||e[M+5&7]||e[M+6&7]||e[M+7&7])&&(i=e,A=M)}for(;t.data!==r;)if(n=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,n?(o?n.next=o:delete n.next,this):e?(o?e[M]=o:delete e[M],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[A]=t:this._root=t),this):(this._root=o,this)}function pp(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}function mp(){return this._root}function gp(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}function _p(r){var e=[],t,i=this._root,n,o,s,a,u,f,l;for(i&&e.push(new Oe(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!r(i=t.node,o=t.x0,s=t.y0,a=t.z0,u=t.x1,f=t.y1,l=t.z1)&&i.length){var m=(o+u)/2,_=(s+f)/2,g=(a+l)/2;(n=i[7])&&e.push(new Oe(n,m,_,g,u,f,l)),(n=i[6])&&e.push(new Oe(n,o,_,g,m,f,l)),(n=i[5])&&e.push(new Oe(n,m,s,g,u,_,l)),(n=i[4])&&e.push(new Oe(n,o,s,g,m,_,l)),(n=i[3])&&e.push(new Oe(n,m,_,a,u,f,g)),(n=i[2])&&e.push(new Oe(n,o,_,a,m,f,g)),(n=i[1])&&e.push(new Oe(n,m,s,a,u,_,g)),(n=i[0])&&e.push(new Oe(n,o,s,a,m,_,g))}return this}function vp(r){var e=[],t=[],i;for(this._root&&e.push(new Oe(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=e.pop();){var n=i.node;if(n.length){var o,s=i.x0,a=i.y0,u=i.z0,f=i.x1,l=i.y1,m=i.z1,_=(s+f)/2,g=(a+l)/2,w=(u+m)/2;(o=n[0])&&e.push(new Oe(o,s,a,u,_,g,w)),(o=n[1])&&e.push(new Oe(o,_,a,u,f,g,w)),(o=n[2])&&e.push(new Oe(o,s,g,u,_,l,w)),(o=n[3])&&e.push(new Oe(o,_,g,u,f,l,w)),(o=n[4])&&e.push(new Oe(o,s,a,w,_,g,m)),(o=n[5])&&e.push(new Oe(o,_,a,w,f,g,m)),(o=n[6])&&e.push(new Oe(o,s,g,w,_,l,m)),(o=n[7])&&e.push(new Oe(o,_,g,w,f,l,m))}t.push(i)}for(;i=t.pop();)r(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function yp(r){return r[0]}function qp(r){return arguments.length?(this._x=r,this):this._x}function wp(r){return r[1]}function bp(r){return arguments.length?(this._y=r,this):this._y}function xp(r){return r[2]}function Ep(r){return arguments.length?(this._z=r,this):this._z}function It(r,e,t,i){var n=new ns(e??yp,t??wp,i??xp,NaN,NaN,NaN,NaN,NaN,NaN);return r==null?n:n.addAll(r)}function ns(r,e,t,i,n,o,s,a,u){this._x=r,this._y=e,this._z=t,this._x0=i,this._y0=n,this._z0=o,this._x1=s,this._y1=a,this._z1=u,this._root=void 0}function Sp(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}var pr=It.prototype=ns.prototype;pr.copy=function(){var r=new ns(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,i;if(!e)return r;if(!e.length)return r._root=Sp(e),r;for(t=[{source:e,target:r._root=new Array(8)}];e=t.pop();)for(var n=0;n<8;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(8)}):e.target[n]=Sp(i));return r};pr.add=op;pr.addAll=ap;pr.cover=up;pr.data=fp;pr.extent=cp;pr.find=lp;pr.findAllWithinRadius=hp;pr.remove=dp;pr.removeAll=pp;pr.root=mp;pr.size=gp;pr.visit=_p;pr.visitAfter=vp;pr.x=qp;pr.y=bp;pr.z=Ep;function os(r){return r.x+r.vx}function Np(r){return r.y+r.vy}function nE(r){return r.z+r.vz}function Mp(r){var e,t,i,n,o=1,s=1;typeof r!="function"&&(r=Ae(r==null?1:+r));function a(){for(var l,m=e.length,_,g,w,b,q,y,x,E=0;E<s;++E)for(_=(t===1?xi(e,os):t===2?Nr(e,os,Np):t===3?It(e,os,Np,nE):null).visitAfter(u),l=0;l<m;++l)g=e[l],y=i[g.index],x=y*y,w=g.x+g.vx,t>1&&(b=g.y+g.vy),t>2&&(q=g.z+g.vz),_.visit(N);function N(M,A,T,j,B,z,U){var V=[A,T,j,B,z,U],W=V[0],H=V[1],se=V[2],fe=V[t],be=V[t+1],Ee=V[t+2],ce=M.data,Ie=M.r,_e=y+Ie;if(ce){if(ce.index>g.index){var ae=w-ce.x-ce.vx,Re=t>1?b-ce.y-ce.vy:0,F=t>2?q-ce.z-ce.vz:0,P=ae*ae+Re*Re+F*F;P<_e*_e&&(ae===0&&(ae=vr(n),P+=ae*ae),t>1&&Re===0&&(Re=vr(n),P+=Re*Re),t>2&&F===0&&(F=vr(n),P+=F*F),P=(_e-(P=Math.sqrt(P)))/P*o,g.vx+=(ae*=P)*(_e=(Ie*=Ie)/(x+Ie)),t>1&&(g.vy+=(Re*=P)*_e),t>2&&(g.vz+=(F*=P)*_e),ce.vx-=ae*(_e=1-_e),t>1&&(ce.vy-=Re*_e),t>2&&(ce.vz-=F*_e))}return}return W>w+_e||fe<w-_e||t>1&&(H>b+_e||be<b-_e)||t>2&&(se>q+_e||Ee<q-_e)}}function u(l){if(l.data)return l.r=i[l.data.index];for(var m=l.r=0;m<Math.pow(2,t);++m)l[m]&&l[m].r>l.r&&(l.r=l[m].r)}function f(){if(e){var l,m=e.length,_;for(i=new Array(m),l=0;l<m;++l)_=e[l],i[_.index]=+r(_,l,e)}}return a.initialize=function(l,...m){e=l,n=m.find(_=>typeof _=="function")||Math.random,t=m.find(_=>[1,2,3].includes(_))||2,f()},a.iterations=function(l){return arguments.length?(s=+l,a):s},a.strength=function(l){return arguments.length?(o=+l,a):o},a.radius=function(l){return arguments.length?(r=typeof l=="function"?l:Ae(+l),f(),a):r},a}function Ip(r,e,t){var i,n=1;r==null&&(r=0),e==null&&(e=0),t==null&&(t=0);function o(){var s,a=i.length,u,f=0,l=0,m=0;for(s=0;s<a;++s)u=i[s],f+=u.x||0,l+=u.y||0,m+=u.z||0;for(f=(f/a-r)*n,l=(l/a-e)*n,m=(m/a-t)*n,s=0;s<a;++s)u=i[s],f&&(u.x-=f),l&&(u.y-=l),m&&(u.z-=m)}return o.initialize=function(s){i=s},o.x=function(s){return arguments.length?(r=+s,o):r},o.y=function(s){return arguments.length?(e=+s,o):e},o.z=function(s){return arguments.length?(t=+s,o):t},o.strength=function(s){return arguments.length?(n=+s,o):n},o}function Rp(){let r=1;return()=>(r=(1664525*r+1013904223)%4294967296)/4294967296}var Ap=3;function ln(r){return r.x}function ss(r){return r.y}function Op(r){return r.z}var oE=10,sE=Math.PI*(3-Math.sqrt(5)),aE=Math.PI*20/(9+Math.sqrt(221));function Cp(r,e){e=e||2;var t=Math.min(Ap,Math.max(1,Math.round(e))),i,n=1,o=.001,s=1-Math.pow(o,1/300),a=0,u=.6,f=new Map,l=qi(g),m=wi("tick","end"),_=Rp();r==null&&(r=[]);function g(){w(),m.call("tick",i),n<o&&(l.stop(),m.call("end",i))}function w(y){var x,E=r.length,N;y===void 0&&(y=1);for(var M=0;M<y;++M)for(n+=(a-n)*s,f.forEach(function(A){A(n)}),x=0;x<E;++x)N=r[x],N.fx==null?N.x+=N.vx*=u:(N.x=N.fx,N.vx=0),t>1&&(N.fy==null?N.y+=N.vy*=u:(N.y=N.fy,N.vy=0)),t>2&&(N.fz==null?N.z+=N.vz*=u:(N.z=N.fz,N.vz=0));return i}function b(){for(var y=0,x=r.length,E;y<x;++y){if(E=r[y],E.index=y,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),E.fz!=null&&(E.z=E.fz),isNaN(E.x)||t>1&&isNaN(E.y)||t>2&&isNaN(E.z)){var N=oE*(t>2?Math.cbrt(.5+y):t>1?Math.sqrt(.5+y):y),M=y*sE,A=y*aE;t===1?E.x=N:t===2?(E.x=N*Math.cos(M),E.y=N*Math.sin(M)):(E.x=N*Math.sin(M)*Math.cos(A),E.y=N*Math.cos(M),E.z=N*Math.sin(M)*Math.sin(A))}(isNaN(E.vx)||t>1&&isNaN(E.vy)||t>2&&isNaN(E.vz))&&(E.vx=0,t>1&&(E.vy=0),t>2&&(E.vz=0))}}function q(y){return y.initialize&&y.initialize(r,_,t),y}return b(),i={tick:w,restart:function(){return l.restart(g),i},stop:function(){return l.stop(),i},numDimensions:function(y){return arguments.length?(t=Math.min(Ap,Math.max(1,Math.round(y))),f.forEach(q),i):t},nodes:function(y){return arguments.length?(r=y,b(),f.forEach(q),i):r},alpha:function(y){return arguments.length?(n=+y,i):n},alphaMin:function(y){return arguments.length?(o=+y,i):o},alphaDecay:function(y){return arguments.length?(s=+y,i):+s},alphaTarget:function(y){return arguments.length?(a=+y,i):a},velocityDecay:function(y){return arguments.length?(u=1-y,i):1-u},randomSource:function(y){return arguments.length?(_=y,f.forEach(q),i):_},force:function(y,x){return arguments.length>1?(x==null?f.delete(y):f.set(y,q(x)),i):f.get(y)},find:function(){var y=Array.prototype.slice.call(arguments),x=y.shift()||0,E=(t>1?y.shift():null)||0,N=(t>2?y.shift():null)||0,M=y.shift()||1/0,A=0,T=r.length,j,B,z,U,V,W;for(M*=M,A=0;A<T;++A)V=r[A],j=x-V.x,B=E-(V.y||0),z=N-(V.z||0),U=j*j+B*B+z*z,U<M&&(W=V,M=U);return W},on:function(y,x){return arguments.length>1?(m.on(y,x),i):m.on(y)}}}function Tp(){var r,e,t,i,n,o=Ae(-30),s,a=1,u=1/0,f=.81;function l(w){var b,q=r.length,y=(e===1?xi(r,ln):e===2?Nr(r,ln,ss):e===3?It(r,ln,ss,Op):null).visitAfter(_);for(n=w,b=0;b<q;++b)t=r[b],y.visit(g)}function m(){if(r){var w,b=r.length,q;for(s=new Array(b),w=0;w<b;++w)q=r[w],s[q.index]=+o(q,w,r)}}function _(w){var b=0,q,y,x=0,E,N,M,A,T=w.length;if(T){for(E=N=M=A=0;A<T;++A)(q=w[A])&&(y=Math.abs(q.value))&&(b+=q.value,x+=y,E+=y*(q.x||0),N+=y*(q.y||0),M+=y*(q.z||0));b*=Math.sqrt(4/T),w.x=E/x,e>1&&(w.y=N/x),e>2&&(w.z=M/x)}else{q=w,q.x=q.data.x,e>1&&(q.y=q.data.y),e>2&&(q.z=q.data.z);do b+=s[q.data.index];while(q=q.next)}w.value=b}function g(w,b,q,y,x){if(!w.value)return!0;var E=[q,y,x][e-1],N=w.x-t.x,M=e>1?w.y-t.y:0,A=e>2?w.z-t.z:0,T=E-b,j=N*N+M*M+A*A;if(T*T/f<j)return j<u&&(N===0&&(N=vr(i),j+=N*N),e>1&&M===0&&(M=vr(i),j+=M*M),e>2&&A===0&&(A=vr(i),j+=A*A),j<a&&(j=Math.sqrt(a*j)),t.vx+=N*w.value*n/j,e>1&&(t.vy+=M*w.value*n/j),e>2&&(t.vz+=A*w.value*n/j)),!0;if(w.length||j>=u)return;(w.data!==t||w.next)&&(N===0&&(N=vr(i),j+=N*N),e>1&&M===0&&(M=vr(i),j+=M*M),e>2&&A===0&&(A=vr(i),j+=A*A),j<a&&(j=Math.sqrt(a*j)));do w.data!==t&&(T=s[w.data.index]*n/j,t.vx+=N*T,e>1&&(t.vy+=M*T),e>2&&(t.vz+=A*T));while(w=w.next)}return l.initialize=function(w,...b){r=w,i=b.find(q=>typeof q=="function")||Math.random,e=b.find(q=>[1,2,3].includes(q))||2,m()},l.strength=function(w){return arguments.length?(o=typeof w=="function"?w:Ae(+w),m(),l):o},l.distanceMin=function(w){return arguments.length?(a=w*w,l):Math.sqrt(a)},l.distanceMax=function(w){return arguments.length?(u=w*w,l):Math.sqrt(u)},l.theta=function(w){return arguments.length?(f=w*w,l):Math.sqrt(f)},l}function uE(r){return r.index}function kp(r,e){var t=r.get(e);if(!t)throw new Error("node not found: "+e);return t}function Pp(r){var e=uE,t=_,i,n=Ae(30),o,s,a,u,f,l,m=1;r==null&&(r=[]);function _(y){return 1/Math.min(u[y.source.index],u[y.target.index])}function g(y){for(var x=0,E=r.length;x<m;++x)for(var N=0,M,A,T,j=0,B=0,z=0,U,V;N<E;++N)M=r[N],A=M.source,T=M.target,j=T.x+T.vx-A.x-A.vx||vr(l),a>1&&(B=T.y+T.vy-A.y-A.vy||vr(l)),a>2&&(z=T.z+T.vz-A.z-A.vz||vr(l)),U=Math.sqrt(j*j+B*B+z*z),U=(U-o[N])/U*y*i[N],j*=U,B*=U,z*=U,T.vx-=j*(V=f[N]),a>1&&(T.vy-=B*V),a>2&&(T.vz-=z*V),A.vx+=j*(V=1-V),a>1&&(A.vy+=B*V),a>2&&(A.vz+=z*V)}function w(){if(s){var y,x=s.length,E=r.length,N=new Map(s.map((A,T)=>[e(A,T,s),A])),M;for(y=0,u=new Array(x);y<E;++y)M=r[y],M.index=y,typeof M.source!="object"&&(M.source=kp(N,M.source)),typeof M.target!="object"&&(M.target=kp(N,M.target)),u[M.source.index]=(u[M.source.index]||0)+1,u[M.target.index]=(u[M.target.index]||0)+1;for(y=0,f=new Array(E);y<E;++y)M=r[y],f[y]=u[M.source.index]/(u[M.source.index]+u[M.target.index]);i=new Array(E),b(),o=new Array(E),q()}}function b(){if(s)for(var y=0,x=r.length;y<x;++y)i[y]=+t(r[y],y,r)}function q(){if(s)for(var y=0,x=r.length;y<x;++y)o[y]=+n(r[y],y,r)}return g.initialize=function(y,...x){s=y,l=x.find(E=>typeof E=="function")||Math.random,a=x.find(E=>[1,2,3].includes(E))||2,w()},g.links=function(y){return arguments.length?(r=y,w(),g):r},g.id=function(y){return arguments.length?(e=y,g):e},g.iterations=function(y){return arguments.length?(m=+y,g):m},g.strength=function(y){return arguments.length?(t=typeof y=="function"?y:Ae(+y),b(),g):t},g.distance=function(y){return arguments.length?(n=typeof y=="function"?y:Ae(+y),q(),g):n},g}var Ei=class extends Mt{constructor(){super(...arguments),this.id="d3-force-3d",this.config={simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource","numDimensions"]},this.forceMap={link:Pp,manyBody:Tp,center:Ip,collide:Mp,radial:Gd,x:Bd,y:Dd,z:zd}}getDefaultOptions(){return{numDimensions:3,link:{id:e=>e.id},manyBody:{},center:{x:0,y:0,z:0}}}initSimulation(){return Cp()}setupForces(e,t){Object.entries(this.forceMap).forEach(([i,n])=>{let o=i;if(t[i]){let s=e.force(o);s||(s=n(),e.force(o,s)),Lr(s,Object.entries(t[o]))}else e.force(o,null)})}};var Si=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function hn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function dn(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function i(){var n=!1;try{n=this instanceof i}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}function Ft(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var as,jp;function Lp(){if(jp)return as;jp=1;function r(){this.__data__=[],this.size=0}return as=r,as}var us,Fp;function Rr(){if(Fp)return us;Fp=1;function r(e,t){return e===t||e!==e&&t!==t}return us=r,us}var fs,zp;function rt(){if(zp)return fs;zp=1;var r=Rr();function e(t,i){for(var n=t.length;n--;)if(r(t[n][0],i))return n;return-1}return fs=e,fs}var cs,Dp;function Bp(){if(Dp)return cs;Dp=1;var r=rt(),e=Array.prototype,t=e.splice;function i(n){var o=this.__data__,s=r(o,n);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():t.call(o,s,1),--this.size,!0}return cs=i,cs}var ls,Gp;function Up(){if(Gp)return ls;Gp=1;var r=rt();function e(t){var i=this.__data__,n=r(i,t);return n<0?void 0:i[n][1]}return ls=e,ls}var hs,$p;function Vp(){if($p)return hs;$p=1;var r=rt();function e(t){return r(this.__data__,t)>-1}return hs=e,hs}var ds,Wp;function Kp(){if(Wp)return ds;Wp=1;var r=rt();function e(t,i){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,i])):n[o][1]=i,this}return ds=e,ds}var ps,Yp;function tt(){if(Yp)return ps;Yp=1;var r=Lp(),e=Bp(),t=Up(),i=Vp(),n=Kp();function o(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}return o.prototype.clear=r,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=i,o.prototype.set=n,ps=o,ps}var ms,Xp;function Zp(){if(Xp)return ms;Xp=1;var r=tt();function e(){this.__data__=new r,this.size=0}return ms=e,ms}var gs,Qp;function Jp(){if(Qp)return gs;Qp=1;function r(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}return gs=r,gs}var _s,Hp;function em(){if(Hp)return _s;Hp=1;function r(e){return this.__data__.get(e)}return _s=r,_s}var vs,rm;function tm(){if(rm)return vs;rm=1;function r(e){return this.__data__.has(e)}return vs=r,vs}var ys,im;function pn(){if(im)return ys;im=1;var r=typeof Si=="object"&&Si&&Si.Object===Object&&Si;return ys=r,ys}var qs,nm;function Qe(){if(nm)return qs;nm=1;var r=pn(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return qs=t,qs}var ws,om;function Ar(){if(om)return ws;om=1;var r=Qe(),e=r.Symbol;return ws=e,ws}var bs,sm;function am(){if(sm)return bs;sm=1;var r=Ar(),e=Object.prototype,t=e.hasOwnProperty,i=e.toString,n=r?r.toStringTag:void 0;function o(s){var a=t.call(s,n),u=s[n];try{s[n]=void 0;var f=!0}catch{}var l=i.call(s);return f&&(a?s[n]=u:delete s[n]),l}return bs=o,bs}var xs,um;function fm(){if(um)return xs;um=1;var r=Object.prototype,e=r.toString;function t(i){return e.call(i)}return xs=t,xs}var Es,cm;function qr(){if(cm)return Es;cm=1;var r=Ar(),e=am(),t=fm(),i="[object Null]",n="[object Undefined]",o=r?r.toStringTag:void 0;function s(a){return a==null?a===void 0?n:i:o&&o in Object(a)?e(a):t(a)}return Es=s,Es}var Ss,lm;function Ve(){if(lm)return Ss;lm=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Ss=r,Ss}var Ns,hm;function $r(){if(hm)return Ns;hm=1;var r=qr(),e=Ve(),t="[object AsyncFunction]",i="[object Function]",n="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!e(a))return!1;var u=r(a);return u==i||u==n||u==t||u==o}return Ns=s,Ns}var Ms,dm;function pm(){if(dm)return Ms;dm=1;var r=Qe(),e=r["__core-js_shared__"];return Ms=e,Ms}var Is,mm;function gm(){if(mm)return Is;mm=1;var r=pm(),e=(function(){var i=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function t(i){return!!e&&e in i}return Is=t,Is}var Rs,_m;function mn(){if(_m)return Rs;_m=1;var r=Function.prototype,e=r.toString;function t(i){if(i!=null){try{return e.call(i)}catch{}try{return i+""}catch{}}return""}return Rs=t,Rs}var As,vm;function ym(){if(vm)return As;vm=1;var r=$r(),e=gm(),t=Ve(),i=mn(),n=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,u=s.toString,f=a.hasOwnProperty,l=RegExp("^"+u.call(f).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(_){if(!t(_)||e(_))return!1;var g=r(_)?l:o;return g.test(i(_))}return As=m,As}var Os,qm;function wm(){if(qm)return Os;qm=1;function r(e,t){return e?.[t]}return Os=r,Os}var Cs,bm;function wr(){if(bm)return Cs;bm=1;var r=ym(),e=wm();function t(i,n){var o=e(i,n);return r(o)?o:void 0}return Cs=t,Cs}var Ts,xm;function zt(){if(xm)return Ts;xm=1;var r=wr(),e=Qe(),t=r(e,"Map");return Ts=t,Ts}var ks,Em;function it(){if(Em)return ks;Em=1;var r=wr(),e=r(Object,"create");return ks=e,ks}var Ps,Sm;function Nm(){if(Sm)return Ps;Sm=1;var r=it();function e(){this.__data__=r?r(null):{},this.size=0}return Ps=e,Ps}var js,Mm;function Im(){if(Mm)return js;Mm=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return js=r,js}var Ls,Rm;function Am(){if(Rm)return Ls;Rm=1;var r=it(),e="__lodash_hash_undefined__",t=Object.prototype,i=t.hasOwnProperty;function n(o){var s=this.__data__;if(r){var a=s[o];return a===e?void 0:a}return i.call(s,o)?s[o]:void 0}return Ls=n,Ls}var Fs,Om;function Cm(){if(Om)return Fs;Om=1;var r=it(),e=Object.prototype,t=e.hasOwnProperty;function i(n){var o=this.__data__;return r?o[n]!==void 0:t.call(o,n)}return Fs=i,Fs}var zs,Tm;function km(){if(Tm)return zs;Tm=1;var r=it(),e="__lodash_hash_undefined__";function t(i,n){var o=this.__data__;return this.size+=this.has(i)?0:1,o[i]=r&&n===void 0?e:n,this}return zs=t,zs}var Ds,Pm;function jm(){if(Pm)return Ds;Pm=1;var r=Nm(),e=Im(),t=Am(),i=Cm(),n=km();function o(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}return o.prototype.clear=r,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=i,o.prototype.set=n,Ds=o,Ds}var Bs,Lm;function Fm(){if(Lm)return Bs;Lm=1;var r=jm(),e=tt(),t=zt();function i(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Bs=i,Bs}var Gs,zm;function Dm(){if(zm)return Gs;zm=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Gs=r,Gs}var Us,Bm;function nt(){if(Bm)return Us;Bm=1;var r=Dm();function e(t,i){var n=t.__data__;return r(i)?n[typeof i=="string"?"string":"hash"]:n.map}return Us=e,Us}var $s,Gm;function Um(){if(Gm)return $s;Gm=1;var r=nt();function e(t){var i=r(this,t).delete(t);return this.size-=i?1:0,i}return $s=e,$s}var Vs,$m;function Vm(){if($m)return Vs;$m=1;var r=nt();function e(t){return r(this,t).get(t)}return Vs=e,Vs}var Ws,Wm;function Km(){if(Wm)return Ws;Wm=1;var r=nt();function e(t){return r(this,t).has(t)}return Ws=e,Ws}var Ks,Ym;function Xm(){if(Ym)return Ks;Ym=1;var r=nt();function e(t,i){var n=r(this,t),o=n.size;return n.set(t,i),this.size+=n.size==o?0:1,this}return Ks=e,Ks}var Ys,Zm;function Dt(){if(Zm)return Ys;Zm=1;var r=Fm(),e=Um(),t=Vm(),i=Km(),n=Xm();function o(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}return o.prototype.clear=r,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=i,o.prototype.set=n,Ys=o,Ys}var Xs,Qm;function Jm(){if(Qm)return Xs;Qm=1;var r=tt(),e=zt(),t=Dt(),i=200;function n(o,s){var a=this.__data__;if(a instanceof r){var u=a.__data__;if(!e||u.length<i-1)return u.push([o,s]),this.size=++a.size,this;a=this.__data__=new t(u)}return a.set(o,s),this.size=a.size,this}return Xs=n,Xs}var Zs,Hm;function ot(){if(Hm)return Zs;Hm=1;var r=tt(),e=Zp(),t=Jp(),i=em(),n=tm(),o=Jm();function s(a){var u=this.__data__=new r(a);this.size=u.size}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=i,s.prototype.has=n,s.prototype.set=o,Zs=s,Zs}var Qs,eg;function Bt(){if(eg)return Qs;eg=1;function r(e,t){for(var i=-1,n=e==null?0:e.length;++i<n&&t(e[i],i,e)!==!1;);return e}return Qs=r,Qs}var Js,rg;function gn(){if(rg)return Js;rg=1;var r=wr(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Js=e,Js}var Hs,tg;function st(){if(tg)return Hs;tg=1;var r=gn();function e(t,i,n){i=="__proto__"&&r?r(t,i,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[i]=n}return Hs=e,Hs}var ea,ig;function at(){if(ig)return ea;ig=1;var r=st(),e=Rr(),t=Object.prototype,i=t.hasOwnProperty;function n(o,s,a){var u=o[s];(!(i.call(o,s)&&e(u,a))||a===void 0&&!(s in o))&&r(o,s,a)}return ea=n,ea}var ra,ng;function Vr(){if(ng)return ra;ng=1;var r=at(),e=st();function t(i,n,o,s){var a=!o;o||(o={});for(var u=-1,f=n.length;++u<f;){var l=n[u],m=s?s(o[l],i[l],l,o,i):void 0;m===void 0&&(m=i[l]),a?e(o,l,m):r(o,l,m)}return o}return ra=t,ra}var ta,og;function sg(){if(og)return ta;og=1;function r(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}return ta=r,ta}var ia,ag;function tr(){if(ag)return ia;ag=1;function r(e){return e!=null&&typeof e=="object"}return ia=r,ia}var na,ug;function fg(){if(ug)return na;ug=1;var r=qr(),e=tr(),t="[object Arguments]";function i(n){return e(n)&&r(n)==t}return na=i,na}var oa,cg;function Wr(){if(cg)return oa;cg=1;var r=fg(),e=tr(),t=Object.prototype,i=t.hasOwnProperty,n=t.propertyIsEnumerable,o=r((function(){return arguments})())?r:function(s){return e(s)&&i.call(s,"callee")&&!n.call(s,"callee")};return oa=o,oa}var sa,lg;function qe(){if(lg)return sa;lg=1;var r=Array.isArray;return sa=r,sa}var Gt={exports:{}};var aa,hg;function dg(){if(hg)return aa;hg=1;function r(){return!1}return aa=r,aa}Gt.exports;var pg;function Or(){return pg?Gt.exports:(pg=1,(function(r,e){var t=Qe(),i=dg(),n=e&&!e.nodeType&&e,o=n&&!0&&r&&!r.nodeType&&r,s=o&&o.exports===n,a=s?t.Buffer:void 0,u=a?a.isBuffer:void 0,f=u||i;r.exports=f})(Gt,Gt.exports),Gt.exports)}var ua,mg;function ut(){if(mg)return ua;mg=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(i,n){var o=typeof i;return n=n??r,!!n&&(o=="number"||o!="symbol"&&e.test(i))&&i>-1&&i%1==0&&i<n}return ua=t,ua}var fa,gg;function Ut(){if(gg)return fa;gg=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return fa=e,fa}var ca,_g;function vg(){if(_g)return ca;_g=1;var r=qr(),e=Ut(),t=tr(),i="[object Arguments]",n="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",u="[object Function]",f="[object Map]",l="[object Number]",m="[object Object]",_="[object RegExp]",g="[object Set]",w="[object String]",b="[object WeakMap]",q="[object ArrayBuffer]",y="[object DataView]",x="[object Float32Array]",E="[object Float64Array]",N="[object Int8Array]",M="[object Int16Array]",A="[object Int32Array]",T="[object Uint8Array]",j="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",U={};U[x]=U[E]=U[N]=U[M]=U[A]=U[T]=U[j]=U[B]=U[z]=!0,U[i]=U[n]=U[q]=U[o]=U[y]=U[s]=U[a]=U[u]=U[f]=U[l]=U[m]=U[_]=U[g]=U[w]=U[b]=!1;function V(W){return t(W)&&e(W.length)&&!!U[r(W)]}return ca=V,ca}var la,yg;function ft(){if(yg)return la;yg=1;function r(e){return function(t){return e(t)}}return la=r,la}var $t={exports:{}};$t.exports;var qg;function Vt(){return qg?$t.exports:(qg=1,(function(r,e){var t=pn(),i=e&&!e.nodeType&&e,n=i&&!0&&r&&!r.nodeType&&r,o=n&&n.exports===i,s=o&&t.process,a=(function(){try{var u=n&&n.require&&n.require("util").types;return u||s&&s.binding&&s.binding("util")}catch{}})();r.exports=a})($t,$t.exports),$t.exports)}var ha,wg;function Kr(){if(wg)return ha;wg=1;var r=vg(),e=ft(),t=Vt(),i=t&&t.isTypedArray,n=i?e(i):r;return ha=n,ha}var da,bg;function _n(){if(bg)return da;bg=1;var r=sg(),e=Wr(),t=qe(),i=Or(),n=ut(),o=Kr(),s=Object.prototype,a=s.hasOwnProperty;function u(f,l){var m=t(f),_=!m&&e(f),g=!m&&!_&&i(f),w=!m&&!_&&!g&&o(f),b=m||_||g||w,q=b?r(f.length,String):[],y=q.length;for(var x in f)(l||a.call(f,x))&&!(b&&(x=="length"||g&&(x=="offset"||x=="parent")||w&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||n(x,y)))&&q.push(x);return q}return da=u,da}var pa,xg;function ct(){if(xg)return pa;xg=1;var r=Object.prototype;function e(t){var i=t&&t.constructor,n=typeof i=="function"&&i.prototype||r;return t===n}return pa=e,pa}var ma,Eg;function vn(){if(Eg)return ma;Eg=1;function r(e,t){return function(i){return e(t(i))}}return ma=r,ma}var ga,Sg;function Ng(){if(Sg)return ga;Sg=1;var r=vn(),e=r(Object.keys,Object);return ga=e,ga}var _a,Mg;function Wt(){if(Mg)return _a;Mg=1;var r=ct(),e=Ng(),t=Object.prototype,i=t.hasOwnProperty;function n(o){if(!r(o))return e(o);var s=[];for(var a in Object(o))i.call(o,a)&&a!="constructor"&&s.push(a);return s}return _a=n,_a}var va,Ig;function cr(){if(Ig)return va;Ig=1;var r=$r(),e=Ut();function t(i){return i!=null&&e(i.length)&&!r(i)}return va=t,va}var ya,Rg;function mr(){if(Rg)return ya;Rg=1;var r=_n(),e=Wt(),t=cr();function i(n){return t(n)?r(n):e(n)}return ya=i,ya}var qa,Ag;function Og(){if(Ag)return qa;Ag=1;var r=Vr(),e=mr();function t(i,n){return i&&r(n,e(n),i)}return qa=t,qa}var wa,Cg;function Tg(){if(Cg)return wa;Cg=1;function r(e){var t=[];if(e!=null)for(var i in Object(e))t.push(i);return t}return wa=r,wa}var ba,kg;function Pg(){if(kg)return ba;kg=1;var r=Ve(),e=ct(),t=Tg(),i=Object.prototype,n=i.hasOwnProperty;function o(s){if(!r(s))return t(s);var a=e(s),u=[];for(var f in s)f=="constructor"&&(a||!n.call(s,f))||u.push(f);return u}return ba=o,ba}var xa,jg;function br(){if(jg)return xa;jg=1;var r=_n(),e=Pg(),t=cr();function i(n){return t(n)?r(n,!0):e(n)}return xa=i,xa}var Ea,Lg;function Fg(){if(Lg)return Ea;Lg=1;var r=Vr(),e=br();function t(i,n){return i&&r(n,e(n),i)}return Ea=t,Ea}var Kt={exports:{}};Kt.exports;var zg;function yn(){return zg?Kt.exports:(zg=1,(function(r,e){var t=Qe(),i=e&&!e.nodeType&&e,n=i&&!0&&r&&!r.nodeType&&r,o=n&&n.exports===i,s=o?t.Buffer:void 0,a=s?s.allocUnsafe:void 0;function u(f,l){if(l)return f.slice();var m=f.length,_=a?a(m):new f.constructor(m);return f.copy(_),_}r.exports=u})(Kt,Kt.exports),Kt.exports)}var Sa,Dg;function qn(){if(Dg)return Sa;Dg=1;function r(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}return Sa=r,Sa}var Na,Bg;function wn(){if(Bg)return Na;Bg=1;function r(e,t){for(var i=-1,n=e==null?0:e.length,o=0,s=[];++i<n;){var a=e[i];t(a,i,e)&&(s[o++]=a)}return s}return Na=r,Na}var Ma,Gg;function bn(){if(Gg)return Ma;Gg=1;function r(){return[]}return Ma=r,Ma}var Ia,Ug;function Yt(){if(Ug)return Ia;Ug=1;var r=wn(),e=bn(),t=Object.prototype,i=t.propertyIsEnumerable,n=Object.getOwnPropertySymbols,o=n?function(s){return s==null?[]:(s=Object(s),r(n(s),function(a){return i.call(s,a)}))}:e;return Ia=o,Ia}var Ra,$g;function Vg(){if($g)return Ra;$g=1;var r=Vr(),e=Yt();function t(i,n){return r(i,e(i),n)}return Ra=t,Ra}var Aa,Wg;function Xt(){if(Wg)return Aa;Wg=1;function r(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}return Aa=r,Aa}var Oa,Kg;function lt(){if(Kg)return Oa;Kg=1;var r=vn(),e=r(Object.getPrototypeOf,Object);return Oa=e,Oa}var Ca,Yg;function xn(){if(Yg)return Ca;Yg=1;var r=Xt(),e=lt(),t=Yt(),i=bn(),n=Object.getOwnPropertySymbols,o=n?function(s){for(var a=[];s;)r(a,t(s)),s=e(s);return a}:i;return Ca=o,Ca}var Ta,Xg;function Zg(){if(Xg)return Ta;Xg=1;var r=Vr(),e=xn();function t(i,n){return r(i,e(i),n)}return Ta=t,Ta}var ka,Qg;function En(){if(Qg)return ka;Qg=1;var r=Xt(),e=qe();function t(i,n,o){var s=n(i);return e(i)?s:r(s,o(i))}return ka=t,ka}var Pa,Jg;function Sn(){if(Jg)return Pa;Jg=1;var r=En(),e=Yt(),t=mr();function i(n){return r(n,t,e)}return Pa=i,Pa}var ja,Hg;function e_(){if(Hg)return ja;Hg=1;var r=En(),e=xn(),t=br();function i(n){return r(n,t,e)}return ja=i,ja}var La,r_;function t_(){if(r_)return La;r_=1;var r=wr(),e=Qe(),t=r(e,"DataView");return La=t,La}var Fa,i_;function n_(){if(i_)return Fa;i_=1;var r=wr(),e=Qe(),t=r(e,"Promise");return Fa=t,Fa}var za,o_;function Nn(){if(o_)return za;o_=1;var r=wr(),e=Qe(),t=r(e,"Set");return za=t,za}var Da,s_;function a_(){if(s_)return Da;s_=1;var r=wr(),e=Qe(),t=r(e,"WeakMap");return Da=t,Da}var Ba,u_;function Cr(){if(u_)return Ba;u_=1;var r=t_(),e=zt(),t=n_(),i=Nn(),n=a_(),o=qr(),s=mn(),a="[object Map]",u="[object Object]",f="[object Promise]",l="[object Set]",m="[object WeakMap]",_="[object DataView]",g=s(r),w=s(e),b=s(t),q=s(i),y=s(n),x=o;return(r&&x(new r(new ArrayBuffer(1)))!=_||e&&x(new e)!=a||t&&x(t.resolve())!=f||i&&x(new i)!=l||n&&x(new n)!=m)&&(x=function(E){var N=o(E),M=N==u?E.constructor:void 0,A=M?s(M):"";if(A)switch(A){case g:return _;case w:return a;case b:return f;case q:return l;case y:return m}return N}),Ba=x,Ba}var Ga,f_;function c_(){if(f_)return Ga;f_=1;var r=Object.prototype,e=r.hasOwnProperty;function t(i){var n=i.length,o=new i.constructor(n);return n&&typeof i[0]=="string"&&e.call(i,"index")&&(o.index=i.index,o.input=i.input),o}return Ga=t,Ga}var Ua,l_;function Mn(){if(l_)return Ua;l_=1;var r=Qe(),e=r.Uint8Array;return Ua=e,Ua}var $a,h_;function Zt(){if(h_)return $a;h_=1;var r=Mn();function e(t){var i=new t.constructor(t.byteLength);return new r(i).set(new r(t)),i}return $a=e,$a}var Va,d_;function p_(){if(d_)return Va;d_=1;var r=Zt();function e(t,i){var n=i?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}return Va=e,Va}var Wa,m_;function g_(){if(m_)return Wa;m_=1;var r=/\w*$/;function e(t){var i=new t.constructor(t.source,r.exec(t));return i.lastIndex=t.lastIndex,i}return Wa=e,Wa}var Ka,__;function v_(){if(__)return Ka;__=1;var r=Ar(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function i(n){return t?Object(t.call(n)):{}}return Ka=i,Ka}var Ya,y_;function In(){if(y_)return Ya;y_=1;var r=Zt();function e(t,i){var n=i?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}return Ya=e,Ya}var Xa,q_;function w_(){if(q_)return Xa;q_=1;var r=Zt(),e=p_(),t=g_(),i=v_(),n=In(),o="[object Boolean]",s="[object Date]",a="[object Map]",u="[object Number]",f="[object RegExp]",l="[object Set]",m="[object String]",_="[object Symbol]",g="[object ArrayBuffer]",w="[object DataView]",b="[object Float32Array]",q="[object Float64Array]",y="[object Int8Array]",x="[object Int16Array]",E="[object Int32Array]",N="[object Uint8Array]",M="[object Uint8ClampedArray]",A="[object Uint16Array]",T="[object Uint32Array]";function j(B,z,U){var V=B.constructor;switch(z){case g:return r(B);case o:case s:return new V(+B);case w:return e(B,U);case b:case q:case y:case x:case E:case N:case M:case A:case T:return n(B,U);case a:return new V;case u:case m:return new V(B);case f:return t(B);case l:return new V;case _:return i(B)}}return Xa=j,Xa}var Za,b_;function Rn(){if(b_)return Za;b_=1;var r=Ve(),e=Object.create,t=(function(){function i(){}return function(n){if(!r(n))return{};if(e)return e(n);i.prototype=n;var o=new i;return i.prototype=void 0,o}})();return Za=t,Za}var Qa,x_;function An(){if(x_)return Qa;x_=1;var r=Rn(),e=lt(),t=ct();function i(n){return typeof n.constructor=="function"&&!t(n)?r(e(n)):{}}return Qa=i,Qa}var Ja,E_;function S_(){if(E_)return Ja;E_=1;var r=Cr(),e=tr(),t="[object Map]";function i(n){return e(n)&&r(n)==t}return Ja=i,Ja}var Ha,N_;function M_(){if(N_)return Ha;N_=1;var r=S_(),e=ft(),t=Vt(),i=t&&t.isMap,n=i?e(i):r;return Ha=n,Ha}var eu,I_;function R_(){if(I_)return eu;I_=1;var r=Cr(),e=tr(),t="[object Set]";function i(n){return e(n)&&r(n)==t}return eu=i,eu}var ru,A_;function O_(){if(A_)return ru;A_=1;var r=R_(),e=ft(),t=Vt(),i=t&&t.isSet,n=i?e(i):r;return ru=n,ru}var tu,C_;function On(){if(C_)return tu;C_=1;var r=ot(),e=Bt(),t=at(),i=Og(),n=Fg(),o=yn(),s=qn(),a=Vg(),u=Zg(),f=Sn(),l=e_(),m=Cr(),_=c_(),g=w_(),w=An(),b=qe(),q=Or(),y=M_(),x=Ve(),E=O_(),N=mr(),M=br(),A=1,T=2,j=4,B="[object Arguments]",z="[object Array]",U="[object Boolean]",V="[object Date]",W="[object Error]",H="[object Function]",se="[object GeneratorFunction]",fe="[object Map]",be="[object Number]",Ee="[object Object]",ce="[object RegExp]",Ie="[object Set]",_e="[object String]",ae="[object Symbol]",Re="[object WeakMap]",F="[object ArrayBuffer]",P="[object DataView]",X="[object Float32Array]",Q="[object Float64Array]",oe="[object Int8Array]",ge="[object Int16Array]",ve="[object Int32Array]",je="[object Uint8Array]",Je="[object Uint8ClampedArray]",Ye="[object Uint16Array]",Be="[object Uint32Array]",ye={};ye[B]=ye[z]=ye[F]=ye[P]=ye[U]=ye[V]=ye[X]=ye[Q]=ye[oe]=ye[ge]=ye[ve]=ye[fe]=ye[be]=ye[Ee]=ye[ce]=ye[Ie]=ye[_e]=ye[ae]=ye[je]=ye[Je]=ye[Ye]=ye[Be]=!0,ye[W]=ye[H]=ye[Re]=!1;function Mr(Se,Xr,rr,xo,Zr,sr){var ar,kr=Xr&A,Ct=Xr&T,Li=Xr&j;if(rr&&(ar=Zr?rr(Se,xo,Zr,sr):rr(Se)),ar!==void 0)return ar;if(!x(Se))return Se;var qt=b(Se);if(qt){if(ar=_(Se),!kr)return s(Se,ar)}else{var Hr=m(Se),Fi=Hr==H||Hr==se;if(q(Se))return o(Se,kr);if(Hr==Ee||Hr==B||Fi&&!Zr){if(ar=Ct||Fi?{}:w(Se),!kr)return Ct?u(Se,n(ar,Se)):a(Se,i(ar,Se))}else{if(!ye[Hr])return Zr?Se:{};ar=g(Se,Hr,kr)}}sr||(sr=new r);var zi=sr.get(Se);if(zi)return zi;sr.set(Se,ar),E(Se)?Se.forEach(function(Fr){ar.add(Mr(Fr,Xr,rr,Fr,Se,sr))}):y(Se)&&Se.forEach(function(Fr,zr){ar.set(zr,Mr(Fr,Xr,rr,zr,Se,sr))});var Eo=Li?Ct?l:f:Ct?M:N,Di=qt?void 0:Eo(Se);return e(Di||Se,function(Fr,zr){Di&&(zr=Fr,Fr=Se[zr]),t(ar,zr,Mr(Fr,Xr,rr,zr,Se,sr))}),ar}return tu=Mr,tu}var iu,T_;function k_(){if(T_)return iu;T_=1;var r=On(),e=4;function t(i){return r(i,e)}return iu=t,iu}var nu,P_;function Qt(){if(P_)return nu;P_=1;function r(e){return function(){return e}}return nu=r,nu}var ou,j_;function L_(){if(j_)return ou;j_=1;function r(e){return function(t,i,n){for(var o=-1,s=Object(t),a=n(t),u=a.length;u--;){var f=a[e?u:++o];if(i(s[f],f,s)===!1)break}return t}}return ou=r,ou}var su,F_;function Jt(){if(F_)return su;F_=1;var r=L_(),e=r();return su=e,su}var au,z_;function Ht(){if(z_)return au;z_=1;var r=Jt(),e=mr();function t(i,n){return i&&r(i,n,e)}return au=t,au}var uu,D_;function B_(){if(D_)return uu;D_=1;var r=cr();function e(t,i){return function(n,o){if(n==null)return n;if(!r(n))return t(n,o);for(var s=n.length,a=i?s:-1,u=Object(n);(i?a--:++a<s)&&o(u[a],a,u)!==!1;);return n}}return uu=e,uu}var fu,G_;function ht(){if(G_)return fu;G_=1;var r=Ht(),e=B_(),t=e(r);return fu=t,fu}var cu,U_;function xr(){if(U_)return cu;U_=1;function r(e){return e}return cu=r,cu}var lu,$_;function Cn(){if($_)return lu;$_=1;var r=xr();function e(t){return typeof t=="function"?t:r}return lu=e,lu}var hu,V_;function Tn(){if(V_)return hu;V_=1;var r=Bt(),e=ht(),t=Cn(),i=qe();function n(o,s){var a=i(o)?r:e;return a(o,t(s))}return hu=n,hu}var du,W_;function kn(){return W_||(W_=1,du=Tn()),du}var pu,K_;function Y_(){if(K_)return pu;K_=1;var r=ht();function e(t,i){var n=[];return r(t,function(o,s,a){i(o,s,a)&&n.push(o)}),n}return pu=e,pu}var mu,X_;function Z_(){if(X_)return mu;X_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return mu=e,mu}var gu,Q_;function J_(){if(Q_)return gu;Q_=1;function r(e){return this.__data__.has(e)}return gu=r,gu}var _u,H_;function Pn(){if(H_)return _u;H_=1;var r=Dt(),e=Z_(),t=J_();function i(n){var o=-1,s=n==null?0:n.length;for(this.__data__=new r;++o<s;)this.add(n[o])}return i.prototype.add=i.prototype.push=e,i.prototype.has=t,_u=i,_u}var vu,ev;function rv(){if(ev)return vu;ev=1;function r(e,t){for(var i=-1,n=e==null?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}return vu=r,vu}var yu,tv;function jn(){if(tv)return yu;tv=1;function r(e,t){return e.has(t)}return yu=r,yu}var qu,iv;function Ln(){if(iv)return qu;iv=1;var r=Pn(),e=rv(),t=jn(),i=1,n=2;function o(s,a,u,f,l,m){var _=u&i,g=s.length,w=a.length;if(g!=w&&!(_&&w>g))return!1;var b=m.get(s),q=m.get(a);if(b&&q)return b==a&&q==s;var y=-1,x=!0,E=u&n?new r:void 0;for(m.set(s,a),m.set(a,s);++y<g;){var N=s[y],M=a[y];if(f)var A=_?f(M,N,y,a,s,m):f(N,M,y,s,a,m);if(A!==void 0){if(A)continue;x=!1;break}if(E){if(!e(a,function(T,j){if(!t(E,j)&&(N===T||l(N,T,u,f,m)))return E.push(j)})){x=!1;break}}else if(!(N===M||l(N,M,u,f,m))){x=!1;break}}return m.delete(s),m.delete(a),x}return qu=o,qu}var wu,nv;function ov(){if(nv)return wu;nv=1;function r(e){var t=-1,i=Array(e.size);return e.forEach(function(n,o){i[++t]=[o,n]}),i}return wu=r,wu}var bu,sv;function ei(){if(sv)return bu;sv=1;function r(e){var t=-1,i=Array(e.size);return e.forEach(function(n){i[++t]=n}),i}return bu=r,bu}var xu,av;function uv(){if(av)return xu;av=1;var r=Ar(),e=Mn(),t=Rr(),i=Ln(),n=ov(),o=ei(),s=1,a=2,u="[object Boolean]",f="[object Date]",l="[object Error]",m="[object Map]",_="[object Number]",g="[object RegExp]",w="[object Set]",b="[object String]",q="[object Symbol]",y="[object ArrayBuffer]",x="[object DataView]",E=r?r.prototype:void 0,N=E?E.valueOf:void 0;function M(A,T,j,B,z,U,V){switch(j){case x:if(A.byteLength!=T.byteLength||A.byteOffset!=T.byteOffset)return!1;A=A.buffer,T=T.buffer;case y:return!(A.byteLength!=T.byteLength||!U(new e(A),new e(T)));case u:case f:case _:return t(+A,+T);case l:return A.name==T.name&&A.message==T.message;case g:case b:return A==T+"";case m:var W=n;case w:var H=B&s;if(W||(W=o),A.size!=T.size&&!H)return!1;var se=V.get(A);if(se)return se==T;B|=a,V.set(A,T);var fe=i(W(A),W(T),B,z,U,V);return V.delete(A),fe;case q:if(N)return N.call(A)==N.call(T)}return!1}return xu=M,xu}var Eu,fv;function cv(){if(fv)return Eu;fv=1;var r=Sn(),e=1,t=Object.prototype,i=t.hasOwnProperty;function n(o,s,a,u,f,l){var m=a&e,_=r(o),g=_.length,w=r(s),b=w.length;if(g!=b&&!m)return!1;for(var q=g;q--;){var y=_[q];if(!(m?y in s:i.call(s,y)))return!1}var x=l.get(o),E=l.get(s);if(x&&E)return x==s&&E==o;var N=!0;l.set(o,s),l.set(s,o);for(var M=m;++q<g;){y=_[q];var A=o[y],T=s[y];if(u)var j=m?u(T,A,y,s,o,l):u(A,T,y,o,s,l);if(!(j===void 0?A===T||f(A,T,a,u,l):j)){N=!1;break}M||(M=y=="constructor")}if(N&&!M){var B=o.constructor,z=s.constructor;B!=z&&"constructor"in o&&"constructor"in s&&!(typeof B=="function"&&B instanceof B&&typeof z=="function"&&z instanceof z)&&(N=!1)}return l.delete(o),l.delete(s),N}return Eu=n,Eu}var Su,lv;function hv(){if(lv)return Su;lv=1;var r=ot(),e=Ln(),t=uv(),i=cv(),n=Cr(),o=qe(),s=Or(),a=Kr(),u=1,f="[object Arguments]",l="[object Array]",m="[object Object]",_=Object.prototype,g=_.hasOwnProperty;function w(b,q,y,x,E,N){var M=o(b),A=o(q),T=M?l:n(b),j=A?l:n(q);T=T==f?m:T,j=j==f?m:j;var B=T==m,z=j==m,U=T==j;if(U&&s(b)){if(!s(q))return!1;M=!0,B=!1}if(U&&!B)return N||(N=new r),M||a(b)?e(b,q,y,x,E,N):t(b,q,T,y,x,E,N);if(!(y&u)){var V=B&&g.call(b,"__wrapped__"),W=z&&g.call(q,"__wrapped__");if(V||W){var H=V?b.value():b,se=W?q.value():q;return N||(N=new r),E(H,se,y,x,N)}}return U?(N||(N=new r),i(b,q,y,x,E,N)):!1}return Su=w,Su}var Nu,dv;function Fn(){if(dv)return Nu;dv=1;var r=hv(),e=tr();function t(i,n,o,s,a){return i===n?!0:i==null||n==null||!e(i)&&!e(n)?i!==i&&n!==n:r(i,n,o,s,t,a)}return Nu=t,Nu}var Mu,pv;function mv(){if(pv)return Mu;pv=1;var r=ot(),e=Fn(),t=1,i=2;function n(o,s,a,u){var f=a.length,l=f,m=!u;if(o==null)return!l;for(o=Object(o);f--;){var _=a[f];if(m&&_[2]?_[1]!==o[_[0]]:!(_[0]in o))return!1}for(;++f<l;){_=a[f];var g=_[0],w=o[g],b=_[1];if(m&&_[2]){if(w===void 0&&!(g in o))return!1}else{var q=new r;if(u)var y=u(w,b,g,o,s,q);if(!(y===void 0?e(b,w,t|i,u,q):y))return!1}}return!0}return Mu=n,Mu}var Iu,gv;function zn(){if(gv)return Iu;gv=1;var r=Ve();function e(t){return t===t&&!r(t)}return Iu=e,Iu}var Ru,_v;function vv(){if(_v)return Ru;_v=1;var r=zn(),e=mr();function t(i){for(var n=e(i),o=n.length;o--;){var s=n[o],a=i[s];n[o]=[s,a,r(a)]}return n}return Ru=t,Ru}var Au,yv;function Dn(){if(yv)return Au;yv=1;function r(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==void 0||e in Object(i))}}return Au=r,Au}var Ou,qv;function wv(){if(qv)return Ou;qv=1;var r=mv(),e=vv(),t=Dn();function i(n){var o=e(n);return o.length==1&&o[0][2]?t(o[0][0],o[0][1]):function(s){return s===n||r(s,n,o)}}return Ou=i,Ou}var Cu,bv;function Tr(){if(bv)return Cu;bv=1;var r=qr(),e=tr(),t="[object Symbol]";function i(n){return typeof n=="symbol"||e(n)&&r(n)==t}return Cu=i,Cu}var Tu,xv;function ri(){if(xv)return Tu;xv=1;var r=qe(),e=Tr(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function n(o,s){if(r(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||e(o)?!0:i.test(o)||!t.test(o)||s!=null&&o in Object(s)}return Tu=n,Tu}var ku,Ev;function Sv(){if(Ev)return ku;Ev=1;var r=Dt(),e="Expected a function";function t(i,n){if(typeof i!="function"||n!=null&&typeof n!="function")throw new TypeError(e);var o=function(){var s=arguments,a=n?n.apply(this,s):s[0],u=o.cache;if(u.has(a))return u.get(a);var f=i.apply(this,s);return o.cache=u.set(a,f)||u,f};return o.cache=new(t.Cache||r),o}return t.Cache=r,ku=t,ku}var Pu,Nv;function Mv(){if(Nv)return Pu;Nv=1;var r=Sv(),e=500;function t(i){var n=r(i,function(s){return o.size===e&&o.clear(),s}),o=n.cache;return n}return Pu=t,Pu}var ju,Iv;function Rv(){if(Iv)return ju;Iv=1;var r=Mv(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,i=r(function(n){var o=[];return n.charCodeAt(0)===46&&o.push(""),n.replace(e,function(s,a,u,f){o.push(u?f.replace(t,"$1"):a||s)}),o});return ju=i,ju}var Lu,Av;function dt(){if(Av)return Lu;Av=1;function r(e,t){for(var i=-1,n=e==null?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o}return Lu=r,Lu}var Fu,Ov;function Cv(){if(Ov)return Fu;Ov=1;var r=Ar(),e=dt(),t=qe(),i=Tr(),n=r?r.prototype:void 0,o=n?n.toString:void 0;function s(a){if(typeof a=="string")return a;if(t(a))return e(a,s)+"";if(i(a))return o?o.call(a):"";var u=a+"";return u=="0"&&1/a==-1/0?"-0":u}return Fu=s,Fu}var zu,Tv;function Bn(){if(Tv)return zu;Tv=1;var r=Cv();function e(t){return t==null?"":r(t)}return zu=e,zu}var Du,kv;function pt(){if(kv)return Du;kv=1;var r=qe(),e=ri(),t=Rv(),i=Bn();function n(o,s){return r(o)?o:e(o,s)?[o]:t(i(o))}return Du=n,Du}var Bu,Pv;function Yr(){if(Pv)return Bu;Pv=1;var r=Tr();function e(t){if(typeof t=="string"||r(t))return t;var i=t+"";return i=="0"&&1/t==-1/0?"-0":i}return Bu=e,Bu}var Gu,jv;function mt(){if(jv)return Gu;jv=1;var r=pt(),e=Yr();function t(i,n){n=r(n,i);for(var o=0,s=n.length;i!=null&&o<s;)i=i[e(n[o++])];return o&&o==s?i:void 0}return Gu=t,Gu}var Uu,Lv;function Fv(){if(Lv)return Uu;Lv=1;var r=mt();function e(t,i,n){var o=t==null?void 0:r(t,i);return o===void 0?n:o}return Uu=e,Uu}var $u,zv;function Dv(){if(zv)return $u;zv=1;function r(e,t){return e!=null&&t in Object(e)}return $u=r,$u}var Vu,Bv;function Gn(){if(Bv)return Vu;Bv=1;var r=pt(),e=Wr(),t=qe(),i=ut(),n=Ut(),o=Yr();function s(a,u,f){u=r(u,a);for(var l=-1,m=u.length,_=!1;++l<m;){var g=o(u[l]);if(!(_=a!=null&&f(a,g)))break;a=a[g]}return _||++l!=m?_:(m=a==null?0:a.length,!!m&&n(m)&&i(g,m)&&(t(a)||e(a)))}return Vu=s,Vu}var Wu,Gv;function Un(){if(Gv)return Wu;Gv=1;var r=Dv(),e=Gn();function t(i,n){return i!=null&&e(i,n,r)}return Wu=t,Wu}var Ku,Uv;function $v(){if(Uv)return Ku;Uv=1;var r=Fn(),e=Fv(),t=Un(),i=ri(),n=zn(),o=Dn(),s=Yr(),a=1,u=2;function f(l,m){return i(l)&&n(m)?o(s(l),m):function(_){var g=e(_,l);return g===void 0&&g===m?t(_,l):r(m,g,a|u)}}return Ku=f,Ku}var Yu,Vv;function $n(){if(Vv)return Yu;Vv=1;function r(e){return function(t){return t?.[e]}}return Yu=r,Yu}var Xu,Wv;function Kv(){if(Wv)return Xu;Wv=1;var r=mt();function e(t){return function(i){return r(i,t)}}return Xu=e,Xu}var Zu,Yv;function Xv(){if(Yv)return Zu;Yv=1;var r=$n(),e=Kv(),t=ri(),i=Yr();function n(o){return t(o)?r(i(o)):e(o)}return Zu=n,Zu}var Qu,Zv;function lr(){if(Zv)return Qu;Zv=1;var r=wv(),e=$v(),t=xr(),i=qe(),n=Xv();function o(s){return typeof s=="function"?s:s==null?t:typeof s=="object"?i(s)?e(s[0],s[1]):r(s):n(s)}return Qu=o,Qu}var Ju,Qv;function Vn(){if(Qv)return Ju;Qv=1;var r=wn(),e=Y_(),t=lr(),i=qe();function n(o,s){var a=i(o)?r:e;return a(o,t(s,3))}return Ju=n,Ju}var Hu,Jv;function Hv(){if(Jv)return Hu;Jv=1;var r=Object.prototype,e=r.hasOwnProperty;function t(i,n){return i!=null&&e.call(i,n)}return Hu=t,Hu}var ef,e0;function Wn(){if(e0)return ef;e0=1;var r=Hv(),e=Gn();function t(i,n){return i!=null&&e(i,n,r)}return ef=t,ef}var rf,r0;function t0(){if(r0)return rf;r0=1;var r=Wt(),e=Cr(),t=Wr(),i=qe(),n=cr(),o=Or(),s=ct(),a=Kr(),u="[object Map]",f="[object Set]",l=Object.prototype,m=l.hasOwnProperty;function _(g){if(g==null)return!0;if(n(g)&&(i(g)||typeof g=="string"||typeof g.splice=="function"||o(g)||a(g)||t(g)))return!g.length;var w=e(g);if(w==u||w==f)return!g.size;if(s(g))return!r(g).length;for(var b in g)if(m.call(g,b))return!1;return!0}return rf=_,rf}var tf,i0;function Kn(){if(i0)return tf;i0=1;function r(e){return e===void 0}return tf=r,tf}var nf,n0;function Yn(){if(n0)return nf;n0=1;var r=ht(),e=cr();function t(i,n){var o=-1,s=e(i)?Array(i.length):[];return r(i,function(a,u,f){s[++o]=n(a,u,f)}),s}return nf=t,nf}var of,o0;function Xn(){if(o0)return of;o0=1;var r=dt(),e=lr(),t=Yn(),i=qe();function n(o,s){var a=i(o)?r:t;return a(o,e(s,3))}return of=n,of}var sf,s0;function a0(){if(s0)return sf;s0=1;function r(e,t,i,n){var o=-1,s=e==null?0:e.length;for(n&&s&&(i=e[++o]);++o<s;)i=t(i,e[o],o,e);return i}return sf=r,sf}var af,u0;function f0(){if(u0)return af;u0=1;function r(e,t,i,n,o){return o(e,function(s,a,u){i=n?(n=!1,s):t(i,s,a,u)}),i}return af=r,af}var uf,c0;function Zn(){if(c0)return uf;c0=1;var r=a0(),e=ht(),t=lr(),i=f0(),n=qe();function o(s,a,u){var f=n(s)?r:i,l=arguments.length<3;return f(s,t(a,4),u,l,e)}return uf=o,uf}var ff,l0;function h0(){if(l0)return ff;l0=1;var r=qr(),e=qe(),t=tr(),i="[object String]";function n(o){return typeof o=="string"||!e(o)&&t(o)&&r(o)==i}return ff=n,ff}var cf,d0;function p0(){if(d0)return cf;d0=1;var r=$n(),e=r("length");return cf=e,cf}var lf,m0;function g0(){if(m0)return lf;m0=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",n=e+t+i,o="\\ufe0e\\ufe0f",s="\\u200d",a=RegExp("["+s+r+n+o+"]");function u(f){return a.test(f)}return lf=u,lf}var hf,_0;function v0(){if(_0)return hf;_0=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",n=e+t+i,o="\\ufe0e\\ufe0f",s="["+r+"]",a="["+n+"]",u="\\ud83c[\\udffb-\\udfff]",f="(?:"+a+"|"+u+")",l="[^"+r+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",_="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",w=f+"?",b="["+o+"]?",q="(?:"+g+"(?:"+[l,m,_].join("|")+")"+b+w+")*",y=b+w+q,x="(?:"+[l+a+"?",a,m,_,s].join("|")+")",E=RegExp(u+"(?="+u+")|"+x+y,"g");function N(M){for(var A=E.lastIndex=0;E.test(M);)++A;return A}return hf=N,hf}var df,y0;function q0(){if(y0)return df;y0=1;var r=p0(),e=g0(),t=v0();function i(n){return e(n)?t(n):r(n)}return df=i,df}var pf,w0;function b0(){if(w0)return pf;w0=1;var r=Wt(),e=Cr(),t=cr(),i=h0(),n=q0(),o="[object Map]",s="[object Set]";function a(u){if(u==null)return 0;if(t(u))return i(u)?n(u):u.length;var f=e(u);return f==o||f==s?u.size:r(u).length}return pf=a,pf}var mf,x0;function E0(){if(x0)return mf;x0=1;var r=Bt(),e=Rn(),t=Ht(),i=lr(),n=lt(),o=qe(),s=Or(),a=$r(),u=Ve(),f=Kr();function l(m,_,g){var w=o(m),b=w||s(m)||f(m);if(_=i(_,4),g==null){var q=m&&m.constructor;b?g=w?new q:[]:u(m)?g=a(q)?e(n(m)):{}:g={}}return(b?r:t)(m,function(y,x,E){return _(g,y,x,E)}),g}return mf=l,mf}var gf,S0;function N0(){if(S0)return gf;S0=1;var r=Ar(),e=Wr(),t=qe(),i=r?r.isConcatSpreadable:void 0;function n(o){return t(o)||e(o)||!!(i&&o&&o[i])}return gf=n,gf}var _f,M0;function ti(){if(M0)return _f;M0=1;var r=Xt(),e=N0();function t(i,n,o,s,a){var u=-1,f=i.length;for(o||(o=e),a||(a=[]);++u<f;){var l=i[u];n>0&&o(l)?n>1?t(l,n-1,o,s,a):r(a,l):s||(a[a.length]=l)}return a}return _f=t,_f}var vf,I0;function R0(){if(I0)return vf;I0=1;function r(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}return vf=r,vf}var yf,A0;function Qn(){if(A0)return yf;A0=1;var r=R0(),e=Math.max;function t(i,n,o){return n=e(n===void 0?i.length-1:n,0),function(){for(var s=arguments,a=-1,u=e(s.length-n,0),f=Array(u);++a<u;)f[a]=s[n+a];a=-1;for(var l=Array(n+1);++a<n;)l[a]=s[a];return l[n]=o(f),r(i,this,l)}}return yf=t,yf}var qf,O0;function C0(){if(O0)return qf;O0=1;var r=Qt(),e=gn(),t=xr(),i=e?function(n,o){return e(n,"toString",{configurable:!0,enumerable:!1,value:r(o),writable:!0})}:t;return qf=i,qf}var wf,T0;function k0(){if(T0)return wf;T0=1;var r=800,e=16,t=Date.now;function i(n){var o=0,s=0;return function(){var a=t(),u=e-(a-s);if(s=a,u>0){if(++o>=r)return arguments[0]}else o=0;return n.apply(void 0,arguments)}}return wf=i,wf}var bf,P0;function Jn(){if(P0)return bf;P0=1;var r=C0(),e=k0(),t=e(r);return bf=t,bf}var xf,j0;function gt(){if(j0)return xf;j0=1;var r=xr(),e=Qn(),t=Jn();function i(n,o){return t(e(n,o,r),n+"")}return xf=i,xf}var Ef,L0;function Hn(){if(L0)return Ef;L0=1;function r(e,t,i,n){for(var o=e.length,s=i+(n?1:-1);n?s--:++s<o;)if(t(e[s],s,e))return s;return-1}return Ef=r,Ef}var Sf,F0;function z0(){if(F0)return Sf;F0=1;function r(e){return e!==e}return Sf=r,Sf}var Nf,D0;function B0(){if(D0)return Nf;D0=1;function r(e,t,i){for(var n=i-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}return Nf=r,Nf}var Mf,G0;function U0(){if(G0)return Mf;G0=1;var r=Hn(),e=z0(),t=B0();function i(n,o,s){return o===o?t(n,o,s):r(n,e,s)}return Mf=i,Mf}var If,$0;function V0(){if($0)return If;$0=1;var r=U0();function e(t,i){var n=t==null?0:t.length;return!!n&&r(t,i,0)>-1}return If=e,If}var Rf,W0;function K0(){if(W0)return Rf;W0=1;function r(e,t,i){for(var n=-1,o=e==null?0:e.length;++n<o;)if(i(t,e[n]))return!0;return!1}return Rf=r,Rf}var Af,Y0;function X0(){if(Y0)return Af;Y0=1;function r(){}return Af=r,Af}var Of,Z0;function Q0(){if(Z0)return Of;Z0=1;var r=Nn(),e=X0(),t=ei(),i=1/0,n=r&&1/t(new r([,-0]))[1]==i?function(o){return new r(o)}:e;return Of=n,Of}var Cf,J0;function H0(){if(J0)return Cf;J0=1;var r=Pn(),e=V0(),t=K0(),i=jn(),n=Q0(),o=ei(),s=200;function a(u,f,l){var m=-1,_=e,g=u.length,w=!0,b=[],q=b;if(l)w=!1,_=t;else if(g>=s){var y=f?null:n(u);if(y)return o(y);w=!1,_=i,q=new r}else q=f?[]:b;e:for(;++m<g;){var x=u[m],E=f?f(x):x;if(x=l||x!==0?x:0,w&&E===E){for(var N=q.length;N--;)if(q[N]===E)continue e;f&&q.push(E),b.push(x)}else _(q,E,l)||(q!==b&&q.push(E),b.push(x))}return b}return Cf=a,Cf}var Tf,ey;function eo(){if(ey)return Tf;ey=1;var r=cr(),e=tr();function t(i){return e(i)&&r(i)}return Tf=t,Tf}var kf,ry;function ty(){if(ry)return kf;ry=1;var r=ti(),e=gt(),t=H0(),i=eo(),n=e(function(o){return t(r(o,1,i,!0))});return kf=n,kf}var Pf,iy;function ny(){if(iy)return Pf;iy=1;var r=dt();function e(t,i){return r(i,function(n){return t[n]})}return Pf=e,Pf}var jf,oy;function ro(){if(oy)return jf;oy=1;var r=ny(),e=mr();function t(i){return i==null?[]:r(i,e(i))}return jf=t,jf}var Lf,sy;function We(){if(sy)return Lf;sy=1;var r;if(typeof Ft=="function")try{r={clone:k_(),constant:Qt(),each:kn(),filter:Vn(),has:Wn(),isArray:qe(),isEmpty:t0(),isFunction:$r(),isUndefined:Kn(),keys:mr(),map:Xn(),reduce:Zn(),size:b0(),transform:E0(),union:ty(),values:ro()}}catch{}return r||(r=window._),Lf=r,Lf}var Ff,ay;function ii(){if(ay)return Ff;ay=1;var r=We();Ff=n;var e="\0",t="\0",i="";function n(l){this._isDirected=r.has(l,"directed")?l.directed:!0,this._isMultigraph=r.has(l,"multigraph")?l.multigraph:!1,this._isCompound=r.has(l,"compound")?l.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(l){return this._label=l,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(l){return r.isFunction(l)||(l=r.constant(l)),this._defaultNodeLabelFn=l,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return r.keys(this._nodes)},n.prototype.sources=function(){var l=this;return r.filter(this.nodes(),function(m){return r.isEmpty(l._in[m])})},n.prototype.sinks=function(){var l=this;return r.filter(this.nodes(),function(m){return r.isEmpty(l._out[m])})},n.prototype.setNodes=function(l,m){var _=arguments,g=this;return r.each(l,function(w){_.length>1?g.setNode(w,m):g.setNode(w)}),this},n.prototype.setNode=function(l,m){return r.has(this._nodes,l)?(arguments.length>1&&(this._nodes[l]=m),this):(this._nodes[l]=arguments.length>1?m:this._defaultNodeLabelFn(l),this._isCompound&&(this._parent[l]=t,this._children[l]={},this._children[t][l]=!0),this._in[l]={},this._preds[l]={},this._out[l]={},this._sucs[l]={},++this._nodeCount,this)},n.prototype.node=function(l){return this._nodes[l]},n.prototype.hasNode=function(l){return r.has(this._nodes,l)},n.prototype.removeNode=function(l){var m=this;if(r.has(this._nodes,l)){var _=function(g){m.removeEdge(m._edgeObjs[g])};delete this._nodes[l],this._isCompound&&(this._removeFromParentsChildList(l),delete this._parent[l],r.each(this.children(l),function(g){m.setParent(g)}),delete this._children[l]),r.each(r.keys(this._in[l]),_),delete this._in[l],delete this._preds[l],r.each(r.keys(this._out[l]),_),delete this._out[l],delete this._sucs[l],--this._nodeCount}return this},n.prototype.setParent=function(l,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(m))m=t;else{m+="";for(var _=m;!r.isUndefined(_);_=this.parent(_))if(_===l)throw new Error("Setting "+m+" as parent of "+l+" would create a cycle");this.setNode(m)}return this.setNode(l),this._removeFromParentsChildList(l),this._parent[l]=m,this._children[m][l]=!0,this},n.prototype._removeFromParentsChildList=function(l){delete this._children[this._parent[l]][l]},n.prototype.parent=function(l){if(this._isCompound){var m=this._parent[l];if(m!==t)return m}},n.prototype.children=function(l){if(r.isUndefined(l)&&(l=t),this._isCompound){var m=this._children[l];if(m)return r.keys(m)}else{if(l===t)return this.nodes();if(this.hasNode(l))return[]}},n.prototype.predecessors=function(l){var m=this._preds[l];if(m)return r.keys(m)},n.prototype.successors=function(l){var m=this._sucs[l];if(m)return r.keys(m)},n.prototype.neighbors=function(l){var m=this.predecessors(l);if(m)return r.union(m,this.successors(l))},n.prototype.isLeaf=function(l){var m;return this.isDirected()?m=this.successors(l):m=this.neighbors(l),m.length===0},n.prototype.filterNodes=function(l){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var _=this;r.each(this._nodes,function(b,q){l(q)&&m.setNode(q,b)}),r.each(this._edgeObjs,function(b){m.hasNode(b.v)&&m.hasNode(b.w)&&m.setEdge(b,_.edge(b))});var g={};function w(b){var q=_.parent(b);return q===void 0||m.hasNode(q)?(g[b]=q,q):q in g?g[q]:w(q)}return this._isCompound&&r.each(m.nodes(),function(b){m.setParent(b,w(b))}),m},n.prototype.setDefaultEdgeLabel=function(l){return r.isFunction(l)||(l=r.constant(l)),this._defaultEdgeLabelFn=l,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return r.values(this._edgeObjs)},n.prototype.setPath=function(l,m){var _=this,g=arguments;return r.reduce(l,function(w,b){return g.length>1?_.setEdge(w,b,m):_.setEdge(w,b),b}),this},n.prototype.setEdge=function(){var l,m,_,g,w=!1,b=arguments[0];typeof b=="object"&&b!==null&&"v"in b?(l=b.v,m=b.w,_=b.name,arguments.length===2&&(g=arguments[1],w=!0)):(l=b,m=arguments[1],_=arguments[3],arguments.length>2&&(g=arguments[2],w=!0)),l=""+l,m=""+m,r.isUndefined(_)||(_=""+_);var q=a(this._isDirected,l,m,_);if(r.has(this._edgeLabels,q))return w&&(this._edgeLabels[q]=g),this;if(!r.isUndefined(_)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(m),this._edgeLabels[q]=w?g:this._defaultEdgeLabelFn(l,m,_);var y=u(this._isDirected,l,m,_);return l=y.v,m=y.w,Object.freeze(y),this._edgeObjs[q]=y,o(this._preds[m],l),o(this._sucs[l],m),this._in[m][q]=y,this._out[l][q]=y,this._edgeCount++,this},n.prototype.edge=function(l,m,_){var g=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,l,m,_);return this._edgeLabels[g]},n.prototype.hasEdge=function(l,m,_){var g=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,l,m,_);return r.has(this._edgeLabels,g)},n.prototype.removeEdge=function(l,m,_){var g=arguments.length===1?f(this._isDirected,arguments[0]):a(this._isDirected,l,m,_),w=this._edgeObjs[g];return w&&(l=w.v,m=w.w,delete this._edgeLabels[g],delete this._edgeObjs[g],s(this._preds[m],l),s(this._sucs[l],m),delete this._in[m][g],delete this._out[l][g],this._edgeCount--),this},n.prototype.inEdges=function(l,m){var _=this._in[l];if(_){var g=r.values(_);return m?r.filter(g,function(w){return w.v===m}):g}},n.prototype.outEdges=function(l,m){var _=this._out[l];if(_){var g=r.values(_);return m?r.filter(g,function(w){return w.w===m}):g}},n.prototype.nodeEdges=function(l,m){var _=this.inEdges(l,m);if(_)return _.concat(this.outEdges(l,m))};function o(l,m){l[m]?l[m]++:l[m]=1}function s(l,m){--l[m]||delete l[m]}function a(l,m,_,g){var w=""+m,b=""+_;if(!l&&w>b){var q=w;w=b,b=q}return w+i+b+i+(r.isUndefined(g)?e:g)}function u(l,m,_,g){var w=""+m,b=""+_;if(!l&&w>b){var q=w;w=b,b=q}var y={v:w,w:b};return g&&(y.name=g),y}function f(l,m){return a(l,m.v,m.w,m.name)}return Ff}var zf,uy;function fy(){return uy||(uy=1,zf="2.1.8"),zf}var Df,cy;function ly(){return cy||(cy=1,Df={Graph:ii(),version:fy()}),Df}var Bf,hy;function dy(){if(hy)return Bf;hy=1;var r=We(),e=ii();Bf={write:t,read:o};function t(s){var a={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:i(s),edges:n(s)};return r.isUndefined(s.graph())||(a.value=r.clone(s.graph())),a}function i(s){return r.map(s.nodes(),function(a){var u=s.node(a),f=s.parent(a),l={v:a};return r.isUndefined(u)||(l.value=u),r.isUndefined(f)||(l.parent=f),l})}function n(s){return r.map(s.edges(),function(a){var u=s.edge(a),f={v:a.v,w:a.w};return r.isUndefined(a.name)||(f.name=a.name),r.isUndefined(u)||(f.value=u),f})}function o(s){var a=new e(s.options).setGraph(s.value);return r.each(s.nodes,function(u){a.setNode(u.v,u.value),u.parent&&a.setParent(u.v,u.parent)}),r.each(s.edges,function(u){a.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),a}return Bf}var Gf,py;function my(){if(py)return Gf;py=1;var r=We();Gf=e;function e(t){var i={},n=[],o;function s(a){r.has(i,a)||(i[a]=!0,o.push(a),r.each(t.successors(a),s),r.each(t.predecessors(a),s))}return r.each(t.nodes(),function(a){o=[],s(a),o.length&&n.push(o)}),n}return Gf}var Uf,gy;function to(){if(gy)return Uf;gy=1;var r=We();Uf=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var i=this._keyIndices[t];if(i!==void 0)return this._arr[i].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,i){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var o=this._arr,s=o.length;return n[t]=s,o.push({key:t,priority:i}),this._decrease(s),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,i){var n=this._keyIndices[t];if(i>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+i);this._arr[n].priority=i,this._decrease(n)},e.prototype._heapify=function(t){var i=this._arr,n=2*t,o=n+1,s=t;n<i.length&&(s=i[n].priority<i[s].priority?n:s,o<i.length&&(s=i[o].priority<i[s].priority?o:s),s!==t&&(this._swap(t,s),this._heapify(s)))},e.prototype._decrease=function(t){for(var i=this._arr,n=i[t].priority,o;t!==0&&(o=t>>1,!(i[o].priority<n));)this._swap(t,o),t=o},e.prototype._swap=function(t,i){var n=this._arr,o=this._keyIndices,s=n[t],a=n[i];n[t]=a,n[i]=s,o[a.key]=t,o[s.key]=i},Uf}var $f,_y;function io(){if(_y)return $f;_y=1;var r=We(),e=to();$f=i;var t=r.constant(1);function i(o,s,a,u){return n(o,String(s),a||t,u||function(f){return o.outEdges(f)})}function n(o,s,a,u){var f={},l=new e,m,_,g=function(w){var b=w.v!==m?w.v:w.w,q=f[b],y=a(w),x=_.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+w+" Weight: "+y);x<q.distance&&(q.distance=x,q.predecessor=m,l.decrease(b,x))};for(o.nodes().forEach(function(w){var b=w===s?0:Number.POSITIVE_INFINITY;f[w]={distance:b},l.add(w,b)});l.size()>0&&(m=l.removeMin(),_=f[m],_.distance!==Number.POSITIVE_INFINITY);)u(m).forEach(g);return f}return $f}var Vf,vy;function yy(){if(vy)return Vf;vy=1;var r=io(),e=We();Vf=t;function t(i,n,o){return e.transform(i.nodes(),function(s,a){s[a]=r(i,a,n,o)},{})}return Vf}var Wf,qy;function no(){if(qy)return Wf;qy=1;var r=We();Wf=e;function e(t){var i=0,n=[],o={},s=[];function a(u){var f=o[u]={onStack:!0,lowlink:i,index:i++};if(n.push(u),t.successors(u).forEach(function(_){r.has(o,_)?o[_].onStack&&(f.lowlink=Math.min(f.lowlink,o[_].index)):(a(_),f.lowlink=Math.min(f.lowlink,o[_].lowlink))}),f.lowlink===f.index){var l=[],m;do m=n.pop(),o[m].onStack=!1,l.push(m);while(u!==m);s.push(l)}}return t.nodes().forEach(function(u){r.has(o,u)||a(u)}),s}return Wf}var Kf,wy;function by(){if(wy)return Kf;wy=1;var r=We(),e=no();Kf=t;function t(i){return r.filter(e(i),function(n){return n.length>1||n.length===1&&i.hasEdge(n[0],n[0])})}return Kf}var Yf,xy;function Ey(){if(xy)return Yf;xy=1;var r=We();Yf=t;var e=r.constant(1);function t(n,o,s){return i(n,o||e,s||function(a){return n.outEdges(a)})}function i(n,o,s){var a={},u=n.nodes();return u.forEach(function(f){a[f]={},a[f][f]={distance:0},u.forEach(function(l){f!==l&&(a[f][l]={distance:Number.POSITIVE_INFINITY})}),s(f).forEach(function(l){var m=l.v===f?l.w:l.v,_=o(l);a[f][m]={distance:_,predecessor:f}})}),u.forEach(function(f){var l=a[f];u.forEach(function(m){var _=a[m];u.forEach(function(g){var w=_[f],b=l[g],q=_[g],y=w.distance+b.distance;y<q.distance&&(q.distance=y,q.predecessor=b.predecessor)})})}),a}return Yf}var Xf,Sy;function oo(){if(Sy)return Xf;Sy=1;var r=We();Xf=e,e.CycleException=t;function e(i){var n={},o={},s=[];function a(u){if(r.has(o,u))throw new t;r.has(n,u)||(o[u]=!0,n[u]=!0,r.each(i.predecessors(u),a),delete o[u],s.push(u))}if(r.each(i.sinks(),a),r.size(n)!==i.nodeCount())throw new t;return s}function t(){}return t.prototype=new Error,Xf}var Zf,Ny;function My(){if(Ny)return Zf;Ny=1;var r=oo();Zf=e;function e(t){try{r(t)}catch(i){if(i instanceof r.CycleException)return!1;throw i}return!0}return Zf}var Qf,Iy;function so(){if(Iy)return Qf;Iy=1;var r=We();Qf=e;function e(i,n,o){r.isArray(n)||(n=[n]);var s=(i.isDirected()?i.successors:i.neighbors).bind(i),a=[],u={};return r.each(n,function(f){if(!i.hasNode(f))throw new Error("Graph does not have node: "+f);t(i,f,o==="post",u,s,a)}),a}function t(i,n,o,s,a,u){r.has(s,n)||(s[n]=!0,o||u.push(n),r.each(a(n),function(f){t(i,f,o,s,a,u)}),o&&u.push(n))}return Qf}var Jf,Ry;function Ay(){if(Ry)return Jf;Ry=1;var r=so();Jf=e;function e(t,i){return r(t,i,"post")}return Jf}var Hf,Oy;function Cy(){if(Oy)return Hf;Oy=1;var r=so();Hf=e;function e(t,i){return r(t,i,"pre")}return Hf}var ec,Ty;function ky(){if(Ty)return ec;Ty=1;var r=We(),e=ii(),t=to();ec=i;function i(n,o){var s=new e,a={},u=new t,f;function l(_){var g=_.v===f?_.w:_.v,w=u.priority(g);if(w!==void 0){var b=o(_);b<w&&(a[g]=f,u.decrease(g,b))}}if(n.nodeCount()===0)return s;r.each(n.nodes(),function(_){u.add(_,Number.POSITIVE_INFINITY),s.setNode(_)}),u.decrease(n.nodes()[0],0);for(var m=!1;u.size()>0;){if(f=u.removeMin(),r.has(a,f))s.setEdge(f,a[f]);else{if(m)throw new Error("Input graph is not connected: "+n);m=!0}n.nodeEdges(f).forEach(l)}return s}return ec}var rc,Py;function jy(){return Py||(Py=1,rc={components:my(),dijkstra:io(),dijkstraAll:yy(),findCycles:by(),floydWarshall:Ey(),isAcyclic:My(),postorder:Ay(),preorder:Cy(),prim:ky(),tarjan:no(),topsort:oo()}),rc}var tc,Ly;function Fy(){if(Ly)return tc;Ly=1;var r=ly();return tc={Graph:r.Graph,json:dy(),alg:jy(),version:r.version},tc}var ic,zy;function er(){if(zy)return ic;zy=1;var r;if(typeof Ft=="function")try{r=Fy()}catch{}return r||(r=window.graphlib),ic=r,ic}var nc,Dy;function By(){if(Dy)return nc;Dy=1;var r=On(),e=1,t=4;function i(n){return r(n,e|t)}return nc=i,nc}var oc,Gy;function _t(){if(Gy)return oc;Gy=1;var r=Rr(),e=cr(),t=ut(),i=Ve();function n(o,s,a){if(!i(a))return!1;var u=typeof s;return(u=="number"?e(a)&&t(s,a.length):u=="string"&&s in a)?r(a[s],o):!1}return oc=n,oc}var sc,Uy;function $y(){if(Uy)return sc;Uy=1;var r=gt(),e=Rr(),t=_t(),i=br(),n=Object.prototype,o=n.hasOwnProperty,s=r(function(a,u){a=Object(a);var f=-1,l=u.length,m=l>2?u[2]:void 0;for(m&&t(u[0],u[1],m)&&(l=1);++f<l;)for(var _=u[f],g=i(_),w=-1,b=g.length;++w<b;){var q=g[w],y=a[q];(y===void 0||e(y,n[q])&&!o.call(a,q))&&(a[q]=_[q])}return a});return sc=s,sc}var ac,Vy;function Wy(){if(Vy)return ac;Vy=1;var r=lr(),e=cr(),t=mr();function i(n){return function(o,s,a){var u=Object(o);if(!e(o)){var f=r(s,3);o=t(o),s=function(m){return f(u[m],m,u)}}var l=n(o,s,a);return l>-1?u[f?o[l]:l]:void 0}}return ac=i,ac}var uc,Ky;function Yy(){if(Ky)return uc;Ky=1;var r=/\s/;function e(t){for(var i=t.length;i--&&r.test(t.charAt(i)););return i}return uc=e,uc}var fc,Xy;function Zy(){if(Xy)return fc;Xy=1;var r=Yy(),e=/^\s+/;function t(i){return i&&i.slice(0,r(i)+1).replace(e,"")}return fc=t,fc}var cc,Qy;function Jy(){if(Qy)return cc;Qy=1;var r=Zy(),e=Ve(),t=Tr(),i=NaN,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function u(f){if(typeof f=="number")return f;if(t(f))return i;if(e(f)){var l=typeof f.valueOf=="function"?f.valueOf():f;f=e(l)?l+"":l}if(typeof f!="string")return f===0?f:+f;f=r(f);var m=o.test(f);return m||s.test(f)?a(f.slice(2),m?2:8):n.test(f)?i:+f}return cc=u,cc}var lc,Hy;function ao(){if(Hy)return lc;Hy=1;var r=Jy(),e=1/0,t=17976931348623157e292;function i(n){if(!n)return n===0?n:0;if(n=r(n),n===e||n===-e){var o=n<0?-1:1;return o*t}return n===n?n:0}return lc=i,lc}var hc,eq;function rq(){if(eq)return hc;eq=1;var r=ao();function e(t){var i=r(t),n=i%1;return i===i?n?i-n:i:0}return hc=e,hc}var dc,tq;function iq(){if(tq)return dc;tq=1;var r=Hn(),e=lr(),t=rq(),i=Math.max;function n(o,s,a){var u=o==null?0:o.length;if(!u)return-1;var f=a==null?0:t(a);return f<0&&(f=i(u+f,0)),r(o,e(s,3),f)}return dc=n,dc}var pc,nq;function oq(){if(nq)return pc;nq=1;var r=Wy(),e=iq(),t=r(e);return pc=t,pc}var mc,sq;function uo(){if(sq)return mc;sq=1;var r=ti();function e(t){var i=t==null?0:t.length;return i?r(t,1):[]}return mc=e,mc}var gc,aq;function uq(){if(aq)return gc;aq=1;var r=Jt(),e=Cn(),t=br();function i(n,o){return n==null?n:r(n,e(o),t)}return gc=i,gc}var _c,fq;function cq(){if(fq)return _c;fq=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return _c=r,_c}var vc,lq;function hq(){if(lq)return vc;lq=1;var r=st(),e=Ht(),t=lr();function i(n,o){var s={};return o=t(o,3),e(n,function(a,u,f){r(s,u,o(a,u,f))}),s}return vc=i,vc}var yc,dq;function ni(){if(dq)return yc;dq=1;var r=Tr();function e(t,i,n){for(var o=-1,s=t.length;++o<s;){var a=t[o],u=i(a);if(u!=null&&(f===void 0?u===u&&!r(u):n(u,f)))var f=u,l=a}return l}return yc=e,yc}var qc,pq;function mq(){if(pq)return qc;pq=1;function r(e,t){return e>t}return qc=r,qc}var wc,gq;function _q(){if(gq)return wc;gq=1;var r=ni(),e=mq(),t=xr();function i(n){return n&&n.length?r(n,t,e):void 0}return wc=i,wc}var bc,vq;function fo(){if(vq)return bc;vq=1;var r=st(),e=Rr();function t(i,n,o){(o!==void 0&&!e(i[n],o)||o===void 0&&!(n in i))&&r(i,n,o)}return bc=t,bc}var xc,yq;function qq(){if(yq)return xc;yq=1;var r=qr(),e=lt(),t=tr(),i="[object Object]",n=Function.prototype,o=Object.prototype,s=n.toString,a=o.hasOwnProperty,u=s.call(Object);function f(l){if(!t(l)||r(l)!=i)return!1;var m=e(l);if(m===null)return!0;var _=a.call(m,"constructor")&&m.constructor;return typeof _=="function"&&_ instanceof _&&s.call(_)==u}return xc=f,xc}var Ec,wq;function co(){if(wq)return Ec;wq=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return Ec=r,Ec}var Sc,bq;function xq(){if(bq)return Sc;bq=1;var r=Vr(),e=br();function t(i){return r(i,e(i))}return Sc=t,Sc}var Nc,Eq;function Sq(){if(Eq)return Nc;Eq=1;var r=fo(),e=yn(),t=In(),i=qn(),n=An(),o=Wr(),s=qe(),a=eo(),u=Or(),f=$r(),l=Ve(),m=qq(),_=Kr(),g=co(),w=xq();function b(q,y,x,E,N,M,A){var T=g(q,x),j=g(y,x),B=A.get(j);if(B){r(q,x,B);return}var z=M?M(T,j,x+"",q,y,A):void 0,U=z===void 0;if(U){var V=s(j),W=!V&&u(j),H=!V&&!W&&_(j);z=j,V||W||H?s(T)?z=T:a(T)?z=i(T):W?(U=!1,z=e(j,!0)):H?(U=!1,z=t(j,!0)):z=[]:m(j)||o(j)?(z=T,o(T)?z=w(T):(!l(T)||f(T))&&(z=n(j))):U=!1}U&&(A.set(j,z),N(z,j,E,M,A),A.delete(j)),r(q,x,z)}return Nc=b,Nc}var Mc,Nq;function Mq(){if(Nq)return Mc;Nq=1;var r=ot(),e=fo(),t=Jt(),i=Sq(),n=Ve(),o=br(),s=co();function a(u,f,l,m,_){u!==f&&t(f,function(g,w){if(_||(_=new r),n(g))i(u,f,w,l,a,m,_);else{var b=m?m(s(u,w),g,w+"",u,f,_):void 0;b===void 0&&(b=g),e(u,w,b)}},o)}return Mc=a,Mc}var Ic,Iq;function Rq(){if(Iq)return Ic;Iq=1;var r=gt(),e=_t();function t(i){return r(function(n,o){var s=-1,a=o.length,u=a>1?o[a-1]:void 0,f=a>2?o[2]:void 0;for(u=i.length>3&&typeof u=="function"?(a--,u):void 0,f&&e(o[0],o[1],f)&&(u=a<3?void 0:u,a=1),n=Object(n);++s<a;){var l=o[s];l&&i(n,l,s,u)}return n})}return Ic=t,Ic}var Rc,Aq;function Oq(){if(Aq)return Rc;Aq=1;var r=Mq(),e=Rq(),t=e(function(i,n,o){r(i,n,o)});return Rc=t,Rc}var Ac,Cq;function lo(){if(Cq)return Ac;Cq=1;function r(e,t){return e<t}return Ac=r,Ac}var Oc,Tq;function kq(){if(Tq)return Oc;Tq=1;var r=ni(),e=lo(),t=xr();function i(n){return n&&n.length?r(n,t,e):void 0}return Oc=i,Oc}var Cc,Pq;function jq(){if(Pq)return Cc;Pq=1;var r=ni(),e=lr(),t=lo();function i(n,o){return n&&n.length?r(n,e(o,2),t):void 0}return Cc=i,Cc}var Tc,Lq;function Fq(){if(Lq)return Tc;Lq=1;var r=Qe(),e=function(){return r.Date.now()};return Tc=e,Tc}var kc,zq;function Dq(){if(zq)return kc;zq=1;var r=at(),e=pt(),t=ut(),i=Ve(),n=Yr();function o(s,a,u,f){if(!i(s))return s;a=e(a,s);for(var l=-1,m=a.length,_=m-1,g=s;g!=null&&++l<m;){var w=n(a[l]),b=u;if(w==="__proto__"||w==="constructor"||w==="prototype")return s;if(l!=_){var q=g[w];b=f?f(q,w,g):void 0,b===void 0&&(b=i(q)?q:t(a[l+1])?[]:{})}r(g,w,b),g=g[w]}return s}return kc=o,kc}var Pc,Bq;function Gq(){if(Bq)return Pc;Bq=1;var r=mt(),e=Dq(),t=pt();function i(n,o,s){for(var a=-1,u=o.length,f={};++a<u;){var l=o[a],m=r(n,l);s(m,l)&&e(f,t(l,n),m)}return f}return Pc=i,Pc}var jc,Uq;function $q(){if(Uq)return jc;Uq=1;var r=Gq(),e=Un();function t(i,n){return r(i,n,function(o,s){return e(i,s)})}return jc=t,jc}var Lc,Vq;function Wq(){if(Vq)return Lc;Vq=1;var r=uo(),e=Qn(),t=Jn();function i(n){return t(e(n,void 0,r),n+"")}return Lc=i,Lc}var Fc,Kq;function Yq(){if(Kq)return Fc;Kq=1;var r=$q(),e=Wq(),t=e(function(i,n){return i==null?{}:r(i,n)});return Fc=t,Fc}var zc,Xq;function Zq(){if(Xq)return zc;Xq=1;var r=Math.ceil,e=Math.max;function t(i,n,o,s){for(var a=-1,u=e(r((n-i)/(o||1)),0),f=Array(u);u--;)f[s?u:++a]=i,i+=o;return f}return zc=t,zc}var Dc,Qq;function Jq(){if(Qq)return Dc;Qq=1;var r=Zq(),e=_t(),t=ao();function i(n){return function(o,s,a){return a&&typeof a!="number"&&e(o,s,a)&&(s=a=void 0),o=t(o),s===void 0?(s=o,o=0):s=t(s),a=a===void 0?o<s?1:-1:t(a),r(o,s,a,n)}}return Dc=i,Dc}var Bc,Hq;function ew(){if(Hq)return Bc;Hq=1;var r=Jq(),e=r();return Bc=e,Bc}var Gc,rw;function tw(){if(rw)return Gc;rw=1;function r(e,t){var i=e.length;for(e.sort(t);i--;)e[i]=e[i].value;return e}return Gc=r,Gc}var Uc,iw;function nw(){if(iw)return Uc;iw=1;var r=Tr();function e(t,i){if(t!==i){var n=t!==void 0,o=t===null,s=t===t,a=r(t),u=i!==void 0,f=i===null,l=i===i,m=r(i);if(!f&&!m&&!a&&t>i||a&&u&&l&&!f&&!m||o&&u&&l||!n&&l||!s)return 1;if(!o&&!a&&!m&&t<i||m&&n&&s&&!o&&!a||f&&n&&s||!u&&s||!l)return-1}return 0}return Uc=e,Uc}var $c,ow;function sw(){if(ow)return $c;ow=1;var r=nw();function e(t,i,n){for(var o=-1,s=t.criteria,a=i.criteria,u=s.length,f=n.length;++o<u;){var l=r(s[o],a[o]);if(l){if(o>=f)return l;var m=n[o];return l*(m=="desc"?-1:1)}}return t.index-i.index}return $c=e,$c}var Vc,aw;function uw(){if(aw)return Vc;aw=1;var r=dt(),e=mt(),t=lr(),i=Yn(),n=tw(),o=ft(),s=sw(),a=xr(),u=qe();function f(l,m,_){m.length?m=r(m,function(b){return u(b)?function(q){return e(q,b.length===1?b[0]:b)}:b}):m=[a];var g=-1;m=r(m,o(t));var w=i(l,function(b,q,y){var x=r(m,function(E){return E(b)});return{criteria:x,index:++g,value:b}});return n(w,function(b,q){return s(b,q,_)})}return Vc=f,Vc}var Wc,fw;function cw(){if(fw)return Wc;fw=1;var r=ti(),e=uw(),t=gt(),i=_t(),n=t(function(o,s){if(o==null)return[];var a=s.length;return a>1&&i(o,s[0],s[1])?s=[]:a>2&&i(s[0],s[1],s[2])&&(s=[s[0]]),e(o,r(s,1),[])});return Wc=n,Wc}var Kc,lw;function hw(){if(lw)return Kc;lw=1;var r=Bn(),e=0;function t(i){var n=++e;return r(i)+n}return Kc=t,Kc}var Yc,dw;function pw(){if(dw)return Yc;dw=1;function r(e,t,i){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var u=n<s?t[n]:void 0;i(a,e[n],u)}return a}return Yc=r,Yc}var Xc,mw;function gw(){if(mw)return Xc;mw=1;var r=at(),e=pw();function t(i,n){return e(i||[],n||[],r)}return Xc=t,Xc}var Zc,_w;function he(){if(_w)return Zc;_w=1;var r;if(typeof Ft=="function")try{r={cloneDeep:By(),constant:Qt(),defaults:$y(),each:kn(),filter:Vn(),find:oq(),flatten:uo(),forEach:Tn(),forIn:uq(),has:Wn(),isUndefined:Kn(),last:cq(),map:Xn(),mapValues:hq(),max:_q(),merge:Oq(),min:kq(),minBy:jq(),now:Fq(),pick:Yq(),range:ew(),reduce:Zn(),sortBy:cw(),uniqueId:hw(),values:ro(),zipObject:gw()}}catch{}return r||(r=window._),Zc=r,Zc}var Qc,vw;function yw(){if(vw)return Qc;vw=1,Qc=r;function r(){var i={};i._next=i._prev=i,this._sentinel=i}r.prototype.dequeue=function(){var i=this._sentinel,n=i._prev;if(n!==i)return e(n),n},r.prototype.enqueue=function(i){var n=this._sentinel;i._prev&&i._next&&e(i),i._next=n._next,n._next._prev=i,n._next=i,i._prev=n},r.prototype.toString=function(){for(var i=[],n=this._sentinel,o=n._prev;o!==n;)i.push(JSON.stringify(o,t)),o=o._prev;return"["+i.join(", ")+"]"};function e(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function t(i,n){if(i!=="_next"&&i!=="_prev")return n}return Qc}var Jc,qw;function ww(){if(qw)return Jc;qw=1;var r=he(),e=er().Graph,t=yw();Jc=n;var i=r.constant(1);function n(f,l){if(f.nodeCount()<=1)return[];var m=a(f,l||i),_=o(m.graph,m.buckets,m.zeroIdx);return r.flatten(r.map(_,function(g){return f.outEdges(g.v,g.w)}),!0)}function o(f,l,m){for(var _=[],g=l[l.length-1],w=l[0],b;f.nodeCount();){for(;b=w.dequeue();)s(f,l,m,b);for(;b=g.dequeue();)s(f,l,m,b);if(f.nodeCount()){for(var q=l.length-2;q>0;--q)if(b=l[q].dequeue(),b){_=_.concat(s(f,l,m,b,!0));break}}}return _}function s(f,l,m,_,g){var w=g?[]:void 0;return r.forEach(f.inEdges(_.v),function(b){var q=f.edge(b),y=f.node(b.v);g&&w.push({v:b.v,w:b.w}),y.out-=q,u(l,m,y)}),r.forEach(f.outEdges(_.v),function(b){var q=f.edge(b),y=b.w,x=f.node(y);x.in-=q,u(l,m,x)}),f.removeNode(_.v),w}function a(f,l){var m=new e,_=0,g=0;r.forEach(f.nodes(),function(q){m.setNode(q,{v:q,in:0,out:0})}),r.forEach(f.edges(),function(q){var y=m.edge(q.v,q.w)||0,x=l(q),E=y+x;m.setEdge(q.v,q.w,E),g=Math.max(g,m.node(q.v).out+=x),_=Math.max(_,m.node(q.w).in+=x)});var w=r.range(g+_+3).map(function(){return new t}),b=_+1;return r.forEach(m.nodes(),function(q){u(w,b,m.node(q))}),{graph:m,buckets:w,zeroIdx:b}}function u(f,l,m){m.out?m.in?f[m.out-m.in+l].enqueue(m):f[f.length-1].enqueue(m):f[0].enqueue(m)}return Jc}var Hc,bw;function xw(){if(bw)return Hc;bw=1;var r=he(),e=ww();Hc={run:t,undo:n};function t(o){var s=o.graph().acyclicer==="greedy"?e(o,a(o)):i(o);r.forEach(s,function(u){var f=o.edge(u);o.removeEdge(u),f.forwardName=u.name,f.reversed=!0,o.setEdge(u.w,u.v,f,r.uniqueId("rev"))});function a(u){return function(f){return u.edge(f).weight}}}function i(o){var s=[],a={},u={};function f(l){r.has(u,l)||(u[l]=!0,a[l]=!0,r.forEach(o.outEdges(l),function(m){r.has(a,m.w)?s.push(m):f(m.w)}),delete a[l])}return r.forEach(o.nodes(),f),s}function n(o){r.forEach(o.edges(),function(s){var a=o.edge(s);if(a.reversed){o.removeEdge(s);var u=a.forwardName;delete a.reversed,delete a.forwardName,o.setEdge(s.w,s.v,a,u)}})}return Hc}var el,Ew;function De(){if(Ew)return el;Ew=1;var r=he(),e=er().Graph;el={addDummyNode:t,simplify:i,asNonCompoundGraph:n,successorWeights:o,predecessorWeights:s,intersectRect:a,buildLayerMatrix:u,normalizeRanks:f,removeEmptyRanks:l,addBorderNode:m,maxRank:_,partition:g,time:w,notime:b};function t(q,y,x,E){var N;do N=r.uniqueId(E);while(q.hasNode(N));return x.dummy=y,q.setNode(N,x),N}function i(q){var y=new e().setGraph(q.graph());return r.forEach(q.nodes(),function(x){y.setNode(x,q.node(x))}),r.forEach(q.edges(),function(x){var E=y.edge(x.v,x.w)||{weight:0,minlen:1},N=q.edge(x);y.setEdge(x.v,x.w,{weight:E.weight+N.weight,minlen:Math.max(E.minlen,N.minlen)})}),y}function n(q){var y=new e({multigraph:q.isMultigraph()}).setGraph(q.graph());return r.forEach(q.nodes(),function(x){q.children(x).length||y.setNode(x,q.node(x))}),r.forEach(q.edges(),function(x){y.setEdge(x,q.edge(x))}),y}function o(q){var y=r.map(q.nodes(),function(x){var E={};return r.forEach(q.outEdges(x),function(N){E[N.w]=(E[N.w]||0)+q.edge(N).weight}),E});return r.zipObject(q.nodes(),y)}function s(q){var y=r.map(q.nodes(),function(x){var E={};return r.forEach(q.inEdges(x),function(N){E[N.v]=(E[N.v]||0)+q.edge(N).weight}),E});return r.zipObject(q.nodes(),y)}function a(q,y){var x=q.x,E=q.y,N=y.x-x,M=y.y-E,A=q.width/2,T=q.height/2;if(!N&&!M)throw new Error("Not possible to find intersection inside of the rectangle");var j,B;return Math.abs(M)*A>Math.abs(N)*T?(M<0&&(T=-T),j=T*N/M,B=T):(N<0&&(A=-A),j=A,B=A*M/N),{x:x+j,y:E+B}}function u(q){var y=r.map(r.range(_(q)+1),function(){return[]});return r.forEach(q.nodes(),function(x){var E=q.node(x),N=E.rank;r.isUndefined(N)||(y[N][E.order]=x)}),y}function f(q){var y=r.min(r.map(q.nodes(),function(x){return q.node(x).rank}));r.forEach(q.nodes(),function(x){var E=q.node(x);r.has(E,"rank")&&(E.rank-=y)})}function l(q){var y=r.min(r.map(q.nodes(),function(M){return q.node(M).rank})),x=[];r.forEach(q.nodes(),function(M){var A=q.node(M).rank-y;x[A]||(x[A]=[]),x[A].push(M)});var E=0,N=q.graph().nodeRankFactor;r.forEach(x,function(M,A){r.isUndefined(M)&&A%N!==0?--E:E&&r.forEach(M,function(T){q.node(T).rank+=E})})}function m(q,y,x,E){var N={width:0,height:0};return arguments.length>=4&&(N.rank=x,N.order=E),t(q,"border",N,y)}function _(q){return r.max(r.map(q.nodes(),function(y){var x=q.node(y).rank;if(!r.isUndefined(x))return x}))}function g(q,y){var x={lhs:[],rhs:[]};return r.forEach(q,function(E){y(E)?x.lhs.push(E):x.rhs.push(E)}),x}function w(q,y){var x=r.now();try{return y()}finally{console.log(q+" time: "+(r.now()-x)+"ms")}}function b(q,y){return y()}return el}var rl,Sw;function Nw(){if(Sw)return rl;Sw=1;var r=he(),e=De();rl={run:t,undo:n};function t(o){o.graph().dummyChains=[],r.forEach(o.edges(),function(s){i(o,s)})}function i(o,s){var a=s.v,u=o.node(a).rank,f=s.w,l=o.node(f).rank,m=s.name,_=o.edge(s),g=_.labelRank;if(l!==u+1){o.removeEdge(s);var w,b,q;for(q=0,++u;u<l;++q,++u)_.points=[],b={width:0,height:0,edgeLabel:_,edgeObj:s,rank:u},w=e.addDummyNode(o,"edge",b,"_d"),u===g&&(b.width=_.width,b.height=_.height,b.dummy="edge-label",b.labelpos=_.labelpos),o.setEdge(a,w,{weight:_.weight},m),q===0&&o.graph().dummyChains.push(w),a=w;o.setEdge(a,f,{weight:_.weight},m)}}function n(o){r.forEach(o.graph().dummyChains,function(s){var a=o.node(s),u=a.edgeLabel,f;for(o.setEdge(a.edgeObj,u);a.dummy;)f=o.successors(s)[0],o.removeNode(s),u.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(u.x=a.x,u.y=a.y,u.width=a.width,u.height=a.height),s=f,a=o.node(s)})}return rl}var tl,Mw;function Rt(){if(Mw)return tl;Mw=1;var r=he();tl={longestPath:e,slack:t};function e(i){var n={};function o(s){var a=i.node(s);if(r.has(n,s))return a.rank;n[s]=!0;var u=r.min(r.map(i.outEdges(s),function(f){return o(f.w)-i.edge(f).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),a.rank=u}r.forEach(i.sources(),o)}function t(i,n){return i.node(n.w).rank-i.node(n.v).rank-i.edge(n).minlen}return tl}var il,Iw;function ho(){if(Iw)return il;Iw=1;var r=he(),e=er().Graph,t=Rt().slack;il=i;function i(a){var u=new e({directed:!1}),f=a.nodes()[0],l=a.nodeCount();u.setNode(f,{});for(var m,_;n(u,a)<l;)m=o(u,a),_=u.hasNode(m.v)?t(a,m):-t(a,m),s(u,a,_);return u}function n(a,u){function f(l){r.forEach(u.nodeEdges(l),function(m){var _=m.v,g=l===_?m.w:_;!a.hasNode(g)&&!t(u,m)&&(a.setNode(g,{}),a.setEdge(l,g,{}),f(g))})}return r.forEach(a.nodes(),f),a.nodeCount()}function o(a,u){return r.minBy(u.edges(),function(f){if(a.hasNode(f.v)!==a.hasNode(f.w))return t(u,f)})}function s(a,u,f){r.forEach(a.nodes(),function(l){u.node(l).rank+=f})}return il}var nl,Rw;function Aw(){if(Rw)return nl;Rw=1;var r=he(),e=ho(),t=Rt().slack,i=Rt().longestPath,n=er().alg.preorder,o=er().alg.postorder,s=De().simplify;nl=a,a.initLowLimValues=m,a.initCutValues=u,a.calcCutValue=l,a.leaveEdge=g,a.enterEdge=w,a.exchangeEdges=b;function a(E){E=s(E),i(E);var N=e(E);m(N),u(N,E);for(var M,A;M=g(N);)A=w(N,E,M),b(N,E,M,A)}function u(E,N){var M=o(E,E.nodes());M=M.slice(0,M.length-1),r.forEach(M,function(A){f(E,N,A)})}function f(E,N,M){var A=E.node(M),T=A.parent;E.edge(M,T).cutvalue=l(E,N,M)}function l(E,N,M){var A=E.node(M),T=A.parent,j=!0,B=N.edge(M,T),z=0;return B||(j=!1,B=N.edge(T,M)),z=B.weight,r.forEach(N.nodeEdges(M),function(U){var V=U.v===M,W=V?U.w:U.v;if(W!==T){var H=V===j,se=N.edge(U).weight;if(z+=H?se:-se,y(E,M,W)){var fe=E.edge(M,W).cutvalue;z+=H?-fe:fe}}}),z}function m(E,N){arguments.length<2&&(N=E.nodes()[0]),_(E,{},1,N)}function _(E,N,M,A,T){var j=M,B=E.node(A);return N[A]=!0,r.forEach(E.neighbors(A),function(z){r.has(N,z)||(M=_(E,N,M,z,A))}),B.low=j,B.lim=M++,T?B.parent=T:delete B.parent,M}function g(E){return r.find(E.edges(),function(N){return E.edge(N).cutvalue<0})}function w(E,N,M){var A=M.v,T=M.w;N.hasEdge(A,T)||(A=M.w,T=M.v);var j=E.node(A),B=E.node(T),z=j,U=!1;j.lim>B.lim&&(z=B,U=!0);var V=r.filter(N.edges(),function(W){return U===x(E,E.node(W.v),z)&&U!==x(E,E.node(W.w),z)});return r.minBy(V,function(W){return t(N,W)})}function b(E,N,M,A){var T=M.v,j=M.w;E.removeEdge(T,j),E.setEdge(A.v,A.w,{}),m(E),u(E,N),q(E,N)}function q(E,N){var M=r.find(E.nodes(),function(T){return!N.node(T).parent}),A=n(E,M);A=A.slice(1),r.forEach(A,function(T){var j=E.node(T).parent,B=N.edge(T,j),z=!1;B||(B=N.edge(j,T),z=!0),N.node(T).rank=N.node(j).rank+(z?B.minlen:-B.minlen)})}function y(E,N,M){return E.hasEdge(N,M)}function x(E,N,M){return M.low<=N.lim&&N.lim<=M.lim}return nl}var ol,Ow;function Cw(){if(Ow)return ol;Ow=1;var r=Rt(),e=r.longestPath,t=ho(),i=Aw();ol=n;function n(u){switch(u.graph().ranker){case"network-simplex":a(u);break;case"tight-tree":s(u);break;case"longest-path":o(u);break;default:a(u)}}var o=e;function s(u){e(u),t(u)}function a(u){i(u)}return ol}var sl,Tw;function kw(){if(Tw)return sl;Tw=1;var r=he();sl=e;function e(n){var o=i(n);r.forEach(n.graph().dummyChains,function(s){for(var a=n.node(s),u=a.edgeObj,f=t(n,o,u.v,u.w),l=f.path,m=f.lca,_=0,g=l[_],w=!0;s!==u.w;){if(a=n.node(s),w){for(;(g=l[_])!==m&&n.node(g).maxRank<a.rank;)_++;g===m&&(w=!1)}if(!w){for(;_<l.length-1&&n.node(g=l[_+1]).minRank<=a.rank;)_++;g=l[_]}n.setParent(s,g),s=n.successors(s)[0]}})}function t(n,o,s,a){var u=[],f=[],l=Math.min(o[s].low,o[a].low),m=Math.max(o[s].lim,o[a].lim),_,g;_=s;do _=n.parent(_),u.push(_);while(_&&(o[_].low>l||m>o[_].lim));for(g=_,_=a;(_=n.parent(_))!==g;)f.push(_);return{path:u.concat(f.reverse()),lca:g}}function i(n){var o={},s=0;function a(u){var f=s;r.forEach(n.children(u),a),o[u]={low:f,lim:s++}}return r.forEach(n.children(),a),o}return sl}var al,Pw;function jw(){if(Pw)return al;Pw=1;var r=he(),e=De();al={run:t,cleanup:s};function t(a){var u=e.addDummyNode(a,"root",{},"_root"),f=n(a),l=r.max(r.values(f))-1,m=2*l+1;a.graph().nestingRoot=u,r.forEach(a.edges(),function(g){a.edge(g).minlen*=m});var _=o(a)+1;r.forEach(a.children(),function(g){i(a,u,m,_,l,f,g)}),a.graph().nodeRankFactor=m}function i(a,u,f,l,m,_,g){var w=a.children(g);if(!w.length){g!==u&&a.setEdge(u,g,{weight:0,minlen:f});return}var b=e.addBorderNode(a,"_bt"),q=e.addBorderNode(a,"_bb"),y=a.node(g);a.setParent(b,g),y.borderTop=b,a.setParent(q,g),y.borderBottom=q,r.forEach(w,function(x){i(a,u,f,l,m,_,x);var E=a.node(x),N=E.borderTop?E.borderTop:x,M=E.borderBottom?E.borderBottom:x,A=E.borderTop?l:2*l,T=N!==M?1:m-_[g]+1;a.setEdge(b,N,{weight:A,minlen:T,nestingEdge:!0}),a.setEdge(M,q,{weight:A,minlen:T,nestingEdge:!0})}),a.parent(g)||a.setEdge(u,b,{weight:0,minlen:m+_[g]})}function n(a){var u={};function f(l,m){var _=a.children(l);_&&_.length&&r.forEach(_,function(g){f(g,m+1)}),u[l]=m}return r.forEach(a.children(),function(l){f(l,1)}),u}function o(a){return r.reduce(a.edges(),function(u,f){return u+a.edge(f).weight},0)}function s(a){var u=a.graph();a.removeNode(u.nestingRoot),delete u.nestingRoot,r.forEach(a.edges(),function(f){var l=a.edge(f);l.nestingEdge&&a.removeEdge(f)})}return al}var ul,Lw;function Fw(){if(Lw)return ul;Lw=1;var r=he(),e=De();ul=t;function t(n){function o(s){var a=n.children(s),u=n.node(s);if(a.length&&r.forEach(a,o),r.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var f=u.minRank,l=u.maxRank+1;f<l;++f)i(n,"borderLeft","_bl",s,u,f),i(n,"borderRight","_br",s,u,f)}}r.forEach(n.children(),o)}function i(n,o,s,a,u,f){var l={width:0,height:0,rank:f,borderType:o},m=u[o][f-1],_=e.addDummyNode(n,"border",l,s);u[o][f]=_,n.setParent(_,a),m&&n.setEdge(m,_,{weight:1})}return ul}var fl,zw;function Dw(){if(zw)return fl;zw=1;var r=he();fl={adjust:e,undo:t};function e(f){var l=f.graph().rankdir.toLowerCase();(l==="lr"||l==="rl")&&i(f)}function t(f){var l=f.graph().rankdir.toLowerCase();(l==="bt"||l==="rl")&&o(f),(l==="lr"||l==="rl")&&(a(f),i(f))}function i(f){r.forEach(f.nodes(),function(l){n(f.node(l))}),r.forEach(f.edges(),function(l){n(f.edge(l))})}function n(f){var l=f.width;f.width=f.height,f.height=l}function o(f){r.forEach(f.nodes(),function(l){s(f.node(l))}),r.forEach(f.edges(),function(l){var m=f.edge(l);r.forEach(m.points,s),r.has(m,"y")&&s(m)})}function s(f){f.y=-f.y}function a(f){r.forEach(f.nodes(),function(l){u(f.node(l))}),r.forEach(f.edges(),function(l){var m=f.edge(l);r.forEach(m.points,u),r.has(m,"x")&&u(m)})}function u(f){var l=f.x;f.x=f.y,f.y=l}return fl}var cl,Bw;function Gw(){if(Bw)return cl;Bw=1;var r=he();cl=e;function e(t){var i={},n=r.filter(t.nodes(),function(f){return!t.children(f).length}),o=r.max(r.map(n,function(f){return t.node(f).rank})),s=r.map(r.range(o+1),function(){return[]});function a(f){if(!r.has(i,f)){i[f]=!0;var l=t.node(f);s[l.rank].push(f),r.forEach(t.successors(f),a)}}var u=r.sortBy(n,function(f){return t.node(f).rank});return r.forEach(u,a),s}return cl}var ll,Uw;function $w(){if(Uw)return ll;Uw=1;var r=he();ll=e;function e(i,n){for(var o=0,s=1;s<n.length;++s)o+=t(i,n[s-1],n[s]);return o}function t(i,n,o){for(var s=r.zipObject(o,r.map(o,function(_,g){return g})),a=r.flatten(r.map(n,function(_){return r.sortBy(r.map(i.outEdges(_),function(g){return{pos:s[g.w],weight:i.edge(g).weight}}),"pos")}),!0),u=1;u<o.length;)u<<=1;var f=2*u-1;u-=1;var l=r.map(new Array(f),function(){return 0}),m=0;return r.forEach(a.forEach(function(_){var g=_.pos+u;l[g]+=_.weight;for(var w=0;g>0;)g%2&&(w+=l[g+1]),g=g-1>>1,l[g]+=_.weight;m+=_.weight*w})),m}return ll}var hl,Vw;function Ww(){if(Vw)return hl;Vw=1;var r=he();hl=e;function e(t,i){return r.map(i,function(n){var o=t.inEdges(n);if(o.length){var s=r.reduce(o,function(a,u){var f=t.edge(u),l=t.node(u.v);return{sum:a.sum+f.weight*l.order,weight:a.weight+f.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:n}})}return hl}var dl,Kw;function Yw(){if(Kw)return dl;Kw=1;var r=he();dl=e;function e(n,o){var s={};r.forEach(n,function(u,f){var l=s[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:f};r.isUndefined(u.barycenter)||(l.barycenter=u.barycenter,l.weight=u.weight)}),r.forEach(o.edges(),function(u){var f=s[u.v],l=s[u.w];!r.isUndefined(f)&&!r.isUndefined(l)&&(l.indegree++,f.out.push(s[u.w]))});var a=r.filter(s,function(u){return!u.indegree});return t(a)}function t(n){var o=[];function s(f){return function(l){l.merged||(r.isUndefined(l.barycenter)||r.isUndefined(f.barycenter)||l.barycenter>=f.barycenter)&&i(f,l)}}function a(f){return function(l){l.in.push(f),--l.indegree===0&&n.push(l)}}for(;n.length;){var u=n.pop();o.push(u),r.forEach(u.in.reverse(),s(u)),r.forEach(u.out,a(u))}return r.map(r.filter(o,function(f){return!f.merged}),function(f){return r.pick(f,["vs","i","barycenter","weight"])})}function i(n,o){var s=0,a=0;n.weight&&(s+=n.barycenter*n.weight,a+=n.weight),o.weight&&(s+=o.barycenter*o.weight,a+=o.weight),n.vs=o.vs.concat(n.vs),n.barycenter=s/a,n.weight=a,n.i=Math.min(o.i,n.i),o.merged=!0}return dl}var pl,Xw;function Zw(){if(Xw)return pl;Xw=1;var r=he(),e=De();pl=t;function t(o,s){var a=e.partition(o,function(b){return r.has(b,"barycenter")}),u=a.lhs,f=r.sortBy(a.rhs,function(b){return-b.i}),l=[],m=0,_=0,g=0;u.sort(n(!!s)),g=i(l,f,g),r.forEach(u,function(b){g+=b.vs.length,l.push(b.vs),m+=b.barycenter*b.weight,_+=b.weight,g=i(l,f,g)});var w={vs:r.flatten(l,!0)};return _&&(w.barycenter=m/_,w.weight=_),w}function i(o,s,a){for(var u;s.length&&(u=r.last(s)).i<=a;)s.pop(),o.push(u.vs),a++;return a}function n(o){return function(s,a){return s.barycenter<a.barycenter?-1:s.barycenter>a.barycenter?1:o?a.i-s.i:s.i-a.i}}return pl}var ml,Qw;function Jw(){if(Qw)return ml;Qw=1;var r=he(),e=Ww(),t=Yw(),i=Zw();ml=n;function n(a,u,f,l){var m=a.children(u),_=a.node(u),g=_?_.borderLeft:void 0,w=_?_.borderRight:void 0,b={};g&&(m=r.filter(m,function(M){return M!==g&&M!==w}));var q=e(a,m);r.forEach(q,function(M){if(a.children(M.v).length){var A=n(a,M.v,f,l);b[M.v]=A,r.has(A,"barycenter")&&s(M,A)}});var y=t(q,f);o(y,b);var x=i(y,l);if(g&&(x.vs=r.flatten([g,x.vs,w],!0),a.predecessors(g).length)){var E=a.node(a.predecessors(g)[0]),N=a.node(a.predecessors(w)[0]);r.has(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+E.order+N.order)/(x.weight+2),x.weight+=2}return x}function o(a,u){r.forEach(a,function(f){f.vs=r.flatten(f.vs.map(function(l){return u[l]?u[l].vs:l}),!0)})}function s(a,u){r.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight)}return ml}var gl,Hw;function e1(){if(Hw)return gl;Hw=1;var r=he(),e=er().Graph;gl=t;function t(n,o,s){var a=i(n),u=new e({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(f){return n.node(f)});return r.forEach(n.nodes(),function(f){var l=n.node(f),m=n.parent(f);(l.rank===o||l.minRank<=o&&o<=l.maxRank)&&(u.setNode(f),u.setParent(f,m||a),r.forEach(n[s](f),function(_){var g=_.v===f?_.w:_.v,w=u.edge(g,f),b=r.isUndefined(w)?0:w.weight;u.setEdge(g,f,{weight:n.edge(_).weight+b})}),r.has(l,"minRank")&&u.setNode(f,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),u}function i(n){for(var o;n.hasNode(o=r.uniqueId("_root")););return o}return gl}var _l,r1;function t1(){if(r1)return _l;r1=1;var r=he();_l=e;function e(t,i,n){var o={},s;r.forEach(n,function(a){for(var u=t.parent(a),f,l;u;){if(f=t.parent(u),f?(l=o[f],o[f]=u):(l=s,s=u),l&&l!==u){i.setEdge(l,u);return}u=f}})}return _l}var vl,i1;function n1(){if(i1)return vl;i1=1;var r=he(),e=Gw(),t=$w(),i=Jw(),n=e1(),o=t1(),s=er().Graph,a=De();vl=u;function u(_){var g=a.maxRank(_),w=f(_,r.range(1,g+1),"inEdges"),b=f(_,r.range(g-1,-1,-1),"outEdges"),q=e(_);m(_,q);for(var y=Number.POSITIVE_INFINITY,x,E=0,N=0;N<4;++E,++N){l(E%2?w:b,E%4>=2),q=a.buildLayerMatrix(_);var M=t(_,q);M<y&&(N=0,x=r.cloneDeep(q),y=M)}m(_,x)}function f(_,g,w){return r.map(g,function(b){return n(_,b,w)})}function l(_,g){var w=new s;r.forEach(_,function(b){var q=b.graph().root,y=i(b,q,w,g);r.forEach(y.vs,function(x,E){b.node(x).order=E}),o(b,w,y.vs)})}function m(_,g){r.forEach(g,function(w){r.forEach(w,function(b,q){_.node(b).order=q})})}return vl}var yl,o1;function s1(){if(o1)return yl;o1=1;var r=he(),e=er().Graph,t=De();yl={positionX:w,findType1Conflicts:i,findType2Conflicts:n,addConflict:s,hasConflict:a,verticalAlignment:u,horizontalCompaction:f,alignCoordinates:_,findSmallestWidthAlignment:m,balance:g};function i(y,x){var E={};function N(M,A){var T=0,j=0,B=M.length,z=r.last(A);return r.forEach(A,function(U,V){var W=o(y,U),H=W?y.node(W).order:B;(W||U===z)&&(r.forEach(A.slice(j,V+1),function(se){r.forEach(y.predecessors(se),function(fe){var be=y.node(fe),Ee=be.order;(Ee<T||H<Ee)&&!(be.dummy&&y.node(se).dummy)&&s(E,fe,se)})}),j=V+1,T=H)}),A}return r.reduce(x,N),E}function n(y,x){var E={};function N(A,T,j,B,z){var U;r.forEach(r.range(T,j),function(V){U=A[V],y.node(U).dummy&&r.forEach(y.predecessors(U),function(W){var H=y.node(W);H.dummy&&(H.order<B||H.order>z)&&s(E,W,U)})})}function M(A,T){var j=-1,B,z=0;return r.forEach(T,function(U,V){if(y.node(U).dummy==="border"){var W=y.predecessors(U);W.length&&(B=y.node(W[0]).order,N(T,z,V,j,B),z=V,j=B)}N(T,z,T.length,B,A.length)}),T}return r.reduce(x,M),E}function o(y,x){if(y.node(x).dummy)return r.find(y.predecessors(x),function(E){return y.node(E).dummy})}function s(y,x,E){if(x>E){var N=x;x=E,E=N}var M=y[x];M||(y[x]=M={}),M[E]=!0}function a(y,x,E){if(x>E){var N=x;x=E,E=N}return r.has(y[x],E)}function u(y,x,E,N){var M={},A={},T={};return r.forEach(x,function(j){r.forEach(j,function(B,z){M[B]=B,A[B]=B,T[B]=z})}),r.forEach(x,function(j){var B=-1;r.forEach(j,function(z){var U=N(z);if(U.length){U=r.sortBy(U,function(fe){return T[fe]});for(var V=(U.length-1)/2,W=Math.floor(V),H=Math.ceil(V);W<=H;++W){var se=U[W];A[z]===z&&B<T[se]&&!a(E,z,se)&&(A[se]=z,A[z]=M[z]=M[se],B=T[se])}}})}),{root:M,align:A}}function f(y,x,E,N,M){var A={},T=l(y,x,E,M),j=M?"borderLeft":"borderRight";function B(V,W){for(var H=T.nodes(),se=H.pop(),fe={};se;)fe[se]?V(se):(fe[se]=!0,H.push(se),H=H.concat(W(se))),se=H.pop()}function z(V){A[V]=T.inEdges(V).reduce(function(W,H){return Math.max(W,A[H.v]+T.edge(H))},0)}function U(V){var W=T.outEdges(V).reduce(function(se,fe){return Math.min(se,A[fe.w]-T.edge(fe))},Number.POSITIVE_INFINITY),H=y.node(V);W!==Number.POSITIVE_INFINITY&&H.borderType!==j&&(A[V]=Math.max(A[V],W))}return B(z,T.predecessors.bind(T)),B(U,T.successors.bind(T)),r.forEach(N,function(V){A[V]=A[E[V]]}),A}function l(y,x,E,N){var M=new e,A=y.graph(),T=b(A.nodesep,A.edgesep,N);return r.forEach(x,function(j){var B;r.forEach(j,function(z){var U=E[z];if(M.setNode(U),B){var V=E[B],W=M.edge(V,U);M.setEdge(V,U,Math.max(T(y,z,B),W||0))}B=z})}),M}function m(y,x){return r.minBy(r.values(x),function(E){var N=Number.NEGATIVE_INFINITY,M=Number.POSITIVE_INFINITY;return r.forIn(E,function(A,T){var j=q(y,T)/2;N=Math.max(A+j,N),M=Math.min(A-j,M)}),N-M})}function _(y,x){var E=r.values(x),N=r.min(E),M=r.max(E);r.forEach(["u","d"],function(A){r.forEach(["l","r"],function(T){var j=A+T,B=y[j],z;if(B!==x){var U=r.values(B);z=T==="l"?N-r.min(U):M-r.max(U),z&&(y[j]=r.mapValues(B,function(V){return V+z}))}})})}function g(y,x){return r.mapValues(y.ul,function(E,N){if(x)return y[x.toLowerCase()][N];var M=r.sortBy(r.map(y,N));return(M[1]+M[2])/2})}function w(y){var x=t.buildLayerMatrix(y),E=r.merge(i(y,x),n(y,x)),N={},M;r.forEach(["u","d"],function(T){M=T==="u"?x:r.values(x).reverse(),r.forEach(["l","r"],function(j){j==="r"&&(M=r.map(M,function(V){return r.values(V).reverse()}));var B=(T==="u"?y.predecessors:y.successors).bind(y),z=u(y,M,E,B),U=f(y,M,z.root,z.align,j==="r");j==="r"&&(U=r.mapValues(U,function(V){return-V})),N[T+j]=U})});var A=m(y,N);return _(N,A),g(N,y.graph().align)}function b(y,x,E){return function(N,M,A){var T=N.node(M),j=N.node(A),B=0,z;if(B+=T.width/2,r.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":z=-T.width/2;break;case"r":z=T.width/2;break}if(z&&(B+=E?z:-z),z=0,B+=(T.dummy?x:y)/2,B+=(j.dummy?x:y)/2,B+=j.width/2,r.has(j,"labelpos"))switch(j.labelpos.toLowerCase()){case"l":z=j.width/2;break;case"r":z=-j.width/2;break}return z&&(B+=E?z:-z),z=0,B}}function q(y,x){return y.node(x).width}return yl}var ql,a1;function u1(){if(a1)return ql;a1=1;var r=he(),e=De(),t=s1().positionX;ql=i;function i(o){o=e.asNonCompoundGraph(o),n(o),r.forEach(t(o),function(s,a){o.node(a).x=s})}function n(o){var s=e.buildLayerMatrix(o),a=o.graph().ranksep,u=0;r.forEach(s,function(f){var l=r.max(r.map(f,function(m){return o.node(m).height}));r.forEach(f,function(m){o.node(m).y=u+l/2}),u+=l+a})}return ql}var wl,f1;function c1(){if(f1)return wl;f1=1;var r=he(),e=xw(),t=Nw(),i=Cw(),n=De().normalizeRanks,o=kw(),s=De().removeEmptyRanks,a=jw(),u=Fw(),f=Dw(),l=n1(),m=u1(),_=De(),g=er().Graph;wl=w;function w(F,P){var X=P&&P.debugTiming?_.time:_.notime;X("layout",function(){var Q=X(" buildLayoutGraph",function(){return B(F)});X(" runLayout",function(){b(Q,X)}),X(" updateInputGraph",function(){q(F,Q)})})}function b(F,P){P(" makeSpaceForEdgeLabels",function(){z(F)}),P(" removeSelfEdges",function(){ce(F)}),P(" acyclic",function(){e.run(F)}),P(" nestingGraph.run",function(){a.run(F)}),P(" rank",function(){i(_.asNonCompoundGraph(F))}),P(" injectEdgeLabelProxies",function(){U(F)}),P(" removeEmptyRanks",function(){s(F)}),P(" nestingGraph.cleanup",function(){a.cleanup(F)}),P(" normalizeRanks",function(){n(F)}),P(" assignRankMinMax",function(){V(F)}),P(" removeEdgeLabelProxies",function(){W(F)}),P(" normalize.run",function(){t.run(F)}),P(" parentDummyChains",function(){o(F)}),P(" addBorderSegments",function(){u(F)}),P(" order",function(){l(F)}),P(" insertSelfEdges",function(){Ie(F)}),P(" adjustCoordinateSystem",function(){f.adjust(F)}),P(" position",function(){m(F)}),P(" positionSelfEdges",function(){_e(F)}),P(" removeBorderNodes",function(){Ee(F)}),P(" normalize.undo",function(){t.undo(F)}),P(" fixupEdgeLabelCoords",function(){fe(F)}),P(" undoCoordinateSystem",function(){f.undo(F)}),P(" translateGraph",function(){H(F)}),P(" assignNodeIntersects",function(){se(F)}),P(" reversePoints",function(){be(F)}),P(" acyclic.undo",function(){e.undo(F)})}function q(F,P){r.forEach(F.nodes(),function(X){var Q=F.node(X),oe=P.node(X);Q&&(Q.x=oe.x,Q.y=oe.y,P.children(X).length&&(Q.width=oe.width,Q.height=oe.height))}),r.forEach(F.edges(),function(X){var Q=F.edge(X),oe=P.edge(X);Q.points=oe.points,r.has(oe,"x")&&(Q.x=oe.x,Q.y=oe.y)}),F.graph().width=P.graph().width,F.graph().height=P.graph().height}var y=["nodesep","edgesep","ranksep","marginx","marginy"],x={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],N=["width","height"],M={width:0,height:0},A=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},j=["labelpos"];function B(F){var P=new g({multigraph:!0,compound:!0}),X=Re(F.graph());return P.setGraph(r.merge({},x,ae(X,y),r.pick(X,E))),r.forEach(F.nodes(),function(Q){var oe=Re(F.node(Q));P.setNode(Q,r.defaults(ae(oe,N),M)),P.setParent(Q,F.parent(Q))}),r.forEach(F.edges(),function(Q){var oe=Re(F.edge(Q));P.setEdge(Q,r.merge({},T,ae(oe,A),r.pick(oe,j)))}),P}function z(F){var P=F.graph();P.ranksep/=2,r.forEach(F.edges(),function(X){var Q=F.edge(X);Q.minlen*=2,Q.labelpos.toLowerCase()!=="c"&&(P.rankdir==="TB"||P.rankdir==="BT"?Q.width+=Q.labeloffset:Q.height+=Q.labeloffset)})}function U(F){r.forEach(F.edges(),function(P){var X=F.edge(P);if(X.width&&X.height){var Q=F.node(P.v),oe=F.node(P.w),ge={rank:(oe.rank-Q.rank)/2+Q.rank,e:P};_.addDummyNode(F,"edge-proxy",ge,"_ep")}})}function V(F){var P=0;r.forEach(F.nodes(),function(X){var Q=F.node(X);Q.borderTop&&(Q.minRank=F.node(Q.borderTop).rank,Q.maxRank=F.node(Q.borderBottom).rank,P=r.max(P,Q.maxRank))}),F.graph().maxRank=P}function W(F){r.forEach(F.nodes(),function(P){var X=F.node(P);X.dummy==="edge-proxy"&&(F.edge(X.e).labelRank=X.rank,F.removeNode(P))})}function H(F){var P=Number.POSITIVE_INFINITY,X=0,Q=Number.POSITIVE_INFINITY,oe=0,ge=F.graph(),ve=ge.marginx||0,je=ge.marginy||0;function Je(Ye){var Be=Ye.x,ye=Ye.y,Mr=Ye.width,Se=Ye.height;P=Math.min(P,Be-Mr/2),X=Math.max(X,Be+Mr/2),Q=Math.min(Q,ye-Se/2),oe=Math.max(oe,ye+Se/2)}r.forEach(F.nodes(),function(Ye){Je(F.node(Ye))}),r.forEach(F.edges(),function(Ye){var Be=F.edge(Ye);r.has(Be,"x")&&Je(Be)}),P-=ve,Q-=je,r.forEach(F.nodes(),function(Ye){var Be=F.node(Ye);Be.x-=P,Be.y-=Q}),r.forEach(F.edges(),function(Ye){var Be=F.edge(Ye);r.forEach(Be.points,function(ye){ye.x-=P,ye.y-=Q}),r.has(Be,"x")&&(Be.x-=P),r.has(Be,"y")&&(Be.y-=Q)}),ge.width=X-P+ve,ge.height=oe-Q+je}function se(F){r.forEach(F.edges(),function(P){var X=F.edge(P),Q=F.node(P.v),oe=F.node(P.w),ge,ve;X.points?(ge=X.points[0],ve=X.points[X.points.length-1]):(X.points=[],ge=oe,ve=Q),X.points.unshift(_.intersectRect(Q,ge)),X.points.push(_.intersectRect(oe,ve))})}function fe(F){r.forEach(F.edges(),function(P){var X=F.edge(P);if(r.has(X,"x"))switch((X.labelpos==="l"||X.labelpos==="r")&&(X.width-=X.labeloffset),X.labelpos){case"l":X.x-=X.width/2+X.labeloffset;break;case"r":X.x+=X.width/2+X.labeloffset;break}})}function be(F){r.forEach(F.edges(),function(P){var X=F.edge(P);X.reversed&&X.points.reverse()})}function Ee(F){r.forEach(F.nodes(),function(P){if(F.children(P).length){var X=F.node(P),Q=F.node(X.borderTop),oe=F.node(X.borderBottom),ge=F.node(r.last(X.borderLeft)),ve=F.node(r.last(X.borderRight));X.width=Math.abs(ve.x-ge.x),X.height=Math.abs(oe.y-Q.y),X.x=ge.x+X.width/2,X.y=Q.y+X.height/2}}),r.forEach(F.nodes(),function(P){F.node(P).dummy==="border"&&F.removeNode(P)})}function ce(F){r.forEach(F.edges(),function(P){if(P.v===P.w){var X=F.node(P.v);X.selfEdges||(X.selfEdges=[]),X.selfEdges.push({e:P,label:F.edge(P)}),F.removeEdge(P)}})}function Ie(F){var P=_.buildLayerMatrix(F);r.forEach(P,function(X){var Q=0;r.forEach(X,function(oe,ge){var ve=F.node(oe);ve.order=ge+Q,r.forEach(ve.selfEdges,function(je){_.addDummyNode(F,"selfedge",{width:je.label.width,height:je.label.height,rank:ve.rank,order:ge+ ++Q,e:je.e,label:je.label},"_se")}),delete ve.selfEdges})})}function _e(F){r.forEach(F.nodes(),function(P){var X=F.node(P);if(X.dummy==="selfedge"){var Q=F.node(X.e.v),oe=Q.x+Q.width/2,ge=Q.y,ve=X.x-oe,je=Q.height/2;F.setEdge(X.e,X.label),F.removeNode(P),X.label.points=[{x:oe+2*ve/3,y:ge-je},{x:oe+5*ve/6,y:ge-je},{x:oe+ve,y:ge},{x:oe+5*ve/6,y:ge+je},{x:oe+2*ve/3,y:ge+je}],X.label.x=X.x,X.label.y=X.y}})}function ae(F,P){return r.mapValues(r.pick(F,P),Number)}function Re(F){var P={};return r.forEach(F,function(X,Q){P[Q.toLowerCase()]=X}),P}return wl}var bl,l1;function h1(){if(l1)return bl;l1=1;var r=he(),e=De(),t=er().Graph;bl={debugOrdering:i};function i(n){var o=e.buildLayerMatrix(n),s=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(n.nodes(),function(a){s.setNode(a,{label:a}),s.setParent(a,"layer"+n.node(a).rank)}),r.forEach(n.edges(),function(a){s.setEdge(a.v,a.w,{},a.name)}),r.forEach(o,function(a,u){var f="layer"+u;s.setNode(f,{rank:"same"}),r.reduce(a,function(l,m){return s.setEdge(l,m,{style:"invis"}),m})}),s}return bl}var xl,d1;function p1(){return d1||(d1=1,xl="0.8.5"),xl}var El,m1;function g1(){return m1||(m1=1,El={graphlib:er(),layout:c1(),debug:h1(),util:{time:De().time,notime:De().notime},version:p1()}),El}var Sl=g1(),_1=hn(Sl);var v1=function(r){return cn(r,"Boolean")};function y1(r,e){if(r){var t;if(jt(r))for(var i=0,n=r.length;i<n&&(t=e(r[i],i),t!==!1);i++);else if(Qi(r)){for(var o in r)if(r.hasOwnProperty(o)&&(t=e(r[o],o),t===!1))break}}}var fE=Object.prototype.hasOwnProperty,q1=(function(r,e){if(r===null||!bi(r))return{};var t={};return y1(e,function(i){fE.call(r,i)&&(t[i]=r[i])}),t});var Ni=class extends Ze{constructor(){super(...arguments),this.id="dagre",this.isCompoundGraph=null,this.config={graphAttributes:["rankdir","align","nodesep","edgesep","ranksep","marginx","marginy","acyclicer","ranker"],nodeAttributes:["width","height"],edgeAttributes:["minlen","weight","width","height","labelpos","labeloffset"]}}getDefaultOptions(){return{directed:!0,multigraph:!0,rankdir:"TB",align:void 0,nodesep:50,edgesep:10,ranksep:50,marginx:0,marginy:0,acyclicer:void 0,ranker:"network-simplex",nodeSize:[0,0],edgeMinLen:1,edgeWeight:1,edgeLabelSize:[0,0],edgeLabelPos:"r",edgeLabelOffset:10}}layout(){return Ne(this,void 0,void 0,function*(){let e=new Sl.graphlib.Graph({directed:!!this.options.directed,multigraph:!!this.options.multigraph,compound:this.isCompound()});e.setGraph(q1(this.options,this.config.graphAttributes)),e.setDefaultEdgeLabel(()=>({}));let t=Tt(this.options.nodeSize,0);this.model.forEachNode(g=>{let w=g._original,[b,q]=wt(t(w)),y={width:b,height:q};if(e.setNode(String(g.id),y),this.isCompound()){if(Fe(g.parentId))return;e.setParent(String(g.id),String(g.parentId))}});let{edgeLabelSize:i,edgeLabelOffset:n,edgeLabelPos:o,edgeMinLen:s,edgeWeight:a}=this.options,u=Tt(i,0,"edge"),f=ur(n,10,"edge"),l=typeof o=="string"?()=>o:Te(o,["edge"]),m=ur(s,1,"edge"),_=ur(a,1,"edge");this.model.forEachEdge(g=>{let w=g._original,[b,q]=wt(u(w)),y={width:b,height:q,labelpos:l(w),labeloffset:f(w),minlen:m(w),weight:_(w)};e.setEdge(String(g.source),String(g.target),y,String(g.id))}),_1.layout(e),this.model.forEachNode(g=>{let w=e.node(String(g.id));w&&(g.x=w.x,g.y=w.y,g.size=[w.width,w.height])}),this.model.forEachEdge(g=>{let w=e.edge(String(g.source),String(g.target),String(g.id));if(!w)return;let{width:b,height:q,weight:y,minlen:x,labelpos:E,labeloffset:N,points:M}=w;g.labelSize=[b,q],g.weight=y,g.minLen=x,g.labelPos=E,g.labelOffset=N,g.points=M.map(ai)})})}isCompound(){return this.isCompoundGraph!==null?this.isCompoundGraph:v1(this.options.compound)?this.isCompoundGraph=this.options.compound:(this.isCompoundGraph=this.model.nodes().some(e=>!Fe(e.parentId)),this.isCompoundGraph)}};function w1(r=2){let e=!1;function t(i,n){i.forEachEdge(o=>{var s,a;let{source:u,target:f}=o,l=i.node(u),m=i.node(f);if(!l||!m)return;let _=m.x-l.x,g=m.y-l.y,w=r===3?((s=m.z)!==null&&s!==void 0?s:0)-((a=l.z)!==null&&a!==void 0?a:0):0;!_&&!g&&(_=.01,g=.01,r===3&&!w&&(w=.01));let b=Math.sqrt(_*_+g*g+w*w);if(b<Number(l.size)+Number(m.size))return;let q=_/b,y=g/b,x=w/b,{linkDistance:E=200,edgeStrength:N=200}=o,A=(E-b)*N,T=l.mass||1,j=m.mass||1,B=1/T,z=1/j,U=q*A,V=y*A,W=x*A;n[u].x-=U*B,n[u].y-=V*B,n[u].z-=W*B,n[f].x+=U*z,n[f].y+=V*z,n[f].z+=W*z})}return t.dimensions=function(i){return arguments.length?(r=i,t):r},t.preventOverlap=function(i){return arguments.length?(e=i,t):e},t}function b1(r){let e,t=800,i=600;function n(o,s){if(!e)return;let{leaf:a,single:u,others:f,center:l}=e,m=o.nodes(),_=o.edges(),g=m.map(b=>Object.assign(Object.assign({},b),{data:b.data||{}})),w=_.map(b=>Object.assign(Object.assign({},b),{data:b.data||{}}));o.forEachNode(b=>{let{id:q,mass:y,x,y:E,z:N=0,data:M}=b,A=o.degree(q,"in"),T=o.degree(q,"out"),j=o.degree(q,"both"),B=Object.assign(Object.assign({},b),{data:M||{}}),{x:z,y:U,z:V,centerStrength:W}=l?.(B,g,w,t,i)||{x:0,y:0,z:0,centerStrength:0};if(!Me(z)||!Me(U))return;let H=(x-z)/y,se=(E-U)/y,fe=(N-(V||0))/y;if(W&&(s[q].x-=W*H,s[q].y-=W*se,s[q].z-=W*fe),j===0){let Ee=u(B);if(!Ee)return;s[q].x-=Ee*H,s[q].y-=Ee*se,s[q].z-=Ee*fe;return}if(A===0||T===0){let Ee=a(B,g,w);if(!Ee)return;s[q].x-=Ee*H,s[q].y-=Ee*se,s[q].z-=Ee*fe;return}let be=f(B);be&&(s[q].x-=be*H,s[q].y-=be*se,s[q].z-=be*fe)})}return n.options=function(o){return arguments.length?(e=o,n):e},n.width=function(o){return arguments.length?(t=o,n):t},n.height=function(o){return arguments.length?(i=o,n):i},n}var oi=1e-6,x1=500;function E1(r=2){let e=1;function t(a,u){let f=a.nodes();if(f.length<2||e<=0)return;if(r===2){let m=f.map((g,w)=>({id:g.id,index:w,x:g.x,y:g.y,r:Number(g.size)/2,mass:g.mass||1,fx:g.fx,fy:g.fy})),_=Nr(m,g=>g.x,g=>g.y).visitAfter(cE);for(let g of m)_.visit((w,b,q,y,x)=>{let E=w.r||0,N=g.r+E;if(b>g.x+N||y<g.x-N||q>g.y+N||x<g.y-N)return!0;if(!w.data)return!1;let M=w;do{let A=M.data;A&&A.index>g.index&&o(g,A,u),M=M.next}while(M);return!1});return}let l=f.map((m,_)=>{var g;return{id:m.id,index:_,x:m.x,y:m.y,z:(g=m.z)!==null&&g!==void 0?g:0,r:Number(m.size)/2,mass:m.mass||1,fx:m.fx,fy:m.fy,fz:m.fz}});for(let m=0;m<l.length;m++)for(let _=m+1;_<l.length;_++)s(l[m],l[_],u)}function i(a){return Me(a.fx)&&Me(a.fy)?0:1/(a.mass||1)}function n(a){return Me(a.fx)&&Me(a.fy)&&Me(a.fz)?0:1/(a.mass||1)}function o(a,u,f){let l=a.x-u.x,m=a.y-u.y,_=Math.hypot(l,m),g=a.r+u.r;if(_>=g)return;_<oi&&(l=a.index<u.index?oi:-oi,m=0,_=Math.abs(l));let w=g-_,b=l/_,q=m/_,y=w*e*x1,x=i(a),E=i(u);x&&(f[a.id].x+=b*y*x,f[a.id].y+=q*y*x),E&&(f[u.id].x-=b*y*E,f[u.id].y-=q*y*E)}function s(a,u,f){let l=a.x-u.x,m=a.y-u.y,_=a.z-u.z,g=Math.sqrt(l*l+m*m+_*_),w=a.r+u.r;if(g>=w)return;g<oi&&(l=a.index<u.index?oi:-oi,m=0,_=0,g=Math.abs(l));let b=w-g,q=l/g,y=m/g,x=_/g,E=b*e*x1,N=n(a),M=n(u);N&&(f[a.id].x+=q*E*N,f[a.id].y+=y*E*N,f[a.id].z+=x*E*N),M&&(f[u.id].x-=q*E*M,f[u.id].y-=y*E*M,f[u.id].z-=x*E*M)}return t.dimensions=function(a){return arguments.length?(r=a,t):r},t.strength=function(a){return arguments.length?(e=a,t):e},t}function cE(r){var e;let t=0;if(r.length)for(let i=0;i<r.length;i++){let n=r[i];n&&n.r>t&&(t=n.r)}else if(r.data){t=r.data.r||0;let i=r.next;for(;i;)t=Math.max(t,((e=i.data)===null||e===void 0?void 0:e.r)||0),i=i.next}r.r=t}function S1(r=[0,0,0],e=10){let t;function i(n,o){n.nodes()&&n.forEachNode(a=>{let{id:u,mass:f,x:l,y:m,z:_=0}=a,g=0,w=0,b=0,q=e,y=n.degree(u),x=t?.(a,y);if(x){let[E,N,M]=x;g=l-E,w=m-N,q=M}else g=l-r[0],w=m-r[1],b=_-(r[2]||0);q&&(o[u].x-=q*g/f,o[u].y-=q*w/f,o[u].z-=q*b/f)})}return i.center=function(n){return arguments.length?(r=n,i):r},i.gravity=function(n){return arguments.length?(e=n,i):e},i.getCenter=function(n){return arguments.length?(t=n,i):t},i}function N1(r=1,e=.005,t=2){function i(n,o){let s=e*e;hE(n,r,s,o,t)}return i.factor=function(n){return arguments.length?(r=n,i):r},i.coulombDisScale=function(n){return arguments.length?(e=n,i):e},i.dimensions=function(n){return arguments.length?(t=n,i):t},i}var lE=.81,Nl=.1;function hE(r,e,t,i,n=2){let o=e/t,a=r.nodes().map((l,m)=>{let{nodeStrength:_,x:g,y:w,z:b,size:q,mass:y}=l;return{x:g,y:w,z:b,size:q,index:m,id:l.id,vx:0,vy:0,vz:0,weight:o*_,mass:y||1}}),u=(n===2?Nr(a,l=>l.x,l=>l.y):It(a,l=>l.x,l=>l.y,l=>l.z)).visitAfter(dE),f=new Map;return a.forEach(l=>{f.set(l.id,l),mE(l,u,n)}),a.map(l=>{let m=l.id;i[m]={x:l.vx/l.mass,y:l.vy/l.mass,z:l.vz/l.mass}}),i}function dE(r){let e=0,t=0,i=0,n=0,o=0,s=r.length;if(s){for(let a=0;a<s;a++){let u=r[a];u&&u.weight&&(e+=u.weight,t+=u.x*u.weight,i+=u.y*u.weight,n+=u.z*u.weight,o+=u.size*u.weight)}r.x=t/e,r.y=i/e,r.z=n/e,r.size=o/e,r.weight=e}else{let a=r;r.x=a.data.x,r.y=a.data.y,r.z=a.data.z,r.size=a.data.size,r.weight=a.data.weight}}var pE=(r,e,t,i,n,o,s,a,u)=>{var f;if(((f=r.data)===null||f===void 0?void 0:f.id)===a.id)return;let l=u===2?i:u===3?o:t,m=a.x-r.x||Nl,_=a.y-r.y||Nl,g=a.z-r.z||Nl,w=[m,_,g],b=l-e,q=0;for(let E=0;E<u;E++)q+=w[E]*w[E];let x=Math.sqrt(q)*q;if(b*b*lE<q){let E=r.weight/x;return a.vx+=m*E,a.vy+=_*E,a.vz+=g*E,!0}if(r.length)return!1;if(r.data!==a){let E=r.data.weight/x;a.vx+=m*E,a.vy+=_*E,a.vz+=g*E}};function mE(r,e,t){e.visit((i,n,o,s,a,u,f)=>pE(i,n,o,s,a,u,f,r,t))}var gE="*",M1=(function(){function r(){this._events={}}return r.prototype.on=function(e,t,i){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!i}),this},r.prototype.once=function(e,t){return this.on(e,t,!0)},r.prototype.emit=function(e){for(var t=this,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];var o=this._events[e]||[],s=this._events[gE]||[],a=function(u){for(var f=u.length,l=0;l<f;l++)if(u[l]){var m=u[l],_=m.callback,g=m.once;g&&(u.splice(l,1),u.length===0&&delete t._events[e],f--,l--),_.apply(t,i)}};a(o),a(s)},r.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var i=this._events[e]||[],n=i.length,o=0;o<n;o++)i[o].callback===t&&(i.splice(o,1),n--,o--);i.length===0&&delete this._events[e]}return this},r.prototype.getEvents=function(){return this._events},r})();var vt=class extends M1{constructor(){super(...arguments),this.iteration=0,this.judgingDistance=1/0,this.running=!1,this.tickCallback=null,this.endCallback=null,this.timer=0}initialize(e){this.options=e,this.iteration=0,this.judgingDistance=1/0}on(e,t){return e==="tick"&&(this.tickCallback=t),e==="end"&&(this.endCallback=t),this}tick(e=1){var t;for(let i=0;i<e;i++){let n=this.runOneStep();this.judgingDistance=n,this.iteration++,(t=this.tickCallback)===null||t===void 0||t.call(this)}return this}restart(){if(this.running)return this;let{maxIteration:e=500,minMovement:t=0,animate:i=!0}=this.options;if(!i||typeof window>"u"){for(;this.iteration<e&&(this.judgingDistance>t||this.iteration<1);)this.tick(1);return Promise.resolve().then(()=>{var n;(n=this.endCallback)===null||n===void 0||n.call(this)}),this}return this.running=!0,this.timer=window.setInterval(()=>{var n;this.tick(1),(this.iteration>=e||this.judgingDistance<t)&&(this.stop(),(n=this.endCallback)===null||n===void 0||n.call(this))},0),this}stop(){return this.running=!1,this.timer&&(clearInterval(this.timer),this.timer=0),this}};var po=class extends vt{constructor(){super(...arguments),this.forces=new Map,this.velMap={}}data(e){return this.model=e,e.forEachNode(t=>{this.velMap[t.id]={x:0,y:0,z:0}}),this}force(e,t){return arguments.length===1?this.forces.get(e)||null:(t===null?this.forces.delete(e):t&&this.forces.set(e,t),t||null)}runOneStep(){let e={},t=this.model.nodes();if(!t.length)return 0;t.forEach(n=>{e[n.id]={x:0,y:0,z:0}}),this.forces.forEach(n=>{n(this.model,e)}),this.updateVelocity(e);let i=this.updatePosition();return this.monitor(e,t),i}setFixedPosition(e,t){let i=this.model.node(e);if(!i)return;let n=["fx","fy","fz"];if(t===null){n.forEach(s=>delete i[s]);return}t.forEach((s,a)=>{a<n.length&&(typeof s=="number"||s===null)&&(i[n[a]]=s)});let o=this.velMap[e];o&&(o.x=0,o.y=0,o.z=0)}updateVelocity(e){let{damping:t=.9,maxSpeed:i=100,interval:n=.02,dimensions:o=2}=this.options;this.model.nodes().forEach(s=>{let a=s.id,u=(this.velMap[a].x+e[a].x*n)*t,f=(this.velMap[a].y+e[a].y*n)*t,l=o===3?(this.velMap[a].z+e[a].z*n)*t:0,m=Math.sqrt(u*u+f*f+l*l);if(m>i){let _=i/m;u*=_,f*=_,l*=_}this.velMap[a]={x:u,y:f,z:l}})}updatePosition(){let{distanceThresholdMode:e="mean",interval:t=.02,dimensions:i=2}=this.options,n=this.model.nodes(),o=0,s=e==="max"?-1/0:e==="min"?1/0:0;return n.forEach(a=>{let u=a.id;if(Me(a.fx)&&Me(a.fy)){a.x=a.fx,a.y=a.fy,i===3&&Me(a.fz)&&(a.z=a.fz);return}let f=this.velMap[u].x*t,l=this.velMap[u].y*t,m=i===3?this.velMap[u].z*t:0;a.x+=f,a.y+=l,i===3&&(a.z=(a.z||0)+m);let _=Math.sqrt(f*f+l*l+m*m);e==="max"?s=Math.max(s,_):e==="min"?s=Math.min(s,_):o+=_}),e==="mean"?o/n.length:s}monitor(e,t){let{monitor:i,dimensions:n=2}=this.options;if(!i)return;let o=0;t.forEach(s=>{let a=e[s.id],u=a.x*a.x+a.y*a.y+(n===3?a.z*a.z:0);o+=(s.mass||1)*u*.5}),i({energy:o,nodes:t,edges:this.model.edges(),iterations:this.iteration})}};var I1=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)};var _E={}.toString,R1=function(r){return _E.call(r).replace(/^\[object /,"").replace(/]$/,"")};var vE=Object.prototype,A1=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||vE;return r===t};var yE=Object.prototype.hasOwnProperty;function O1(r){if(Fe(r))return!0;if(I1(r))return!r.length;var e=R1(r);if(e==="Map"||e==="Set")return!r.size;if(A1(r))return!Object.keys(r).length;for(var t in r)if(yE.call(r,t))return!1;return!0}var qE={nodeSize:30,dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,collideStrength:1,preventOverlap:!0,distanceThresholdMode:"mean"},Mi=class extends Br{constructor(){super(...arguments),this.id="force",this.simulation=null}getDefaultOptions(){return qE}layout(){var e;return Ne(this,void 0,void 0,function*(){let t=this.parseOptions(this.options),{width:i,height:n,dimensions:o}=t;if(this.initializePhysicsData(this.model,t),xt(this.model,i,n,o),!(!((e=this.model.nodes())===null||e===void 0)&&e.length))return;let s=this.setSimulation(t);return s.data(this.model),s.initialize(t),s.restart(),new Promise(a=>{s.on("end",()=>a())})})}initializePhysicsData(e,t){let{nodeSize:i,getMass:n,nodeStrength:o,edgeStrength:s,linkDistance:a}=t;e.forEachNode(u=>{let f=u._original;u.size=i(f),u.mass=n(f),u.nodeStrength=o(f)}),e.forEachEdge(u=>{let f=u._original;u.edgeStrength=s(f),u.linkDistance=a(f,e.originalNode(u.source),e.originalNode(u.target))})}setSimulation(e){let t=this.simulation||new po;return this.simulation||(this.simulation=t.on("tick",()=>{var i;(i=e.onTick)===null||i===void 0||i.call(e,this)})),this.setupRepulsiveForce(t,e),this.setupAttractiveForce(t,e),this.setupCollideForce(t,e),this.setupGravityForce(t,e),this.setupCentripetalForce(t,e),t}setupRepulsiveForce(e,t){let{factor:i,coulombDisScale:n,dimensions:o}=t,s=e.force("repulsive");s||(s=N1(i,n,o),e.force("repulsive",s)),s.factor&&s.factor(i),s.coulombDisScale&&s.coulombDisScale(n),s.dimensions&&s.dimensions(o)}setupAttractiveForce(e,t){let{dimensions:i,preventOverlap:n}=t;if((this.model.edges()||[]).length>0){let s=e.force("attractive");s||(s=w1(i),e.force("attractive",s)),s.dimensions&&s.dimensions(i),s.preventOverlap&&s.preventOverlap(n)}else e.force("attractive",null)}setupGravityForce(e,t){let{center:i,gravity:n,getCenter:o}=t;if(n){let s=e.force("gravity");s||(s=S1(i,n),e.force("gravity",s)),s.center&&s.center(i),s.gravity&&s.gravity(n),s.getCenter&&s.getCenter(o)}else e.force("gravity",null)}setupCollideForce(e,t){let{preventOverlap:i,collideStrength:n=1,dimensions:o}=t;if(i&&n){let s=e.force("collide");s||(s=E1(o),e.force("collide",s)),s.strength&&s.strength(n),s.dimensions&&s.dimensions(o)}else e.force("collide",null)}setupCentripetalForce(e,t){let{centripetalOptions:i,width:n,height:o}=t;if(i){let s=e.force("centripetal");s||(s=b1(),e.force("centripetal",s)),s.options&&s.options(i),s.width&&s.width(n),s.height&&s.height(o)}else e.force("centripetal",null)}parseOptions(e){let t=Object.assign(Object.assign({},e),Pe(e));if(t.nodeClusterBy&&(t.nodeClusterBy=Te(t.nodeClusterBy,["node"])),e.getMass?t.getMass=ur(e.getMass,1):t.getMass=n=>{if(!n)return 1;let o=1,s=this.model.degree(n.id,"both");return!s||s<5?o:s*5*o},e.getCenter){let n=["node","degree"];t.getCenter=Te(e.getCenter,n)}let i=or(e.nodeSize,e.nodeSpacing);return t.nodeSize=n=>{if(!n)return 0;let[o,s,a]=i(n);return Math.max(o,s,a)},t.linkDistance=e.linkDistance?Te(e.linkDistance,["edge","source","target"]):(n,o,s)=>1+n.nodeSize(o)+n.nodeSize(s),t.nodeStrength=ur(e.nodeStrength,1),t.edgeStrength=ur(e.edgeStrength,1,"edge"),t.clusterNodeStrength=ur(e.clusterNodeStrength,1),this.formatCentripetal(t),t}formatCentripetal(e){var t,i;let{dimensions:n,centripetalOptions:o,center:s,leafCluster:a,clustering:u,nodeClusterBy:f}=e,l=["node","nodes","edges"],m=Te(o?.leaf,l),_=ur(o?.single,2),g=ur(o?.others,1),w=(t=o?.center)!==null&&t!==void 0?t:(E=>({x:s[0],y:s[1],z:n===3?s[2]:void 0})),b=Te(w,["node","nodes","edges","width","height"]),q=Object.assign(Object.assign({},o),{leaf:m,single:_,others:g,center:b});o&&(e.centripetalOptions=q);let y,x;if(a&&f&&(y=this.getSameTypeLeafMap(f),x=Array.from(new Set((i=this.model.nodes())===null||i===void 0?void 0:i.map(E=>f(E._original))))||[],e.centripetalOptions=Object.assign({},q,{single:()=>100,leaf:E=>{let{siblingLeaves:N,sameTypeLeaves:M}=y[E.id]||{};return M?.length===N?.length||x?.length===1?1:e.clusterNodeStrength(E)},others:()=>1,center:E=>{let N=this.model.degree(E.id,"both");if(!N)return{x:100,y:100,z:0};let M;if(N===1){let{sameTypeLeaves:A=[]}=y[E.id]||{};A.length===1?M=void 0:A.length>1&&(M=this.getAvgNodePosition(A))}else M=void 0;return{x:M?.x,y:M?.y,z:M?.z}}})),u&&f){y||(y=this.getSameTypeLeafMap(f));let E=[];O1(E)&&this.model.forEachNode(M=>{let A=f(M._original);A&&!E.includes(A)&&E.push(A)});let N={};E.forEach(M=>{let A=this.model.nodes().filter(T=>f(T._original)===M);N[M]=this.getAvgNodePosition(A)}),e.centripetalOptions=Object.assign(q,{single:M=>e.clusterNodeStrength(M),leaf:M=>e.clusterNodeStrength(M),others:M=>e.clusterNodeStrength(M),center:M=>{let A=N[f(M._original)];return{x:A?.x,y:A?.y,z:A?.z}}})}}getSameTypeLeafMap(e){let t={};return this.model.forEachNode(i=>{this.model.degree(i.id,"both")===1&&(t[i.id]=this.getCoreNodeAndSiblingLeaves(i,e))}),t}getCoreNodeAndSiblingLeaves(e,t){let i=this.model.degree(e.id,"in"),n=this.model.degree(e.id,"out"),o=e,s=[];if(i===0){let f=this.model.successors(e.id);o=this.model.node(f[0]),s=this.model.neighbors(o.id).map(l=>this.model.node(l))}else if(n===0){let f=this.model.predecessors(e.id);o=this.model.node(f[0]),s=this.model.neighbors(o.id).map(l=>this.model.node(l))}s=s.filter(f=>this.model.degree(f.id,"in")===0||this.model.degree(f.id,"out")===0);let a=t(e._original)||"",u=s.filter(f=>t(f._original)===a&&(this.model.degree(f.id,"in")===0||this.model.degree(f.id,"out")===0));return{coreNode:o,siblingLeaves:s,sameTypeLeaves:u}}getAvgNodePosition(e){let t={x:0,y:0};e.forEach(n=>{t.x+=n.x||0,t.y+=n.y||0});let i=e.length||1;return{x:t.x/i,y:t.y/i}}tick(e=1){return this.simulation&&this.simulation.tick(e),this}stop(){return this.simulation&&this.simulation.stop(),this}restart(){return this.simulation&&this.simulation.restart(),this}setFixedPosition(e,t){return this.simulation&&this.simulation.setFixedPosition(e,t),this}};var mo=class r{constructor(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}distanceTo(e){let t=this.rx-e.rx,i=this.ry-e.ry;return Math.hypot(t,i)}setPos(e,t){this.rx=e,this.ry=t}resetForce(){this.fx=0,this.fy=0}addForce(e){let t=e.rx-this.rx,i=e.ry-this.ry,n=Math.hypot(t,i);n=n<1e-4?1e-4:n;let o=this.g*(this.degree+1)*(e.degree+1)/n;this.fx+=o*t/n,this.fy+=o*i/n}in(e){return e.contains(this.rx,this.ry)}add(e){let t=this.mass+e.mass,i=(this.rx*this.mass+e.rx*e.mass)/t,n=(this.ry*this.mass+e.ry*e.mass)/t,o=this.degree+e.degree,s={rx:i,ry:n,mass:t,degree:o};return new r(s)}};var go=class r{constructor(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}getLength(){return this.length}contains(e,t){let i=this.length/2;return e<=this.xmid+i&&e>=this.xmid-i&&t<=this.ymid+i&&t>=this.ymid-i}NW(){let e=this.xmid-this.length/4,t=this.ymid+this.length/4,i=this.length/2,n={xmid:e,ymid:t,length:i};return new r(n)}NE(){let e=this.xmid+this.length/4,t=this.ymid+this.length/4,i=this.length/2,n={xmid:e,ymid:t,length:i};return new r(n)}SW(){let e=this.xmid-this.length/4,t=this.ymid-this.length/4,i=this.length/2,n={xmid:e,ymid:t,length:i};return new r(n)}SE(){let e=this.xmid+this.length/4,t=this.ymid-this.length/4,i=this.length/2,n={xmid:e,ymid:t,length:i};return new r(n)}};var _o=class r{constructor(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}insert(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new r(this.quad.NW()),this.NE=new r(this.quad.NE()),this.SW=new r(this.quad.SW()),this.SE=new r(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e))}_putBody(e){this.quad&&(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{let t=this.quad?this.quad.getLength():0,i=this.body.distanceTo(e);t/i<this.theta?e.addForce(this.body):(this.NW&&this.NW.updateForce(e),this.NE&&this.NE.updateForce(e),this.SW&&this.SW.updateForce(e),this.SE&&this.SE.updateForce(e))}}};var C1=class extends vt{constructor(){super(...arguments),this.sg=0,this.forces={},this.preForces={},this.bodies={},this.sizes={},this.maxIteration=0}data(e,t){return this.model=e,this.sizes=t,this}initialize(e){super.initialize(e),this.maxIteration=e.maxIteration,this.sg=0,this.initForces()}initForces(){let{model:e,options:t}=this,{kr:i,barnesHut:n}=t,o=e.nodes();this.forces={},this.preForces={},this.bodies={};for(let s=0;s<o.length;s+=1){let a=o[s];if(this.forces[a.id]=[0,0],this.preForces[a.id]=[0,0],n){let u={id:s,rx:a.x,ry:a.y,mass:1,g:i,degree:e.degree(a.id)};this.bodies[a.id]=new mo(u)}}}setFixedPosition(e,t){let i=this.model.node(e);if(!i)return;let n=["fx","fy","fz"];if(t===null){n.forEach(o=>{delete i[o]});return}t.forEach((o,s)=>{s<n.length&&(typeof o=="number"||o===null)&&(i[n[s]]=o)})}isNodeFixed(e){return Me(e.fx)&&Me(e.fy)}syncFixedPositions(){this.model.forEachNode(e=>{this.isNodeFixed(e)&&(e.x=e.fx,e.y=e.fy)})}runOneStep(){let{model:e,options:t}=this,{preventOverlap:i,barnesHut:n}=t,o=this.maxIteration-this.iteration,s=100,a=e.nodes();for(let u=0;u<a.length;u+=1){let{id:f}=a[u];this.preForces[f]=[...this.forces[f]||[0,0]],this.forces[f]=[0,0]}return this.syncFixedPositions(),this.calculateAttractive(o),n&&!i?this.calculateOptRepulsiveGravity():this.calculateRepulsiveGravity(o,s),this.updatePositions()}calculateAttractive(e){let{model:t,options:i}=this,{preventOverlap:n,dissuadeHubs:o,mode:s,prune:a}=i,u=t.edges();for(let f=0;f<u.length;f+=1){let{source:l,target:m}=u[f],_=t.node(l),g=t.node(m),w=t.degree(l),b=t.degree(m);if(a&&(w<=1||b<=1))continue;let q=g.x-_.x,y=g.y-_.y,x=Math.hypot(q,y);x=x<1e-4?1e-4:x;let E=q/x,N=y/x,M=x;n&&(M=Math.max(0,x-this.sizes[l]-this.sizes[m]));let A=M,T=M;s==="linlog"&&(A=Math.log(1+M),T=A),o&&(A=M/w,T=M/b),this.forces[l][0]+=A*E,this.forces[l][1]+=A*N,this.forces[m][0]-=T*E,this.forces[m][1]-=T*N}}calculateOptRepulsiveGravity(){let{model:e,options:t}=this,{kg:i,center:n,prune:o,kr:s}=t,a=e.nodes(),u=a.length,f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,m=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(let y=0;y<u;y+=1){let x=a[y],{id:E,x:N,y:M}=x;if(o&&e.degree(E)<=1)continue;let A=this.bodies[E];A&&(A.setPos(N,M),N<f&&(f=N),N>l&&(l=N),M<m&&(m=M),M>_&&(_=M))}let g=Math.max(l-f,_-m);(!isFinite(g)||g<=0)&&(g=1);let w={xmid:(l+f)/2,ymid:(_+m)/2,length:g,massCenter:n,mass:u},b=new go(w),q=new _o(b);for(let y=0;y<u;y+=1){let{id:x}=a[y];if(o&&e.degree(x)<=1)continue;let E=this.bodies[x];E&&E.in(b)&&q.insert(E)}for(let y=0;y<u;y+=1){let x=a[y],{id:E,x:N,y:M}=x,A=e.degree(E);if(o&&A<=1)continue;let T=this.bodies[E];if(!T)continue;T.resetForce(),q.updateForce(T),this.forces[E][0]-=T.fx,this.forces[E][1]-=T.fy;let j=N-n[0],B=M-n[1],z=Math.hypot(j,B);z=z<1e-4?1e-4:z;let U=j/z,V=B/z,W=i*(A+1);this.forces[E][0]-=W*U,this.forces[E][1]-=W*V}}calculateRepulsiveGravity(e,t){let{model:i,options:n}=this,{preventOverlap:o,kr:s,kg:a,center:u,prune:f}=n,l=i.nodes(),m=l.length;for(let _=0;_<m;_+=1){let g=l[_],w=i.degree(g.id);for(let M=_+1;M<m;M+=1){let A=l[M],T=i.degree(A.id);if(f&&(w<=1||T<=1))continue;let j=A.x-g.x,B=A.y-g.y,z=Math.hypot(j,B);z=z<1e-4?1e-4:z;let U=j/z,V=B/z,W=z,H;if(o){let se=z-this.sizes[g.id]-this.sizes[A.id];se<0?H=t*(w+1)*(T+1):se===0?H=0:(W=se,H=s*(w+1)*(T+1)/W)}else H=s*(w+1)*(T+1)/W;this.forces[g.id][0]-=H*U,this.forces[g.id][1]-=H*V,this.forces[A.id][0]+=H*U,this.forces[A.id][1]+=H*V}let b=g.x-u[0],q=g.y-u[1],y=Math.hypot(b,q);y=y<1e-4?1e-4:y;let x=b/y,E=q/y,N=a*(w+1);this.forces[g.id][0]-=N*x,this.forces[g.id][1]-=N*E}}updatePositions(){let{model:e,options:t}=this,{ks:i,tao:n,prune:o,ksmax:s,distanceThresholdMode:a="max"}=t,u=e.nodes(),f=u.length,l={},m={},_=0,g=0;for(let N=0;N<f;N+=1){let{id:M}=u[N],A=e.degree(M);if(o&&A<=1)continue;let T=this.preForces[M]||[0,0],j=this.forces[M]||[0,0],B=j[0]-T[0],z=j[1]-T[1],U=Math.hypot(B,z),V=j[0]+T[0],W=j[1]+T[1],H=Math.hypot(V,W);l[M]=U,m[M]=H/2,_+=(A+1)*l[M],g+=(A+1)*m[M]}let w=this.sg,b=this.sg;_<=0?w=b>0?b:1:(w=n*g/_,b!==0&&(w=w>1.5*b?1.5*b:w)),this.sg=w;let q=0,y=1/0,x=0,E=0;for(let N=0;N<f;N+=1){let M=u[N],A=M.id,T=e.degree(A);if(o&&T<=1||this.isNodeFixed(M))continue;let j=l[A]||0,B=i*w/(1+w*Math.sqrt(j)),z=Math.hypot(this.forces[A][0],this.forces[A][1]);z=z<1e-4?1e-4:z;let U=s/z;B>U&&(B=U);let V=B*this.forces[A][0],W=B*this.forces[A][1];M.x+=V,M.y+=W;let H=Math.hypot(V,W);H>0&&(E++,x+=H,H>q&&(q=H),H<y&&(y=H))}switch(a){case"min":return y;case"mean":return E>0?x/E:0;default:return q}}destroy(){this.stop(),this.forces={},this.preForces={},this.bodies={},this.sizes={},this.off()}};var Ml={nodeSize:10,nodeSpacing:0,width:300,height:300,kr:5,kg:1,mode:"normal",preventOverlap:!1,dissuadeHubs:!1,maxIteration:0,ks:.1,ksmax:10,tao:.1},Ii=class extends Br{constructor(){super(...arguments),this.id="force-atlas2",this.simulation=null}getDefaultOptions(){return Ml}layout(e){return Ne(this,void 0,void 0,function*(){let t=this.parseOptions(e),{width:i,height:n,prune:o,center:s}=t,a=this.model.nodeCount();if(!a||a===1)return gr(this.model,s);xt(this.model,i,n);let u=this.getSizes(t.nodeSize,t.nodeSpacing),f=this.setSimulation();f.data(this.model,u),f.initialize(t),f.restart();let l=()=>new Promise(m=>{f.on("end",m)});if(!o)return l();if(yield l(),o){let m=this.model.edges();for(let _=0;_<m.length;_+=1){let{source:g,target:w}=m[_],b=this.model.degree(g),q=this.model.degree(w),y=this.model.node(g),x=this.model.node(w);b<=1?(y.x=x.x,y.y=x.y):q<=1&&(x.x=y.x,x.y=y.y)}f.initialize(Object.assign(Object.assign({},t),{prune:!1,barnesHut:!1})),f.tick(100)}})}getSizes(e,t){let i={},n=or(e,t,Ml.nodeSize,Ml.nodeSpacing);return this.model.forEachNode(o=>{i[o.id]=Math.max(...n(o._original))}),i}setSimulation(){let e=this.simulation||new C1;return this.simulation||(this.simulation=e.on("tick",()=>{var t,i;return(i=(t=this.options).onTick)===null||i===void 0?void 0:i.call(t,this)})),this.simulation}parseOptions(e={}){let{barnesHut:t,prune:i,maxIteration:n,kr:o,kg:s}=e,a={},u=this.model.nodeCount();return t===void 0&&u>250&&(a.barnesHut=!0),i===void 0&&u>100&&(a.prune=!0),n===0&&!i?(a.maxIteration=250,u<=200&&u>100?a.maxIteration=1e3:u>200&&(a.maxIteration=1200)):n===0&&i&&(a.maxIteration=100,u<=200&&u>100?a.maxIteration=500:u>200&&(a.maxIteration=950)),o||(a.kr=50,u>100&&u<=500?a.kr=20:u>500&&(a.kr=1)),s||(a.kg=20,u>100&&u<=500?a.kg=10:u>500&&(a.kg=1)),Object.assign(Object.assign(Object.assign({},e),a),Pe(e))}stop(){var e;(e=this.simulation)===null||e===void 0||e.stop()}tick(e=1){var t;(t=this.simulation)===null||t===void 0||t.tick(e)}restart(){var e;(e=this.simulation)===null||e===void 0||e.restart()}setFixedPosition(e,t){var i;(i=this.simulation)===null||i===void 0||i.setFixedPosition(e,t)}destroy(){var e;super.destroy(),this.stop(),(e=this.simulation)===null||e===void 0||e.destroy(),this.simulation=null}};var wE=800,vo=class extends vt{constructor(){super(...arguments),this.displacements=null,this.clusterMap=null}data(e){return this.model=e,this}initialize(e){super.initialize(e),this.recomputeConstants(),this.displacements=null,this.clusterMap=null,this.initDisplacements()}recomputeConstants(){let{model:e,options:t}=this,{width:i,height:n}=Pe(t),o=i*n;this.k2=o/(e.nodeCount()+1),this.k=Math.sqrt(this.k2),this.maxDisplace=Math.sqrt(o)/10}runOneStep(){return this.syncFixedPositions(),this.initDisplacements(),this.calculateRepulsive(),this.calculateAttractive(),this.applyClusterGravity(),this.applyGlobalGravity(),this.updatePositions()}setFixedPosition(e,t){let i=this.model.node(e);if(!i)return;let n=["fx","fy","fz"];if(t===null){n.forEach(o=>{delete i[o]});return}t.forEach((o,s)=>{s<n.length&&(typeof o=="number"||o===null)&&(i[n[s]]=o)})}isNodeFixed(e){return!Fe(e.fx)&&!Fe(e.fy)}syncFixedPositions(){let{model:e,options:t}=this,i=t.dimensions===3;e.forEachNode(n=>{this.isNodeFixed(n)&&(n.x=n.fx,n.y=n.fy,i&&n.fz!==void 0&&(n.z=n.fz))})}initDisplacements(){this.displacements||(this.displacements=new Map,this.model.forEachNode(e=>{this.displacements.set(e.id,{x:0,y:0,z:0})})),this.displacements.forEach(e=>{e.x=0,e.y=0,e.z=0})}calculateRepulsive(){let{model:e,options:t}=this,i=t.dimensions===3,n=e.nodes();for(let o=0;o<n.length;o++){let s=n[o],a=this.displacements.get(s.id),u=this.isNodeFixed(s);for(let f=o+1;f<n.length;f++){let l=n[f],m=this.displacements.get(l.id),_=this.isNodeFixed(l),g=s.x-l.x,w=s.y-l.y,b=i?s.z-l.z:0,q=g*g+w*w+b*b;q===0&&(q=1,g=.01,w=.01,b=.01);let y=this.k2/q,x=g*y,E=w*y,N=b*y;!u&&!_?(a.x+=x,a.y+=E,m.x-=x,m.y-=E,i&&(a.z+=N,m.z-=N)):u&&!_?(m.x-=x*2,m.y-=E*2,i&&(m.z-=N*2)):!u&&_&&(a.x+=x*2,a.y+=E*2,i&&(a.z+=N*2))}}}calculateAttractive(){let{model:e,options:t}=this,i=t.dimensions===3;e.forEachEdge(n=>{let{source:o,target:s}=n;if(!o||!s||o===s)return;let a=e.node(o),u=e.node(s),f=this.displacements.get(o),l=this.displacements.get(s),m=this.isNodeFixed(a),_=this.isNodeFixed(u),g=u.x-a.x,w=u.y-a.y,b=i?u.z-a.z:0,q=Math.sqrt(g*g+w*w+b*b);if(q===0)return;let y=q/this.k,x=g*y,E=w*y,N=b*y;!m&&!_?(f.x+=x,f.y+=E,l.x-=x,l.y-=E,i&&(f.z+=N,l.z-=N)):m&&!_?(l.x-=x*2,l.y-=E*2,i&&(l.z-=N*2)):!m&&_&&(f.x+=x*2,f.y+=E*2,i&&(f.z+=N*2))})}applyClusterGravity(){let{model:e,options:t}=this,{nodeClusterBy:i,clusterGravity:n,dimensions:o,clustering:s}=t;if(!s||(this.clusterMap||(this.clusterMap=new Map,e.forEachNode(u=>{let f=i(e.originalNode(u.id));this.clusterMap.has(f)||this.clusterMap.set(f,{name:f,cx:0,cy:0,cz:0,count:0})})),this.clusterMap.size===0))return;let a=o===3;this.clusterMap.forEach(u=>{u.cx=0,u.cy=0,u.cz=0,u.count=0}),e.forEachNode(u=>{let f=i(e.originalNode(u.id)),l=this.clusterMap.get(f);l&&(l.cx+=u.x,l.cy+=u.y,a&&(l.cz+=u.z),l.count++)}),this.clusterMap.forEach(u=>{u.count>0&&(u.cx/=u.count,u.cy/=u.count,u.cz/=u.count)}),e.forEachNode(u=>{let{id:f}=u;if(this.isNodeFixed(u))return;let l=i(e.originalNode(f)),m=this.clusterMap.get(l);if(!m)return;let _=this.displacements.get(f),g=u.x-m.cx,w=u.y-m.cy,b=a?u.z-m.cz:0,q=Math.sqrt(g*g+w*w+b*b);if(q===0)return;let y=this.k*n;_.x-=y*g/q,_.y-=y*w/q,a&&(_.z-=y*b/q)})}applyGlobalGravity(){let{model:e,options:t}=this,{gravity:i,center:n,dimensions:o}=t,s=o===3,a=.01*this.k*i;e.forEachNode(u=>{let{id:f}=u;if(this.isNodeFixed(u))return;let l=this.displacements.get(f);l.x-=a*(u.x-n[0]),l.y-=a*(u.y-n[1]),s&&(l.z-=a*(u.z-(n[2]||0)))})}updatePositions(){let{model:e,options:t}=this,{speed:i,dimensions:n,distanceThresholdMode:o="max"}=t,s=n===3,a=0,u=1/0,f=0,l=0;if(e.forEachNode(m=>{let{id:_}=m;if(this.isNodeFixed(m))return;let g=this.displacements.get(_),w=Math.sqrt(g.x*g.x+g.y*g.y+(s?g.z*g.z:0));if(w===0)return;let b=Math.min(this.maxDisplace*(i/wE),w),q=b/w;m.x+=g.x*q,m.y+=g.y*q,s&&(m.z=m.z+g.z*q),a=Math.max(a,b),u=Math.min(u,b),f+=b,l++}),l===0)return 0;switch(o){case"min":return u===1/0?0:u;case"mean":return f/l;default:return a}}destroy(){var e,t;this.stop(),(e=this.displacements)===null||e===void 0||e.clear(),(t=this.clusterMap)===null||t===void 0||t.clear()}};var bE={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"node.cluster",dimensions:2},Ri=class extends Br{constructor(){super(...arguments),this.id="fruchterman",this.simulation=null}getDefaultOptions(){return bE}parseOptions(e={}){let{clustering:t,nodeClusterBy:i}=this.options,n=t&&!!i;return Object.assign(e,Pe(e),{clustering:n,nodeClusterBy:Te(i,["node"])}),e}layout(){return Ne(this,void 0,void 0,function*(){let e=this.parseOptions(this.options),{dimensions:t,center:i,width:n,height:o}=e,s=this.model.nodeCount();if(!s||s===1){gr(this.model,i,t);return}xt(this.model,n,o,t);let a=this.setSimulation();return a.data(this.model),a.initialize(e),a.restart(),new Promise(u=>{a.on("end",()=>u())})})}setSimulation(){let e=this.simulation||new vo;return this.simulation||(this.simulation=e.on("tick",()=>{var t,i;return(i=(t=this.options).onTick)===null||i===void 0?void 0:i.call(t,this)})),this.simulation}restart(){var e;(e=this.simulation)===null||e===void 0||e.restart()}stop(){var e;(e=this.simulation)===null||e===void 0||e.stop()}tick(e=1){var t;(t=this.simulation)===null||t===void 0||t.tick(e)}setFixedPosition(e,t){var i;(i=this.simulation)===null||i===void 0||i.setFixedPosition(e,t)}destroy(){var e;super.destroy(),this.stop(),(e=this.simulation)===null||e===void 0||e.destroy(),this.simulation=null}};var yo={begin:[0,0],preventOverlap:!0,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30,nodeSpacing:10,width:300,height:300},Ai=class extends Ze{constructor(){super(...arguments),this.id="grid"}getDefaultOptions(){return yo}parseOptions(e={},t){let{rows:i,cols:n,position:o,sortBy:s}=e,{width:a,height:u,center:f}=Pe(e),l=e.rows,m=e.cols,_=t.nodeCount();if(i!=null&&n!=null)l=i,m=n;else if(i!=null&&n==null)l=i,m=Math.ceil(_/l);else if(i==null&&n!=null)m=n,l=Math.ceil(_/m);else{let b=Math.sqrt(_*u/a);l=Math.round(b),m=Math.round(a/u*b)}l=Math.max(l,1),m=Math.max(m,1);let g={rows:l,cols:m};if(g.cols*g.rows>_){let b=qo(g),q=wo(g);(b-1)*q>=_?qo(g,b-1):(q-1)*b>=_&&wo(g,q-1)}else for(;g.cols*g.rows<_;){let b=qo(g),q=wo(g);(q+1)*b>=_?wo(g,q+1):qo(g,b+1)}let w=s?s==="degree"||s==="id"?s:Te(s,["nodeA","nodeB"]):yo.sortBy;return Object.assign(Object.assign({},e),{sortBy:w,rcs:g,center:f,width:a,height:u,position:Te(o,["node"])})}layout(){return Ne(this,void 0,void 0,function*(){let{begin:e,rcs:t,sortBy:i,width:n,height:o,condense:s,preventOverlap:a,nodeSpacing:u,nodeSize:f,position:l}=this.parseOptions(this.options,this.model),m=this.model.nodeCount();if(!m||m===1){gr(this.model,e);return}i==="degree"?St(this.model):i==="id"?Qo(this.model):di(this.model,i);let _=s?0:n/t.cols,g=s?0:o/t.rows;if(a){let y=or(f,u,yo.nodeSize,yo.nodeSpacing);this.model.forEachNode(x=>{let[E,N]=y(x._original);_=Math.max(_,E),g=Math.max(g,N)})}let w={},b={row:0,col:0},q={};this.model.forEachNode(y=>{let x=y._original,E;if(l&&(E=l(x)),E&&(E.row!==void 0||E.col!==void 0)){let N={row:E.row,col:E.col};if(N.col===void 0)for(N.col=0;Il(w,N);)N.col++;else if(N.row===void 0)for(N.row=0;Il(w,N);)N.row++;q[y.id]=N,k1(w,N)}xE(y,e,_,g,q,t,b,w)})})}},qo=(r,e)=>{let t,i=r.rows||5,n=r.cols||5;return e==null?t=Math.min(i,n):Math.min(i,n)===r.rows?r.rows=e:r.cols=e,t},wo=(r,e)=>{let t,i=r.rows||5,n=r.cols||5;return e==null?t=Math.max(i,n):Math.max(i,n)===r.rows?r.rows=e:r.cols=e,t},Il=(r,e)=>r[`c-${e.row}-${e.col}`]||!1,k1=(r,e)=>r[`c-${e.row}-${e.col}`]=!0,T1=(r,e)=>{let t=r.cols||5;e.col++,e.col>=t&&(e.col=0,e.row++)},xE=(r,e,t,i,n,o,s,a)=>{let u,f,l=n[r.id];if(l)u=l.col*t+t/2+e[0],f=l.row*i+i/2+e[1];else{for(;Il(a,s);)T1(o,s);u=s.col*t+t/2+e[0],f=s.row*i+i/2+e[1],k1(a,s),T1(o,s)}r.x=u,r.y=f};var we={};var Rl={};Bl(Rl,{isAnyArray:()=>yt});var EE=Object.prototype.toString;function yt(r){let e=EE.call(r);return e.endsWith("Array]")&&!e.includes("Big")}var P1=dn(Rl);var Al={};Bl(Al,{default:()=>SE});function j1(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!yt(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,i=t===void 0?0:t,n=e.toIndex,o=n===void 0?r.length:n;if(i<0||i>=r.length||!Number.isInteger(i))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=i||o>r.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=r[i],a=i+1;a<o;a++)r[a]>s&&(s=r[a]);return s}function L1(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!yt(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,i=t===void 0?0:t,n=e.toIndex,o=n===void 0?r.length:n;if(i<0||i>=r.length||!Number.isInteger(i))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=i||o>r.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=r[i],a=i+1;a<o;a++)r[a]<s&&(s=r[a]);return s}function SE(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(yt(r)){if(r.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!yt(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(r.length);var i=L1(r),n=j1(r);if(i===n)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=e.min,s=o===void 0?e.autoMinMax?i:0:o,a=e.max,u=a===void 0?e.autoMinMax?n:1:a;if(s>=u)throw new RangeError("min option must be smaller than max option");for(var f=(u-s)/(n-i),l=0;l<r.length;l++)t[l]=(r[l]-i)*f+s;return t}var F1=dn(Al);var z1;function D1(){if(z1)return we;z1=1,Object.defineProperty(we,"__esModule",{value:!0});var r=P1,e=F1;let t=" ".repeat(2),i=" ".repeat(4);function n(){return o(this)}function o(S,h={}){let{maxRows:d=15,maxColumns:c=10,maxNumSize:p=8,padMinus:v="auto"}=h;return`${S.constructor.name} {
4
+ ${t}[
5
+ ${i}${s(S,d,c,p,v)}
6
+ ${t}]
7
+ ${t}rows: ${S.rows}
8
+ ${t}columns: ${S.columns}
9
+ }`}function s(S,h,d,c,p){let{rows:v,columns:I}=S,R=Math.min(v,h),O=Math.min(I,d),C=[];if(p==="auto"){p=!1;e:for(let G=0;G<R;G++)for(let k=0;k<O;k++)if(S.get(G,k)<0){p=!0;break e}}for(let G=0;G<R;G++){let k=[];for(let K=0;K<O;K++)k.push(a(S.get(G,K),c,p));C.push(`${k.join(" ")}`)}return O!==I&&(C[C.length-1]+=` ... ${I-d} more columns`),R!==v&&C.push(`... ${v-h} more rows`),C.join(`
10
+ ${i}`)}function a(S,h,d){return(S>=0&&d?` ${u(S,h-1)}`:u(S,h)).padEnd(h)}function u(S,h){let d=S.toString();if(d.length<=h)return d;let c=S.toFixed(h);if(c.length>h&&(c=S.toFixed(Math.max(0,h-(c.length-h)))),c.length<=h&&!c.startsWith("0.000")&&!c.startsWith("-0.000"))return c;let p=S.toExponential(h);return p.length>h&&(p=S.toExponential(Math.max(0,h-(p.length-h)))),p.slice(0)}function f(S,h){S.prototype.add=function(c){return typeof c=="number"?this.addS(c):this.addM(c)},S.prototype.addS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)+c);return this},S.prototype.addM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)+c.get(p,v));return this},S.add=function(c,p){return new h(c).add(p)},S.prototype.sub=function(c){return typeof c=="number"?this.subS(c):this.subM(c)},S.prototype.subS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)-c);return this},S.prototype.subM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)-c.get(p,v));return this},S.sub=function(c,p){return new h(c).sub(p)},S.prototype.subtract=S.prototype.sub,S.prototype.subtractS=S.prototype.subS,S.prototype.subtractM=S.prototype.subM,S.subtract=S.sub,S.prototype.mul=function(c){return typeof c=="number"?this.mulS(c):this.mulM(c)},S.prototype.mulS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)*c);return this},S.prototype.mulM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)*c.get(p,v));return this},S.mul=function(c,p){return new h(c).mul(p)},S.prototype.multiply=S.prototype.mul,S.prototype.multiplyS=S.prototype.mulS,S.prototype.multiplyM=S.prototype.mulM,S.multiply=S.mul,S.prototype.div=function(c){return typeof c=="number"?this.divS(c):this.divM(c)},S.prototype.divS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)/c);return this},S.prototype.divM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)/c.get(p,v));return this},S.div=function(c,p){return new h(c).div(p)},S.prototype.divide=S.prototype.div,S.prototype.divideS=S.prototype.divS,S.prototype.divideM=S.prototype.divM,S.divide=S.div,S.prototype.mod=function(c){return typeof c=="number"?this.modS(c):this.modM(c)},S.prototype.modS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)%c);return this},S.prototype.modM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)%c.get(p,v));return this},S.mod=function(c,p){return new h(c).mod(p)},S.prototype.modulus=S.prototype.mod,S.prototype.modulusS=S.prototype.modS,S.prototype.modulusM=S.prototype.modM,S.modulus=S.mod,S.prototype.and=function(c){return typeof c=="number"?this.andS(c):this.andM(c)},S.prototype.andS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)&c);return this},S.prototype.andM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)&c.get(p,v));return this},S.and=function(c,p){return new h(c).and(p)},S.prototype.or=function(c){return typeof c=="number"?this.orS(c):this.orM(c)},S.prototype.orS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)|c);return this},S.prototype.orM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)|c.get(p,v));return this},S.or=function(c,p){return new h(c).or(p)},S.prototype.xor=function(c){return typeof c=="number"?this.xorS(c):this.xorM(c)},S.prototype.xorS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)^c);return this},S.prototype.xorM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)^c.get(p,v));return this},S.xor=function(c,p){return new h(c).xor(p)},S.prototype.leftShift=function(c){return typeof c=="number"?this.leftShiftS(c):this.leftShiftM(c)},S.prototype.leftShiftS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)<<c);return this},S.prototype.leftShiftM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)<<c.get(p,v));return this},S.leftShift=function(c,p){return new h(c).leftShift(p)},S.prototype.signPropagatingRightShift=function(c){return typeof c=="number"?this.signPropagatingRightShiftS(c):this.signPropagatingRightShiftM(c)},S.prototype.signPropagatingRightShiftS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)>>c);return this},S.prototype.signPropagatingRightShiftM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)>>c.get(p,v));return this},S.signPropagatingRightShift=function(c,p){return new h(c).signPropagatingRightShift(p)},S.prototype.rightShift=function(c){return typeof c=="number"?this.rightShiftS(c):this.rightShiftM(c)},S.prototype.rightShiftS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)>>>c);return this},S.prototype.rightShiftM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)>>>c.get(p,v));return this},S.rightShift=function(c,p){return new h(c).rightShift(p)},S.prototype.zeroFillRightShift=S.prototype.rightShift,S.prototype.zeroFillRightShiftS=S.prototype.rightShiftS,S.prototype.zeroFillRightShiftM=S.prototype.rightShiftM,S.zeroFillRightShift=S.rightShift,S.prototype.not=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,~this.get(c,p));return this},S.not=function(c){return new h(c).not()},S.prototype.abs=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.abs(this.get(c,p)));return this},S.abs=function(c){return new h(c).abs()},S.prototype.acos=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.acos(this.get(c,p)));return this},S.acos=function(c){return new h(c).acos()},S.prototype.acosh=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.acosh(this.get(c,p)));return this},S.acosh=function(c){return new h(c).acosh()},S.prototype.asin=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.asin(this.get(c,p)));return this},S.asin=function(c){return new h(c).asin()},S.prototype.asinh=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.asinh(this.get(c,p)));return this},S.asinh=function(c){return new h(c).asinh()},S.prototype.atan=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.atan(this.get(c,p)));return this},S.atan=function(c){return new h(c).atan()},S.prototype.atanh=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.atanh(this.get(c,p)));return this},S.atanh=function(c){return new h(c).atanh()},S.prototype.cbrt=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.cbrt(this.get(c,p)));return this},S.cbrt=function(c){return new h(c).cbrt()},S.prototype.ceil=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.ceil(this.get(c,p)));return this},S.ceil=function(c){return new h(c).ceil()},S.prototype.clz32=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.clz32(this.get(c,p)));return this},S.clz32=function(c){return new h(c).clz32()},S.prototype.cos=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.cos(this.get(c,p)));return this},S.cos=function(c){return new h(c).cos()},S.prototype.cosh=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.cosh(this.get(c,p)));return this},S.cosh=function(c){return new h(c).cosh()},S.prototype.exp=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.exp(this.get(c,p)));return this},S.exp=function(c){return new h(c).exp()},S.prototype.expm1=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.expm1(this.get(c,p)));return this},S.expm1=function(c){return new h(c).expm1()},S.prototype.floor=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.floor(this.get(c,p)));return this},S.floor=function(c){return new h(c).floor()},S.prototype.fround=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.fround(this.get(c,p)));return this},S.fround=function(c){return new h(c).fround()},S.prototype.log=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.log(this.get(c,p)));return this},S.log=function(c){return new h(c).log()},S.prototype.log1p=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.log1p(this.get(c,p)));return this},S.log1p=function(c){return new h(c).log1p()},S.prototype.log10=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.log10(this.get(c,p)));return this},S.log10=function(c){return new h(c).log10()},S.prototype.log2=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.log2(this.get(c,p)));return this},S.log2=function(c){return new h(c).log2()},S.prototype.round=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.round(this.get(c,p)));return this},S.round=function(c){return new h(c).round()},S.prototype.sign=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.sign(this.get(c,p)));return this},S.sign=function(c){return new h(c).sign()},S.prototype.sin=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.sin(this.get(c,p)));return this},S.sin=function(c){return new h(c).sin()},S.prototype.sinh=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.sinh(this.get(c,p)));return this},S.sinh=function(c){return new h(c).sinh()},S.prototype.sqrt=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.sqrt(this.get(c,p)));return this},S.sqrt=function(c){return new h(c).sqrt()},S.prototype.tan=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.tan(this.get(c,p)));return this},S.tan=function(c){return new h(c).tan()},S.prototype.tanh=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.tanh(this.get(c,p)));return this},S.tanh=function(c){return new h(c).tanh()},S.prototype.trunc=function(){for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.set(c,p,Math.trunc(this.get(c,p)));return this},S.trunc=function(c){return new h(c).trunc()},S.pow=function(c,p){return new h(c).pow(p)},S.prototype.pow=function(c){return typeof c=="number"?this.powS(c):this.powM(c)},S.prototype.powS=function(c){for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)**c);return this},S.prototype.powM=function(c){if(c=h.checkMatrix(c),this.rows!==c.rows||this.columns!==c.columns)throw new RangeError("Matrices dimensions must be equal");for(let p=0;p<this.rows;p++)for(let v=0;v<this.columns;v++)this.set(p,v,this.get(p,v)**c.get(p,v));return this}}function l(S,h,d){let c=d?S.rows:S.rows-1;if(h<0||h>c)throw new RangeError("Row index out of range")}function m(S,h,d){let c=d?S.columns:S.columns-1;if(h<0||h>c)throw new RangeError("Column index out of range")}function _(S,h){if(h.to1DArray&&(h=h.to1DArray()),h.length!==S.columns)throw new RangeError("vector size must be the same as the number of columns");return h}function g(S,h){if(h.to1DArray&&(h=h.to1DArray()),h.length!==S.rows)throw new RangeError("vector size must be the same as the number of rows");return h}function w(S,h){if(!r.isAnyArray(h))throw new TypeError("row indices must be an array");for(let d=0;d<h.length;d++)if(h[d]<0||h[d]>=S.rows)throw new RangeError("row indices are out of range")}function b(S,h){if(!r.isAnyArray(h))throw new TypeError("column indices must be an array");for(let d=0;d<h.length;d++)if(h[d]<0||h[d]>=S.columns)throw new RangeError("column indices are out of range")}function q(S,h,d,c,p){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(x("startRow",h),x("endRow",d),x("startColumn",c),x("endColumn",p),h>d||c>p||h<0||h>=S.rows||d<0||d>=S.rows||c<0||c>=S.columns||p<0||p>=S.columns)throw new RangeError("Submatrix indices are out of range")}function y(S,h=0){let d=[];for(let c=0;c<S;c++)d.push(h);return d}function x(S,h){if(typeof h!="number")throw new TypeError(`${S} must be a number`)}function E(S){if(S.isEmpty())throw new Error("Empty matrix has no elements to index")}function N(S){let h=y(S.rows);for(let d=0;d<S.rows;++d)for(let c=0;c<S.columns;++c)h[d]+=S.get(d,c);return h}function M(S){let h=y(S.columns);for(let d=0;d<S.rows;++d)for(let c=0;c<S.columns;++c)h[c]+=S.get(d,c);return h}function A(S){let h=0;for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)h+=S.get(d,c);return h}function T(S){let h=y(S.rows,1);for(let d=0;d<S.rows;++d)for(let c=0;c<S.columns;++c)h[d]*=S.get(d,c);return h}function j(S){let h=y(S.columns,1);for(let d=0;d<S.rows;++d)for(let c=0;c<S.columns;++c)h[c]*=S.get(d,c);return h}function B(S){let h=1;for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)h*=S.get(d,c);return h}function z(S,h,d){let c=S.rows,p=S.columns,v=[];for(let I=0;I<c;I++){let R=0,O=0,C=0;for(let G=0;G<p;G++)C=S.get(I,G)-d[I],R+=C,O+=C*C;h?v.push((O-R*R/p)/(p-1)):v.push((O-R*R/p)/p)}return v}function U(S,h,d){let c=S.rows,p=S.columns,v=[];for(let I=0;I<p;I++){let R=0,O=0,C=0;for(let G=0;G<c;G++)C=S.get(G,I)-d[I],R+=C,O+=C*C;h?v.push((O-R*R/c)/(c-1)):v.push((O-R*R/c)/c)}return v}function V(S,h,d){let c=S.rows,p=S.columns,v=c*p,I=0,R=0,O=0;for(let C=0;C<c;C++)for(let G=0;G<p;G++)O=S.get(C,G)-d,I+=O,R+=O*O;return h?(R-I*I/v)/(v-1):(R-I*I/v)/v}function W(S,h){for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)S.set(d,c,S.get(d,c)-h[d])}function H(S,h){for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)S.set(d,c,S.get(d,c)-h[c])}function se(S,h){for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)S.set(d,c,S.get(d,c)-h)}function fe(S){let h=[];for(let d=0;d<S.rows;d++){let c=0;for(let p=0;p<S.columns;p++)c+=S.get(d,p)**2/(S.columns-1);h.push(Math.sqrt(c))}return h}function be(S,h){for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)S.set(d,c,S.get(d,c)/h[d])}function Ee(S){let h=[];for(let d=0;d<S.columns;d++){let c=0;for(let p=0;p<S.rows;p++)c+=S.get(p,d)**2/(S.rows-1);h.push(Math.sqrt(c))}return h}function ce(S,h){for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)S.set(d,c,S.get(d,c)/h[c])}function Ie(S){let h=S.size-1,d=0;for(let c=0;c<S.columns;c++)for(let p=0;p<S.rows;p++)d+=S.get(p,c)**2/h;return Math.sqrt(d)}function _e(S,h){for(let d=0;d<S.rows;d++)for(let c=0;c<S.columns;c++)S.set(d,c,S.get(d,c)/h)}class ae{static from1DArray(h,d,c){if(h*d!==c.length)throw new RangeError("data length does not match given dimensions");let v=new P(h,d);for(let I=0;I<h;I++)for(let R=0;R<d;R++)v.set(I,R,c[I*d+R]);return v}static rowVector(h){let d=new P(1,h.length);for(let c=0;c<h.length;c++)d.set(0,c,h[c]);return d}static columnVector(h){let d=new P(h.length,1);for(let c=0;c<h.length;c++)d.set(c,0,h[c]);return d}static zeros(h,d){return new P(h,d)}static ones(h,d){return new P(h,d).fill(1)}static rand(h,d,c={}){if(typeof c!="object")throw new TypeError("options must be an object");let{random:p=Math.random}=c,v=new P(h,d);for(let I=0;I<h;I++)for(let R=0;R<d;R++)v.set(I,R,p());return v}static randInt(h,d,c={}){if(typeof c!="object")throw new TypeError("options must be an object");let{min:p=0,max:v=1e3,random:I=Math.random}=c;if(!Number.isInteger(p))throw new TypeError("min must be an integer");if(!Number.isInteger(v))throw new TypeError("max must be an integer");if(p>=v)throw new RangeError("min must be smaller than max");let R=v-p,O=new P(h,d);for(let C=0;C<h;C++)for(let G=0;G<d;G++){let k=p+Math.round(I()*R);O.set(C,G,k)}return O}static eye(h,d,c){d===void 0&&(d=h),c===void 0&&(c=1);let p=Math.min(h,d),v=this.zeros(h,d);for(let I=0;I<p;I++)v.set(I,I,c);return v}static diag(h,d,c){let p=h.length;d===void 0&&(d=p),c===void 0&&(c=d);let v=Math.min(p,d,c),I=this.zeros(d,c);for(let R=0;R<v;R++)I.set(R,R,h[R]);return I}static min(h,d){h=this.checkMatrix(h),d=this.checkMatrix(d);let c=h.rows,p=h.columns,v=new P(c,p);for(let I=0;I<c;I++)for(let R=0;R<p;R++)v.set(I,R,Math.min(h.get(I,R),d.get(I,R)));return v}static max(h,d){h=this.checkMatrix(h),d=this.checkMatrix(d);let c=h.rows,p=h.columns,v=new this(c,p);for(let I=0;I<c;I++)for(let R=0;R<p;R++)v.set(I,R,Math.max(h.get(I,R),d.get(I,R)));return v}static checkMatrix(h){return ae.isMatrix(h)?h:new P(h)}static isMatrix(h){return h!=null&&h.klass==="Matrix"}get size(){return this.rows*this.columns}apply(h){if(typeof h!="function")throw new TypeError("callback must be a function");for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)h.call(this,d,c);return this}to1DArray(){let h=[];for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)h.push(this.get(d,c));return h}to2DArray(){let h=[];for(let d=0;d<this.rows;d++){h.push([]);for(let c=0;c<this.columns;c++)h[d].push(this.get(d,c))}return h}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let h=0;h<this.rows;h++)for(let d=0;d<=h;d++)if(this.get(h,d)!==this.get(d,h))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let h=0;h<this.rows;h++)if(this.get(h,h)!==0)return!1;return!0}isEchelonForm(){let h=0,d=0,c=-1,p=!0,v=!1;for(;h<this.rows&&p;){for(d=0,v=!1;d<this.columns&&v===!1;)this.get(h,d)===0?d++:this.get(h,d)===1&&d>c?(v=!0,c=d):(p=!1,v=!0);h++}return p}isReducedEchelonForm(){let h=0,d=0,c=-1,p=!0,v=!1;for(;h<this.rows&&p;){for(d=0,v=!1;d<this.columns&&v===!1;)this.get(h,d)===0?d++:this.get(h,d)===1&&d>c?(v=!0,c=d):(p=!1,v=!0);for(let I=d+1;I<this.rows;I++)this.get(h,I)!==0&&(p=!1);h++}return p}echelonForm(){let h=this.clone(),d=0,c=0;for(;d<h.rows&&c<h.columns;){let p=d;for(let v=d;v<h.rows;v++)h.get(v,c)>h.get(p,c)&&(p=v);if(h.get(p,c)===0)c++;else{h.swapRows(d,p);let v=h.get(d,c);for(let I=c;I<h.columns;I++)h.set(d,I,h.get(d,I)/v);for(let I=d+1;I<h.rows;I++){let R=h.get(I,c)/h.get(d,c);h.set(I,c,0);for(let O=c+1;O<h.columns;O++)h.set(I,O,h.get(I,O)-h.get(d,O)*R)}d++,c++}}return h}reducedEchelonForm(){let h=this.echelonForm(),d=h.columns,c=h.rows,p=c-1;for(;p>=0;)if(h.maxRow(p)===0)p--;else{let v=0,I=!1;for(;v<c&&I===!1;)h.get(p,v)===1?I=!0:v++;for(let R=0;R<p;R++){let O=h.get(R,v);for(let C=v;C<d;C++){let G=h.get(R,C)-O*h.get(p,C);h.set(R,C,G)}}p--}return h}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(h={}){if(typeof h!="object")throw new TypeError("options must be an object");let{rows:d=1,columns:c=1}=h;if(!Number.isInteger(d)||d<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(c)||c<=0)throw new TypeError("columns must be a positive integer");let p=new P(this.rows*d,this.columns*c);for(let v=0;v<d;v++)for(let I=0;I<c;I++)p.setSubMatrix(this,this.rows*v,this.columns*I);return p}fill(h){for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,h);return this}neg(){return this.mulS(-1)}getRow(h){l(this,h);let d=[];for(let c=0;c<this.columns;c++)d.push(this.get(h,c));return d}getRowVector(h){return P.rowVector(this.getRow(h))}setRow(h,d){l(this,h),d=_(this,d);for(let c=0;c<this.columns;c++)this.set(h,c,d[c]);return this}swapRows(h,d){l(this,h),l(this,d);for(let c=0;c<this.columns;c++){let p=this.get(h,c);this.set(h,c,this.get(d,c)),this.set(d,c,p)}return this}getColumn(h){m(this,h);let d=[];for(let c=0;c<this.rows;c++)d.push(this.get(c,h));return d}getColumnVector(h){return P.columnVector(this.getColumn(h))}setColumn(h,d){m(this,h),d=g(this,d);for(let c=0;c<this.rows;c++)this.set(c,h,d[c]);return this}swapColumns(h,d){m(this,h),m(this,d);for(let c=0;c<this.rows;c++){let p=this.get(c,h);this.set(c,h,this.get(c,d)),this.set(c,d,p)}return this}addRowVector(h){h=_(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)+h[c]);return this}subRowVector(h){h=_(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)-h[c]);return this}mulRowVector(h){h=_(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)*h[c]);return this}divRowVector(h){h=_(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)/h[c]);return this}addColumnVector(h){h=g(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)+h[d]);return this}subColumnVector(h){h=g(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)-h[d]);return this}mulColumnVector(h){h=g(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)*h[d]);return this}divColumnVector(h){h=g(this,h);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)this.set(d,c,this.get(d,c)/h[d]);return this}mulRow(h,d){l(this,h);for(let c=0;c<this.columns;c++)this.set(h,c,this.get(h,c)*d);return this}mulColumn(h,d){m(this,h);for(let c=0;c<this.rows;c++)this.set(c,h,this.get(c,h)*d);return this}max(h){if(this.isEmpty())return NaN;switch(h){case"row":{let d=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)>d[c]&&(d[c]=this.get(c,p));return d}case"column":{let d=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)>d[p]&&(d[p]=this.get(c,p));return d}case void 0:{let d=this.get(0,0);for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)>d&&(d=this.get(c,p));return d}default:throw new Error(`invalid option: ${h}`)}}maxIndex(){E(this);let h=this.get(0,0),d=[0,0];for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)>h&&(h=this.get(c,p),d[0]=c,d[1]=p);return d}min(h){if(this.isEmpty())return NaN;switch(h){case"row":{let d=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)<d[c]&&(d[c]=this.get(c,p));return d}case"column":{let d=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)<d[p]&&(d[p]=this.get(c,p));return d}case void 0:{let d=this.get(0,0);for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)<d&&(d=this.get(c,p));return d}default:throw new Error(`invalid option: ${h}`)}}minIndex(){E(this);let h=this.get(0,0),d=[0,0];for(let c=0;c<this.rows;c++)for(let p=0;p<this.columns;p++)this.get(c,p)<h&&(h=this.get(c,p),d[0]=c,d[1]=p);return d}maxRow(h){if(l(this,h),this.isEmpty())return NaN;let d=this.get(h,0);for(let c=1;c<this.columns;c++)this.get(h,c)>d&&(d=this.get(h,c));return d}maxRowIndex(h){l(this,h),E(this);let d=this.get(h,0),c=[h,0];for(let p=1;p<this.columns;p++)this.get(h,p)>d&&(d=this.get(h,p),c[1]=p);return c}minRow(h){if(l(this,h),this.isEmpty())return NaN;let d=this.get(h,0);for(let c=1;c<this.columns;c++)this.get(h,c)<d&&(d=this.get(h,c));return d}minRowIndex(h){l(this,h),E(this);let d=this.get(h,0),c=[h,0];for(let p=1;p<this.columns;p++)this.get(h,p)<d&&(d=this.get(h,p),c[1]=p);return c}maxColumn(h){if(m(this,h),this.isEmpty())return NaN;let d=this.get(0,h);for(let c=1;c<this.rows;c++)this.get(c,h)>d&&(d=this.get(c,h));return d}maxColumnIndex(h){m(this,h),E(this);let d=this.get(0,h),c=[0,h];for(let p=1;p<this.rows;p++)this.get(p,h)>d&&(d=this.get(p,h),c[0]=p);return c}minColumn(h){if(m(this,h),this.isEmpty())return NaN;let d=this.get(0,h);for(let c=1;c<this.rows;c++)this.get(c,h)<d&&(d=this.get(c,h));return d}minColumnIndex(h){m(this,h),E(this);let d=this.get(0,h),c=[0,h];for(let p=1;p<this.rows;p++)this.get(p,h)<d&&(d=this.get(p,h),c[0]=p);return c}diag(){let h=Math.min(this.rows,this.columns),d=[];for(let c=0;c<h;c++)d.push(this.get(c,c));return d}norm(h="frobenius"){switch(h){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${h}`)}}cumulativeSum(){let h=0;for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)h+=this.get(d,c),this.set(d,c,h);return this}dot(h){ae.isMatrix(h)&&(h=h.to1DArray());let d=this.to1DArray();if(d.length!==h.length)throw new RangeError("vectors do not have the same size");let c=0;for(let p=0;p<d.length;p++)c+=d[p]*h[p];return c}mmul(h){h=P.checkMatrix(h);let d=this.rows,c=this.columns,p=h.columns,v=new P(d,p),I=new Float64Array(c);for(let R=0;R<p;R++){for(let O=0;O<c;O++)I[O]=h.get(O,R);for(let O=0;O<d;O++){let C=0;for(let G=0;G<c;G++)C+=this.get(O,G)*I[G];v.set(O,R,C)}}return v}mpow(h){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(h)||h<0)throw new RangeError("Exponent must be a non-negative integer");let d=P.eye(this.rows),c=this;for(let p=h;p>=1;p/=2)(p&1)!==0&&(d=d.mmul(c)),c=c.mmul(c);return d}strassen2x2(h){h=P.checkMatrix(h);let d=new P(2,2),c=this.get(0,0),p=h.get(0,0),v=this.get(0,1),I=h.get(0,1),R=this.get(1,0),O=h.get(1,0),C=this.get(1,1),G=h.get(1,1),k=(c+C)*(p+G),K=(R+C)*p,re=c*(I-G),$=C*(O-p),Y=(c+v)*G,te=(R-c)*(p+I),L=(v-C)*(O+G),ee=k+$-Y+L,ne=re+Y,de=K+$,pe=k-K+re+te;return d.set(0,0,ee),d.set(0,1,ne),d.set(1,0,de),d.set(1,1,pe),d}strassen3x3(h){h=P.checkMatrix(h);let d=new P(3,3),c=this.get(0,0),p=this.get(0,1),v=this.get(0,2),I=this.get(1,0),R=this.get(1,1),O=this.get(1,2),C=this.get(2,0),G=this.get(2,1),k=this.get(2,2),K=h.get(0,0),re=h.get(0,1),$=h.get(0,2),Y=h.get(1,0),te=h.get(1,1),L=h.get(1,2),ee=h.get(2,0),ne=h.get(2,1),de=h.get(2,2),pe=(c+p+v-I-R-G-k)*te,Ge=(c-I)*(-re+te),ue=R*(-K+re+Y-te-L-ee+de),le=(-c+I+R)*(K-re+te),ke=(I+R)*(-K+re),D=c*K,Z=(-c+C+G)*(K-$+L),ie=(-c+C)*($-L),J=(C+G)*(-K+$),Ue=(c+p+v-R-O-C-G)*L,Ce=G*(-K+$+Y-te-L-ee+ne),Le=(-v+G+k)*(te+ee-ne),$e=(v-k)*(te-ne),hr=v*ee,Pr=(G+k)*(-ee+ne),ir=(-v+R+O)*(L+ee-de),Dr=(v-O)*(L-de),Qr=(R+O)*(-ee+de),xe=p*Y,dr=O*ne,Er=I*$,Sr=C*re,nr=k*de,Z1=D+hr+xe,Q1=pe+le+ke+D+Le+hr+Pr,J1=D+Z+J+Ue+hr+ir+Qr,H1=Ge+ue+le+D+hr+ir+Dr,eb=Ge+le+ke+D+dr,rb=hr+ir+Dr+Qr+Er,tb=D+Z+ie+Ce+Le+$e+hr,ib=Le+$e+hr+Pr+Sr,nb=D+Z+ie+J+nr;return d.set(0,0,Z1),d.set(0,1,Q1),d.set(0,2,J1),d.set(1,0,H1),d.set(1,1,eb),d.set(1,2,rb),d.set(2,0,tb),d.set(2,1,ib),d.set(2,2,nb),d}mmulStrassen(h){h=P.checkMatrix(h);let d=this.clone(),c=d.rows,p=d.columns,v=h.rows,I=h.columns;p!==v&&console.warn(`Multiplying ${c} x ${p} and ${v} x ${I} matrix: dimensions do not match.`);function R(k,K,re){let $=k.rows,Y=k.columns;if($===K&&Y===re)return k;{let te=ae.zeros(K,re);return te=te.setSubMatrix(k,0,0),te}}let O=Math.max(c,v),C=Math.max(p,I);d=R(d,O,C),h=R(h,O,C);function G(k,K,re,$){if(re<=512||$<=512)return k.mmul(K);re%2===1&&$%2===1?(k=R(k,re+1,$+1),K=R(K,re+1,$+1)):re%2===1?(k=R(k,re+1,$),K=R(K,re+1,$)):$%2===1&&(k=R(k,re,$+1),K=R(K,re,$+1));let Y=parseInt(k.rows/2,10),te=parseInt(k.columns/2,10),L=k.subMatrix(0,Y-1,0,te-1),ee=K.subMatrix(0,Y-1,0,te-1),ne=k.subMatrix(0,Y-1,te,k.columns-1),de=K.subMatrix(0,Y-1,te,K.columns-1),pe=k.subMatrix(Y,k.rows-1,0,te-1),Ge=K.subMatrix(Y,K.rows-1,0,te-1),ue=k.subMatrix(Y,k.rows-1,te,k.columns-1),le=K.subMatrix(Y,K.rows-1,te,K.columns-1),ke=G(ae.add(L,ue),ae.add(ee,le),Y,te),D=G(ae.add(pe,ue),ee,Y,te),Z=G(L,ae.sub(de,le),Y,te),ie=G(ue,ae.sub(Ge,ee),Y,te),J=G(ae.add(L,ne),le,Y,te),Ue=G(ae.sub(pe,L),ae.add(ee,de),Y,te),Ce=G(ae.sub(ne,ue),ae.add(Ge,le),Y,te),Le=ae.add(ke,ie);Le.sub(J),Le.add(Ce);let $e=ae.add(Z,J),hr=ae.add(D,ie),Pr=ae.sub(ke,D);Pr.add(Z),Pr.add(Ue);let ir=ae.zeros(2*Le.rows,2*Le.columns);return ir=ir.setSubMatrix(Le,0,0),ir=ir.setSubMatrix($e,Le.rows,0),ir=ir.setSubMatrix(hr,0,Le.columns),ir=ir.setSubMatrix(Pr,Le.rows,Le.columns),ir.subMatrix(0,re-1,0,$-1)}return G(d,h,O,C)}scaleRows(h={}){if(typeof h!="object")throw new TypeError("options must be an object");let{min:d=0,max:c=1}=h;if(!Number.isFinite(d))throw new TypeError("min must be a number");if(!Number.isFinite(c))throw new TypeError("max must be a number");if(d>=c)throw new RangeError("min must be smaller than max");let p=new P(this.rows,this.columns);for(let v=0;v<this.rows;v++){let I=this.getRow(v);I.length>0&&e(I,{min:d,max:c,output:I}),p.setRow(v,I)}return p}scaleColumns(h={}){if(typeof h!="object")throw new TypeError("options must be an object");let{min:d=0,max:c=1}=h;if(!Number.isFinite(d))throw new TypeError("min must be a number");if(!Number.isFinite(c))throw new TypeError("max must be a number");if(d>=c)throw new RangeError("min must be smaller than max");let p=new P(this.rows,this.columns);for(let v=0;v<this.columns;v++){let I=this.getColumn(v);I.length&&e(I,{min:d,max:c,output:I}),p.setColumn(v,I)}return p}flipRows(){let h=Math.ceil(this.columns/2);for(let d=0;d<this.rows;d++)for(let c=0;c<h;c++){let p=this.get(d,c),v=this.get(d,this.columns-1-c);this.set(d,c,v),this.set(d,this.columns-1-c,p)}return this}flipColumns(){let h=Math.ceil(this.rows/2);for(let d=0;d<this.columns;d++)for(let c=0;c<h;c++){let p=this.get(c,d),v=this.get(this.rows-1-c,d);this.set(c,d,v),this.set(this.rows-1-c,d,p)}return this}kroneckerProduct(h){h=P.checkMatrix(h);let d=this.rows,c=this.columns,p=h.rows,v=h.columns,I=new P(d*p,c*v);for(let R=0;R<d;R++)for(let O=0;O<c;O++)for(let C=0;C<p;C++)for(let G=0;G<v;G++)I.set(p*R+C,v*O+G,this.get(R,O)*h.get(C,G));return I}kroneckerSum(h){if(h=P.checkMatrix(h),!this.isSquare()||!h.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let d=this.rows,c=h.rows,p=this.kroneckerProduct(P.eye(c,c)),v=P.eye(d,d).kroneckerProduct(h);return p.add(v)}transpose(){let h=new P(this.columns,this.rows);for(let d=0;d<this.rows;d++)for(let c=0;c<this.columns;c++)h.set(c,d,this.get(d,c));return h}sortRows(h=Re){for(let d=0;d<this.rows;d++)this.setRow(d,this.getRow(d).sort(h));return this}sortColumns(h=Re){for(let d=0;d<this.columns;d++)this.setColumn(d,this.getColumn(d).sort(h));return this}subMatrix(h,d,c,p){q(this,h,d,c,p);let v=new P(d-h+1,p-c+1);for(let I=h;I<=d;I++)for(let R=c;R<=p;R++)v.set(I-h,R-c,this.get(I,R));return v}subMatrixRow(h,d,c){if(d===void 0&&(d=0),c===void 0&&(c=this.columns-1),d>c||d<0||d>=this.columns||c<0||c>=this.columns)throw new RangeError("Argument out of range");let p=new P(h.length,c-d+1);for(let v=0;v<h.length;v++)for(let I=d;I<=c;I++){if(h[v]<0||h[v]>=this.rows)throw new RangeError(`Row index out of range: ${h[v]}`);p.set(v,I-d,this.get(h[v],I))}return p}subMatrixColumn(h,d,c){if(d===void 0&&(d=0),c===void 0&&(c=this.rows-1),d>c||d<0||d>=this.rows||c<0||c>=this.rows)throw new RangeError("Argument out of range");let p=new P(c-d+1,h.length);for(let v=0;v<h.length;v++)for(let I=d;I<=c;I++){if(h[v]<0||h[v]>=this.columns)throw new RangeError(`Column index out of range: ${h[v]}`);p.set(I-d,v,this.get(I,h[v]))}return p}setSubMatrix(h,d,c){if(h=P.checkMatrix(h),h.isEmpty())return this;let p=d+h.rows-1,v=c+h.columns-1;q(this,d,p,c,v);for(let I=0;I<h.rows;I++)for(let R=0;R<h.columns;R++)this.set(d+I,c+R,h.get(I,R));return this}selection(h,d){w(this,h),b(this,d);let c=new P(h.length,d.length);for(let p=0;p<h.length;p++){let v=h[p];for(let I=0;I<d.length;I++){let R=d[I];c.set(p,I,this.get(v,R))}}return c}trace(){let h=Math.min(this.rows,this.columns),d=0;for(let c=0;c<h;c++)d+=this.get(c,c);return d}clone(){return this.constructor.copy(this,new P(this.rows,this.columns))}static copy(h,d){for(let[c,p,v]of h.entries())d.set(c,p,v);return d}sum(h){switch(h){case"row":return N(this);case"column":return M(this);case void 0:return A(this);default:throw new Error(`invalid option: ${h}`)}}product(h){switch(h){case"row":return T(this);case"column":return j(this);case void 0:return B(this);default:throw new Error(`invalid option: ${h}`)}}mean(h){let d=this.sum(h);switch(h){case"row":{for(let c=0;c<this.rows;c++)d[c]/=this.columns;return d}case"column":{for(let c=0;c<this.columns;c++)d[c]/=this.rows;return d}case void 0:return d/this.size;default:throw new Error(`invalid option: ${h}`)}}variance(h,d={}){if(typeof h=="object"&&(d=h,h=void 0),typeof d!="object")throw new TypeError("options must be an object");let{unbiased:c=!0,mean:p=this.mean(h)}=d;if(typeof c!="boolean")throw new TypeError("unbiased must be a boolean");switch(h){case"row":{if(!r.isAnyArray(p))throw new TypeError("mean must be an array");return z(this,c,p)}case"column":{if(!r.isAnyArray(p))throw new TypeError("mean must be an array");return U(this,c,p)}case void 0:{if(typeof p!="number")throw new TypeError("mean must be a number");return V(this,c,p)}default:throw new Error(`invalid option: ${h}`)}}standardDeviation(h,d){typeof h=="object"&&(d=h,h=void 0);let c=this.variance(h,d);if(h===void 0)return Math.sqrt(c);for(let p=0;p<c.length;p++)c[p]=Math.sqrt(c[p]);return c}center(h,d={}){if(typeof h=="object"&&(d=h,h=void 0),typeof d!="object")throw new TypeError("options must be an object");let{center:c=this.mean(h)}=d;switch(h){case"row":{if(!r.isAnyArray(c))throw new TypeError("center must be an array");return W(this,c),this}case"column":{if(!r.isAnyArray(c))throw new TypeError("center must be an array");return H(this,c),this}case void 0:{if(typeof c!="number")throw new TypeError("center must be a number");return se(this,c),this}default:throw new Error(`invalid option: ${h}`)}}scale(h,d={}){if(typeof h=="object"&&(d=h,h=void 0),typeof d!="object")throw new TypeError("options must be an object");let c=d.scale;switch(h){case"row":{if(c===void 0)c=fe(this);else if(!r.isAnyArray(c))throw new TypeError("scale must be an array");return be(this,c),this}case"column":{if(c===void 0)c=Ee(this);else if(!r.isAnyArray(c))throw new TypeError("scale must be an array");return ce(this,c),this}case void 0:{if(c===void 0)c=Ie(this);else if(typeof c!="number")throw new TypeError("scale must be a number");return _e(this,c),this}default:throw new Error(`invalid option: ${h}`)}}toString(h){return o(this,h)}[Symbol.iterator](){return this.entries()}*entries(){for(let h=0;h<this.rows;h++)for(let d=0;d<this.columns;d++)yield[h,d,this.get(h,d)]}*values(){for(let h=0;h<this.rows;h++)for(let d=0;d<this.columns;d++)yield this.get(h,d)}}ae.prototype.klass="Matrix",typeof Symbol<"u"&&(ae.prototype[Symbol.for("nodejs.util.inspect.custom")]=n);function Re(S,h){return S-h}function F(S){return S.every(h=>typeof h=="number")}ae.random=ae.rand,ae.randomInt=ae.randInt,ae.diagonal=ae.diag,ae.prototype.diagonal=ae.prototype.diag,ae.identity=ae.eye,ae.prototype.negate=ae.prototype.neg,ae.prototype.tensorProduct=ae.prototype.kroneckerProduct;class P extends ae{data;#e(h,d){if(this.data=[],Number.isInteger(d)&&d>=0)for(let c=0;c<h;c++)this.data.push(new Float64Array(d));else throw new TypeError("nColumns must be a positive integer");this.rows=h,this.columns=d}constructor(h,d){if(super(),P.isMatrix(h))this.#e(h.rows,h.columns),P.copy(h,this);else if(Number.isInteger(h)&&h>=0)this.#e(h,d);else if(r.isAnyArray(h)){let c=h;if(h=c.length,d=h?c[0].length:0,typeof d!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let p=0;p<h;p++){if(c[p].length!==d)throw new RangeError("Inconsistent array dimensions");if(!F(c[p]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(c[p]))}this.rows=h,this.columns=d}else throw new TypeError("First argument must be a positive number or an array")}set(h,d,c){return this.data[h][d]=c,this}get(h,d){return this.data[h][d]}removeRow(h){return l(this,h),this.data.splice(h,1),this.rows-=1,this}addRow(h,d){return d===void 0&&(d=h,h=this.rows),l(this,h,!0),d=Float64Array.from(_(this,d)),this.data.splice(h,0,d),this.rows+=1,this}removeColumn(h){m(this,h);for(let d=0;d<this.rows;d++){let c=new Float64Array(this.columns-1);for(let p=0;p<h;p++)c[p]=this.data[d][p];for(let p=h+1;p<this.columns;p++)c[p-1]=this.data[d][p];this.data[d]=c}return this.columns-=1,this}addColumn(h,d){typeof d>"u"&&(d=h,h=this.columns),m(this,h,!0),d=g(this,d);for(let c=0;c<this.rows;c++){let p=new Float64Array(this.columns+1),v=0;for(;v<h;v++)p[v]=this.data[c][v];for(p[v++]=d[c];v<this.columns+1;v++)p[v]=this.data[c][v-1];this.data[c]=p}return this.columns+=1,this}}f(ae,P);class X extends ae{#e;get size(){return this.#e.size}get rows(){return this.#e.rows}get columns(){return this.#e.columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(h){return P.isMatrix(h)&&h.klassType==="SymmetricMatrix"}static zeros(h){return new this(h)}static ones(h){return new this(h).fill(1)}constructor(h){if(super(),P.isMatrix(h)){if(!h.isSymmetric())throw new TypeError("not symmetric data");this.#e=P.copy(h,new P(h.rows,h.rows))}else if(Number.isInteger(h)&&h>=0)this.#e=new P(h,h);else if(this.#e=new P(h),!this.isSymmetric())throw new TypeError("not symmetric data")}clone(){let h=new X(this.diagonalSize);for(let[d,c,p]of this.upperRightEntries())h.set(d,c,p);return h}toMatrix(){return new P(this)}get(h,d){return this.#e.get(h,d)}set(h,d,c){return this.#e.set(h,d,c),this.#e.set(d,h,c),this}removeCross(h){return this.#e.removeRow(h),this.#e.removeColumn(h),this}addCross(h,d){d===void 0&&(d=h,h=this.diagonalSize);let c=d.slice();return c.splice(h,1),this.#e.addRow(h,c),this.#e.addColumn(h,d),this}applyMask(h){if(h.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");let d=[];for(let[c,p]of h.entries())p||d.push(c);d.reverse();for(let c of d)this.removeCross(c);return this}toCompact(){let{diagonalSize:h}=this,d=new Array(h*(h+1)/2);for(let c=0,p=0,v=0;v<d.length;v++)d[v]=this.get(p,c),++c>=h&&(c=++p);return d}static fromCompact(h){let d=h.length,c=(Math.sqrt(8*d+1)-1)/2;if(!Number.isInteger(c))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(h)}`);let p=new X(c);for(let v=0,I=0,R=0;R<d;R++)p.set(v,I,h[R]),++v>=c&&(v=++I);return p}*upperRightEntries(){for(let h=0,d=0;h<this.diagonalSize;void 0){let c=this.get(h,d);yield[h,d,c],++d>=this.diagonalSize&&(d=++h)}}*upperRightValues(){for(let h=0,d=0;h<this.diagonalSize;void 0)yield this.get(h,d),++d>=this.diagonalSize&&(d=++h)}}X.prototype.klassType="SymmetricMatrix";class Q extends X{static isDistanceMatrix(h){return X.isSymmetricMatrix(h)&&h.klassSubType==="DistanceMatrix"}constructor(h){if(super(h),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(h,d,c){return h===d&&(c=0),super.set(h,d,c)}addCross(h,d){return d===void 0&&(d=h,h=this.diagonalSize),d=d.slice(),d[h]=0,super.addCross(h,d)}toSymmetricMatrix(){return new X(this)}clone(){let h=new Q(this.diagonalSize);for(let[d,c,p]of this.upperRightEntries())d!==c&&h.set(d,c,p);return h}toCompact(){let{diagonalSize:h}=this,d=(h-1)*h/2,c=new Array(d);for(let p=1,v=0,I=0;I<c.length;I++)c[I]=this.get(v,p),++p>=h&&(p=++v+1);return c}static fromCompact(h){let d=h.length;if(d===0)return new this(0);let c=(Math.sqrt(8*d+1)+1)/2;if(!Number.isInteger(c))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(h)}`);let p=new this(c);for(let v=1,I=0,R=0;R<d;R++)p.set(v,I,h[R]),++v>=c&&(v=++I+1);return p}}Q.prototype.klassSubType="DistanceMatrix";class oe extends ae{constructor(h,d,c){super(),this.matrix=h,this.rows=d,this.columns=c}}class ge extends oe{constructor(h,d){m(h,d),super(h,h.rows,1),this.column=d}set(h,d,c){return this.matrix.set(h,this.column,c),this}get(h){return this.matrix.get(h,this.column)}}class ve extends oe{constructor(h,d){b(h,d),super(h,h.rows,d.length),this.columnIndices=d}set(h,d,c){return this.matrix.set(h,this.columnIndices[d],c),this}get(h,d){return this.matrix.get(h,this.columnIndices[d])}}class je extends oe{constructor(h){super(h,h.rows,h.columns)}set(h,d,c){return this.matrix.set(h,this.columns-d-1,c),this}get(h,d){return this.matrix.get(h,this.columns-d-1)}}class Je extends oe{constructor(h){super(h,h.rows,h.columns)}set(h,d,c){return this.matrix.set(this.rows-h-1,d,c),this}get(h,d){return this.matrix.get(this.rows-h-1,d)}}class Ye extends oe{constructor(h,d){l(h,d),super(h,1,h.columns),this.row=d}set(h,d,c){return this.matrix.set(this.row,d,c),this}get(h,d){return this.matrix.get(this.row,d)}}class Be extends oe{constructor(h,d){w(h,d),super(h,d.length,h.columns),this.rowIndices=d}set(h,d,c){return this.matrix.set(this.rowIndices[h],d,c),this}get(h,d){return this.matrix.get(this.rowIndices[h],d)}}class ye extends oe{constructor(h,d,c){w(h,d),b(h,c),super(h,d.length,c.length),this.rowIndices=d,this.columnIndices=c}set(h,d,c){return this.matrix.set(this.rowIndices[h],this.columnIndices[d],c),this}get(h,d){return this.matrix.get(this.rowIndices[h],this.columnIndices[d])}}class Mr extends oe{constructor(h,d,c,p,v){q(h,d,c,p,v),super(h,c-d+1,v-p+1),this.startRow=d,this.startColumn=p}set(h,d,c){return this.matrix.set(this.startRow+h,this.startColumn+d,c),this}get(h,d){return this.matrix.get(this.startRow+h,this.startColumn+d)}}class Se extends oe{constructor(h){super(h,h.columns,h.rows)}set(h,d,c){return this.matrix.set(d,h,c),this}get(h,d){return this.matrix.get(d,h)}}class Xr extends ae{constructor(h,d={}){let{rows:c=1}=d;if(h.length%c!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=c,this.columns=h.length/c,this.data=h}set(h,d,c){let p=this._calculateIndex(h,d);return this.data[p]=c,this}get(h,d){let c=this._calculateIndex(h,d);return this.data[c]}_calculateIndex(h,d){return h*this.columns+d}}class rr extends ae{constructor(h){super(),this.data=h,this.rows=h.length,this.columns=h[0].length}set(h,d,c){return this.data[h][d]=c,this}get(h,d){return this.data[h][d]}}function xo(S,h){if(r.isAnyArray(S))return S[0]&&r.isAnyArray(S[0])?new rr(S):new Xr(S,h);throw new Error("the argument is not an array")}class Zr{constructor(h){h=rr.checkMatrix(h);let d=h.clone(),c=d.rows,p=d.columns,v=new Float64Array(c),I=1,R,O,C,G,k,K,re,$,Y;for(R=0;R<c;R++)v[R]=R;for($=new Float64Array(c),O=0;O<p;O++){for(R=0;R<c;R++)$[R]=d.get(R,O);for(R=0;R<c;R++){for(Y=Math.min(R,O),k=0,C=0;C<Y;C++)k+=d.get(R,C)*$[C];$[R]-=k,d.set(R,O,$[R])}for(G=O,R=O+1;R<c;R++)Math.abs($[R])>Math.abs($[G])&&(G=R);if(G!==O){for(C=0;C<p;C++)K=d.get(G,C),d.set(G,C,d.get(O,C)),d.set(O,C,K);re=v[G],v[G]=v[O],v[O]=re,I=-I}if(O<c&&d.get(O,O)!==0)for(R=O+1;R<c;R++)d.set(R,O,d.get(R,O)/d.get(O,O))}this.LU=d,this.pivotVector=v,this.pivotSign=I}isSingular(){let h=this.LU,d=h.columns;for(let c=0;c<d;c++)if(h.get(c,c)===0)return!0;return!1}solve(h){h=P.checkMatrix(h);let d=this.LU;if(d.rows!==h.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let p=h.columns,v=h.subMatrixRow(this.pivotVector,0,p-1),I=d.columns,R,O,C;for(C=0;C<I;C++)for(R=C+1;R<I;R++)for(O=0;O<p;O++)v.set(R,O,v.get(R,O)-v.get(C,O)*d.get(R,C));for(C=I-1;C>=0;C--){for(O=0;O<p;O++)v.set(C,O,v.get(C,O)/d.get(C,C));for(R=0;R<C;R++)for(O=0;O<p;O++)v.set(R,O,v.get(R,O)-v.get(C,O)*d.get(R,C))}return v}get determinant(){let h=this.LU;if(!h.isSquare())throw new Error("Matrix must be square");let d=this.pivotSign,c=h.columns;for(let p=0;p<c;p++)d*=h.get(p,p);return d}get lowerTriangularMatrix(){let h=this.LU,d=h.rows,c=h.columns,p=new P(d,c);for(let v=0;v<d;v++)for(let I=0;I<c;I++)v>I?p.set(v,I,h.get(v,I)):v===I?p.set(v,I,1):p.set(v,I,0);return p}get upperTriangularMatrix(){let h=this.LU,d=h.rows,c=h.columns,p=new P(d,c);for(let v=0;v<d;v++)for(let I=0;I<c;I++)v<=I?p.set(v,I,h.get(v,I)):p.set(v,I,0);return p}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function sr(S,h){let d=0;return Math.abs(S)>Math.abs(h)?(d=h/S,Math.abs(S)*Math.sqrt(1+d*d)):h!==0?(d=S/h,Math.abs(h)*Math.sqrt(1+d*d)):0}class ar{constructor(h){h=rr.checkMatrix(h);let d=h.clone(),c=h.rows,p=h.columns,v=new Float64Array(p),I,R,O,C;for(O=0;O<p;O++){let G=0;for(I=O;I<c;I++)G=sr(G,d.get(I,O));if(G!==0){for(d.get(O,O)<0&&(G=-G),I=O;I<c;I++)d.set(I,O,d.get(I,O)/G);for(d.set(O,O,d.get(O,O)+1),R=O+1;R<p;R++){for(C=0,I=O;I<c;I++)C+=d.get(I,O)*d.get(I,R);for(C=-C/d.get(O,O),I=O;I<c;I++)d.set(I,R,d.get(I,R)+C*d.get(I,O))}}v[O]=-G}this.QR=d,this.Rdiag=v}solve(h){h=P.checkMatrix(h);let d=this.QR,c=d.rows;if(h.rows!==c)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let p=h.columns,v=h.clone(),I=d.columns,R,O,C,G;for(C=0;C<I;C++)for(O=0;O<p;O++){for(G=0,R=C;R<c;R++)G+=d.get(R,C)*v.get(R,O);for(G=-G/d.get(C,C),R=C;R<c;R++)v.set(R,O,v.get(R,O)+G*d.get(R,C))}for(C=I-1;C>=0;C--){for(O=0;O<p;O++)v.set(C,O,v.get(C,O)/this.Rdiag[C]);for(R=0;R<C;R++)for(O=0;O<p;O++)v.set(R,O,v.get(R,O)-v.get(C,O)*d.get(R,C))}return v.subMatrix(0,I-1,0,p-1)}isFullRank(){let h=this.QR.columns;for(let d=0;d<h;d++)if(this.Rdiag[d]===0)return!1;return!0}get upperTriangularMatrix(){let h=this.QR,d=h.columns,c=new P(d,d),p,v;for(p=0;p<d;p++)for(v=0;v<d;v++)p<v?c.set(p,v,h.get(p,v)):p===v?c.set(p,v,this.Rdiag[p]):c.set(p,v,0);return c}get orthogonalMatrix(){let h=this.QR,d=h.rows,c=h.columns,p=new P(d,c),v,I,R,O;for(R=c-1;R>=0;R--){for(v=0;v<d;v++)p.set(v,R,0);for(p.set(R,R,1),I=R;I<c;I++)if(h.get(R,R)!==0){for(O=0,v=R;v<d;v++)O+=h.get(v,R)*p.get(v,I);for(O=-O/h.get(R,R),v=R;v<d;v++)p.set(v,I,p.get(v,I)+O*h.get(v,R))}}return p}}class kr{constructor(h,d={}){if(h=rr.checkMatrix(h),h.isEmpty())throw new Error("Matrix must be non-empty");let c=h.rows,p=h.columns,{computeLeftSingularVectors:v=!0,computeRightSingularVectors:I=!0,autoTranspose:R=!1}=d,O=!!v,C=!!I,G=!1,k;if(c<p)if(!R)k=h.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{k=h.transpose(),c=k.rows,p=k.columns,G=!0;let D=O;O=C,C=D}else k=h.clone();let K=Math.min(c,p),re=Math.min(c+1,p),$=new Float64Array(re),Y=new P(c,K),te=new P(p,p),L=new Float64Array(p),ee=new Float64Array(c),ne=new Float64Array(re);for(let D=0;D<re;D++)ne[D]=D;let de=Math.min(c-1,p),pe=Math.max(0,Math.min(p-2,c)),Ge=Math.max(de,pe);for(let D=0;D<Ge;D++){if(D<de){$[D]=0;for(let Z=D;Z<c;Z++)$[D]=sr($[D],k.get(Z,D));if($[D]!==0){k.get(D,D)<0&&($[D]=-$[D]);for(let Z=D;Z<c;Z++)k.set(Z,D,k.get(Z,D)/$[D]);k.set(D,D,k.get(D,D)+1)}$[D]=-$[D]}for(let Z=D+1;Z<p;Z++){if(D<de&&$[D]!==0){let ie=0;for(let J=D;J<c;J++)ie+=k.get(J,D)*k.get(J,Z);ie=-ie/k.get(D,D);for(let J=D;J<c;J++)k.set(J,Z,k.get(J,Z)+ie*k.get(J,D))}L[Z]=k.get(D,Z)}if(O&&D<de)for(let Z=D;Z<c;Z++)Y.set(Z,D,k.get(Z,D));if(D<pe){L[D]=0;for(let Z=D+1;Z<p;Z++)L[D]=sr(L[D],L[Z]);if(L[D]!==0){L[D+1]<0&&(L[D]=0-L[D]);for(let Z=D+1;Z<p;Z++)L[Z]/=L[D];L[D+1]+=1}if(L[D]=-L[D],D+1<c&&L[D]!==0){for(let Z=D+1;Z<c;Z++)ee[Z]=0;for(let Z=D+1;Z<c;Z++)for(let ie=D+1;ie<p;ie++)ee[Z]+=L[ie]*k.get(Z,ie);for(let Z=D+1;Z<p;Z++){let ie=-L[Z]/L[D+1];for(let J=D+1;J<c;J++)k.set(J,Z,k.get(J,Z)+ie*ee[J])}}if(C)for(let Z=D+1;Z<p;Z++)te.set(Z,D,L[Z])}}let ue=Math.min(p,c+1);if(de<p&&($[de]=k.get(de,de)),c<ue&&($[ue-1]=0),pe+1<ue&&(L[pe]=k.get(pe,ue-1)),L[ue-1]=0,O){for(let D=de;D<K;D++){for(let Z=0;Z<c;Z++)Y.set(Z,D,0);Y.set(D,D,1)}for(let D=de-1;D>=0;D--)if($[D]!==0){for(let Z=D+1;Z<K;Z++){let ie=0;for(let J=D;J<c;J++)ie+=Y.get(J,D)*Y.get(J,Z);ie=-ie/Y.get(D,D);for(let J=D;J<c;J++)Y.set(J,Z,Y.get(J,Z)+ie*Y.get(J,D))}for(let Z=D;Z<c;Z++)Y.set(Z,D,-Y.get(Z,D));Y.set(D,D,1+Y.get(D,D));for(let Z=0;Z<D-1;Z++)Y.set(Z,D,0)}else{for(let Z=0;Z<c;Z++)Y.set(Z,D,0);Y.set(D,D,1)}}if(C)for(let D=p-1;D>=0;D--){if(D<pe&&L[D]!==0)for(let Z=D+1;Z<p;Z++){let ie=0;for(let J=D+1;J<p;J++)ie+=te.get(J,D)*te.get(J,Z);ie=-ie/te.get(D+1,D);for(let J=D+1;J<p;J++)te.set(J,Z,te.get(J,Z)+ie*te.get(J,D))}for(let Z=0;Z<p;Z++)te.set(Z,D,0);te.set(D,D,1)}let le=ue-1,ke=Number.EPSILON;for(;ue>0;){let D,Z;for(D=ue-2;D>=-1&&D!==-1;D--){let ie=Number.MIN_VALUE+ke*Math.abs($[D]+Math.abs($[D+1]));if(Math.abs(L[D])<=ie||Number.isNaN(L[D])){L[D]=0;break}}if(D===ue-2)Z=4;else{let ie;for(ie=ue-1;ie>=D&&ie!==D;ie--){let J=(ie!==ue?Math.abs(L[ie]):0)+(ie!==D+1?Math.abs(L[ie-1]):0);if(Math.abs($[ie])<=ke*J){$[ie]=0;break}}ie===D?Z=3:ie===ue-1?Z=1:(Z=2,D=ie)}switch(D++,Z){case 1:{let ie=L[ue-2];L[ue-2]=0;for(let J=ue-2;J>=D;J--){let Ue=sr($[J],ie),Ce=$[J]/Ue,Le=ie/Ue;if($[J]=Ue,J!==D&&(ie=-Le*L[J-1],L[J-1]=Ce*L[J-1]),C)for(let $e=0;$e<p;$e++)Ue=Ce*te.get($e,J)+Le*te.get($e,ue-1),te.set($e,ue-1,-Le*te.get($e,J)+Ce*te.get($e,ue-1)),te.set($e,J,Ue)}break}case 2:{let ie=L[D-1];L[D-1]=0;for(let J=D;J<ue;J++){let Ue=sr($[J],ie),Ce=$[J]/Ue,Le=ie/Ue;if($[J]=Ue,ie=-Le*L[J],L[J]=Ce*L[J],O)for(let $e=0;$e<c;$e++)Ue=Ce*Y.get($e,J)+Le*Y.get($e,D-1),Y.set($e,D-1,-Le*Y.get($e,J)+Ce*Y.get($e,D-1)),Y.set($e,J,Ue)}break}case 3:{let ie=Math.max(Math.abs($[ue-1]),Math.abs($[ue-2]),Math.abs(L[ue-2]),Math.abs($[D]),Math.abs(L[D])),J=$[ue-1]/ie,Ue=$[ue-2]/ie,Ce=L[ue-2]/ie,Le=$[D]/ie,$e=L[D]/ie,hr=((Ue+J)*(Ue-J)+Ce*Ce)/2,Pr=J*Ce*(J*Ce),ir=0;(hr!==0||Pr!==0)&&(hr<0?ir=0-Math.sqrt(hr*hr+Pr):ir=Math.sqrt(hr*hr+Pr),ir=Pr/(hr+ir));let Dr=(Le+J)*(Le-J)+ir,Qr=Le*$e;for(let xe=D;xe<ue-1;xe++){let dr=sr(Dr,Qr);dr===0&&(dr=Number.MIN_VALUE);let Er=Dr/dr,Sr=Qr/dr;if(xe!==D&&(L[xe-1]=dr),Dr=Er*$[xe]+Sr*L[xe],L[xe]=Er*L[xe]-Sr*$[xe],Qr=Sr*$[xe+1],$[xe+1]=Er*$[xe+1],C)for(let nr=0;nr<p;nr++)dr=Er*te.get(nr,xe)+Sr*te.get(nr,xe+1),te.set(nr,xe+1,-Sr*te.get(nr,xe)+Er*te.get(nr,xe+1)),te.set(nr,xe,dr);if(dr=sr(Dr,Qr),dr===0&&(dr=Number.MIN_VALUE),Er=Dr/dr,Sr=Qr/dr,$[xe]=dr,Dr=Er*L[xe]+Sr*$[xe+1],$[xe+1]=-Sr*L[xe]+Er*$[xe+1],Qr=Sr*L[xe+1],L[xe+1]=Er*L[xe+1],O&&xe<c-1)for(let nr=0;nr<c;nr++)dr=Er*Y.get(nr,xe)+Sr*Y.get(nr,xe+1),Y.set(nr,xe+1,-Sr*Y.get(nr,xe)+Er*Y.get(nr,xe+1)),Y.set(nr,xe,dr)}L[ue-2]=Dr;break}case 4:{if($[D]<=0&&($[D]=$[D]<0?-$[D]:0,C))for(let ie=0;ie<=le;ie++)te.set(ie,D,-te.get(ie,D));for(;D<le&&!($[D]>=$[D+1]);){let ie=$[D];if($[D]=$[D+1],$[D+1]=ie,C&&D<p-1)for(let J=0;J<p;J++)ie=te.get(J,D+1),te.set(J,D+1,te.get(J,D)),te.set(J,D,ie);if(O&&D<c-1)for(let J=0;J<c;J++)ie=Y.get(J,D+1),Y.set(J,D+1,Y.get(J,D)),Y.set(J,D,ie);D++}ue--;break}}}if(G){let D=te;te=Y,Y=D}this.m=c,this.n=p,this.s=$,this.U=Y,this.V=te}solve(h){let d=h,c=this.threshold,p=this.s.length,v=P.zeros(p,p);for(let K=0;K<p;K++)Math.abs(this.s[K])<=c?v.set(K,K,0):v.set(K,K,1/this.s[K]);let I=this.U,R=this.rightSingularVectors,O=R.mmul(v),C=R.rows,G=I.rows,k=P.zeros(C,G);for(let K=0;K<C;K++)for(let re=0;re<G;re++){let $=0;for(let Y=0;Y<p;Y++)$+=O.get(K,Y)*I.get(re,Y);k.set(K,re,$)}return k.mmul(d)}solveForDiagonal(h){return this.solve(P.diag(h))}inverse(){let h=this.V,d=this.threshold,c=h.rows,p=h.columns,v=new P(c,this.s.length);for(let G=0;G<c;G++)for(let k=0;k<p;k++)Math.abs(this.s[k])>d&&v.set(G,k,h.get(G,k)/this.s[k]);let I=this.U,R=I.rows,O=I.columns,C=new P(c,R);for(let G=0;G<c;G++)for(let k=0;k<R;k++){let K=0;for(let re=0;re<O;re++)K+=v.get(G,re)*I.get(k,re);C.set(G,k,K)}return C}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let h=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,d=0,c=this.s;for(let p=0,v=c.length;p<v;p++)c[p]>h&&d++;return d}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return P.diag(this.s)}}function Ct(S,h=!1){return S=rr.checkMatrix(S),h?new kr(S).inverse():Li(S,P.eye(S.rows))}function Li(S,h,d=!1){return S=rr.checkMatrix(S),h=rr.checkMatrix(h),d?new kr(S).solve(h):S.isSquare()?new Zr(S).solve(h):new ar(S).solve(h)}function qt(S){if(S=P.checkMatrix(S),S.isSquare()){if(S.columns===0)return 1;let h,d,c,p;if(S.columns===2)return h=S.get(0,0),d=S.get(0,1),c=S.get(1,0),p=S.get(1,1),h*p-d*c;if(S.columns===3){let v,I,R;return v=new ye(S,[1,2],[1,2]),I=new ye(S,[1,2],[0,2]),R=new ye(S,[1,2],[0,1]),h=S.get(0,0),d=S.get(0,1),c=S.get(0,2),h*qt(v)-d*qt(I)+c*qt(R)}else return new Zr(S).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Hr(S,h){let d=[];for(let c=0;c<S;c++)c!==h&&d.push(c);return d}function Fi(S,h,d,c=1e-9,p=1e-9){if(S>p)return new Array(h.rows+1).fill(0);{let v=h.addRow(d,[0]);for(let I=0;I<v.rows;I++)Math.abs(v.get(I,0))<c&&v.set(I,0,0);return v.to1DArray()}}function zi(S,h={}){let{thresholdValue:d=1e-9,thresholdError:c=1e-9}=h;S=P.checkMatrix(S);let p=S.rows,v=new P(p,p);for(let I=0;I<p;I++){let R=P.columnVector(S.getRow(I)),O=S.subMatrixRow(Hr(p,I)).transpose(),G=new kr(O).solve(R),k=P.sub(R,O.mmul(G)).abs().max();v.setRow(I,Fi(k,G,I,d,c))}return v}function Eo(S,h=Number.EPSILON){if(S=P.checkMatrix(S),S.isEmpty())return S.transpose();let d=new kr(S,{autoTranspose:!0}),c=d.leftSingularVectors,p=d.rightSingularVectors,v=d.diagonal;for(let I=0;I<v.length;I++)Math.abs(v[I])>h?v[I]=1/v[I]:v[I]=0;return p.mmul(P.diag(v).mmul(c.transpose()))}function Di(S,h=S,d={}){S=new P(S);let c=!1;if(typeof h=="object"&&!P.isMatrix(h)&&!r.isAnyArray(h)?(d=h,h=S,c=!0):h=new P(h),S.rows!==h.rows)throw new TypeError("Both matrices must have the same number of rows");let{center:p=!0}=d;p&&(S=S.center("column"),c||(h=h.center("column")));let v=S.transpose().mmul(h);for(let I=0;I<v.rows;I++)for(let R=0;R<v.columns;R++)v.set(I,R,v.get(I,R)*(1/(S.rows-1)));return v}function Fr(S,h=S,d={}){S=new P(S);let c=!1;if(typeof h=="object"&&!P.isMatrix(h)&&!r.isAnyArray(h)?(d=h,h=S,c=!0):h=new P(h),S.rows!==h.rows)throw new TypeError("Both matrices must have the same number of rows");let{center:p=!0,scale:v=!0}=d;p&&(S.center("column"),c||h.center("column")),v&&(S.scale("column"),c||h.scale("column"));let I=S.standardDeviation("column",{unbiased:!0}),R=c?I:h.standardDeviation("column",{unbiased:!0}),O=S.transpose().mmul(h);for(let C=0;C<O.rows;C++)for(let G=0;G<O.columns;G++)O.set(C,G,O.get(C,G)*(1/(I[C]*R[G]))*(1/(S.rows-1)));return O}class zr{constructor(h,d={}){let{assumeSymmetric:c=!1}=d;if(h=rr.checkMatrix(h),!h.isSquare())throw new Error("Matrix is not a square matrix");if(h.isEmpty())throw new Error("Matrix must be non-empty");let p=h.columns,v=new P(p,p),I=new Float64Array(p),R=new Float64Array(p),O=h,C,G,k=!1;if(c?k=!0:k=h.isSymmetric(),k){for(C=0;C<p;C++)for(G=0;G<p;G++)v.set(C,G,O.get(C,G));W1(p,R,I,v),K1(p,R,I,v)}else{let K=new P(p,p),re=new Float64Array(p);for(G=0;G<p;G++)for(C=0;C<p;C++)K.set(C,G,O.get(C,G));Y1(p,K,re,v),X1(p,R,I,v,K)}this.n=p,this.e=R,this.d=I,this.V=v}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let h=this.n,d=this.e,c=this.d,p=new P(h,h),v,I;for(v=0;v<h;v++){for(I=0;I<h;I++)p.set(v,I,0);p.set(v,v,c[v]),d[v]>0?p.set(v,v+1,d[v]):d[v]<0&&p.set(v,v-1,d[v])}return p}}function W1(S,h,d,c){let p,v,I,R,O,C,G,k;for(O=0;O<S;O++)d[O]=c.get(S-1,O);for(R=S-1;R>0;R--){for(k=0,I=0,C=0;C<R;C++)k=k+Math.abs(d[C]);if(k===0)for(h[R]=d[R-1],O=0;O<R;O++)d[O]=c.get(R-1,O),c.set(R,O,0),c.set(O,R,0);else{for(C=0;C<R;C++)d[C]/=k,I+=d[C]*d[C];for(p=d[R-1],v=Math.sqrt(I),p>0&&(v=-v),h[R]=k*v,I=I-p*v,d[R-1]=p-v,O=0;O<R;O++)h[O]=0;for(O=0;O<R;O++){for(p=d[O],c.set(O,R,p),v=h[O]+c.get(O,O)*p,C=O+1;C<=R-1;C++)v+=c.get(C,O)*d[C],h[C]+=c.get(C,O)*p;h[O]=v}for(p=0,O=0;O<R;O++)h[O]/=I,p+=h[O]*d[O];for(G=p/(I+I),O=0;O<R;O++)h[O]-=G*d[O];for(O=0;O<R;O++){for(p=d[O],v=h[O],C=O;C<=R-1;C++)c.set(C,O,c.get(C,O)-(p*h[C]+v*d[C]));d[O]=c.get(R-1,O),c.set(R,O,0)}}d[R]=I}for(R=0;R<S-1;R++){if(c.set(S-1,R,c.get(R,R)),c.set(R,R,1),I=d[R+1],I!==0){for(C=0;C<=R;C++)d[C]=c.get(C,R+1)/I;for(O=0;O<=R;O++){for(v=0,C=0;C<=R;C++)v+=c.get(C,R+1)*c.get(C,O);for(C=0;C<=R;C++)c.set(C,O,c.get(C,O)-v*d[C])}}for(C=0;C<=R;C++)c.set(C,R+1,0)}for(O=0;O<S;O++)d[O]=c.get(S-1,O),c.set(S-1,O,0);c.set(S-1,S-1,1),h[0]=0}function K1(S,h,d,c){let p,v,I,R,O,C,G,k,K,re,$,Y,te,L,ee,ne;for(I=1;I<S;I++)h[I-1]=h[I];h[S-1]=0;let de=0,pe=0,Ge=Number.EPSILON;for(C=0;C<S;C++){for(pe=Math.max(pe,Math.abs(d[C])+Math.abs(h[C])),G=C;G<S&&!(Math.abs(h[G])<=Ge*pe);)G++;if(G>C)do{for(p=d[C],k=(d[C+1]-p)/(2*h[C]),K=sr(k,1),k<0&&(K=-K),d[C]=h[C]/(k+K),d[C+1]=h[C]*(k+K),re=d[C+1],v=p-d[C],I=C+2;I<S;I++)d[I]-=v;for(de=de+v,k=d[G],$=1,Y=$,te=$,L=h[C+1],ee=0,ne=0,I=G-1;I>=C;I--)for(te=Y,Y=$,ne=ee,p=$*h[I],v=$*k,K=sr(k,h[I]),h[I+1]=ee*K,ee=h[I]/K,$=k/K,k=$*d[I]-ee*p,d[I+1]=v+ee*($*p+ee*d[I]),O=0;O<S;O++)v=c.get(O,I+1),c.set(O,I+1,ee*c.get(O,I)+$*v),c.set(O,I,$*c.get(O,I)-ee*v);k=-ee*ne*te*L*h[C]/re,h[C]=ee*k,d[C]=$*k}while(Math.abs(h[C])>Ge*pe);d[C]=d[C]+de,h[C]=0}for(I=0;I<S-1;I++){for(O=I,k=d[I],R=I+1;R<S;R++)d[R]<k&&(O=R,k=d[R]);if(O!==I)for(d[O]=d[I],d[I]=k,R=0;R<S;R++)k=c.get(R,I),c.set(R,I,c.get(R,O)),c.set(R,O,k)}}function Y1(S,h,d,c){let p=0,v=S-1,I,R,O,C,G,k,K;for(k=p+1;k<=v-1;k++){for(K=0,C=k;C<=v;C++)K=K+Math.abs(h.get(C,k-1));if(K!==0){for(O=0,C=v;C>=k;C--)d[C]=h.get(C,k-1)/K,O+=d[C]*d[C];for(R=Math.sqrt(O),d[k]>0&&(R=-R),O=O-d[k]*R,d[k]=d[k]-R,G=k;G<S;G++){for(I=0,C=v;C>=k;C--)I+=d[C]*h.get(C,G);for(I=I/O,C=k;C<=v;C++)h.set(C,G,h.get(C,G)-I*d[C])}for(C=0;C<=v;C++){for(I=0,G=v;G>=k;G--)I+=d[G]*h.get(C,G);for(I=I/O,G=k;G<=v;G++)h.set(C,G,h.get(C,G)-I*d[G])}d[k]=K*d[k],h.set(k,k-1,K*R)}}for(C=0;C<S;C++)for(G=0;G<S;G++)c.set(C,G,C===G?1:0);for(k=v-1;k>=p+1;k--)if(h.get(k,k-1)!==0){for(C=k+1;C<=v;C++)d[C]=h.get(C,k-1);for(G=k;G<=v;G++){for(R=0,C=k;C<=v;C++)R+=d[C]*c.get(C,G);for(R=R/d[k]/h.get(k,k-1),C=k;C<=v;C++)c.set(C,G,c.get(C,G)+R*d[C])}}}function X1(S,h,d,c,p){let v=S-1,I=0,R=S-1,O=Number.EPSILON,C=0,G=0,k=0,K=0,re=0,$=0,Y=0,te=0,L,ee,ne,de,pe,Ge,ue,le,ke,D,Z,ie,J,Ue,Ce;for(L=0;L<S;L++)for((L<I||L>R)&&(d[L]=p.get(L,L),h[L]=0),ee=Math.max(L-1,0);ee<S;ee++)G=G+Math.abs(p.get(L,ee));for(;v>=I;){for(de=v;de>I&&($=Math.abs(p.get(de-1,de-1))+Math.abs(p.get(de,de)),$===0&&($=G),!(Math.abs(p.get(de,de-1))<O*$));)de--;if(de===v)p.set(v,v,p.get(v,v)+C),d[v]=p.get(v,v),h[v]=0,v--,te=0;else if(de===v-1){if(ue=p.get(v,v-1)*p.get(v-1,v),k=(p.get(v-1,v-1)-p.get(v,v))/2,K=k*k+ue,Y=Math.sqrt(Math.abs(K)),p.set(v,v,p.get(v,v)+C),p.set(v-1,v-1,p.get(v-1,v-1)+C),le=p.get(v,v),K>=0){for(Y=k>=0?k+Y:k-Y,d[v-1]=le+Y,d[v]=d[v-1],Y!==0&&(d[v]=le-ue/Y),h[v-1]=0,h[v]=0,le=p.get(v,v-1),$=Math.abs(le)+Math.abs(Y),k=le/$,K=Y/$,re=Math.sqrt(k*k+K*K),k=k/re,K=K/re,ee=v-1;ee<S;ee++)Y=p.get(v-1,ee),p.set(v-1,ee,K*Y+k*p.get(v,ee)),p.set(v,ee,K*p.get(v,ee)-k*Y);for(L=0;L<=v;L++)Y=p.get(L,v-1),p.set(L,v-1,K*Y+k*p.get(L,v)),p.set(L,v,K*p.get(L,v)-k*Y);for(L=I;L<=R;L++)Y=c.get(L,v-1),c.set(L,v-1,K*Y+k*c.get(L,v)),c.set(L,v,K*c.get(L,v)-k*Y)}else d[v-1]=le+k,d[v]=le+k,h[v-1]=Y,h[v]=-Y;v=v-2,te=0}else{if(le=p.get(v,v),ke=0,ue=0,de<v&&(ke=p.get(v-1,v-1),ue=p.get(v,v-1)*p.get(v-1,v)),te===10){for(C+=le,L=I;L<=v;L++)p.set(L,L,p.get(L,L)-le);$=Math.abs(p.get(v,v-1))+Math.abs(p.get(v-1,v-2)),le=ke=.75*$,ue=-.4375*$*$}if(te===30&&($=(ke-le)/2,$=$*$+ue,$>0)){for($=Math.sqrt($),ke<le&&($=-$),$=le-ue/((ke-le)/2+$),L=I;L<=v;L++)p.set(L,L,p.get(L,L)-$);C+=$,le=ke=ue=.964}for(te=te+1,pe=v-2;pe>=de&&(Y=p.get(pe,pe),re=le-Y,$=ke-Y,k=(re*$-ue)/p.get(pe+1,pe)+p.get(pe,pe+1),K=p.get(pe+1,pe+1)-Y-re-$,re=p.get(pe+2,pe+1),$=Math.abs(k)+Math.abs(K)+Math.abs(re),k=k/$,K=K/$,re=re/$,!(pe===de||Math.abs(p.get(pe,pe-1))*(Math.abs(K)+Math.abs(re))<O*(Math.abs(k)*(Math.abs(p.get(pe-1,pe-1))+Math.abs(Y)+Math.abs(p.get(pe+1,pe+1))))));)pe--;for(L=pe+2;L<=v;L++)p.set(L,L-2,0),L>pe+2&&p.set(L,L-3,0);for(ne=pe;ne<=v-1&&(Ue=ne!==v-1,ne!==pe&&(k=p.get(ne,ne-1),K=p.get(ne+1,ne-1),re=Ue?p.get(ne+2,ne-1):0,le=Math.abs(k)+Math.abs(K)+Math.abs(re),le!==0&&(k=k/le,K=K/le,re=re/le)),le!==0);ne++)if($=Math.sqrt(k*k+K*K+re*re),k<0&&($=-$),$!==0){for(ne!==pe?p.set(ne,ne-1,-$*le):de!==pe&&p.set(ne,ne-1,-p.get(ne,ne-1)),k=k+$,le=k/$,ke=K/$,Y=re/$,K=K/k,re=re/k,ee=ne;ee<S;ee++)k=p.get(ne,ee)+K*p.get(ne+1,ee),Ue&&(k=k+re*p.get(ne+2,ee),p.set(ne+2,ee,p.get(ne+2,ee)-k*Y)),p.set(ne,ee,p.get(ne,ee)-k*le),p.set(ne+1,ee,p.get(ne+1,ee)-k*ke);for(L=0;L<=Math.min(v,ne+3);L++)k=le*p.get(L,ne)+ke*p.get(L,ne+1),Ue&&(k=k+Y*p.get(L,ne+2),p.set(L,ne+2,p.get(L,ne+2)-k*re)),p.set(L,ne,p.get(L,ne)-k),p.set(L,ne+1,p.get(L,ne+1)-k*K);for(L=I;L<=R;L++)k=le*c.get(L,ne)+ke*c.get(L,ne+1),Ue&&(k=k+Y*c.get(L,ne+2),c.set(L,ne+2,c.get(L,ne+2)-k*re)),c.set(L,ne,c.get(L,ne)-k),c.set(L,ne+1,c.get(L,ne+1)-k*K)}}}if(G!==0){for(v=S-1;v>=0;v--)if(k=d[v],K=h[v],K===0)for(de=v,p.set(v,v,1),L=v-1;L>=0;L--){for(ue=p.get(L,L)-k,re=0,ee=de;ee<=v;ee++)re=re+p.get(L,ee)*p.get(ee,v);if(h[L]<0)Y=ue,$=re;else if(de=L,h[L]===0?p.set(L,v,ue!==0?-re/ue:-re/(O*G)):(le=p.get(L,L+1),ke=p.get(L+1,L),K=(d[L]-k)*(d[L]-k)+h[L]*h[L],Ge=(le*$-Y*re)/K,p.set(L,v,Ge),p.set(L+1,v,Math.abs(le)>Math.abs(Y)?(-re-ue*Ge)/le:(-$-ke*Ge)/Y)),Ge=Math.abs(p.get(L,v)),O*Ge*Ge>1)for(ee=L;ee<=v;ee++)p.set(ee,v,p.get(ee,v)/Ge)}else if(K<0)for(de=v-1,Math.abs(p.get(v,v-1))>Math.abs(p.get(v-1,v))?(p.set(v-1,v-1,K/p.get(v,v-1)),p.set(v-1,v,-(p.get(v,v)-k)/p.get(v,v-1))):(Ce=Bi(0,-p.get(v-1,v),p.get(v-1,v-1)-k,K),p.set(v-1,v-1,Ce[0]),p.set(v-1,v,Ce[1])),p.set(v,v-1,0),p.set(v,v,1),L=v-2;L>=0;L--){for(D=0,Z=0,ee=de;ee<=v;ee++)D=D+p.get(L,ee)*p.get(ee,v-1),Z=Z+p.get(L,ee)*p.get(ee,v);if(ue=p.get(L,L)-k,h[L]<0)Y=ue,re=D,$=Z;else if(de=L,h[L]===0?(Ce=Bi(-D,-Z,ue,K),p.set(L,v-1,Ce[0]),p.set(L,v,Ce[1])):(le=p.get(L,L+1),ke=p.get(L+1,L),ie=(d[L]-k)*(d[L]-k)+h[L]*h[L]-K*K,J=(d[L]-k)*2*K,ie===0&&J===0&&(ie=O*G*(Math.abs(ue)+Math.abs(K)+Math.abs(le)+Math.abs(ke)+Math.abs(Y))),Ce=Bi(le*re-Y*D+K*Z,le*$-Y*Z-K*D,ie,J),p.set(L,v-1,Ce[0]),p.set(L,v,Ce[1]),Math.abs(le)>Math.abs(Y)+Math.abs(K)?(p.set(L+1,v-1,(-D-ue*p.get(L,v-1)+K*p.get(L,v))/le),p.set(L+1,v,(-Z-ue*p.get(L,v)-K*p.get(L,v-1))/le)):(Ce=Bi(-re-ke*p.get(L,v-1),-$-ke*p.get(L,v),Y,K),p.set(L+1,v-1,Ce[0]),p.set(L+1,v,Ce[1]))),Ge=Math.max(Math.abs(p.get(L,v-1)),Math.abs(p.get(L,v))),O*Ge*Ge>1)for(ee=L;ee<=v;ee++)p.set(ee,v-1,p.get(ee,v-1)/Ge),p.set(ee,v,p.get(ee,v)/Ge)}for(L=0;L<S;L++)if(L<I||L>R)for(ee=L;ee<S;ee++)c.set(L,ee,p.get(L,ee));for(ee=S-1;ee>=I;ee--)for(L=I;L<=R;L++){for(Y=0,ne=I;ne<=Math.min(ee,R);ne++)Y=Y+c.get(L,ne)*p.get(ne,ee);c.set(L,ee,Y)}}}function Bi(S,h,d,c){let p,v;return Math.abs(d)>Math.abs(c)?(p=c/d,v=d+p*c,[(S+p*h)/v,(h-p*S)/v]):(p=d/c,v=c+p*d,[(p*S+h)/v,(p*h-S)/v])}class zl{constructor(h){if(h=rr.checkMatrix(h),!h.isSymmetric())throw new Error("Matrix is not symmetric");let d=h,c=d.rows,p=new P(c,c),v=!0,I,R,O;for(R=0;R<c;R++){let C=0;for(O=0;O<R;O++){let G=0;for(I=0;I<O;I++)G+=p.get(O,I)*p.get(R,I);G=(d.get(R,O)-G)/p.get(O,O),p.set(R,O,G),C=C+G*G}for(C=d.get(R,R)-C,v&&=C>0,p.set(R,R,Math.sqrt(Math.max(C,0))),O=R+1;O<c;O++)p.set(R,O,0)}this.L=p,this.positiveDefinite=v}isPositiveDefinite(){return this.positiveDefinite}solve(h){h=rr.checkMatrix(h);let d=this.L,c=d.rows;if(h.rows!==c)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let p=h.columns,v=h.clone(),I,R,O;for(O=0;O<c;O++)for(R=0;R<p;R++){for(I=0;I<O;I++)v.set(O,R,v.get(O,R)-v.get(I,R)*d.get(O,I));v.set(O,R,v.get(O,R)/d.get(O,O))}for(O=c-1;O>=0;O--)for(R=0;R<p;R++){for(I=O+1;I<c;I++)v.set(O,R,v.get(O,R)-v.get(I,R)*d.get(I,O));v.set(O,R,v.get(O,R)/d.get(O,O))}return v}get lowerTriangularMatrix(){return this.L}}class Dl{constructor(h,d={}){h=rr.checkMatrix(h);let{Y:c}=d,{scaleScores:p=!1,maxIterations:v=1e3,terminationCriteria:I=1e-10}=d,R;if(c){if(r.isAnyArray(c)&&typeof c[0]=="number"?c=P.columnVector(c):c=rr.checkMatrix(c),c.rows!==h.rows)throw new Error("Y should have the same number of rows as X");R=c.getColumnVector(0)}else R=h.getColumnVector(0);let O=1,C,G,k,K;for(let re=0;re<v&&O>I;re++)k=h.transpose().mmul(R).div(R.transpose().mmul(R).get(0,0)),k=k.div(k.norm()),C=h.mmul(k).div(k.transpose().mmul(k).get(0,0)),re>0&&(O=C.clone().sub(K).pow(2).sum()),K=C.clone(),c?(G=c.transpose().mmul(C).div(C.transpose().mmul(C).get(0,0)),G=G.div(G.norm()),R=c.mmul(G).div(G.transpose().mmul(G).get(0,0))):R=C;if(c){let re=h.transpose().mmul(C).div(C.transpose().mmul(C).get(0,0));re=re.div(re.norm());let $=h.clone().sub(C.clone().mmul(re.transpose())),Y=R.transpose().mmul(C).div(C.transpose().mmul(C).get(0,0)),te=c.clone().sub(C.clone().mulS(Y.get(0,0)).mmul(G.transpose()));this.t=C,this.p=re.transpose(),this.w=k.transpose(),this.q=G,this.u=R,this.s=C.transpose().mmul(C),this.xResidual=$,this.yResidual=te,this.betas=Y}else this.w=k.transpose(),this.s=C.transpose().mmul(C).sqrt(),p?this.t=C.clone().div(this.s.get(0,0)):this.t=C,this.xResidual=h.sub(C.mmul(k.transpose()))}}return we.AbstractMatrix=ae,we.CHO=zl,we.CholeskyDecomposition=zl,we.DistanceMatrix=Q,we.EVD=zr,we.EigenvalueDecomposition=zr,we.LU=Zr,we.LuDecomposition=Zr,we.Matrix=P,we.MatrixColumnSelectionView=ve,we.MatrixColumnView=ge,we.MatrixFlipColumnView=je,we.MatrixFlipRowView=Je,we.MatrixRowSelectionView=Be,we.MatrixRowView=Ye,we.MatrixSelectionView=ye,we.MatrixSubView=Mr,we.MatrixTransposeView=Se,we.NIPALS=Dl,we.Nipals=Dl,we.QR=ar,we.QrDecomposition=ar,we.SVD=kr,we.SingularValueDecomposition=kr,we.SymmetricMatrix=X,we.WrapperMatrix1D=Xr,we.WrapperMatrix2D=rr,we.correlation=Fr,we.covariance=Di,we.default=P,we.determinant=qt,we.inverse=Ct,we.linearDependencies=zi,we.pseudoInverse=Eo,we.solve=Li,we.wrap=xo,we}var Oi=D1(),Ol=hn(Oi);var Cl=Oi.Matrix,B1=Oi.SingularValueDecomposition;Ol.Matrix?Ol.Matrix:Oi.Matrix;var Tl=Array.isArray;var NE=r=>{let e=r.length,t=Array.from({length:e},()=>new Array(e));for(let i=0;i<e;i++){let n=r[i],o=t[i];for(let s=0;s<e;s++)o[s]=i===s?0:n[s]>0?n[s]:1/0}for(let i=0;i<e;i++){let n=t[i];for(let o=0;o<e;o++){let s=t[o],a=s[i];if(a!==1/0)for(let u=0;u<e;u++){let f=n[u];if(f===1/0)continue;let l=a+f;l<s[u]&&(s[u]=l)}}}return t},ME=(r,e)=>{let t=r.nodeCount(),i=Array.from({length:t},()=>new Array(t)),n={},o=0;return r.forEachNode(s=>{n[s.id]=o++}),r.forEachEdge(s=>{let a=n[s.source],u=n[s.target];a===void 0||u===void 0||(i[a][u]=1,e||(i[u][a]=1))}),i},Ci=(r,e)=>{let t=r.nodeCount(),i=Array.from({length:t},()=>[]),n={},o=0;return r.forEachNode(s=>{n[s.id]=o++}),r.forEachEdge(s=>{let a=n[s.source],u=n[s.target];a==null||u==null||(i[a].push(u),e||i[u].push(a))}),i},Pl=(r,e)=>{let t=r.length,i=new Array(t);for(let n=0;n<t;n++){let o=r[n],s=o.length,a=new Array(s);for(let u=0;u<s;u++)a[u]=o[u]*e;i[n]=a}return i},IE=r=>{let e=1/0,t=1/0,i=-1/0,n=-1/0;return r.forEach(o=>{let s=o.data.size;Tl(s)?s.length===1&&(s=[s[0],s[0]]):s===void 0||isNaN(s)?s=[30,30]:Me(s)&&(s=[s,s]);let a=[s[0]/2,s[1]/2],u=o.data.x-a[0],f=o.data.x+a[0],l=o.data.y-a[1],m=o.data.y+a[1];e>u&&(e=u),t>l&&(t=l),i<f&&(i=f),n<m&&(n=m)}),{minX:e,minY:t,maxX:i,maxY:n}},RE=(r,e)=>Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y)),G1=(r,e,t,i="TB",n,o={})=>{if(!e?.length)return;let{stopBranchFn:s,stopAllFn:a}=o;for(let u=0;u<e.length;u++){let f=e[u];if(r.hasNode(f.id)&&!s?.(f)){if(a?.(f))return;i==="TB"&&t(f),G1(r,r.getChildren(f.id,n),t,i,n,o),i!=="TB"&&t(f)}}};function Ti(r){let e=r.length;new Array(e).fill(0);let t=Array.from({length:e},()=>new Array(e).fill(1/0));for(let i=0;i<e;i++)t[i]=AE(r,i);return t}function AE(r,e){let t=r.length,i=new Array(t).fill(1/0);i[e]=0;let n=new kl;for(n.push([0,e]);!n.empty();){let[o,s]=n.pop();if(o!==i[s])continue;let a=r[s];for(let u=0;u<a.length;u++){let f=a[u],l=o+1;l<i[f]&&(i[f]=l,n.push([l,f]))}}return i}var kl=class{constructor(){this.data=[]}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.bubbleDown(0)),e}empty(){return this.data.length===0}bubbleUp(e){let t=this.data;for(;e>0;){let i=e-1>>1;if(t[i][0]<=t[e][0])break;[t[i],t[e]]=[t[e],t[i]],e=i}}bubbleDown(e){let t=this.data,i=t.length;for(;;){let n=e*2+1,o=e*2+2,s=e;if(n<i&&t[n][0]<t[s][0]&&(s=n),o<i&&t[o][0]<t[s][0]&&(s=o),s===e)break;[t[e],t[s]]=[t[s],t[e]],e=s}}};var jl={center:[0,0],linkDistance:50},ki=class extends Ze{constructor(){super(...arguments),this.id="mds"}getDefaultOptions(){return jl}layout(){return Ne(this,void 0,void 0,function*(){let{linkDistance:e=jl.linkDistance}=this.options,{center:t}=Pe(this.options),i=this.model.nodeCount();if(i===0||i===1){gr(this.model,t);return}let n=Ci(this.model,!1),o=Ti(n);OE(o);let s=Pl(o,e),a=Ll(s),u=0;this.model.forEachNode(f=>{let l=a[u++];f.x=l[0]+t[0],f.y=l[1]+t[1]})})}},OE=r=>{let e=Number.NEGATIVE_INFINITY,t=[],i=r.length;for(let n=0;n<i;n++){let o=r[n],s=o.length;for(let a=0;a<s;a++){let u=o[a];u===1/0?t.push([n,a]):e<u&&(e=u)}}for(let n=0;n<t.length;n++){let[o,s]=t[n];r[o][s]=e}},Ll=(r,e=2,t=jl.linkDistance)=>{try{let i=r.length,n=new Cl(i,i);for(let g=0;g<i;g++)for(let w=0;w<i;w++){let b=r[g][w];n.set(g,w,-.5*b*b)}let o=n.mean("row"),s=n.mean("column"),a=n.mean();n.add(a).subRowVector(o).subColumnVector(s);let u=new B1(n),f=Cl.sqrt(u.diagonalMatrix).diagonal(),l=u.leftSingularVectors,m=f,_=[];for(let g=0;g<l.rows;g++){let w=[];for(let b=0;b<e;b++)w.push(l.get(g,b)*m[b]);_.push(w)}return _}catch{let n=[];for(let o=0;o<r.length;o++){let s=Math.random()*t,a=Math.random()*t;n.push([s,a])}return n}};var U1={maxIteration:10,width:10,speed:100,gravity:10,k:5},$1=(r,e)=>{let t=Object.assign(Object.assign({},U1),e),{maxIteration:i,width:n,k:o,speed:s=U1.speed,strictRadial:a,focusNode:u,radiiMap:f,nodeSizeFunc:l}=t,m=o*.002,_=new Map,g=n/10;for(let w=0;w<i&&(r.forEachNode(q=>{_.set(q.id,{x:0,y:0})}),CE(r,_,o,f,l),!(TE(r,_,s,a,u,g,f)<m));w++);},CE=(r,e,t,i,n)=>{let o=0;r.forEachNode(s=>{let a=0;r.forEachNode(u=>{if(a<=o){a++;return}if(s.id===u.id||i.get(s.id)!==i.get(u.id))return;let f=s.x-u.x,l=s.y-u.y,m=Math.sqrt(f*f+l*l);if(m===0){m=1;let w=o>a?1:-1;f=.01*w,l=.01*w}let _=Math.max(...n(s._original)),g=Math.max(...n(u._original));if(m<g/2+_/2){let w=t*t/m,b=e.get(s.id),q=e.get(u.id),y=f/m*w,x=l/m*w;e.set(s.id,{x:b.x+y,y:b.y+x}),e.set(u.id,{x:q.x-y,y:q.y-x})}a++}),o++})},TE=(r,e,t,i,n,o,s)=>{i&&r.forEachNode(f=>{let l=f.x-n.x,m=f.y-n.y,_=Math.sqrt(l*l+m*m),g=m/_,w=-l/_,b=e.get(f.id),q=Math.sqrt(b.x*b.x+b.y*b.y),y=Math.acos((g*b.x+w*b.y)/q);y>Math.PI/2&&(y-=Math.PI/2,g*=-1,w*=-1);let x=Math.cos(y)*q;e.set(f.id,{x:g*x,y:w*x})});let a=0,u=0;return r.forEachNode(f=>{if(f.id===n.id)return;let l=e.get(f.id),m=Math.sqrt(l.x*l.x+l.y*l.y);if(m>0){let _=Math.min(o*(t/800),m);if(f.x+=l.x/m*_,f.y+=l.y/m*_,i){let g=f.x-n.x,w=f.y-n.y,b=Math.sqrt(g*g+w*w);g=g/b*s.get(f.id),w=w/b*s.get(f.id),f.x=n.x+g,f.y=n.y+w}a+=_,u++}}),u>0?a/u:0};var At={focusNode:null,linkDistance:50,maxIteration:1e3,maxPreventOverlapIteration:200,preventOverlap:!1,sortStrength:10,strictRadial:!0,unitRadius:null,nodeSize:10,nodeSpacing:0},Pi=class extends Ze{constructor(){super(...arguments),this.id="radial"}getDefaultOptions(){return At}layout(){return Ne(this,void 0,void 0,function*(){let{width:e,height:t,center:i}=Pe(this.options),n=this.model.nodeCount();if(!n||n===1)return gr(this.model,i);let{focusNode:o,linkDistance:s=At.linkDistance,maxIteration:a=At.maxIteration,maxPreventOverlapIteration:u=At.maxPreventOverlapIteration,nodeSize:f,nodeSpacing:l,preventOverlap:m,sortBy:_,sortStrength:g=At.sortStrength,strictRadial:w,unitRadius:b}=this.options,q=o&&this.model.node(o)||this.model.firstNode(),y=this.model.nodeIndexOf(q.id),x=Ci(this.model,!1),E=Ti(x),N=LE(E,y);jE(E,y,N+1);let M=E[y],A=(e-i[0]>i[0]?i[0]:e-i[0])||e/2,T=(t-i[1]>i[1]?i[1]:t-i[1])||t/2,j=Math.min(A,T),B=Math.max(...M),z=[],U=new Map,V=b??j/B;M.forEach((be,Ee)=>{let ce=be*V;z.push(ce),U.set(this.model.nodeAt(Ee).id,ce)});let W=kE(this.model,E,s,z,V,_,g),H=Ll(W,2,s),se=H[y],fe=0;if(this.model.forEachNode(be=>{let Ee=H[fe];be.x=Ee[0]-se[0],be.y=Ee[1]-se[1],fe++}),this.run(a,W,z,y),this.model.forEachNode(be=>{be.x+=i[0],be.y+=i[1]}),m){let Ee={nodeSizeFunc:or(f,l,At.nodeSize,At.nodeSpacing),radiiMap:U,width:e,strictRadial:!!w,focusNode:q,maxIteration:u,k:n/4.5};$1(this.model,Ee)}})}run(e,t,i,n){let o=PE(t),s=this.model.nodeCount(),a=this.model.nodes(),u=new Float64Array(s),f=new Float64Array(s);for(let l=0;l<s;l++)u[l]=a[l].x,f[l]=a[l].y;for(let l=0;l<=e;l++){let m=l/e,_=1-m;for(let g=0;g<s;g++){if(g===n)continue;let w=u[g],b=f[g],q=Math.sqrt(w*w+b*b),y=q===0?0:1/q,x=0,E=0,N=0;for(let A=0;A<s;A++){if(g===A)continue;let T=u[A],j=f[A],B=Math.sqrt((w-T)*(w-T)+(b-j)*(b-j)),z=B===0?0:1/B,U=t[A][g];N+=o[g][A],x+=o[g][A]*(T+U*(w-T)*z),E+=o[g][A]*(j+U*(b-j)*z)}let M=i[g]===0?0:1/i[g];N*=_,N+=m*M*M,x*=_,x+=m*M*w*y,E*=_,E+=m*M*b*y,u[g]=x/N,f[g]=E/N,a[g].x=u[g],a[g].y=f[g]}}}},kE=(r,e,t,i,n,o,s)=>{let a=e.length,u=new Array(a),f=new Array(a);for(let w=0;w<a;w++)f[w]=i[w]/n;let l=(t+n)/2,m=new Map,_=!o||o==="data"?null:Te(o,["node"]),g=o==="data";for(let w=0;w<a;w++){let b=e[w],q=new Array(a);u[w]=q;let y=f[w]||1;for(let x=0;x<a;x++){if(w===x){q[x]=0;continue}let E=b[x];if(i[w]===i[x])if(g)q[x]=E*Math.abs(w-x)*s/y;else if(_){let N=r.nodeAt(w),M=r.nodeAt(x),A=m.get(N.id);if(A===void 0){let j=_(N._original)||0;A=typeof j=="string"?j.charCodeAt(0):Number(j||0),m.set(N.id,A)}let T=m.get(M.id);if(T===void 0){let j=_(M._original)||0;T=typeof j=="string"?j.charCodeAt(0):Number(j||0),m.set(M.id,T)}q[x]=E*Math.abs(A-T)*s/y}else q[x]=E*t/y;else q[x]=E*l}}return u},PE=r=>{let e=r.length,t=r[0].length,i=[];for(let n=0;n<e;n++){let o=[];for(let s=0;s<t;s++)r[n][s]!==0?o.push(1/(r[n][s]*r[n][s])):o.push(0);i.push(o)}return i},jE=(r,e,t)=>{let i=r.length;for(let n=0;n<i;n++)if(r[e][n]===1/0){r[e][n]=t,r[n][e]=t;for(let o=0;o<i;o++)r[n][o]!==1/0&&r[e][o]===1/0&&(r[e][o]=t+r[n][o],r[o][e]=t+r[n][o])}for(let n=0;n<i;n++)if(n!==e){for(let o=0;o<i;o++)if(r[n][o]===1/0){let s=Math.abs(r[e][n]-r[e][o]);s=s===0?1:s,r[n][o]=s}}},LE=(r,e)=>{let t=r[e],i=0;for(let n=0;n<t.length;n++)t[n]!==1/0&&(i=Math.max(i,t[n]));return i};var ji=class extends Ze{constructor(){super(...arguments),this.id="random"}getDefaultOptions(){return{center:[0,0],width:300,height:300}}layout(){return Ne(this,void 0,void 0,function*(){let{width:e,height:t,center:i}=Pe(this.options);this.model.forEachNode(n=>{n.x=V1(e)+i[0],n.y=V1(t)+i[1]})})}},FE=.9,V1=r=>(Math.random()-.5)*FE*r;var bo={"antv-dagre":hi,"d3-force-3d":Ei,"d3-force":Mt,"force-atlas2":Ii,circular:pi,concentric:mi,dagre:Ni,force:Mi,fruchterman:Ri,grid:Ai,mds:ki,radial:Pi,random:ji};var zE={layout:r=>r?{type:"concentric",preventOverlap:!0}:{type:"force",preventOverlap:!0},nodeSize:20,nodeSpacing:0,comboPadding:10,comboSpacing:0},Ot="root",Fl=class extends Ze{constructor(){super(...arguments),this.id="combo-combined",this.relativePositions=new Map,this.getParentId=e=>e.parentId||Ot}getDefaultOptions(){return zE}layout(){return Ne(this,void 0,void 0,function*(){let{center:e}=Pe(this.options);this.resetLayoutState();let t=this.buildHierarchyTree();yield this.layoutHierarchy(t),this.convertToGlobalPositions(t,e),this.applyPositionsToModel(t)})}isCombo(e){return!!e.isCombo}resetLayoutState(){this.relativePositions.clear()}layoutHierarchy(e){return Ne(this,void 0,void 0,function*(){for(let g of e.children||[])this.isCombo(g)&&(yield this.layoutHierarchy(g));let t=e.children||[];if(t.length===0){e.size=[0,0,0],e.parentId=e.id===Ot?null:e.parentId;return}let i=this.getLayoutConfig(e),{type:n}=i,o=Gl(i,["type"]),s=this.getLayoutClass(n),a=new s(o),u=this.createTemporaryGraphData(t);yield DE(a,u,{});let f=a.model.nodes();this.recordRelativePositions(f,e);let{center:l,width:m,height:_}=this.calculateComboBounds(e);e.size=[m,_,0],(e.children||[]).forEach(g=>{let w=this.relativePositions.get(g.id);if(!w)return;let b=Object.assign(Object.assign({},w),{x:w.x-l[0],y:w.y-l[1]});this.relativePositions.set(g.id,b)})})}recordRelativePositions(e,t){let i=this.calculateComboCenter(e);e.forEach(n=>{this.relativePositions.set(n.id,{x:n.x-i[0],y:n.y-i[1],relativeTo:String(t.id)})})}buildHierarchyTree(){let e={id:Ot,isCombo:!0,children:[],parentId:null},t=new Map;return t.set(Ot,e),this.model.forEachNode(i=>{if(this.isCombo(i)){let n=Object.assign(Object.assign({},i),{children:[],parentId:this.getParentId(i)});t.set(String(i.id),n)}}),this.model.forEachNode(i=>{let n=t.get(this.getParentId(i));if(this.isCombo(i)){let o=t.get(String(i.id));n&&o&&(n.children.push(o),o.parentId=n.id)}else n&&n.children.push(Object.assign(Object.assign({},i),{children:[],parentId:this.getParentId(i)}))}),e}convertToGlobalPositions(e,t){var i,n;let o=e.id===Ot?null:this.relativePositions.get(e.id),s=t[0]+((i=o?.x)!==null&&i!==void 0?i:0),a=t[1]+((n=o?.y)!==null&&n!==void 0?n:0);e.x=s,e.y=a,(e.children||[]).forEach(u=>{var f,l;let m=this.relativePositions.get(u.id);u.x=s+((f=m?.x)!==null&&f!==void 0?f:0),u.y=a+((l=m?.y)!==null&&l!==void 0?l:0),u.size=this.getNodeLikeSize(u,!1),this.isCombo(u)&&this.convertToGlobalPositions(u,[s,a])})}getLayoutConfig(e){let t=typeof this.options.layout=="object"?this.options.layout:Te(this.options.layout,["comboId"]);if(typeof t=="function"){let i=e.id===Ot?null:e.id;return this.normalizeLayoutConfig(t(i))}return this.normalizeLayoutConfig(t)}normalizeLayoutConfig(e){let t=Object.assign(Object.assign({type:"concentric"},Pe(this.options)),{nodeSize:"node.size",nodeSpacing:0});return e?typeof e=="string"?Object.assign(Object.assign({},t),{type:e}):Object.assign(Object.assign({},t),e):t}getLayoutClass(e){return bo[e]||bo.concentric}createTemporaryGraphData(e){let t=e.map(s=>Object.assign(Object.assign({},s),{size:this.getNodeLikeSize(s)})),i=new Set(e.map(s=>String(s.id))),n=[],o=s=>{let a=String(s),u=new Set;for(;a&&!u.has(a);){if(i.has(a))return a;u.add(a);let f=this.model.node(a),l=f?.parentId;a=l==null?null:String(l)}return null};return this.model.forEachEdge(s=>{let a=o(String(s.source)),u=o(String(s.target));!a||!u||a!==u&&n.push({source:a,target:u})}),{nodes:t,edges:n}}calculateComboCenter(e){if(e.length===0)return[0,0];let t=new Map;e.forEach(a=>{let u=this.getNodeLikeSize(a);t.set(a.id,u)});let i=1/0,n=1/0,o=-1/0,s=-1/0;return e.forEach(a=>{let[u=0,f=0]=t.get(a.id);i=Math.min(i,a.x-u/2),n=Math.min(n,a.y-f/2),o=Math.max(o,a.x+u/2),s=Math.max(s,a.y+f/2)}),!Number.isFinite(i)||!Number.isFinite(n)?[0,0]:[(i+o)/2,(n+s)/2]}calculateComboBounds(e){let t=e.children||[];if(t.length===0)return{center:[0,0],width:0,height:0};let i=1/0,n=1/0,o=-1/0,s=-1/0;if(t.forEach(f=>{var l,m;let _=this.relativePositions.get(f.id),g=(l=_?.x)!==null&&l!==void 0?l:0,w=(m=_?.y)!==null&&m!==void 0?m:0,[b,q]=this.getNodeLikeSize(f);i=Math.min(i,g-b/2),n=Math.min(n,w-q/2),o=Math.max(o,g+b/2),s=Math.max(s,w+q/2)}),!Number.isFinite(i)||!Number.isFinite(n))return{center:[0,0],width:0,height:0};let u=ur(this.options.comboPadding,20,"combo")(e._original);return{center:[(i+o)/2,(n+s)/2],width:o-i+u*2,height:s-n+u*2}}getNodeLikeSize(e,t=!0){return this.isCombo(e)?this.getComboSize(e,t):this.getNodeSize(e,t)}getNodeSize(e,t=!0){let{nodeSize:i,nodeSpacing:n}=this.options;return or(i,t?n:0)(e._original)}getComboSize(e,t=!0){let i=ur(this.options.comboSpacing,0,"combo"),n=t?i(e._original):0,[o,s]=e.size;return[o+n/2,s+n/2,0]}applyPositionsToModel(e){let t=n=>{let o=this.model.node(n.id);o&&(o.x=n.x,o.y=n.y,n.size&&(o.size=n.size))},i=n=>{n.id!==Ot&&t(n),(n.children||[]).forEach(o=>{this.isCombo(o)?i(o):t(o)})};i(e)}};function DE(r,e,t={}){var i;return Ne(this,void 0,void 0,function*(){return ko(r)?(r.execute(e,t),r.stop(),r.tick((i=t.iterations)!==null&&i!==void 0?i:300)):yield r.execute(e,t)})}export{hi as AntVDagreLayout,Ze as BaseLayout,pi as CircularLayout,Fl as ComboCombinedLayout,mi as ConcentricLayout,Ei as D3Force3DLayout,Mt as D3ForceLayout,Ni as DagreLayout,Ii as ForceAtlas2Layout,Mi as ForceLayout,Ri as FruchtermanLayout,ui as GraphLib,Ai as GridLayout,ki as MDSLayout,Pi as RadialLayout,ji as RandomLayout,fi as RuntimeContext,ci as Supervisor,gr as applySingleNodeLayout,Jr as assignDefined,Io as evaluateExpression,NE as floydWarshall,Te as formatFn,or as formatNodeSizeFn,ur as formatNumberFn,Tt as formatSizeFn,Ci as getAdjList,ME as getAdjMatrix,RE as getEuclideanDistance,IE as getLayoutBBox,Dx as getNestedValue,G1 as graphTreeDfs,xt as initNodePosition,Tl as isArray,ko as isLayoutWithIterations,Ro as isSize,Ti as johnson,Pe as normalizeViewport,St as orderByDegree,Qo as orderById,di as orderBySorter,Xi as orderByTopology,ai as parsePoint,wt as parseSize,bo as registry,Pl as scaleMatrix,Bx as setNestedValue,vb as toPointObject};
11
+ /*! Bundled license information:
12
+
13
+ comlink/dist/esm/comlink.js:
14
+ (**
15
+ * @license
16
+ * Copyright 2019 Google LLC
17
+ * SPDX-License-Identifier: Apache-2.0
18
+ *)
19
+ */
20
+ //# sourceMappingURL=layout.mjs.map