@antv/g2 5.3.6-beta.4 → 5.4.1

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 (546) hide show
  1. package/dist/g2.lite.min.js +10 -10
  2. package/dist/g2.min.js +8 -8
  3. package/esm/animation/morphing.js.map +1 -1
  4. package/esm/animation/scaleInY.js.map +1 -1
  5. package/esm/animation/utils.js.map +1 -1
  6. package/esm/animation/waveIn.js.map +1 -1
  7. package/esm/api/composition.js.map +1 -1
  8. package/esm/api/define.js.map +1 -1
  9. package/esm/api/mark.js.map +1 -1
  10. package/esm/api/node.js.map +1 -1
  11. package/esm/api/runtime.js +2 -2
  12. package/esm/api/runtime.js.map +1 -1
  13. package/esm/api/utils.js.map +1 -1
  14. package/esm/component/axis.d.ts +1 -0
  15. package/esm/component/axis.js.map +1 -1
  16. package/esm/component/axisRadar.js.map +1 -1
  17. package/esm/component/legendCategory.js.map +1 -1
  18. package/esm/component/legendContinuous.js +1 -1
  19. package/esm/component/legendContinuous.js.map +1 -1
  20. package/esm/component/slider.js.map +1 -1
  21. package/esm/component/title.js.map +1 -1
  22. package/esm/component/utils.d.ts +1 -1
  23. package/esm/component/utils.js.map +1 -1
  24. package/esm/composition/facetRect.js.map +1 -1
  25. package/esm/composition/geoView.js.map +1 -1
  26. package/esm/composition/repeatMatrix.js.map +1 -1
  27. package/esm/composition/spaceFlex.js.map +1 -1
  28. package/esm/composition/timingKeyframe.js.map +1 -1
  29. package/esm/composition/utils.js.map +1 -1
  30. package/esm/data/cluster.d.ts +1 -1
  31. package/esm/data/ema.js.map +1 -1
  32. package/esm/data/fetch.js.map +1 -1
  33. package/esm/data/pick.js.map +1 -1
  34. package/esm/data/sankey.js.map +1 -1
  35. package/esm/data/sortBy.js.map +1 -1
  36. package/esm/data/utils/arc/arc.d.ts +6 -6
  37. package/esm/data/utils/arc/arc.js.map +1 -1
  38. package/esm/data/utils/d3-cloud/index.js.map +1 -1
  39. package/esm/data/utils/d3-sankey/sankey.d.ts +5 -5
  40. package/esm/data/utils/d3-sankey/sankey.js.map +1 -1
  41. package/esm/data/utils/fields.js.map +1 -1
  42. package/esm/data/utils/memo.js +1 -1
  43. package/esm/data/utils/memo.js.map +1 -1
  44. package/esm/data/utils/venn/circleintersection.js.map +1 -1
  45. package/esm/data/utils/venn/diagram.js.map +1 -1
  46. package/esm/data/utils/venn/fmin/bisect.js.map +1 -1
  47. package/esm/data/utils/venn/fmin/blas1.js.map +1 -1
  48. package/esm/data/utils/venn/fmin/conjugateGradient.js.map +1 -1
  49. package/esm/data/utils/venn/fmin/gradientDescent.js.map +1 -1
  50. package/esm/data/utils/venn/fmin/linesearch.js.map +1 -1
  51. package/esm/data/utils/venn/fmin/nelderMead.js.map +1 -1
  52. package/esm/data/utils/venn/layout.js.map +1 -1
  53. package/esm/data/wordCloud.js.map +1 -1
  54. package/esm/index.d.ts +2 -0
  55. package/esm/interaction/brushAxisHighlight.js +1 -1
  56. package/esm/interaction/brushAxisHighlight.js.map +1 -1
  57. package/esm/interaction/brushFilter.js.map +1 -1
  58. package/esm/interaction/brushHighlight.d.ts +5 -0
  59. package/esm/interaction/brushHighlight.js +4 -0
  60. package/esm/interaction/brushHighlight.js.map +1 -1
  61. package/esm/interaction/chartIndex.js.map +1 -1
  62. package/esm/interaction/elementHighlight.js.map +1 -1
  63. package/esm/interaction/elementPointMove.js.map +1 -1
  64. package/esm/interaction/elementSelect.js.map +1 -1
  65. package/esm/interaction/event.js.map +1 -1
  66. package/esm/interaction/fisheye.js.map +1 -1
  67. package/esm/interaction/index.d.ts +1 -0
  68. package/esm/interaction/index.js +1 -0
  69. package/esm/interaction/index.js.map +1 -1
  70. package/esm/interaction/legendFilter.js +17 -11
  71. package/esm/interaction/legendFilter.js.map +1 -1
  72. package/esm/interaction/legendHighlight.js.map +1 -1
  73. package/esm/interaction/poptip.js.map +1 -1
  74. package/esm/interaction/sliderFilter.js +6 -2
  75. package/esm/interaction/sliderFilter.js.map +1 -1
  76. package/esm/interaction/sliderWheel.d.ts +19 -0
  77. package/esm/interaction/sliderWheel.js +82 -0
  78. package/esm/interaction/sliderWheel.js.map +1 -0
  79. package/esm/interaction/tooltip.js +1 -1
  80. package/esm/interaction/tooltip.js.map +1 -1
  81. package/esm/interaction/treemapDrillDown.js.map +1 -1
  82. package/esm/interaction/utils.d.ts +12 -2
  83. package/esm/interaction/utils.js +20 -0
  84. package/esm/interaction/utils.js.map +1 -1
  85. package/esm/label-transform/exceedAdjust.js.map +1 -1
  86. package/esm/label-transform/overflowStroke.js.map +1 -1
  87. package/esm/label-transform/overlapDodgeY.js.map +1 -1
  88. package/esm/lib/builtinlib.d.ts +1 -1
  89. package/esm/lib/core.d.ts +2 -1
  90. package/esm/lib/core.js +2 -1
  91. package/esm/lib/core.js.map +1 -1
  92. package/esm/lib/std.d.ts +1 -0
  93. package/esm/mark/area.js.map +1 -1
  94. package/esm/mark/box.js +3 -3
  95. package/esm/mark/box.js.map +1 -1
  96. package/esm/mark/boxplot.js.map +1 -1
  97. package/esm/mark/chord.js +2 -2
  98. package/esm/mark/chord.js.map +1 -1
  99. package/esm/mark/density.js +1 -1
  100. package/esm/mark/density.js.map +1 -1
  101. package/esm/mark/gauge.js.map +1 -1
  102. package/esm/mark/line.js.map +1 -1
  103. package/esm/mark/polygon.js.map +1 -1
  104. package/esm/mark/sankey.js +3 -1
  105. package/esm/mark/sankey.js.map +1 -1
  106. package/esm/mark/utils.js.map +1 -1
  107. package/esm/runtime/component.js.map +1 -1
  108. package/esm/runtime/coordinate.js.map +1 -1
  109. package/esm/runtime/layout.js.map +1 -1
  110. package/esm/runtime/mark.js +3 -2
  111. package/esm/runtime/mark.js.map +1 -1
  112. package/esm/runtime/option-preprocess/axis-breaks.js.map +1 -1
  113. package/esm/runtime/option-preprocess/index.js.map +1 -1
  114. package/esm/runtime/option-preprocess/style.js.map +1 -1
  115. package/esm/runtime/plot.js +7 -6
  116. package/esm/runtime/plot.js.map +1 -1
  117. package/esm/runtime/render.js +1 -0
  118. package/esm/runtime/render.js.map +1 -1
  119. package/esm/runtime/scale.js.map +1 -1
  120. package/esm/runtime/transform.js.map +1 -1
  121. package/esm/runtime/types/options.d.ts +1 -0
  122. package/esm/shape/area/curve.js.map +1 -1
  123. package/esm/shape/axis-breaks/axis-breaks.d.ts +4 -2
  124. package/esm/shape/axis-breaks/axis-breaks.js +59 -33
  125. package/esm/shape/axis-breaks/axis-breaks.js.map +1 -1
  126. package/esm/shape/box/box.js.map +1 -1
  127. package/esm/shape/box/violin.js.map +1 -1
  128. package/esm/shape/connector/connector.js.map +1 -1
  129. package/esm/shape/heatmap/renderer/gradient.js.map +1 -1
  130. package/esm/shape/heatmap/renderer/index.js.map +1 -1
  131. package/esm/shape/interval/color.js.map +1 -1
  132. package/esm/shape/interval/funnel.js.map +1 -1
  133. package/esm/shape/interval/pyramid.js.map +1 -1
  134. package/esm/shape/label/label.js.map +1 -1
  135. package/esm/shape/label/position/default.js.map +1 -1
  136. package/esm/shape/label/position/outside.js.map +1 -1
  137. package/esm/shape/label/position/utils.js.map +1 -1
  138. package/esm/shape/line/curve.js.map +1 -1
  139. package/esm/shape/line/trail.js.map +1 -1
  140. package/esm/shape/link/arc.js.map +1 -1
  141. package/esm/shape/link/vhv.js.map +1 -1
  142. package/esm/shape/liquid/liquid.js.map +1 -1
  143. package/esm/shape/liquid/wave.js.map +1 -1
  144. package/esm/shape/point/color.js.map +1 -1
  145. package/esm/shape/polygon/polygon.js.map +1 -1
  146. package/esm/shape/polygon/ribbon.js.map +1 -1
  147. package/esm/shape/text/advance.d.ts +1 -1
  148. package/esm/shape/text/advance.js.map +1 -1
  149. package/esm/shape/utils.js.map +1 -1
  150. package/esm/shape/vector/vector.js.map +1 -1
  151. package/esm/theme/create.js +1 -1
  152. package/esm/theme/create.js.map +1 -1
  153. package/esm/transform/diffY.js.map +1 -1
  154. package/esm/transform/dodgeX.js.map +1 -1
  155. package/esm/transform/filter.js.map +1 -1
  156. package/esm/transform/maybeDefaultX.js.map +1 -1
  157. package/esm/transform/maybeDefaultY.js.map +1 -1
  158. package/esm/transform/maybeTitle.js.map +1 -1
  159. package/esm/transform/maybeVisualPosition.js +1 -1
  160. package/esm/transform/maybeVisualPosition.js.map +1 -1
  161. package/esm/transform/normalizeY.js.map +1 -1
  162. package/esm/transform/pack.js.map +1 -1
  163. package/esm/transform/sample.js.map +1 -1
  164. package/esm/transform/sort.js.map +1 -1
  165. package/esm/transform/stackEnter.js.map +1 -1
  166. package/esm/transform/stackY.js +2 -2
  167. package/esm/transform/stackY.js.map +1 -1
  168. package/esm/transform/symmetryY.js.map +1 -1
  169. package/esm/transform/utils/helper.js.map +1 -1
  170. package/esm/transform/utils/lttb.js.map +1 -1
  171. package/esm/transform/utils/order.js.map +1 -1
  172. package/esm/utils/angle.js.map +1 -1
  173. package/esm/utils/array.js.map +1 -1
  174. package/esm/utils/coordinate.d.ts +1 -0
  175. package/esm/utils/coordinate.js.map +1 -1
  176. package/esm/utils/expr.js.map +1 -1
  177. package/esm/utils/helper.js +17 -1
  178. package/esm/utils/helper.js.map +1 -1
  179. package/esm/utils/marker.d.ts +1 -1
  180. package/esm/utils/scale.d.ts +1 -0
  181. package/esm/utils/scale.js +17 -0
  182. package/esm/utils/scale.js.map +1 -1
  183. package/esm/utils/selection.js.map +1 -1
  184. package/esm/utils/style.js.map +1 -1
  185. package/esm/utils/traverse-elements.js.map +1 -1
  186. package/esm/utils/treeDataTransform.js.map +1 -1
  187. package/esm/utils/vector.js.map +1 -1
  188. package/lib/animation/morphing.js.map +1 -1
  189. package/lib/animation/scaleInY.js.map +1 -1
  190. package/lib/animation/utils.js +2 -2
  191. package/lib/animation/utils.js.map +1 -1
  192. package/lib/animation/waveIn.js.map +1 -1
  193. package/lib/api/composition.js +2 -2
  194. package/lib/api/composition.js.map +1 -1
  195. package/lib/api/define.js +3 -2
  196. package/lib/api/define.js.map +1 -1
  197. package/lib/api/extend.js +2 -1
  198. package/lib/api/extend.js.map +1 -1
  199. package/lib/api/library.js +2 -2
  200. package/lib/api/library.js.map +1 -1
  201. package/lib/api/mark.js +2 -2
  202. package/lib/api/mark.js.map +1 -1
  203. package/lib/api/node.js.map +1 -1
  204. package/lib/api/runtime.js +2 -2
  205. package/lib/api/runtime.js.map +1 -1
  206. package/lib/api/utils.js +9 -9
  207. package/lib/api/utils.js.map +1 -1
  208. package/lib/component/axis.d.ts +1 -0
  209. package/lib/component/axis.js +2 -2
  210. package/lib/component/axis.js.map +1 -1
  211. package/lib/component/axisRadar.js.map +1 -1
  212. package/lib/component/axisX.js +2 -2
  213. package/lib/component/axisX.js.map +1 -1
  214. package/lib/component/legendCategory.js.map +1 -1
  215. package/lib/component/legendContinuous.js +1 -1
  216. package/lib/component/legendContinuous.js.map +1 -1
  217. package/lib/component/slider.js.map +1 -1
  218. package/lib/component/title.js.map +1 -1
  219. package/lib/component/utils.d.ts +1 -1
  220. package/lib/component/utils.js +11 -11
  221. package/lib/component/utils.js.map +1 -1
  222. package/lib/composition/facetRect.js +2 -2
  223. package/lib/composition/facetRect.js.map +1 -1
  224. package/lib/composition/geoView.js +7 -17
  225. package/lib/composition/geoView.js.map +1 -1
  226. package/lib/composition/repeatMatrix.js.map +1 -1
  227. package/lib/composition/spaceFlex.js.map +1 -1
  228. package/lib/composition/timingKeyframe.js.map +1 -1
  229. package/lib/composition/utils.js +5 -4
  230. package/lib/composition/utils.js.map +1 -1
  231. package/lib/data/cluster.d.ts +1 -1
  232. package/lib/data/ema.js +2 -2
  233. package/lib/data/ema.js.map +1 -1
  234. package/lib/data/fetch.js.map +1 -1
  235. package/lib/data/filter.js +2 -2
  236. package/lib/data/filter.js.map +1 -1
  237. package/lib/data/fold.js +2 -2
  238. package/lib/data/fold.js.map +1 -1
  239. package/lib/data/kde.js +2 -2
  240. package/lib/data/kde.js.map +1 -1
  241. package/lib/data/pick.js.map +1 -1
  242. package/lib/data/rename.js +2 -2
  243. package/lib/data/rename.js.map +1 -1
  244. package/lib/data/sankey.js.map +1 -1
  245. package/lib/data/sort.js +2 -2
  246. package/lib/data/sort.js.map +1 -1
  247. package/lib/data/sortBy.js.map +1 -1
  248. package/lib/data/utils/arc/arc.d.ts +6 -6
  249. package/lib/data/utils/arc/arc.js +9 -18
  250. package/lib/data/utils/arc/arc.js.map +1 -1
  251. package/lib/data/utils/arc/sort.js +5 -4
  252. package/lib/data/utils/arc/sort.js.map +1 -1
  253. package/lib/data/utils/d3-cloud/index.js +2 -1
  254. package/lib/data/utils/d3-cloud/index.js.map +1 -1
  255. package/lib/data/utils/d3-sankey/align.js +5 -4
  256. package/lib/data/utils/d3-sankey/align.js.map +1 -1
  257. package/lib/data/utils/d3-sankey/constant.js +2 -1
  258. package/lib/data/utils/d3-sankey/constant.js.map +1 -1
  259. package/lib/data/utils/d3-sankey/sankey.d.ts +5 -5
  260. package/lib/data/utils/d3-sankey/sankey.js +2 -1
  261. package/lib/data/utils/d3-sankey/sankey.js.map +1 -1
  262. package/lib/data/utils/fields.js +2 -1
  263. package/lib/data/utils/fields.js.map +1 -1
  264. package/lib/data/utils/flow.js +2 -1
  265. package/lib/data/utils/flow.js.map +1 -1
  266. package/lib/data/utils/memo.js +5 -4
  267. package/lib/data/utils/memo.js.map +1 -1
  268. package/lib/data/utils/venn/circleintersection.js +8 -7
  269. package/lib/data/utils/venn/circleintersection.js.map +1 -1
  270. package/lib/data/utils/venn/diagram.js +2 -1
  271. package/lib/data/utils/venn/diagram.js.map +1 -1
  272. package/lib/data/utils/venn/fmin/bisect.js +2 -1
  273. package/lib/data/utils/venn/fmin/bisect.js.map +1 -1
  274. package/lib/data/utils/venn/fmin/blas1.js +8 -7
  275. package/lib/data/utils/venn/fmin/blas1.js.map +1 -1
  276. package/lib/data/utils/venn/fmin/conjugateGradient.js +3 -2
  277. package/lib/data/utils/venn/fmin/conjugateGradient.js.map +1 -1
  278. package/lib/data/utils/venn/fmin/gradientDescent.js +3 -2
  279. package/lib/data/utils/venn/fmin/gradientDescent.js.map +1 -1
  280. package/lib/data/utils/venn/fmin/linesearch.js +2 -1
  281. package/lib/data/utils/venn/fmin/linesearch.js.map +1 -1
  282. package/lib/data/utils/venn/fmin/nelderMead.js +2 -1
  283. package/lib/data/utils/venn/fmin/nelderMead.js.map +1 -1
  284. package/lib/data/utils/venn/layout.js +11 -10
  285. package/lib/data/utils/venn/layout.js.map +1 -1
  286. package/lib/data/wordCloud.js +3 -3
  287. package/lib/data/wordCloud.js.map +1 -1
  288. package/lib/index.d.ts +2 -0
  289. package/lib/interaction/brushAxisHighlight.js +4 -4
  290. package/lib/interaction/brushAxisHighlight.js.map +1 -1
  291. package/lib/interaction/brushFilter.js +3 -2
  292. package/lib/interaction/brushFilter.js.map +1 -1
  293. package/lib/interaction/brushHighlight.d.ts +5 -0
  294. package/lib/interaction/brushHighlight.js +8 -3
  295. package/lib/interaction/brushHighlight.js.map +1 -1
  296. package/lib/interaction/brushXFilter.js +2 -1
  297. package/lib/interaction/brushXFilter.js.map +1 -1
  298. package/lib/interaction/brushXHighlight.js +3 -2
  299. package/lib/interaction/brushXHighlight.js.map +1 -1
  300. package/lib/interaction/brushYFilter.js +2 -1
  301. package/lib/interaction/brushYFilter.js.map +1 -1
  302. package/lib/interaction/brushYHighlight.js +3 -2
  303. package/lib/interaction/brushYHighlight.js.map +1 -1
  304. package/lib/interaction/chartIndex.js +2 -1
  305. package/lib/interaction/chartIndex.js.map +1 -1
  306. package/lib/interaction/elementHighlight.js +3 -2
  307. package/lib/interaction/elementHighlight.js.map +1 -1
  308. package/lib/interaction/elementHighlightByColor.js +2 -1
  309. package/lib/interaction/elementHighlightByColor.js.map +1 -1
  310. package/lib/interaction/elementHighlightByX.js +2 -1
  311. package/lib/interaction/elementHighlightByX.js.map +1 -1
  312. package/lib/interaction/elementPointMove.js +2 -1
  313. package/lib/interaction/elementPointMove.js.map +1 -1
  314. package/lib/interaction/elementSelect.js +3 -2
  315. package/lib/interaction/elementSelect.js.map +1 -1
  316. package/lib/interaction/elementSelectByColor.js +2 -1
  317. package/lib/interaction/elementSelectByColor.js.map +1 -1
  318. package/lib/interaction/elementSelectByX.js +2 -1
  319. package/lib/interaction/elementSelectByX.js.map +1 -1
  320. package/lib/interaction/event.js +2 -1
  321. package/lib/interaction/event.js.map +1 -1
  322. package/lib/interaction/fisheye.js +2 -1
  323. package/lib/interaction/fisheye.js.map +1 -1
  324. package/lib/interaction/index.d.ts +1 -0
  325. package/lib/interaction/index.js +3 -1
  326. package/lib/interaction/index.js.map +1 -1
  327. package/lib/interaction/legendFilter.js +28 -22
  328. package/lib/interaction/legendFilter.js.map +1 -1
  329. package/lib/interaction/legendHighlight.js +2 -1
  330. package/lib/interaction/legendHighlight.js.map +1 -1
  331. package/lib/interaction/poptip.js +2 -1
  332. package/lib/interaction/poptip.js.map +1 -1
  333. package/lib/interaction/scrollbarFilter.js +2 -2
  334. package/lib/interaction/scrollbarFilter.js.map +1 -1
  335. package/lib/interaction/sliderFilter.js +7 -3
  336. package/lib/interaction/sliderFilter.js.map +1 -1
  337. package/lib/interaction/sliderWheel.d.ts +19 -0
  338. package/lib/interaction/sliderWheel.js +86 -0
  339. package/lib/interaction/sliderWheel.js.map +1 -0
  340. package/lib/interaction/tooltip.js +8 -7
  341. package/lib/interaction/tooltip.js.map +1 -1
  342. package/lib/interaction/treemapDrillDown.js +2 -1
  343. package/lib/interaction/treemapDrillDown.js.map +1 -1
  344. package/lib/interaction/utils.d.ts +12 -2
  345. package/lib/interaction/utils.js +49 -28
  346. package/lib/interaction/utils.js.map +1 -1
  347. package/lib/label-transform/exceedAdjust.js.map +1 -1
  348. package/lib/label-transform/overflowStroke.js.map +1 -1
  349. package/lib/label-transform/overlapDodgeY.js.map +1 -1
  350. package/lib/label-transform/utils.js +3 -2
  351. package/lib/label-transform/utils.js.map +1 -1
  352. package/lib/lib/builtinlib.d.ts +1 -1
  353. package/lib/lib/builtinlib.js +2 -1
  354. package/lib/lib/builtinlib.js.map +1 -1
  355. package/lib/lib/core.d.ts +2 -1
  356. package/lib/lib/core.js +3 -1
  357. package/lib/lib/core.js.map +1 -1
  358. package/lib/lib/geo.js +2 -1
  359. package/lib/lib/geo.js.map +1 -1
  360. package/lib/lib/graph.js +2 -1
  361. package/lib/lib/graph.js.map +1 -1
  362. package/lib/lib/lite.js +2 -1
  363. package/lib/lib/lite.js.map +1 -1
  364. package/lib/lib/plot.js +2 -1
  365. package/lib/lib/plot.js.map +1 -1
  366. package/lib/lib/std.d.ts +1 -0
  367. package/lib/lib/std.js +2 -1
  368. package/lib/lib/std.js.map +1 -1
  369. package/lib/mark/area.js.map +1 -1
  370. package/lib/mark/box.js +3 -3
  371. package/lib/mark/box.js.map +1 -1
  372. package/lib/mark/boxplot.js.map +1 -1
  373. package/lib/mark/chord.js +2 -2
  374. package/lib/mark/chord.js.map +1 -1
  375. package/lib/mark/density.js +1 -1
  376. package/lib/mark/density.js.map +1 -1
  377. package/lib/mark/gauge.js.map +1 -1
  378. package/lib/mark/line.js.map +1 -1
  379. package/lib/mark/polygon.js.map +1 -1
  380. package/lib/mark/range.js +2 -2
  381. package/lib/mark/range.js.map +1 -1
  382. package/lib/mark/sankey.js +3 -1
  383. package/lib/mark/sankey.js.map +1 -1
  384. package/lib/mark/utils.js +17 -16
  385. package/lib/mark/utils.js.map +1 -1
  386. package/lib/runtime/component.js +11 -10
  387. package/lib/runtime/component.js.map +1 -1
  388. package/lib/runtime/coordinate.js +13 -12
  389. package/lib/runtime/coordinate.js.map +1 -1
  390. package/lib/runtime/layout.js +5 -4
  391. package/lib/runtime/layout.js.map +1 -1
  392. package/lib/runtime/library.js +3 -2
  393. package/lib/runtime/library.js.map +1 -1
  394. package/lib/runtime/mark.js +6 -4
  395. package/lib/runtime/mark.js.map +1 -1
  396. package/lib/runtime/option-preprocess/axis-breaks.js +2 -2
  397. package/lib/runtime/option-preprocess/axis-breaks.js.map +1 -1
  398. package/lib/runtime/option-preprocess/index.js +2 -1
  399. package/lib/runtime/option-preprocess/index.js.map +1 -1
  400. package/lib/runtime/option-preprocess/style.js +2 -1
  401. package/lib/runtime/option-preprocess/style.js.map +1 -1
  402. package/lib/runtime/plot.js +10 -8
  403. package/lib/runtime/plot.js.map +1 -1
  404. package/lib/runtime/render.js +5 -3
  405. package/lib/runtime/render.js.map +1 -1
  406. package/lib/runtime/scale.js +18 -27
  407. package/lib/runtime/scale.js.map +1 -1
  408. package/lib/runtime/transform.js +13 -13
  409. package/lib/runtime/transform.js.map +1 -1
  410. package/lib/runtime/types/options.d.ts +1 -0
  411. package/lib/shape/area/curve.js.map +1 -1
  412. package/lib/shape/axis-breaks/axis-breaks.d.ts +4 -2
  413. package/lib/shape/axis-breaks/axis-breaks.js +58 -32
  414. package/lib/shape/axis-breaks/axis-breaks.js.map +1 -1
  415. package/lib/shape/box/box.js.map +1 -1
  416. package/lib/shape/box/violin.js.map +1 -1
  417. package/lib/shape/connector/connector.js.map +1 -1
  418. package/lib/shape/heatmap/renderer/gradient.js +2 -1
  419. package/lib/shape/heatmap/renderer/gradient.js.map +1 -1
  420. package/lib/shape/heatmap/renderer/index.js +2 -1
  421. package/lib/shape/heatmap/renderer/index.js.map +1 -1
  422. package/lib/shape/interval/color.js +2 -2
  423. package/lib/shape/interval/color.js.map +1 -1
  424. package/lib/shape/interval/funnel.js.map +1 -1
  425. package/lib/shape/interval/pyramid.js.map +1 -1
  426. package/lib/shape/label/label.js +7 -17
  427. package/lib/shape/label/label.js.map +1 -1
  428. package/lib/shape/label/position/area.js +2 -1
  429. package/lib/shape/label/position/area.js.map +1 -1
  430. package/lib/shape/label/position/default.js +7 -6
  431. package/lib/shape/label/position/default.js.map +1 -1
  432. package/lib/shape/label/position/outside.js +6 -5
  433. package/lib/shape/label/position/outside.js.map +1 -1
  434. package/lib/shape/label/position/spider.js +2 -1
  435. package/lib/shape/label/position/spider.js.map +1 -1
  436. package/lib/shape/label/position/surround.js +2 -1
  437. package/lib/shape/label/position/surround.js.map +1 -1
  438. package/lib/shape/label/position/utils.js +3 -2
  439. package/lib/shape/label/position/utils.js.map +1 -1
  440. package/lib/shape/line/curve.js.map +1 -1
  441. package/lib/shape/line/trail.js.map +1 -1
  442. package/lib/shape/link/arc.js.map +1 -1
  443. package/lib/shape/link/vhv.js.map +1 -1
  444. package/lib/shape/liquid/liquid.js.map +1 -1
  445. package/lib/shape/liquid/wave.js +2 -1
  446. package/lib/shape/liquid/wave.js.map +1 -1
  447. package/lib/shape/point/color.js +2 -2
  448. package/lib/shape/point/color.js.map +1 -1
  449. package/lib/shape/polygon/polygon.js.map +1 -1
  450. package/lib/shape/polygon/ribbon.js.map +1 -1
  451. package/lib/shape/text/advance.d.ts +1 -1
  452. package/lib/shape/text/advance.js.map +1 -1
  453. package/lib/shape/utils.js +12 -11
  454. package/lib/shape/utils.js.map +1 -1
  455. package/lib/shape/vector/vector.js.map +1 -1
  456. package/lib/theme/create.js +3 -2
  457. package/lib/theme/create.js.map +1 -1
  458. package/lib/transform/diffY.js.map +1 -1
  459. package/lib/transform/dodgeX.js.map +1 -1
  460. package/lib/transform/filter.js.map +1 -1
  461. package/lib/transform/jitter.js +3 -3
  462. package/lib/transform/jitter.js.map +1 -1
  463. package/lib/transform/maybeDefaultX.js.map +1 -1
  464. package/lib/transform/maybeDefaultY.js.map +1 -1
  465. package/lib/transform/maybeTitle.js.map +1 -1
  466. package/lib/transform/maybeVisualPosition.js +1 -1
  467. package/lib/transform/maybeVisualPosition.js.map +1 -1
  468. package/lib/transform/normalizeY.js.map +1 -1
  469. package/lib/transform/pack.js.map +1 -1
  470. package/lib/transform/sample.js.map +1 -1
  471. package/lib/transform/sort.js.map +1 -1
  472. package/lib/transform/stackEnter.js.map +1 -1
  473. package/lib/transform/stackY.js +2 -2
  474. package/lib/transform/stackY.js.map +1 -1
  475. package/lib/transform/symmetryY.js.map +1 -1
  476. package/lib/transform/utils/helper.js +9 -8
  477. package/lib/transform/utils/helper.js.map +1 -1
  478. package/lib/transform/utils/lttb.js +2 -1
  479. package/lib/transform/utils/lttb.js.map +1 -1
  480. package/lib/transform/utils/order.js +5 -4
  481. package/lib/transform/utils/order.js.map +1 -1
  482. package/lib/utils/angle.js +4 -3
  483. package/lib/utils/angle.js.map +1 -1
  484. package/lib/utils/array.js +10 -9
  485. package/lib/utils/array.js.map +1 -1
  486. package/lib/utils/bounds.js +5 -4
  487. package/lib/utils/bounds.js.map +1 -1
  488. package/lib/utils/color.js +2 -1
  489. package/lib/utils/color.js.map +1 -1
  490. package/lib/utils/coordinate.d.ts +1 -0
  491. package/lib/utils/coordinate.js +15 -14
  492. package/lib/utils/coordinate.js.map +1 -1
  493. package/lib/utils/createElement.js +2 -1
  494. package/lib/utils/createElement.js.map +1 -1
  495. package/lib/utils/dateFormat.js +2 -1
  496. package/lib/utils/dateFormat.js.map +1 -1
  497. package/lib/utils/expr.js +2 -2
  498. package/lib/utils/expr.js.map +1 -1
  499. package/lib/utils/flow.js +2 -1
  500. package/lib/utils/flow.js.map +1 -1
  501. package/lib/utils/helper.js +42 -25
  502. package/lib/utils/helper.js.map +1 -1
  503. package/lib/utils/lru.js +2 -1
  504. package/lib/utils/lru.js.map +1 -1
  505. package/lib/utils/mark.js +5 -4
  506. package/lib/utils/mark.js.map +1 -1
  507. package/lib/utils/marker.d.ts +1 -1
  508. package/lib/utils/marker.js +4 -4
  509. package/lib/utils/marker.js.map +1 -1
  510. package/lib/utils/number.js +3 -2
  511. package/lib/utils/number.js.map +1 -1
  512. package/lib/utils/scale.d.ts +1 -0
  513. package/lib/utils/scale.js +25 -6
  514. package/lib/utils/scale.js.map +1 -1
  515. package/lib/utils/selection.js +2 -2
  516. package/lib/utils/selection.js.map +1 -1
  517. package/lib/utils/size.js +3 -2
  518. package/lib/utils/size.js.map +1 -1
  519. package/lib/utils/string.js +3 -2
  520. package/lib/utils/string.js.map +1 -1
  521. package/lib/utils/style.js +5 -4
  522. package/lib/utils/style.js.map +1 -1
  523. package/lib/utils/traverse-elements.js +2 -1
  524. package/lib/utils/traverse-elements.js.map +1 -1
  525. package/lib/utils/treeDataTransform.js +2 -1
  526. package/lib/utils/treeDataTransform.js.map +1 -1
  527. package/lib/utils/vector.js +9 -8
  528. package/lib/utils/vector.js.map +1 -1
  529. package/package.json +4 -4
  530. package/src/component/axis.ts +5 -0
  531. package/src/interaction/brushHighlight.ts +5 -0
  532. package/src/interaction/index.ts +1 -0
  533. package/src/interaction/legendFilter.ts +8 -0
  534. package/src/interaction/sliderFilter.ts +7 -2
  535. package/src/interaction/sliderWheel.ts +125 -0
  536. package/src/interaction/tooltip.ts +0 -1
  537. package/src/interaction/utils.ts +23 -0
  538. package/src/lib/core.ts +2 -0
  539. package/src/mark/sankey.ts +3 -0
  540. package/src/runtime/mark.ts +2 -1
  541. package/src/runtime/plot.ts +6 -6
  542. package/src/runtime/render.ts +1 -0
  543. package/src/runtime/types/options.ts +1 -0
  544. package/src/shape/axis-breaks/axis-breaks.ts +83 -46
  545. package/src/utils/helper.ts +19 -1
  546. package/src/utils/scale.ts +21 -0
package/dist/g2.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:o}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,o]]};r.props={};const i=({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]];i.props={};const o=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];o.props={transform:!0};const a=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};a.props={};const s=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},c=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=s(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};c.props={};const l=()=>[["parallel",0,1,0,1]];l.props={};const u=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];u.props={transform:!0};const f=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:o=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};f.props={};const h=({value:t})=>e=>e.map(()=>t);h.props={};const d=({value:t})=>e=>e.map(t);d.props={};const p=({value:t})=>e=>e.map(e=>e[t]);p.props={};const g=({value:t})=>()=>t;g.props={};var v=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t,e){if(!v(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};function y(t){return"function"==typeof t}function b(t){return null==t}function x(t){return Array.isArray(t)}var w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function k(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(w(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var M=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return k(t,function(n,r){y(t)&&"prototype"===r||e.push(r)}),e};var O=function(t){return"object"==typeof t&&null!==t},E={}.toString,S=function(t,e){return E.call(t)==="[object "+e+"]"},_=function(t){if(!O(t)||!S(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function A(t,e){if(!x(t))return null;var n;if(y(e)&&(n=e),_(e)&&(n=function(t){return function(t,e){var n=M(e),r=n.length;if(b(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null}var T=function(t){if(!x(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e};function P(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;r<e;r++)n=Math.max(n,t[r]);return n}var C=function(t){if(x(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},N=function(t,e,n){if(!x(t)&&!_(t))return t;var r=n;return k(t,function(t,n){r=e(r,t,n)}),r};function L(t){return"string"==typeof t}function j(t){if(v(t)){return t[t.length-1]}}var R=function(t,e,n){return t<e?e:t>n?n:t};function I(t){return"number"==typeof t}function D(t,e,n){return void 0===n&&(n=1e-5),t===e||Math.abs(t-e)<n}var B=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=y(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},F=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=y(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},z=function(t,e){return(t%e+e)%e},$=function(t){return b(t)?"":t.toString()},W=function(t){var e=$(t);return e.charAt(0).toLowerCase()+e.substring(1)};var G=function(t){var e=$(t);return e.charAt(0).toUpperCase()+e.substring(1)},H=function(t){return S(t,"Boolean")};function Y(t){return null===t}var q=function(t){return void 0===t};function V(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var U=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=U(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=U(t[i]):e[i]=t[i];return e},X=U;function K(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout(function(){r=null,n||t.apply(i,o)},e),a&&t.apply(i,o)}}var Z=new Map;function Q(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function J(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(Q(e,i)){var o=e[i];null!==o&&_(o)?(_(t[i])||(t[i]={}),n<r?J(t[i],o,n+1,r):t[i]=e[i]):x(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var tt=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)J(t,e[r]);return t},et=function(t,e){if(!v(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},nt=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(L(t)||L(e))return!1;if(v(t)||v(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=nt(t[r],e[r]));r++);return n}if(O(t)||O(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=nt(t[i[r]],e[i[r]]));r++);return n}return!1},rt=nt,it=function(t){return t},ot=function(t,e,n){for(var r=0,i=L(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},at=function(t,e,n){var r=t,i=L(e)?e.split("."):e;return i.forEach(function(t,e){e<i.length-1?(w(r[t])||(r[t]=I(i[e+1])?[]:{}),r=r[t]):r[t]=n}),t},st=Object.prototype.hasOwnProperty,ct=function(t,e){return N(t,function(t,n,r){return e.includes(r)||(t[r]=n),t},{})},lt=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},ut=function(){},ft=function(t){return t};function ht(t){return b(t)?0:v(t)?t.length:Object.keys(t).length}var dt=1e-6,pt="undefined"!=typeof Float32Array?Float32Array:Array;function gt(){var t=new pt(9);return pt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}var vt=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*l,t[1]=h*i+d*s+p*u,t[2]=h*o+d*c+p*f,t[3]=g*r+v*a+m*l,t[4]=g*i+v*s+m*u,t[5]=g*o+v*c+m*f,t[6]=y*r+b*a+x*l,t[7]=y*i+b*s+x*u,t[8]=y*o+b*c+x*f,t};function mt(){var t=new pt(16);return pt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function yt(t){var e=new pt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function bt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function xt(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var v=new pt(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=c,v[9]=l,v[10]=u,v[11]=f,v[12]=h,v[13]=d,v[14]=p,v[15]=g,v}function wt(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=v,t}function kt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Mt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Ot(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,k=r*l-o*s,M=i*l-o*c,O=u*g-f*p,E=u*v-h*p,S=u*m-d*p,_=f*v-h*g,A=f*m-d*g,T=h*m-d*v,P=y*T-b*A+x*_+w*S-k*E+M*O;return P?(P=1/P,t[0]=(s*T-c*A+l*_)*P,t[1]=(i*A-r*T-o*_)*P,t[2]=(g*M-v*k+m*w)*P,t[3]=(h*k-f*M-d*w)*P,t[4]=(c*S-a*T-l*E)*P,t[5]=(n*T-i*S+o*E)*P,t[6]=(v*x-p*M-m*b)*P,t[7]=(u*M-h*x+d*b)*P,t[8]=(a*A-s*S+l*O)*P,t[9]=(r*S-n*A-o*O)*P,t[10]=(p*k-g*x+m*y)*P,t[11]=(f*x-u*k-d*y)*P,t[12]=(s*E-a*_-c*O)*P,t[13]=(n*_-r*E+i*O)*P,t[14]=(g*b-p*w-v*y)*P,t[15]=(u*w-f*b+h*y)*P,t):null}function Et(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],v=e*a-n*o,m=e*s-r*o,y=n*s-r*a,b=l*p-u*d,x=l*g-f*d,w=u*g-f*p;return c*(e*w-n*x+r*b)-i*(o*w-a*x+s*b)+t[15]*(l*y-u*m+f*v)-h*(d*y-p*m+g*v)}function St(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],w=n[2],k=n[3];return t[0]=b*r+x*s+w*f+k*g,t[1]=b*i+x*c+w*h+k*v,t[2]=b*o+x*l+w*d+k*m,t[3]=b*a+x*u+w*p+k*y,b=n[4],x=n[5],w=n[6],k=n[7],t[4]=b*r+x*s+w*f+k*g,t[5]=b*i+x*c+w*h+k*v,t[6]=b*o+x*l+w*d+k*m,t[7]=b*a+x*u+w*p+k*y,b=n[8],x=n[9],w=n[10],k=n[11],t[8]=b*r+x*s+w*f+k*g,t[9]=b*i+x*c+w*h+k*v,t[10]=b*o+x*l+w*d+k*m,t[11]=b*a+x*u+w*p+k*y,b=n[12],x=n[13],w=n[14],k=n[15],t[12]=b*r+x*s+w*f+k*g,t[13]=b*i+x*c+w*h+k*v,t[14]=b*o+x*l+w*d+k*m,t[15]=b*a+x*u+w*p+k*y,t}function _t(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*v+f*m+e[12],t[13]=i*g+c*v+h*m+e[13],t[14]=o*g+l*v+d*m+e[14],t[15]=a*g+u*v+p*m+e[15]),t}function At(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Tt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function Pt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function Ct(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Nt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Lt(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.sqrt(a*a+s*s+c*c);return l<dt?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function jt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Rt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function It(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Dt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=o*l,v=a*s,m=a*c,y=a*l;return t[0]=1-(d+g),t[1]=f+y,t[2]=h-m,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=p+v,t[7]=0,t[8]=h+m,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Bt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Ft(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(o*o+a*a+s*s),t[2]=Math.sqrt(c*c+l*l+u*u),t}function zt(t,e){var n=new pt(3);Ft(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,g=a+u+p,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(h-c)/v,t[2]=(s-l)/v):a>u&&a>p?(v=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+l)/v,t[2]=(h+c)/v):u>p?(v=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/v,t[0]=(s+l)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/v,t[0]=(h+c)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function $t(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,g=a*u,v=a*f,m=s*f,y=c*l,b=c*u,x=c*f,w=r[0],k=r[1],M=r[2],O=i[0],E=i[1],S=i[2],_=(1-(g+m))*w,A=(d+x)*w,T=(p-b)*w,P=(d-x)*k,C=(1-(h+m))*k,N=(v+y)*k,L=(p+b)*M,j=(v-y)*M,R=(1-(h+g))*M;return t[0]=_,t[1]=A,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+O-(_*O+P*E+L*S),t[13]=n[1]+E-(A*O+C*E+j*S),t[14]=n[2]+S-(T*O+N*E+R*S),t[15]=1,t}function Wt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,g=o*a,v=o*s,m=o*c;return t[0]=1-f-p,t[1]=u+m,t[2]=h-v,t[3]=0,t[4]=u-m,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Gt(t,e,n,r,i){var o=1/Math.tan(e/2);if(t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var a=1/(r-i);t[10]=(i+r)*a,t[14]=2*i*r*a}else t[10]=-1,t[14]=-2*r;return t}var Ht=Gt;function Yt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var qt=Yt;function Vt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function Ut(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],v=e[2],m=r[0],y=r[1],b=r[2],x=n[0],w=n[1],k=n[2];return Math.abs(p-x)<dt&&Math.abs(g-w)<dt&&Math.abs(v-k)<dt?kt(t):(u=p-x,f=g-w,h=v-k,i=y*(h*=d=1/Math.sqrt(u*u+f*f+h*h))-b*(f*=d),o=b*(u*=d)-m*h,a=m*f-y*u,(d=Math.sqrt(i*i+o*o+a*a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-u*a,l=u*o-f*i,(d=Math.sqrt(s*s+c*c+l*l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+o*g+a*v),t[13]=-(s*p+c*g+l*v),t[14]=-(u*p+f*g+h*v),t[15]=1,t)}function Xt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Kt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}var Zt=St,Qt=Xt,Jt=Object.freeze({__proto__:null,create:mt,clone:yt,copy:bt,fromValues:xt,set:wt,identity:kt,transpose:Mt,invert:Ot,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,k=r*l-o*s,M=i*l-o*c,O=u*g-f*p,E=u*v-h*p,S=u*m-d*p,_=f*v-h*g,A=f*m-d*g,T=h*m-d*v;return t[0]=s*T-c*A+l*_,t[1]=i*A-r*T-o*_,t[2]=g*M-v*k+m*w,t[3]=h*k-f*M-d*w,t[4]=c*S-a*T-l*E,t[5]=n*T-i*S+o*E,t[6]=v*x-p*M-m*b,t[7]=u*M-h*x+d*b,t[8]=a*A-s*S+l*O,t[9]=r*S-n*A-o*O,t[10]=p*k-g*x+m*y,t[11]=f*x-u*k-d*y,t[12]=s*E-a*_-c*O,t[13]=n*_-r*E+i*O,t[14]=g*b-p*w-v*y,t[15]=u*w-f*b+h*y,t},determinant:Et,multiply:St,translate:_t,scale:At,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,v,m,y,b,x,w,k,M,O,E,S,_,A=r[0],T=r[1],P=r[2],C=Math.sqrt(A*A+T*T+P*P);return C<dt?null:(A*=C=1/C,T*=C,P*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=A*A*a+o,x=T*A*a+P*i,w=P*A*a-T*i,k=A*T*a-P*i,M=T*T*a+o,O=P*T*a+A*i,E=A*P*a+T*i,S=T*P*a-A*i,_=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+h*x+v*w,t[2]=l*b+d*x+m*w,t[3]=u*b+p*x+y*w,t[4]=s*k+f*M+g*O,t[5]=c*k+h*M+v*O,t[6]=l*k+d*M+m*O,t[7]=u*k+p*M+y*O,t[8]=s*E+f*S+g*_,t[9]=c*E+h*S+v*_,t[10]=l*E+d*S+m*_,t[11]=u*E+p*S+y*_,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Tt,rotateY:Pt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:Ct,fromScaling:Nt,fromRotation:Lt,fromXRotation:jt,fromYRotation:Rt,fromZRotation:It,fromRotationTranslation:Dt,fromQuat2:function(t,e){var n=new pt(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),Dt(t,e,n),t},getTranslation:Bt,getScaling:Ft,getRotation:zt,decompose:function(t,e,n,r){e[0]=r[12],e[1]=r[13],e[2]=r[14];var i=r[0],o=r[1],a=r[2],s=r[4],c=r[5],l=r[6],u=r[8],f=r[9],h=r[10];n[0]=Math.sqrt(i*i+o*o+a*a),n[1]=Math.sqrt(s*s+c*c+l*l),n[2]=Math.sqrt(u*u+f*f+h*h);var d=1/n[0],p=1/n[1],g=1/n[2],v=i*d,m=o*p,y=a*g,b=s*d,x=c*p,w=l*g,k=u*d,M=f*p,O=h*g,E=v+x+O,S=0;return E>0?(S=2*Math.sqrt(E+1),t[3]=.25*S,t[0]=(w-M)/S,t[1]=(k-y)/S,t[2]=(m-b)/S):v>x&&v>O?(S=2*Math.sqrt(1+v-x-O),t[3]=(w-M)/S,t[0]=.25*S,t[1]=(m+b)/S,t[2]=(k+y)/S):x>O?(S=2*Math.sqrt(1+x-v-O),t[3]=(k-y)/S,t[0]=(m+b)/S,t[1]=.25*S,t[2]=(w+M)/S):(S=2*Math.sqrt(1+O-v-x),t[3]=(m-b)/S,t[0]=(k+y)/S,t[1]=(w+M)/S,t[2]=.25*S),t},fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,v=a*u,m=s*c,y=s*l,b=s*u,x=r[0],w=r[1],k=r[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+v))*w,t[6]=(g+m)*w,t[7]=0,t[8]=(d+y)*k,t[9]=(g-m)*k,t[10]=(1-(f+p))*k,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:$t,fromQuat:Wt,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Gt,perspective:Ht,perspectiveZO:function(t,e,n,r,i){var o=1/Math.tan(e/2);if(t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var a=1/(r-i);t[10]=i*a,t[14]=i*r*a}else t[10]=-1,t[14]=-r;return t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Yt,ortho:qt,orthoZO:Vt,lookAt:Ut,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],h=a-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,v=s*f-c*u;return(d=p*p+g*g+v*v)>0&&(p*=d=1/Math.sqrt(d),g*=d,v*=d),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=f*v-h*g,t[5]=h*p-u*v,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Xt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:Kt,equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],v=t[14],m=t[15],y=e[0],b=e[1],x=e[2],w=e[3],k=e[4],M=e[5],O=e[6],E=e[7],S=e[8],_=e[9],A=e[10],T=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-y)<=dt*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-b)<=dt*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=dt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=dt*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-k)<=dt*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(s-M)<=dt*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(c-O)<=dt*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=dt*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-S)<=dt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-_)<=dt*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(h-A)<=dt*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-T)<=dt*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-P)<=dt*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=dt*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-N)<=dt*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(m-L)<=dt*Math.max(1,Math.abs(m),Math.abs(L))},mul:Zt,sub:Qt});function te(){var t=new pt(3);return pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ee(t){var e=new pt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ne(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function re(t,e,n){var r=new pt(3);return r[0]=t,r[1]=e,r[2]=n,r}function ie(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function oe(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ae(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function se(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ce(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function le(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ue(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fe(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function he(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function de(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function pe(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function ge(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=dt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=dt*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=dt*Math.max(1,Math.abs(i),Math.abs(s))}var ve=se,me=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},ye=ne;function be(){var t=new pt(4);return pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function xe(t,e,n,r){var i=new pt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function we(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function ke(){var t=new pt(4);return pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Me(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Oe(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function Ee(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Se(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",o=Math.PI/360;e*=o,r*=o,n*=o;var a=Math.sin(e),s=Math.cos(e),c=Math.sin(n),l=Math.cos(n),u=Math.sin(r),f=Math.cos(r);switch(i){case"xyz":t[0]=a*l*f+s*c*u,t[1]=s*c*f-a*l*u,t[2]=s*l*u+a*c*f,t[3]=s*l*f-a*c*u;break;case"xzy":t[0]=a*l*f-s*c*u,t[1]=s*c*f-a*l*u,t[2]=s*l*u+a*c*f,t[3]=s*l*f+a*c*u;break;case"yxz":t[0]=a*l*f+s*c*u,t[1]=s*c*f-a*l*u,t[2]=s*l*u-a*c*f,t[3]=s*l*f+a*c*u;break;case"yzx":t[0]=a*l*f+s*c*u,t[1]=s*c*f+a*l*u,t[2]=s*l*u-a*c*f,t[3]=s*l*f-a*c*u;break;case"zxy":t[0]=a*l*f-s*c*u,t[1]=s*c*f+a*l*u,t[2]=s*l*u+a*c*f,t[3]=s*l*f-a*c*u;break;case"zyx":t[0]=a*l*f-s*c*u,t[1]=s*c*f+a*l*u,t[2]=s*l*u-a*c*f,t[3]=s*l*f+a*c*u;break;default:throw new Error("Unknown angle order "+i)}return t}te(),function(){var t=be()}();var _e=xe,Ae=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Te=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Pe=Oe,Ce=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};function Ne(){var t=new pt(2);return pt!=Float32Array&&(t[0]=0,t[1]=0),t}te(),re(1,0,0),re(0,1,0),ke(),ke(),gt(),function(){var t=Ne()}();var Le=function(t,e){return Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Le(t,e)};function je(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Le(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Re=function(){return Re=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Re.apply(this,arguments)};function Ie(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function De(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function Be(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())})}function Fe(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ze(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function $e(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function We(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var Ge={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function He(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ye={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qe(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return Ye[e]===t.length-1&&"achlmqstvz".includes(e)})}function Ve(t){return qe(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function Ue(t){return Ve(t)&&t.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function Xe(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Ye[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Ye[n]))),Ye[n]););}function Ke(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function Ze(t){return t>=48&&t<=57||43===t||45===t||46===t}function Qe(t){return t>=48&&t<=57}function Je(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index ".concat(o,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),Qe(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Qe(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;o<n&&Qe(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Qe(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid float exponent'));if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&Qe(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid integer exponent'));for(;o<n&&Qe(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" is not a number')}function tn(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function en(t){for(var e=t.pathValue,n=t.max;t.index<n&&tn(e.charCodeAt(t.index));)t.index+=1}function nn(t){return 97==(32|t)}function rn(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Ye[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,en(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(!nn(i)||3!==a&&4!==a?Je(t):Ke(t),t.err.length)return;t.data.push(t.param),en(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,en(t))}if(t.index>=t.max)break;if(!Ze(n.charCodeAt(t.index)))break}Xe(t)}else Xe(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var on=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function an(t){if(Ve(t))return[].concat(t);var e=function(t){if(qe(t))return[].concat(t);var e=new on(t);for(en(e);e.index<e.max&&!e.err.length;)rn(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map(function(t){var e,a=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map(function(t,e){return t+(e%2?r:n)});e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e})}function sn(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function cn(t){if(Ue(t))return[].concat(t);for(var e=an(t),n=Re({},Ge),r=0;r<e.length;r+=1){e[r]=sn(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function ln(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function un(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,v=e,m=n,y=r,b=s,x=c,w=120*Math.PI/180,k=Math.PI/180*(+i||0),M=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=ln(g,v,-k)).x,v=u.y;var O=(g-(b=(u=ln(b,x,-k)).x))/2,E=(v-(x=u.y))/2,S=O*O/(m*m)+E*E/(y*y);S>1&&(m*=S=Math.sqrt(S),y*=S);var _=m*m,A=y*y,T=(o===a?-1:1)*Math.sqrt(Math.abs((_*A-_*E*E-A*O*O)/(_*E*E+A*O*O)));d=T*m*E/y+(g+b)/2,p=T*-y*O/m+(v+x)/2,f=Math.asin(((v-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),h=Math.asin(((x-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),a&&f>h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var C=h,N=b,L=x;h=f+w*(a&&h>f?1:-1),M=un(b=d+m*Math.cos(h),x=p+y*Math.sin(h),m,y,i,0,a,N,L,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*m*B,z=4/3*y*B,$=[g,v],W=[g+F*R,v-z*j],G=[b+F*D,x-z*I],H=[b,x];if(W[0]=2*$[0]-W[0],W[1]=2*$[1]-W[1],l)return W.concat(G,H,M);for(var Y=[],q=0,V=(M=W.concat(G,H,M)).length;q<V;q+=1)Y[q]=q%2?ln(M[q-1],M[q],k).y:ln(M[q],M[q+1],k).x;return Y}function fn(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var hn=function(t,e,n,r){return $e($e([],fn([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function dn(t,e){var n,r=t[0],i=t.slice(1).map(Number),o=i[0],a=i[1],s=e.x1,c=e.y1,l=e.x,u=e.y;switch("TQ".includes(r)||(e.qx=null,e.qy=null),r){case"M":return e.x=o,e.y=a,t;case"A":return n=[s,c].concat(i),["C"].concat(un(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=o,e.qy=a,n=[s,c].concat(i),["C"].concat(function(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}(n[0],n[1],n[2],n[3],n[4],n[5]));case"L":return["C"].concat(hn(s,c,o,a));case"Z":return s===l&&c===u?["C",s,c,l,u,l,u]:["C"].concat(hn(s,c,l,u))}return t}function pn(t,e){if(void 0===e&&(e=!1),function(t){return Ue(t)&&t.every(function(t){var e=t[0];return"MC".includes(e)})}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=cn(t),a=Re({},Ge),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=dn(o[f],a);o[f]=h,He(o,s,f),l=o.length,"Z"===c&&u.push(f),i=(r=o[f]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function gn(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function vn(t,e,n,r,i){var o=gn([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=fn([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function mn(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function yn(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),v=u(r),m=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===v)return vn(t,e,s,c,l).point;var y=(t-s)/2,b=(e-c)/2,x={x:h(m)*y+f(m)*b,y:-f(m)*y+h(m)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(v,2);w>1&&(g*=d(w),v*=d(w));var k=(Math.pow(g,2)*Math.pow(v,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2)),M=(o!==a?1:-1)*d(k=k<0?0:k),O=M*(g*x.y/v),E=M*(-v*x.x/g),S=h(m)*O-f(m)*E+(t+s)/2,_=f(m)*O+h(m)*E+(e+c)/2,A={x:(x.x-O)/g,y:(x.y-E)/v},T=mn({x:1,y:0},A),P=mn(A,{x:(-x.x-O)/g,y:(-x.y-E)/v});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,N=g*h(C),L=v*f(C);return{x:h(m)*N-f(m)*L+S,y:f(m)*N+h(m)*L+_}}function bn(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,v=u.sampleSize,m=void 0===v?30:v,y="number"==typeof l,b=t,x=e,w=0,k=[b,x,w],M=[b,x],O={x:0,y:0},E=[{x:b,y:x}];y&&l<=0&&(O={x:b,y:x});for(var S=0;S<=m;S+=1){if(b=(f=yn(t,e,n,r,i,o,a,s,c,S/m)).x,x=f.y,d&&E.push({x:b,y:x}),g&&(w+=gn(M,[b,x])),M=[b,x],y&&w>=l&&l>k[2]){var _=(w-l)/(w-k[2]);O={x:M[0]*(1-_)+k[0]*_,y:M[1]*(1-_)+k[1]*_}}k=[b,x,w]}return y&&l>=w&&(O={x:s,y:c}),{length:w,point:O,min:{x:Math.min.apply(null,E.map(function(t){return t.x})),y:Math.min.apply(null,E.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function xn(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function wn(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,v=void 0===g?10:g,m="number"==typeof c,y=t,b=e,x=0,w=[y,b,x],k=[y,b],M={x:0,y:0},O=[{x:y,y:b}];m&&c<=0&&(M={x:y,y:b});for(var E=0;E<=v;E+=1){if(y=(u=xn(t,e,n,r,i,o,a,s,E/v)).x,b=u.y,h&&O.push({x:y,y:b}),p&&(x+=gn(k,[y,b])),k=[y,b],m&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);M={x:k[0]*(1-S)+w[0]*S,y:k[1]*(1-S)+w[1]*S}}w=[y,b,x]}return m&&c>=x&&(M={x:a,y:s}),{length:x,point:M,min:{x:Math.min.apply(null,O.map(function(t){return t.x})),y:Math.min.apply(null,O.map(function(t){return t.y}))},max:{x:Math.max.apply(null,O.map(function(t){return t.x})),y:Math.max.apply(null,O.map(function(t){return t.y}))}}}function kn(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Mn(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,v=t,m=e,y=0,b=[v,m,y],x=[v,m],w={x:0,y:0},k=[{x:v,y:m}];g&&a<=0&&(w={x:v,y:m});for(var M=0;M<=p;M+=1){if(v=(c=kn(t,e,n,r,i,o,M/p)).x,m=c.y,u&&k.push({x:v,y:m}),h&&(y+=gn(x,[v,m])),x=[v,m],g&&y>=a&&a>b[2]){var O=(y-a)/(y-b[2]);w={x:x[0]*(1-O)+b[0]*O,y:x[1]*(1-O)+b[1]*O}}b=[v,m,y]}return g&&a>=y&&(w={x:i,y:o}),{length:y,point:w,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,k.map(function(t){return t.x})),y:Math.max.apply(null,k.map(function(t){return t.y}))}}}function On(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=cn(t),d="number"==typeof e,p=[],g=0,v=0,m=0,y=0,b=[],x=[],w=0,k={x:0,y:0},M=k,O=k,E=k,S=0,_=0,A=h.length;_<A;_+=1)p=(l="M"===(u=(f=h[_])[0]))?p:[g,v].concat(f.slice(1)),l?(M=k={x:m=f[1],y:y=f[2]},w=0,d&&e<.001&&(E=k)):"L"===u?(w=(r=vn(p[0],p[1],p[2],p[3],(e||0)-S)).length,k=r.min,M=r.max,O=r.point):"A"===u?(w=(i=bn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,k=i.min,M=i.max,O=i.point):"C"===u?(w=(o=wn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,k=o.min,M=o.max,O=o.point):"Q"===u?(w=(a=Mn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,k=a.min,M=a.max,O=a.point):"Z"===u&&(w=(s=vn((p=[g,v,m,y])[0],p[1],p[2],p[3],(e||0)-S)).length,k=s.min,M=s.max,O=s.point),d&&S<e&&S+w>=e&&(E=O),x.push(M),b.push(k),S+=w,g=(c="Z"!==u?f.slice(-2):[m,y])[0],v=c[1];return d&&e>=S&&(E={x:g,y:v}),{length:S,point:E,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,x.map(function(t){return t.x})),y:Math.max.apply(null,x.map(function(t){return t.y}))}}}function En(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map(function(r,i){return t.map(function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])})})}(t);return o.forEach(function(o,a){t.slice(1).forEach(function(r,o){i+=gn(t[(a+o)%n].slice(-2),e[o%n].slice(-2))}),r[a]=i,i=0}),o[r.indexOf(Math.min.apply(null,r))]}function Sn(t){return function(t){var e=0,n=0,r=0;return pn(t).map(function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r}).reduce(function(t,e){return t+e},0)}(t)>=0}function _n(t){return t.map(function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?wn(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=fn(n,r,e),s=fn(r,i,e),c=fn(i,o,e),l=fn(a,s,e),u=fn(s,c,e),f=fn(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}})}function An(t,e,n,r){if(void 0===r&&(r=0),r>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var i=_n(t),o=_n(e),a=i.length,s=o.length,c=i.filter(function(t){return t.l}).length,l=o.filter(function(t){return t.l}).length,u=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/c||0,f=o.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,h=n||Math.max(a,s),d=[u,f],p=[h-a,h-s],g=0,v=[i,o].map(function(t,e){return t.l===h?t.map(function(t){return t.s}):t.map(function(t,n){return g=n&&p[e]&&t.l>=d[e],p[e]-=g?1:0,g?t.ss:[t.s]}).flat()});return v[0].length===v[1].length?v:An(v[0],v[1],h,r+1)}function Tn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function Pn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function Cn(t,e){const n=Pn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function Nn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function Ln(t,e){const n=Pn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function jn(t,e){const n=[];for(const r of t)n[r]=e;return n}function Rn(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function In(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=Rn(t,n);if(null!==e)return[e,r]}}return[null,null]}function Dn(t){return!(t instanceof Date)&&"object"==typeof t}const Bn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{y1:Cn(jn(t,0))}})]};function Fn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $n(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=Fn,n=(e,n)=>Fn(t(e),n),r=(e,n)=>t(e)-n):(e=t===Fn||t===zn?t:Wn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function Wn(){return 0}function Gn(t){return null===t?NaN:+t}Bn.props={};const Hn=$n(Fn),Yn=Hn.right,qn=Hn.left,Vn=$n(Gn).center;var Un=Yn;function Xn(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function Kn(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function Zn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Qn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}class Jn extends Map{constructor(t,e=er){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(tr(this,t))}has(t){return super.has(tr(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function tr({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function er(t){return null!==t&&"object"==typeof t?t.valueOf():t}function nr(t){return t}function rr(t,...e){return sr(t,nr,nr,e)}function ir(t,...e){return sr(t,Array.from,nr,e)}function or(t,e,...n){return sr(t,nr,e,n)}function ar(t,e,...n){return sr(t,Array.from,e,n)}function sr(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Jn,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function cr(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,(t,e)=>e);return e.length>1?(e=e.map(e=>t.map(e)),r.sort((t,n)=>{for(const r of e){const e=ur(r[t],r[n]);if(e)return e}})):(n=t.map(n),r.sort((t,e)=>ur(n[t],n[e]))),function(t,e){return Array.from(e,e=>t[e])}(t,r)}return t.sort(lr(n))}function lr(t=Fn){if(t===Fn)return ur;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function ur(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var fr=Array.prototype.slice;function hr(t){return()=>t}const dr=Math.sqrt(50),pr=Math.sqrt(10),gr=Math.sqrt(2);function vr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=dr?10:o>=pr?5:o>=gr?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?vr(t,e,2*n):[s,c,l]}function mr(t,e,n){return vr(t=+t,e=+e,n=+n)[2]}function yr(t){return Math.max(1,Math.ceil(Math.log(Xn(t))/Math.LN2)+1)}function br(){var t=nr,e=Zn,n=yr;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===Zn&&([u,f]=function(t,e,n){let r;for(;;){const i=mr(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,o,a]=r?vr(e,t,n):vr(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),h[0]<=u&&(a=mr(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===Zn){const t=mr(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var v,m=new Array(d+1);for(i=0;i<=d;++i)(v=m[i]=[]).x0=i>0?h[i-1]:u,v.x1=i<d?h[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&m[Math.min(d,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);m[Math.min(d,t+(h[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&m[Un(h,o,0,d)].push(r[i]);return m}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:hr(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:hr([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:hr(Array.isArray(t)?fr.call(t):t),r):n},r}function xr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function wr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function kr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Mr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Or(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?ur:lr(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);Or(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(Er(t,n,e),i(t[r],o)>0&&Er(t,n,r);a<s;){for(Er(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?Er(t,n,s):(++s,Er(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Er(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Sr(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return kr(t);if(e>=1)return xr(t);var r,i=(r-1)*e,o=Math.floor(i),a=xr(Or(t,o).subarray(0,o+1));return a+(kr(t.subarray(o+1))-a)*(i-o)}}function _r(t,e,n=Gn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(e,r)=>Gn(n(t[r],r,t))),e<=0)return Mr(r);if(e>=1)return wr(r);var r,i=Uint32Array.from(t,(t,e)=>e),o=r.length-1,a=Math.floor(o*e);return Or(i,a,0,o,(t,e)=>ur(r[t],r[e])),a=function(t,e=Fn){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?Fn(t,i)>0:0===Fn(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),t=>r[t]),a>=0?a:-1}}function Ar(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Tr(t,e){return Sr(t,.5,e)}function Pr(t,e){return _r(t,.5,e)}function Cr(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Nr(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Lr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function jr(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function Rr(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Ir(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}const Dr=Math.sqrt(50),Br=Math.sqrt(10),Fr=Math.sqrt(2);function zr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=Dr?10:o>=Br?5:o>=Fr?2:1)*10**i:-(10**-i)/(o>=Dr?10:o>=Br?5:o>=Fr?2:1)}function $r(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=Dr?i*=10:o>=Br?i*=5:o>=Fr&&(i*=2),e<t?-i:i}const Wr=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=zr(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=zr(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=zr(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},Gr=1e3,Hr=6e4,Yr=36e5,qr=864e5,Vr=6048e5,Ur=2592e6,Xr=31536e6;function Kr(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e===0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);l<e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const Zr=Kr(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Qr=Kr(Gr,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Gr*e)},t=>t.getSeconds()),Jr=Kr(Hr,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Hr*e)},t=>t.getMinutes()),ti=Kr(Yr,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Yr*e)},t=>t.getHours()),ei=Kr(qr,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qr*e)},t=>t.getDate()-1),ni=Kr(Ur,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth()),ri=Kr(Vr,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setDate(t.getDate()+7*e)},t=>{const e=ni.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Vr)}),ii=Kr(Xr,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear()),oi={millisecond:Zr,second:Qr,minute:Jr,hour:ti,day:ei,week:ri,month:ni,year:ii},ai=Kr(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),si=Kr(Gr,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Gr*e)},t=>t.getUTCSeconds()),ci=Kr(Hr,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Hr*e)},t=>t.getUTCMinutes()),li=Kr(Yr,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Yr*e)},t=>t.getUTCHours()),ui=Kr(qr,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qr*e)},t=>t.getUTCDate()-1),fi=Kr(Ur,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth()),hi=Kr(Vr,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Vr*e)},t=>{const e=fi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Vr)}),di=Kr(Xr,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear()),pi={millisecond:ai,second:si,minute:ci,hour:li,day:ui,week:hi,month:fi,year:di};function gi(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?pi:oi,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,h=r||(a-o)/f,d=s.length,p=Ir(s,h,0,d,u);let g;if(p===d){g=[c,$r(o/c.duration,a/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max($r(o,a,f),1)]}return g}const vi=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=gi(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};function mi(t){return!q(t)&&!Y(t)&&!Number.isNaN(t)}const yi=t=>e=>-t(-e),bi=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?yi(r):r},xi=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?yi(n):n},wi=(t,e,n,r)=>{const i=t<0,o=bi(r,i),a=xi(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};var ki={exports:{}},Mi={exports:{}},Oi=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},Ei=Array.prototype.concat,Si=Array.prototype.slice,_i=Mi.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];Oi(i)?e=Ei.call(e,Si.call(i)):e.push(i)}return e};_i.wrap=function(t){return function(){return t(_i(arguments))}};var Ai={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ti=Mi.exports,Pi=Object.hasOwnProperty,Ci=Object.create(null);for(var Ni in Ai)Pi.call(Ai,Ni)&&(Ci[Ai[Ni]]=Ni);var Li=ki.exports={to:{},get:{}};function ji(t,e,n){return Math.min(Math.max(e,t),n)}function Ri(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}Li.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Li.get.hsl(t),n="hsl";break;case"hwb":e=Li.get.hwb(t),n="hwb";break;default:e=Li.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Li.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Pi.call(Ai,e[1])?((i=Ai[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=ji(i[n],0,255);return i[3]=ji(i[3],0,1),i},Li.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ji(parseFloat(e[2]),0,100),ji(parseFloat(e[3]),0,100),ji(isNaN(n)?1:n,0,1)]}return null},Li.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ji(parseFloat(e[2]),0,100),ji(parseFloat(e[3]),0,100),ji(isNaN(n)?1:n,0,1)]}return null},Li.to.hex=function(){var t=Ti(arguments);return"#"+Ri(t[0])+Ri(t[1])+Ri(t[2])+(t[3]<1?Ri(Math.round(255*t[3])):"")},Li.to.rgb=function(){var t=Ti(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Li.to.rgb.percent=function(){var t=Ti(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},Li.to.hsl=function(){var t=Ti(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Li.to.hwb=function(){var t=Ti(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Li.to.keyword=function(t){return Ci[t.slice(0,3)]};var Ii=ki.exports;function Di(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Bi(t){const e=Ii.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*Di(a,o,e+1/3),255*Di(a,o,e),255*Di(a,o,e-1/3),i]}(r):null}const Fi=(t,e)=>n=>t*(1-n)+e*n,zi=(t,e)=>"number"==typeof t&&"number"==typeof e?Fi(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Bi(t),r=Bi(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,$i=(t,e)=>{const n=Fi(t,e);return t=>Math.round(n(t))};function Wi({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Gi(t){return"object"==typeof t?t.valueOf():t}class Hi extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Gi,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Wi({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Wi({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Yi{transformBreaks(t){return t}constructor(t){var e;this.options=tt({},this.getDefaultOptions()),this.update((null===(e=null==t?void 0:t.breaks)||void 0===e?void 0:e.length)?this.transformBreaks(t):t)}getOptions(){return this.options}update(t={}){const e=t.breaks?this.transformBreaks(t):t;this.options=tt({},this.options,e),this.rescale(e)}rescale(t){}}const qi=Symbol("defaultUnknown");function Vi(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Ui(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==qi)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Xi(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Ki extends Yi{getDefaultOptions(){return{domain:[],range:[],unknown:qi}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Vi(this.domainIndexMap,this.getDomain(),this.domainKey),Ui({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Vi(this.rangeIndexMap,this.getRange(),this.rangeKey),Ui({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Xi(e),this.rangeKey=Xi(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Ki(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Zi(t){return Math.round(1e12*t)/1e12}function Qi(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,v=function(t){const e=t.reduce((t,e)=>Math.min(t,e),1/0);return e===1/0?[]:t.map(t=>t/e)}(l),m=v.reduce((t,e)=>t+e),y=g/m,b=new Hi(e.map((t,e)=>{const n=v[e]*y;return[t,a?Math.floor(n):n]})),x=new Hi(e.map((t,e)=>{const n=v[e]*y+p;return[t,a?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(h-(w-w/c*i))*s;let M=a?Math.round(k):k;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=Zi(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Ji extends Ki{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:qi,flex:[]}}constructor(t){super(t)}clone(){return new Ji(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Qi(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*l);return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const to=(t,e,n,r)=>{let i,o,a=t,s=e;if(a===s&&n>0)return[a];let c=zr(a,s,n);if(0===c||!Number.isFinite(c))return[];if(c>0){a=Math.ceil(a/c),s=Math.floor(s/c),o=new Array(i=Math.ceil(s-a+1));for(let t=0;t<i;t+=1)o[t]=(a+t)*c}else{c=-c,a=Math.ceil(a*c),s=Math.floor(s*c),o=new Array(i=Math.ceil(s-a+1));for(let t=0;t<i;t+=1)o[t]=(a+t)/c}return((t,e)=>{if(!(null==e?void 0:e.length))return t;const n=[...t,...e.flatMap(t=>[t.start,t.end])],r=Array.from(new Set(n)).sort((t,e)=>t-e),i=r.filter(t=>!e.some(({start:e,end:n})=>t>e&&t<n));return i.length?i:t})(o,r)};class eo extends Yi{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:to}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return I(r)&&I(i)?t(r,i,n):[]}clone(){return new eo(this.options)}}function no(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const ro=[1,5,2,2.5,4,3],io=100*Number.EPSILON;function oo(t,e,n,r,i,o){const a=ht(e),s=et(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<io||o-l<io)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function ao(t,e,n){const r=ht(e);return 1-et(e,t)/(r-1)-n+1}function so(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function co(t,e){return t>=e?2-(t-1)/(e-1):1}function lo(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function uo(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}function fo(){return 1}const ho=(t,e,n=5,r=!0,i=ro,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=ao(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=co(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=uo(t,e,h*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,v=Math.ceil(t/h)*c;if(g<=v){const n=v-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,v=oo(l,i,c,n,d,p),m=lo(t,e,n,d),y=so(f,a,t,e,n,d),b=fo(),x=o[0]*v+o[1]*m+o[2]*y+o[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=no(s.lmax),u=no(s.lmin),f=no(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=no(u);for(let t=1;t<h;t+=1)d[t]=no(d[t-1]+f);return d};class po extends Yi{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:ho}}map(t){return mi(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new po(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return I(r)&&I(i)?n(r,i,e):[]}}const go=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=Rr(r,i),c=n(o,a)):(s=Rr(i,r),c=n(a,o)),jr(c,s)},vo=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Rr(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=Ir(t,e,1,r)-1,a=i[n];return jr(o[n],a)(e)}},mo=(t,e,n,r)=>(Math.min(t.length,e.length)>2?vo:go)(t,e,r?$i:n);class yo extends Yi{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Fi,tickCount:5}}map(t){return mi(t)?this.output(t):this.options.unknown}invert(t){return mi(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Wr}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):ft}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=mo(n.map(t),r,o,i);this.output=jr(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=mo(i,r.map(t),Fi);this.input=jr(e,n,o)}}class bo extends yo{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:zi,tickMethod:to,tickCount:5}}transformDomain(t){const{domain:e,range:n=[1,0],breaks:r=[],tickCount:i=5}=t,[o,a]=[Math.min(...e),Math.max(...e)],s=r.filter(({end:t})=>t<a).sort((t,e)=>t.start-e.start),c=to(o,a,i,s);j(c)<a&&c.push(a);const[l,u]=[n[0],j(n)],f=a-o,h=Math.abs(u-l),d=l>u,p=c.map(t=>{const e=(t-o)/f;return d?l-e*h:l+e*h});return s.forEach(({start:t,end:e,gap:n=.05})=>{const r=c.indexOf(t),i=c.indexOf(e),o=(p[r]+p[i])/2,a=n*h,s=d?o+a/2:o-a/2,l=d?o-a/2:o+a/2;p[r]=s,p[i]=l}),{breaksDomain:c,breaksRange:p}}transformBreaks(t){const{domain:e,breaks:n=[]}=t;if(!x(t.breaks))return t;const r=Math.max(...e),i=n.filter(({end:t})=>t<r),o={...t,breaks:i},{breaksDomain:a,breaksRange:s}=this.transformDomain(o);return{...t,domain:a,range:s,breaks:i,tickMethod:()=>[...a]}}chooseTransforms(){return[ft,ft]}clone(){return new bo(this.options)}}class xo extends Ji{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:qi,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new xo(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const wo=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ko extends yo{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:zi,tickMethod:to,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[ft,ft];const e=.5===t?wo:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new ko(this.options)}}class Mo extends ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:zi,tickMethod:to,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Mo(this.options)}}class Oo extends Yi{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!mi(t))return this.options.unknown;const e=Ir(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new Oo(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const Eo=(t,e,n,r=10)=>{const i=t<0,o=xi(r,i),a=bi(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=to(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=to(u,f,t).map(o)}return s?h.reverse():h};class So extends yo{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:zi,tickMethod:Eo,tickCount:5}}chooseNice(){return wi}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[bi(t,n),xi(t,n)]}clone(){return new So(this.options)}}class _o extends Oo{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:ho}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Wr(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new _o(this.options)}}function Ao(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class To extends Oo{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:ho}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort((t,e)=>t-e);const i=[];for(let t=1;t<e;t+=1)i.push(Ao(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new To(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Po=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Co=/\[([^]*?)\]/gm;function No(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Lo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var jo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ro=["January","February","March","April","May","June","July","August","September","October","November","December"],Io=No(Ro,3),Do=Lo({},{dayNamesShort:No(jo,3),dayNames:jo,monthNamesShort:Io,monthNames:Ro,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),Bo=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Fo={D:function(t){return String(t.getDate())},DD:function(t){return Bo(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Bo(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Bo(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Bo(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Bo(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Bo(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Bo(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Bo(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Bo(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Bo(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Bo(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Bo(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Bo(Math.floor(Math.abs(e)/60),2)+":"+Bo(Math.abs(e)%60,2)}},zo={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const $o=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=gi(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Wo(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Go extends yo{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:$o,interpolate:Fi,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return vi}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?pi:oi,r=e?Wo:ft;return e=>function(t,e,n){if(void 0===e&&(e=zo.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=zo[e]||e).replace(Co,function(t,e){return r.push(e),"@@@"});var i=Lo(Lo({},Do),n);return(e=e.replace(Po,function(e){return Fo[e](t,i)})).replace(/@@@/g,function(){return r.shift()})}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new Go(this.options)}}var Ho,Yo=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let qo=Ho=class extends bo{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:ft,tickMethod:to,tickCount:5}}constructor(t){super(t)}clone(){return new Ho(this.options)}};function Vo(t){var e;let n=t;for(;n;){if("view"===(null===(e=n.attributes)||void 0===e?void 0:e.class))return n;n=n.parentNode}return null}function Uo(t){const{markType:e,nodeName:n}=t;return"heatmap"===e&&"image"===n}function Xo(t,e){const n=null!=e?e:Vo(t).__data__,r=t.__data__,{markKey:i,index:o,seriesIndex:a,normalized:s={x:0}}=r,{markState:c}=n,l=Array.from(c.keys()).find(t=>t.key===i);if(l)return a?a.map(t=>l.data[t]):Uo(t)?l.data[Math.round(l.data.length*s.x)]:l.data[o]}function Ko(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof Ji)&&!(t instanceof eo);if(s(r)){return r.clone().invert(a)}if(a&&r instanceof Ji&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}function Zo(t){return t}function Qo(t){return t.reduce((t,e)=>(n,...r)=>e(t(n,...r),...r),Zo)}function Jo(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function ta(t=""){throw new Error(t)}function ea(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||t.attr(e,i)}function na(t){return null!=t&&!Number.isNaN(t)}function ra(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function ia(t,e){return oa(t,e)||{}}function oa(t,e){const n=Object.entries(t||{}).filter(([t])=>t.startsWith(e)).map(([t,n])=>[W(t.replace(e,"").trim()),n]).filter(([t])=>!!t);return 0===n.length?null:Object.fromEntries(n)}function aa(t,...e){return Object.fromEntries(Object.entries(t).filter(([t])=>e.every(e=>!t.startsWith(e))))}function sa(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function ca(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function la(t){return null===t||!1===t}function ua(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];_(o)&&_(t[i])?ua(t[i],o,n,r+1):t[i]=o}return t}}function fa(t,e){return Object.entries(t).reduce((n,[r,i])=>(n[r]=e(i,r,t),n),{})}function ha(t){return t.map((t,e)=>e)}function da(t){return t[0]}function pa(t){return t[t.length-1]}function ga(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function va(t,e=t.length){if(1===e)return t.map(t=>[t]);const n=[];for(let r=0;r<t.length;r++){va(t.slice(r+1),e-1).forEach(e=>{n.push([t[r],...e])})}return n}function ma(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map(t=>{var e;return[t,null===(e=Rn(r,t))||void 0===e?void 0:e[0]]}).filter(([,t])=>na(t));return Array.from(rr(e,t=>i.map(([,e])=>e[t]).join("-")).values())}function ya(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce((t,i)=>0!==t?t:Fn(e[n][i],e[r][i]),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Ea(n=>t(e[n]))}(t):"series"===t?wa:"value"===t?ka:"sum"===t?Ma:"maxIndex"===t?Oa:null}function ba(t,e){for(const n of t)n.sort(e)}function xa(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function wa(t,e,n){return Ea(t=>n[t])}function ka(t,e,n){return Ea(t=>e[t])}function Ma(t,e,n){const r=ha(t),i=Array.from(rr(r,t=>n[+t]).entries()),o=new Map(i.map(([t,n])=>[t,n.reduce((t,n)=>t+ +e[n])]));return Ea(t=>o.get(n[t]))}function Oa(t,e,n){const r=ha(t),i=Array.from(rr(r,t=>n[+t]).entries()),o=new Map(i.map(([t,n])=>[t,wr(n,t=>e[t])]));return Ea(t=>o.get(n[t]))}function Ea(t){return(e,n)=>Fn(t(e),t(n))}qo=Ho=Yo([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return I(n)?Math.round(n):n})(i):i;this.output=jr(s,a,n,t)},n.prototype.invert=void 0}}(function(t){return[t(0),t(1)]},t=>{const[e,n]=t;return jr(Fi(0,1),Rr(e,n))})],qo);const Sa=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{var c;const{data:l,encode:u,style:f={}}=s,[h,d]=Rn(u,"y"),[p,g]=Rn(u,"y1"),[v]=a?In(u,"series","color"):Rn(u,"color"),m=ma(e,t,s),y=(null!==(c=ya(n))&&void 0!==c?c:()=>null)(l,h,v);y&&ba(m,y);const b=new Array(t.length),x=new Array(t.length),w=new Array(t.length),k=[],M=[];for(const t of m){r&&t.reverse();const e=p?+p[t[0]]:0,n=[],i=[];for(const r of t){const t=w[r]=+h[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===h[o[s]];)s--;for(;c<a.length-1&&0===h[a[c]];)c++;k.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=w[t];l=b[t]=(x[t]=l)+e}let u=e;for(const t of n){const e=w[t];e>0?u=b[t]=(x[t]=u)+e:b[t]=x[t]=u}}const O=new Set(k),E=new Set(M),S="y"===i?b:x,_="y"===o?b:x;let A;return A="point"===s.type?{y0:Cn(h,d),y:Pn(S,d)}:{y0:Cn(h,d),y:Pn(S,d),y1:Pn(_,g)},[t,tt({},s,{encode:Object.assign({},A),style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},f)})]}};function _a(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Sa.props={};const Aa=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(_a))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Sa({groupBy:c?["x","series"]:"x"})(e,n,r)};function Ta(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Pa(t){const e=`${t.getFullYear()}-${Ta(t.getMonth()+1)}-${Ta(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Ta(n)}:${Ta(r)}:${Ta(i)}`:e}Aa.props={};const Ca=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(la(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter(t=>t.startsWith(e)).filter(t=>!r[t].inferred).map(t=>Rn(r,t)).filter(([t])=>t).map(t=>t[0]);if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map(t=>t[e]instanceof Date?Pa(t[e]):t[e]).join(", ")};return[t,tt({},n,{tooltip:{title:s}})]}};Ca.props={};const Na=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{x:Cn(jn(t,0))},scale:{x:{guide:null}}})]};Na.props={};const La=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{y:Cn(jn(t,0))},scale:{y:{guide:null}}})]};La.props={};const ja=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{z:Cn(jn(t,0))},scale:{z:{guide:null}}})]};ja.props={};const Ra=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{size:Nn(jn(t,3))}})]};Ra.props={};const Ia=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Ie(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map(({value:t})=>t),a=t.map(t=>o.filter(Array.isArray).map(e=>e[t]).join("-"));return[t,tt({},e,{encode:{key:Pn(a)}})]};Ia.props={};const Da=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=Rn(n,"color");return[t,tt({},e,{encode:{series:Pn(o,a)}})]};Da.props={};const Ba=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Dn)?[t,e]:[t,tt({},e,{encode:{y:Pn(n)}})]};Ba.props={};const Fa=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Dn)?[t,e]:[t,tt({},e,{encode:{x:Pn(n)}})]};Fa.props={};const za=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=Rn(n,"y");return[t,tt({},e,{encode:{y1:Pn([...i])}})]};za.props={};const $a=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=Rn(n,"x");return[t,tt({},e,{encode:{x1:Pn([...i])}})]};$a.props={};const Wa=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Dn))){const r=(t,e)=>Array.isArray(t[0])?t.map(t=>t[e]):[t[e]];return[t,tt({},e,{encode:{x:Pn(r(n,0)),x1:Pn(r(n,1))}})]}return[t,e]};Wa.props={};const Ga=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Dn))){const r=(t,e)=>Array.isArray(t[0])?t.map(t=>t[e]):[t[e]];return[t,tt({},e,{encode:{y:Pn(r(n,0)),y1:Pn(r(n,1))}})]}return[t,e]};Ga.props={};const Ha=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(la(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap(t=>Object.keys(r).filter(e=>e.startsWith(t)).map(t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t));return[t,tt({},n,{tooltip:{items:a}})]}};Ha.props={};const Ya=()=>(t,e)=>[t,tt({scale:{x:{padding:0},y:{padding:0}}},e)];Ya.props={};const qa=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Ie(e,["data","style"]),{x:o,y:a}=r,s=Ie(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],tt({},i,{data:[0],cartesian:!0,encode:{x:Pn([o||0]),y:Pn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};qa.props={};const Va=()=>(t,e)=>{const{style:n={}}=e;return[t,tt({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]};Va.props={};const Ua=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(Dn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map(t=>t[0]),o=r.map(t=>t[1]);return[t,tt({},e,{encode:{x:Pn(i),y:Pn(o)}})]};Ua.props={};const Xa=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,tt({},e,{encode:{series:Nn(jn(t,void 0))}})]};Xa.props={};const Ka=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Ie(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=Rn(s,"y"),[f]=In(s,"series","color"),h=xa(f,l),d=tt({},o,{scale:{series:{domain:h,paddingInner:i}}}),p=ma(e,t,o),g=ya(r);if(!g)return[t,tt(d,{encode:{series:Pn(f)}})];const v=g(a,u,f);v&&ba(p,v);const m=new Array(t.length);for(const t of p){n&&t.reverse();for(let e=0;e<t.length;e++)m[t[e]]=h[e]}return[t,tt(d,{encode:{series:Pn(r?m:f)}})]}};Ka.props={};const Za=t=>{const{groupBy:e=["x"],reducer:n=(t,e)=>e[t[0]],orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map(t=>[t,Rn(s,t)[0]]);if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(rr(n,e=>t[e]).values());e.push(...r)}l=e}if(r){const[t]=Rn(s,r);t&&l.sort((e,r)=>n(e,t)-n(r,t)),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[jn(t,u)]:In(s,"enterDuration",jn(t,u)),[h]=In(s,"enterDelay",jn(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=xr(n,t=>+f[t]);for(const t of n)d[t]=+h[t]+e;e+=r}return[t,tt({},a,{encode:{enterDuration:Nn(f),enterDelay:Nn(d)}})]}};Za.props={};const Qa=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=Ie(i,["x"]),s=Object.entries(a).filter(([t])=>t.startsWith("y")).map(([t])=>[t,Rn(i,t)[0]]),[,c]=s.find(([t])=>"y"===t),l=s.map(([e])=>[e,new Array(t.length)]),u=ma(e,t,r),f=function(t){if("function"==typeof t)return t;const e={min:(t,e)=>kr(t,t=>e[+t]),max:(t,e)=>xr(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>Ar(t,t=>e[+t]),median:(t,e)=>Tr(t,t=>e[+t]),sum:(t,e)=>Lr(t,t=>e[+t]),deviation:(t,e)=>Kn(t,t=>e[+t])};return e[t]||xr}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=la(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,tt({},r,Object.assign({encode:Object.fromEntries(l.map(([t,e])=>[t,Pn(e,Rn(i,t)[1])]))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Ja(t,e,n){if(null===t)return[-.5,.5];const r=xa(t,e),i=new Ji({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function ts(t,e,n){return e*(1-t)+n*t}Qa.props={};const es=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=Rn(o,"x"),[u]=Rn(o,"y"),f=Ja(l,s,n),h=Ja(u,c,r),d=t.map(()=>ts(i(),...h)),p=t.map(()=>ts(i(),...f));return[t,tt({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:Pn(d),dx:Pn(p)}})]}};es.props={};const ns=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=Rn(i,"x"),c=Ja(s,a,e),l=t.map(()=>ts(n(),...c));return[t,tt({scale:{x:{padding:.5}}},r,{encode:{dx:Pn(l)}})]}};ns.props={};const rs=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=Rn(i,"y"),c=Ja(s,a,e),l=t.map(()=>ts(n(),...c));return[t,tt({scale:{y:{padding:.5}}},r,{encode:{dy:Pn(l)}})]}};rs.props={};const is=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Ie(r,["x"]),o=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,Rn(r,t)[0]]),a=o.map(([e])=>[e,new Array(t.length)]),s=ma(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap(t=>o.map(([,e])=>+e[t])),[n,r]=Zn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<o.length;n++){const[,r]=o[n],[,i]=a[n];i[t]=+r[t]+e}}return[t,tt({},n,{encode:Object.fromEntries(a.map(([t,e])=>[t,Pn(e,Rn(r,t)[1])]))})]}};is.props={};const os=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,[i]=Rn(r,"y"),[o,a]=Rn(r,"y1"),s=ma(e,t,n),c=new Array(t.length);for(const t of s){const e=t.map(t=>+i[t]);for(let n=0;n<t.length;n++){const r=t[n],o=Math.max(...e.filter((t,e)=>e!==n));c[r]=+i[r]>o?o:i[r]}}return[t,tt({},n,{encode:{y1:Pn(c,a)}})]}};function as(t,e){return[t[0]]}function ss(t,e){return[t[t.length-1]]}function cs(t,e){return[t[wr(t,t=>e[t])]]}function ls(t,e){return[t[Mr(t,t=>e[t])]]}os.props={};const us=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=ma(e,t,i),[s]=Rn(o,n),c=function(t){return"function"==typeof t?t:{first:as,last:ss,max:cs,min:ls}[t]||as}(r);return[a.flatMap(t=>c(t,s)),i]}};us.props={};const fs=(t={})=>{const{selector:e}=t,n=Ie(t,["selector"]);return us(Object.assign({channel:"x",selector:e},n))};fs.props={};const hs=(t={})=>{const{selector:e}=t,n=Ie(t,["selector"]);return us(Object.assign({channel:"y",selector:e},n))};function ds(t){return e=>null===e?t:`${t} of ${e}`}function ps(){return[(t,e)=>Ar(t,t=>+e[t]),ds("mean")]}function gs(){return[(t,e)=>Tr(t,t=>+e[t]),ds("median")]}function vs(){return[(t,e)=>xr(t,t=>+e[t]),ds("max")]}function ms(){return[(t,e)=>kr(t,t=>+e[t]),ds("min")]}function ys(){return[(t,e)=>t.length,ds("count")]}function bs(){return[(t,e)=>Lr(t,t=>+e[t]),ds("sum")]}function xs(){return[(t,e)=>e[t[0]],ds("first")]}function ws(){return[(t,e)=>e[t[t.length-1]],ds("last")]}hs.props={};const ks=(t={})=>{const{groupBy:e}=t,n=Ie(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:ps,max:vs,count:ys,first:xs,last:ws,sum:bs,min:ms,median:gs}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=Rn(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=Rn(o,n);return r})(c,e),u=a.map(t=>n(t,null!=s?s:i));return[t,Object.assign(Object.assign({},Ln(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]}),c=Object.keys(o).map(t=>{const[e,n]=Rn(o,t),r=a.map(t=>e[t[0]]);return[t,Pn(r,n)]}),l=a.map(t=>i[t[0]]);return[ha(a),tt({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};ks.props={};const Ms=(t={})=>{const{channels:e=["x","y"]}=t,n=Ie(t,["channels"]);return ks(Object.assign(Object.assign({},n),{groupBy:(t,n)=>ma(e,t,n)}))};Ms.props={};const Os=(t={})=>Ms(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));Os.props={};const Es=(t={})=>Ms(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));Es.props={};const Ss=(t={})=>Ms(Object.assign(Object.assign({},t),{channels:["color"]}));Ss.props={};const _s=(t={})=>(e,n)=>{const{reverse:r,slice:i,channel:o,by:a,ordinal:s=!0,reducer:c}=t,{encode:l,scale:u={}}=n,f=u[o].domain,[h]=Rn(l,null!=a?a:o),[d]=Rn(l,o),p=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=Rn(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>xr(t,t=>+o[t]);if("min"===i)return t=>kr(t,t=>+o[t]);if("sum"===i)return t=>Lr(t,t=>+o[t]);if("median"===i)return t=>Tr(t,t=>+o[t]);if("mean"===i)return t=>Ar(t,t=>+o[t]);if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(o,{by:a,reducer:c},l),g=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(e,d,f),v=function(t,e,n){return(2!==e.length?cr(or(t,e,n),([t,e],[n,r])=>Fn(e,r)||Fn(t,n)):cr(rr(t,n),([t,n],[r,i])=>e(n,i)||Fn(t,r))).map(([t])=>t)}(g,p,t=>d[t]),m=s?e:cr(e,t=>h[t]);r&&(!s&&m.reverse(),v.reverse());const y="number"==typeof i?[0,i]:i,b=i?v.slice(...y):v;return[m,tt(n,{scale:{[o]:{domain:b}}})]};_s.props={};const As=(t={})=>_s(Object.assign(Object.assign({},t),{channel:"x"}));As.props={};const Ts=(t={})=>_s(Object.assign(Object.assign({},t),{channel:"color"}));Ts.props={};const Ps=(t={})=>_s(Object.assign(Object.assign({},t),{channel:"y"}));Ps.props={};const Cs=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=Rn(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map(t=>t[e]):t.map(e)}(o,e):Rn(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>Lr(t,t=>+e[t]);throw new Error(`Unknown reducer: ${t}`)}(r,c),u=ar(t,l,t=>s[t]).map(t=>t[1]);return[t,tt({},i,{scale:{x:{flex:u}}})]}};function Ns([t,e],[n,r]){return[t-n,e-r]}function Ls([t,e],[n,r]){return[t+n,e+r]}function js([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Rs([t,e]){return Math.atan2(e,t)}function Is([t,e]){return Rs([t,e])+Math.PI/2}function Ds(t,e){const n=Rs(t),r=Rs(e);return n<r?r-n:2*Math.PI-(n-r)}function Bs(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function Fs([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function zs(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const o=t.length;if(0===o)return[];const{innerWidth:a,innerHeight:s}=i,c=s/a;let l=Math.ceil(Math.sqrt(r/c)),u=a/l,f=Math.ceil(r/l),h=f*u;for(;h>s;)l+=1,u=a/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[g,v]=f<=1?[(a-o*u)/(o-1),(s-u)/2]:[0,0];return t.map((t,r)=>{const[i,o,a,s]=Bs(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-h-1)*u+d-o-p*h-v+.5*e}) scale(${(u-e)/a}, ${(u-e)/s})`})}}Cs.props={};const $s=t=>(e,n)=>[e,tt({},n,{modifier:zs(t),axis:!1})];$s.props={};const Ws="thresholds";function Gs(t){const[e,n]=Zn(t);return Math.min(200,function(t,e,n){const r=Xn(t),i=Kn(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const Hs=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Ie(t,["groupChannels","binChannels"]),i={};return ks(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter(([t])=>!t.startsWith(Ws)))),Object.fromEntries(n.flatMap(t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]}))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map(t=>{const[e]=Rn(a,t);return e}),c=ia(r,Ws),l=t.filter(t=>s.every(e=>na(e[t]))),u=[...e.map(t=>{const[e]=Rn(a,t);return e}).filter(na).map(t=>e=>t[e]),...n.map((t,e)=>{const n=s[e],r=c[t]||Gs(n),o=br().thresholds(r).value(t=>+n[t])(l),a=new Map(o.flatMap(t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map(t=>[t,r])}));return i[t]=a,t=>a.get(t)})];return Array.from(rr(l,t=>u.map(e=>e(t)).join("-")).values())}}))};Hs.props={};const Ys=(t={})=>{const{thresholds:e}=t;return Hs(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function qs(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const v=Math.floor((t+1)*c)+1,m=[o(h),a(h)];for(l=u=-1;g<v;g++)u=.5*Math.abs((m[0]-e)*(o(g)-m[1])-(m[0]-a(g))*(n-m[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map(e=>t[e])}Ys.props={};const Vs=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return qs;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Mr(t,t=>n[t])]],max:(t,e,n)=>[t[wr(t,t=>n[t])]],median:(t,e,n)=>[t[Pr(t,t=>n[t])]]},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap(t=>n(t,e,r))}}(e);return(t,e)=>{const{encode:o}=e,a=ma(r,t,e),[s]=Rn(o,"x"),[c]=Rn(o,"y");return[a.flatMap(t=>i(t,s,c,n)),e]}};Vs.props={};const Us=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map(([t,e])=>{const[n]=Rn(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}}).filter(na),a=e.filter(t=>o.every(e=>e(t))),s=a.map((t,e)=>e);if(0===o.length){const t=function(t){var e;const{encode:n}=t,r=Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),{y:Object.assign(Object.assign({},t.encode.y),{value:[]})})}),i=null===(e=null==n?void 0:n.color)||void 0===e?void 0:e.field;if(!n||!i)return r;let o;for(const[t,e]of Object.entries(n))"x"!==t&&"y"!==t||e.field!==i||(o=Object.assign(Object.assign({},o),{[t]:Object.assign(Object.assign({},e),{value:[]})}));return o?Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),o)}):r}(n);return[e,t]}const c=Object.entries(r).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map(t=>e.value[a[t]]).filter(t=>void 0!==t)})]);return[s,tt({},n,{encode:Object.fromEntries(c),data:a.map(t=>i[t])})]};function Xs(t){return function(){return t}}Us.props={};const Ks=Math.abs,Zs=Math.atan2,Qs=Math.cos,Js=Math.max,tc=Math.min,ec=Math.sin,nc=Math.sqrt,rc=1e-12,ic=Math.PI,oc=ic/2,ac=2*ic;function sc(t){return t>=1?oc:t<=-1?-oc:Math.asin(t)}const cc=Math.PI,lc=2*cc,uc=1e-6,fc=lc-uc;function hc(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class dc{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?hc:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return hc;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>uc)if(Math.abs(u*s-c*l)>uc&&i){let h=n-o,d=r-a,p=s*s+c*c,g=h*h+d*d,v=Math.sqrt(p),m=Math.sqrt(f),y=i*Math.tan((cc-Math.acos((p+f-g)/(2*v*m)))/2),b=y/m,x=y/v;Math.abs(b-1)>uc&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>uc||Math.abs(this._y1-l)>uc)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%lc+lc),f>fc?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>uc&&this._append`A${n},${n},0,${+(f>=cc)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function pc(){return new dc}function gc(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new dc(e)}function vc(t){return t.innerRadius}function mc(t){return t.outerRadius}function yc(t){return t.startAngle}function bc(t){return t.endAngle}function xc(t){return t&&t.padAngle}function wc(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/nc(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,v=(h+p)/2,m=(d+g)/2,y=p-h,b=g-d,x=y*y+b*b,w=i-o,k=h*g-p*d,M=(b<0?-1:1)*nc(Js(0,w*w*x-k*k)),O=(k*b-y*M)/x,E=(-k*y-b*M)/x,S=(k*b+y*M)/x,_=(-k*y+b*M)/x,A=O-v,T=E-m,P=S-v,C=_-m;return A*A+T*T>P*P+C*C&&(O=S,E=_),{cx:O,cy:E,x01:-u,y01:-f,x11:O*(i/w-1),y11:E*(i/w-1)}}function kc(){var t=vc,e=mc,n=Xs(0),r=null,i=yc,o=bc,a=xc,s=null,c=gc(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-oc,p=o.apply(this,arguments)-oc,g=Ks(p-d),v=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>rc)if(g>ac-rc)s.moveTo(h*Qs(d),h*ec(d)),s.arc(0,0,h,d,p,!v),f>rc&&(s.moveTo(f*Qs(p),f*ec(p)),s.arc(0,0,f,p,d,v));else{var m,y,b=d,x=p,w=d,k=p,M=g,O=g,E=a.apply(this,arguments)/2,S=E>rc&&(r?+r.apply(this,arguments):nc(f*f+h*h)),_=tc(Ks(h-f)/2,+n.apply(this,arguments)),A=_,T=_;if(S>rc){var P=sc(S/f*ec(E)),C=sc(S/h*ec(E));(M-=2*P)>rc?(w+=P*=v?1:-1,k-=P):(M=0,w=k=(d+p)/2),(O-=2*C)>rc?(b+=C*=v?1:-1,x-=C):(O=0,b=x=(d+p)/2)}var N=h*Qs(b),L=h*ec(b),j=f*Qs(k),R=f*ec(k);if(_>rc){var I,D=h*Qs(x),B=h*ec(x),F=f*Qs(w),z=f*ec(w);if(g<ic)if(I=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<rc))return[t+(h=(u*(e-o)-f*(t-i))/h)*c,e+h*l]}(N,L,F,z,D,B,j,R)){var $=N-I[0],W=L-I[1],G=D-I[0],H=B-I[1],Y=1/ec(function(t){return t>1?0:t<-1?ic:Math.acos(t)}(($*G+W*H)/(nc($*$+W*W)*nc(G*G+H*H)))/2),q=nc(I[0]*I[0]+I[1]*I[1]);A=tc(_,(f-q)/(Y-1)),T=tc(_,(h-q)/(Y+1))}else A=T=0}O>rc?T>rc?(m=wc(F,z,N,L,h,T,v),y=wc(D,B,j,R,h,T,v),s.moveTo(m.cx+m.x01,m.cy+m.y01),T<_?s.arc(m.cx,m.cy,T,Zs(m.y01,m.x01),Zs(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,T,Zs(m.y01,m.x01),Zs(m.y11,m.x11),!v),s.arc(0,0,h,Zs(m.cy+m.y11,m.cx+m.x11),Zs(y.cy+y.y11,y.cx+y.x11),!v),s.arc(y.cx,y.cy,T,Zs(y.y11,y.x11),Zs(y.y01,y.x01),!v))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!v)):s.moveTo(N,L),f>rc&&M>rc?A>rc?(m=wc(j,R,D,B,f,-A,v),y=wc(N,L,F,z,f,-A,v),s.lineTo(m.cx+m.x01,m.cy+m.y01),A<_?s.arc(m.cx,m.cy,A,Zs(m.y01,m.x01),Zs(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,A,Zs(m.y01,m.x01),Zs(m.y11,m.x11),!v),s.arc(0,0,f,Zs(m.cy+m.y11,m.cx+m.x11),Zs(y.cy+y.y11,y.cx+y.x11),v),s.arc(y.cx,y.cy,A,Zs(y.y11,y.x11),Zs(y.y01,y.x01),!v))):s.arc(0,0,f,k,w,v):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-ic/2;return[Qs(r)*n,ec(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Xs(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Xs(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Xs(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Xs(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Xs(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function Mc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Oc(t){this._context=t}function Ec(t){return new Oc(t)}function Sc(t){return t[0]}function _c(t){return t[1]}function Ac(t,e){var n=Xs(!0),r=null,i=Ec,o=null,a=gc(s);function s(s){var c,l,u,f=(s=Mc(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Sc:Xs(t),e="function"==typeof e?e:void 0===e?_c:Xs(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Xs(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function Tc(t,e,n){var r=null,i=Xs(!0),o=null,a=Ec,s=null,c=gc(l);function l(l){var u,f,h,d,p,g=(l=Mc(l)).length,v=!1,m=new Array(g),y=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===v)if(v=!v)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(m[h],y[h]);s.lineEnd(),s.areaEnd()}v&&(m[u]=+t(d,u,l),y[u]=+e(d,u,l),s.point(r?+r(d,u,l):m[u],n?+n(d,u,l):y[u]))}if(p)return s=null,p+""||null}function u(){return Ac().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Sc:Xs(+t),e="function"==typeof e?e:Xs(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?_c:Xs(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Xs(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Xs(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Xs(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}pc.prototype=dc.prototype,Oc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Pc=Nc(Ec);function Cc(t){this._curve=t}function Nc(t){function e(e){return new Cc(t(e))}return e._curve=t,e}function Lc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Nc(t)):e()._curve},t}function jc(){}function Rc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ic(t,e){this._context=t,this._k=(1-e)/6}function Dc(t,e){this._context=t,this._k=(1-e)/6}function Bc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>rc){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>rc){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Fc(t,e){this._context=t,this._alpha=e}function zc(t,e){this._context=t,this._alpha=e}Cc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Ic.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Rc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Rc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new Ic(t,e)}return n.tension=function(e){return t(+e)},n}(0),Dc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Rc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new Dc(t,e)}return n.tension=function(e){return t(+e)},n}(0),Fc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Bc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return e?new Fc(t,e):new Ic(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),zc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $c=function t(e){function n(t){return e?new zc(t,e):new Dc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Wc(t){this._context=t}function Gc(t){return new Wc(t)}function Hc(t){return t<0?-1:1}function Yc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Hc(o)+Hc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function qc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Vc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Uc(t){this._context=t}function Xc(t){this._context=new Kc(t)}function Kc(t){this._context=t}function Zc(t){return new Uc(t)}function Qc(t){return new Xc(t)}function Jc(t,e){this._context=t,this._t=e}function tl(t){return new Jc(t,.5)}function el(t){return new Jc(t,0)}function nl(t){return new Jc(t,1)}function rl(t){const{transformations:e}=t.getOptions();return e.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function il(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"polar"===t)}function ol(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"reflect"===t)&&e.some(([t])=>t.startsWith("transpose"))}function al(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"helix"===t)}function sl(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"parallel"===t)}function cl(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"fisheye"===t)}function ll(t){return al(t)||il(t)}function ul(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find(t=>"polar"===t[0]);return[+n,+r]}function fl(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find(t=>"polar"===t[0]);return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}Wc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Uc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Vc(this,this._t0,qc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Vc(this,qc(this,n=Yc(this,t,e)),n);break;default:Vc(this,this._t0,n=Yc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Xc.prototype=Object.create(Uc.prototype)).point=function(t,e){Uc.prototype.point.call(this,e,t)},Kc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},Jc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var hl="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function dl(t){return dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(t)}function pl(t){var e=function(t,e){if("object"!=dl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=dl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dl(e)?e:e+""}function gl(t,e,n){return(e=pl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ml(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vl(Object(n),!0).forEach(function(e){gl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function yl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pl(r.key),r)}}function xl(t,e,n){return e&&bl(t.prototype,e),n&&bl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function wl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function kl(t,e){if(t){if("string"==typeof t)return wl(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wl(t,e):void 0}}function Ml(t){return function(t){if(Array.isArray(t))return wl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||kl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ol(t){return Ol=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ol(t)}function El(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(El=function(){return!!t})()}function Sl(t,e){if(e&&("object"==dl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _l(t,e,n){return e=Ol(e),Sl(t,El()?Reflect.construct(e,n||[],Ol(t).constructor):e.apply(t,n))}function Al(t,e){return Al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Al(t,e)}function Tl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Al(t,e)}function Pl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||kl(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Cl={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(Cl);var Nl=Cl.exports;function Ll(){return Ll="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ol(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ll.apply(null,arguments)}function jl(t,e,n,r){var i=Ll(Ol(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:o}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,o]]};r.props={};const i=({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]];i.props={};const o=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];o.props={transform:!0};const a=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};a.props={};const s=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},c=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=s(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};c.props={};const l=()=>[["parallel",0,1,0,1]];l.props={};const u=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];u.props={transform:!0};const f=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:o=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};f.props={};const h=({value:t})=>e=>e.map(()=>t);h.props={};const d=({value:t})=>e=>e.map(t);d.props={};const p=({value:t})=>e=>e.map(e=>e[t]);p.props={};const g=({value:t})=>()=>t;g.props={};var v=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t,e){if(!v(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};function y(t){return"function"==typeof t}function b(t){return null==t}function x(t){return Array.isArray(t)}var w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function k(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(w(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var M=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return k(t,function(n,r){y(t)&&"prototype"===r||e.push(r)}),e};var O=function(t){return"object"==typeof t&&null!==t},E={}.toString,S=function(t,e){return E.call(t)==="[object "+e+"]"},_=function(t){if(!O(t)||!S(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function A(t,e){if(!x(t))return null;var n;if(y(e)&&(n=e),_(e)&&(n=function(t){return function(t,e){var n=M(e),r=n.length;if(b(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null}var T=function(t){if(!x(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e};function P(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;r<e;r++)n=Math.max(n,t[r]);return n}var C=function(t){if(x(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},N=function(t,e,n){if(!x(t)&&!_(t))return t;var r=n;return k(t,function(t,n){r=e(r,t,n)}),r};function L(t){return"string"==typeof t}function j(t){if(v(t)){return t[t.length-1]}}var R=function(t,e,n){return t<e?e:t>n?n:t};function I(t){return"number"==typeof t}function D(t,e,n){return void 0===n&&(n=1e-5),t===e||Math.abs(t-e)<n}var B=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=y(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},F=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=y(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},z=function(t,e){return(t%e+e)%e},$=function(t){return b(t)?"":t.toString()},W=function(t){var e=$(t);return e.charAt(0).toLowerCase()+e.substring(1)};var G=function(t){var e=$(t);return e.charAt(0).toUpperCase()+e.substring(1)},H=function(t){return S(t,"Boolean")};function Y(t){return null===t}var q=function(t){return void 0===t};function V(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var U=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=U(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=U(t[i]):e[i]=t[i];return e},X=U;function K(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout(function(){r=null,n||t.apply(i,o)},e),a&&t.apply(i,o)}}var Z=new Map;function Q(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function J(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(Q(e,i)){var o=e[i];null!==o&&_(o)?(_(t[i])||(t[i]={}),n<r?J(t[i],o,n+1,r):t[i]=e[i]):x(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var tt=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)J(t,e[r]);return t},et=function(t,e){if(!v(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},nt=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(L(t)||L(e))return!1;if(v(t)||v(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=nt(t[r],e[r]));r++);return n}if(O(t)||O(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=nt(t[i[r]],e[i[r]]));r++);return n}return!1},rt=nt,it=function(t){return t},ot=function(t,e,n){for(var r=0,i=L(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},at=function(t,e,n){var r=t,i=L(e)?e.split("."):e;return i.forEach(function(t,e){e<i.length-1?(w(r[t])||(r[t]=I(i[e+1])?[]:{}),r=r[t]):r[t]=n}),t},st=Object.prototype.hasOwnProperty,ct=function(t,e){return N(t,function(t,n,r){return e.includes(r)||(t[r]=n),t},{})},lt=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},ut=function(){},ft=function(t){return t};function ht(t){return b(t)?0:v(t)?t.length:Object.keys(t).length}var dt=1e-6,pt="undefined"!=typeof Float32Array?Float32Array:Array;function gt(){var t=new pt(9);return pt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}var vt=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*l,t[1]=h*i+d*s+p*u,t[2]=h*o+d*c+p*f,t[3]=g*r+v*a+m*l,t[4]=g*i+v*s+m*u,t[5]=g*o+v*c+m*f,t[6]=y*r+b*a+x*l,t[7]=y*i+b*s+x*u,t[8]=y*o+b*c+x*f,t};function mt(){var t=new pt(16);return pt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function yt(t){var e=new pt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function bt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function xt(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var v=new pt(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=c,v[9]=l,v[10]=u,v[11]=f,v[12]=h,v[13]=d,v[14]=p,v[15]=g,v}function wt(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=v,t}function kt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Mt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Ot(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,k=r*l-o*s,M=i*l-o*c,O=u*g-f*p,E=u*v-h*p,S=u*m-d*p,_=f*v-h*g,A=f*m-d*g,T=h*m-d*v,P=y*T-b*A+x*_+w*S-k*E+M*O;return P?(P=1/P,t[0]=(s*T-c*A+l*_)*P,t[1]=(i*A-r*T-o*_)*P,t[2]=(g*M-v*k+m*w)*P,t[3]=(h*k-f*M-d*w)*P,t[4]=(c*S-a*T-l*E)*P,t[5]=(n*T-i*S+o*E)*P,t[6]=(v*x-p*M-m*b)*P,t[7]=(u*M-h*x+d*b)*P,t[8]=(a*A-s*S+l*O)*P,t[9]=(r*S-n*A-o*O)*P,t[10]=(p*k-g*x+m*y)*P,t[11]=(f*x-u*k-d*y)*P,t[12]=(s*E-a*_-c*O)*P,t[13]=(n*_-r*E+i*O)*P,t[14]=(g*b-p*w-v*y)*P,t[15]=(u*w-f*b+h*y)*P,t):null}function Et(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],v=e*a-n*o,m=e*s-r*o,y=n*s-r*a,b=l*p-u*d,x=l*g-f*d,w=u*g-f*p;return c*(e*w-n*x+r*b)-i*(o*w-a*x+s*b)+t[15]*(l*y-u*m+f*v)-h*(d*y-p*m+g*v)}function St(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],w=n[2],k=n[3];return t[0]=b*r+x*s+w*f+k*g,t[1]=b*i+x*c+w*h+k*v,t[2]=b*o+x*l+w*d+k*m,t[3]=b*a+x*u+w*p+k*y,b=n[4],x=n[5],w=n[6],k=n[7],t[4]=b*r+x*s+w*f+k*g,t[5]=b*i+x*c+w*h+k*v,t[6]=b*o+x*l+w*d+k*m,t[7]=b*a+x*u+w*p+k*y,b=n[8],x=n[9],w=n[10],k=n[11],t[8]=b*r+x*s+w*f+k*g,t[9]=b*i+x*c+w*h+k*v,t[10]=b*o+x*l+w*d+k*m,t[11]=b*a+x*u+w*p+k*y,b=n[12],x=n[13],w=n[14],k=n[15],t[12]=b*r+x*s+w*f+k*g,t[13]=b*i+x*c+w*h+k*v,t[14]=b*o+x*l+w*d+k*m,t[15]=b*a+x*u+w*p+k*y,t}function _t(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*v+f*m+e[12],t[13]=i*g+c*v+h*m+e[13],t[14]=o*g+l*v+d*m+e[14],t[15]=a*g+u*v+p*m+e[15]),t}function At(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Tt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function Pt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function Ct(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Nt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Lt(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.sqrt(a*a+s*s+c*c);return l<dt?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function jt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Rt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function It(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Dt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=o*l,v=a*s,m=a*c,y=a*l;return t[0]=1-(d+g),t[1]=f+y,t[2]=h-m,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=p+v,t[7]=0,t[8]=h+m,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Bt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Ft(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(o*o+a*a+s*s),t[2]=Math.sqrt(c*c+l*l+u*u),t}function zt(t,e){var n=new pt(3);Ft(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,g=a+u+p,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(h-c)/v,t[2]=(s-l)/v):a>u&&a>p?(v=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+l)/v,t[2]=(h+c)/v):u>p?(v=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/v,t[0]=(s+l)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/v,t[0]=(h+c)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function $t(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,g=a*u,v=a*f,m=s*f,y=c*l,b=c*u,x=c*f,w=r[0],k=r[1],M=r[2],O=i[0],E=i[1],S=i[2],_=(1-(g+m))*w,A=(d+x)*w,T=(p-b)*w,P=(d-x)*k,C=(1-(h+m))*k,N=(v+y)*k,L=(p+b)*M,j=(v-y)*M,R=(1-(h+g))*M;return t[0]=_,t[1]=A,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+O-(_*O+P*E+L*S),t[13]=n[1]+E-(A*O+C*E+j*S),t[14]=n[2]+S-(T*O+N*E+R*S),t[15]=1,t}function Wt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,g=o*a,v=o*s,m=o*c;return t[0]=1-f-p,t[1]=u+m,t[2]=h-v,t[3]=0,t[4]=u-m,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Gt(t,e,n,r,i){var o=1/Math.tan(e/2);if(t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var a=1/(r-i);t[10]=(i+r)*a,t[14]=2*i*r*a}else t[10]=-1,t[14]=-2*r;return t}var Ht=Gt;function Yt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var qt=Yt;function Vt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function Ut(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],v=e[2],m=r[0],y=r[1],b=r[2],x=n[0],w=n[1],k=n[2];return Math.abs(p-x)<dt&&Math.abs(g-w)<dt&&Math.abs(v-k)<dt?kt(t):(u=p-x,f=g-w,h=v-k,i=y*(h*=d=1/Math.sqrt(u*u+f*f+h*h))-b*(f*=d),o=b*(u*=d)-m*h,a=m*f-y*u,(d=Math.sqrt(i*i+o*o+a*a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-u*a,l=u*o-f*i,(d=Math.sqrt(s*s+c*c+l*l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+o*g+a*v),t[13]=-(s*p+c*g+l*v),t[14]=-(u*p+f*g+h*v),t[15]=1,t)}function Xt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Kt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}var Zt=St,Qt=Xt,Jt=Object.freeze({__proto__:null,create:mt,clone:yt,copy:bt,fromValues:xt,set:wt,identity:kt,transpose:Mt,invert:Ot,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,k=r*l-o*s,M=i*l-o*c,O=u*g-f*p,E=u*v-h*p,S=u*m-d*p,_=f*v-h*g,A=f*m-d*g,T=h*m-d*v;return t[0]=s*T-c*A+l*_,t[1]=i*A-r*T-o*_,t[2]=g*M-v*k+m*w,t[3]=h*k-f*M-d*w,t[4]=c*S-a*T-l*E,t[5]=n*T-i*S+o*E,t[6]=v*x-p*M-m*b,t[7]=u*M-h*x+d*b,t[8]=a*A-s*S+l*O,t[9]=r*S-n*A-o*O,t[10]=p*k-g*x+m*y,t[11]=f*x-u*k-d*y,t[12]=s*E-a*_-c*O,t[13]=n*_-r*E+i*O,t[14]=g*b-p*w-v*y,t[15]=u*w-f*b+h*y,t},determinant:Et,multiply:St,translate:_t,scale:At,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,v,m,y,b,x,w,k,M,O,E,S,_,A=r[0],T=r[1],P=r[2],C=Math.sqrt(A*A+T*T+P*P);return C<dt?null:(A*=C=1/C,T*=C,P*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=A*A*a+o,x=T*A*a+P*i,w=P*A*a-T*i,k=A*T*a-P*i,M=T*T*a+o,O=P*T*a+A*i,E=A*P*a+T*i,S=T*P*a-A*i,_=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+h*x+v*w,t[2]=l*b+d*x+m*w,t[3]=u*b+p*x+y*w,t[4]=s*k+f*M+g*O,t[5]=c*k+h*M+v*O,t[6]=l*k+d*M+m*O,t[7]=u*k+p*M+y*O,t[8]=s*E+f*S+g*_,t[9]=c*E+h*S+v*_,t[10]=l*E+d*S+m*_,t[11]=u*E+p*S+y*_,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Tt,rotateY:Pt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:Ct,fromScaling:Nt,fromRotation:Lt,fromXRotation:jt,fromYRotation:Rt,fromZRotation:It,fromRotationTranslation:Dt,fromQuat2:function(t,e){var n=new pt(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),Dt(t,e,n),t},getTranslation:Bt,getScaling:Ft,getRotation:zt,decompose:function(t,e,n,r){e[0]=r[12],e[1]=r[13],e[2]=r[14];var i=r[0],o=r[1],a=r[2],s=r[4],c=r[5],l=r[6],u=r[8],f=r[9],h=r[10];n[0]=Math.sqrt(i*i+o*o+a*a),n[1]=Math.sqrt(s*s+c*c+l*l),n[2]=Math.sqrt(u*u+f*f+h*h);var d=1/n[0],p=1/n[1],g=1/n[2],v=i*d,m=o*p,y=a*g,b=s*d,x=c*p,w=l*g,k=u*d,M=f*p,O=h*g,E=v+x+O,S=0;return E>0?(S=2*Math.sqrt(E+1),t[3]=.25*S,t[0]=(w-M)/S,t[1]=(k-y)/S,t[2]=(m-b)/S):v>x&&v>O?(S=2*Math.sqrt(1+v-x-O),t[3]=(w-M)/S,t[0]=.25*S,t[1]=(m+b)/S,t[2]=(k+y)/S):x>O?(S=2*Math.sqrt(1+x-v-O),t[3]=(k-y)/S,t[0]=(m+b)/S,t[1]=.25*S,t[2]=(w+M)/S):(S=2*Math.sqrt(1+O-v-x),t[3]=(m-b)/S,t[0]=(k+y)/S,t[1]=(w+M)/S,t[2]=.25*S),t},fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,v=a*u,m=s*c,y=s*l,b=s*u,x=r[0],w=r[1],k=r[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+v))*w,t[6]=(g+m)*w,t[7]=0,t[8]=(d+y)*k,t[9]=(g-m)*k,t[10]=(1-(f+p))*k,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:$t,fromQuat:Wt,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Gt,perspective:Ht,perspectiveZO:function(t,e,n,r,i){var o=1/Math.tan(e/2);if(t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var a=1/(r-i);t[10]=i*a,t[14]=i*r*a}else t[10]=-1,t[14]=-r;return t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Yt,ortho:qt,orthoZO:Vt,lookAt:Ut,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],h=a-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,v=s*f-c*u;return(d=p*p+g*g+v*v)>0&&(p*=d=1/Math.sqrt(d),g*=d,v*=d),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=f*v-h*g,t[5]=h*p-u*v,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Xt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:Kt,equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],v=t[14],m=t[15],y=e[0],b=e[1],x=e[2],w=e[3],k=e[4],M=e[5],O=e[6],E=e[7],S=e[8],_=e[9],A=e[10],T=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-y)<=dt*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-b)<=dt*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=dt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=dt*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-k)<=dt*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(s-M)<=dt*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(c-O)<=dt*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=dt*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-S)<=dt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-_)<=dt*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(h-A)<=dt*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-T)<=dt*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-P)<=dt*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=dt*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-N)<=dt*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(m-L)<=dt*Math.max(1,Math.abs(m),Math.abs(L))},mul:Zt,sub:Qt});function te(){var t=new pt(3);return pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ee(t){var e=new pt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ne(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function re(t,e,n){var r=new pt(3);return r[0]=t,r[1]=e,r[2]=n,r}function ie(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function oe(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ae(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function se(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ce(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function le(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ue(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fe(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function he(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function de(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function pe(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function ge(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=dt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=dt*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=dt*Math.max(1,Math.abs(i),Math.abs(s))}var ve=se,me=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},ye=ne;function be(){var t=new pt(4);return pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function xe(t,e,n,r){var i=new pt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function we(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function ke(){var t=new pt(4);return pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Me(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Oe(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function Ee(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Se(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",o=Math.PI/360;e*=o,r*=o,n*=o;var a=Math.sin(e),s=Math.cos(e),c=Math.sin(n),l=Math.cos(n),u=Math.sin(r),f=Math.cos(r);switch(i){case"xyz":t[0]=a*l*f+s*c*u,t[1]=s*c*f-a*l*u,t[2]=s*l*u+a*c*f,t[3]=s*l*f-a*c*u;break;case"xzy":t[0]=a*l*f-s*c*u,t[1]=s*c*f-a*l*u,t[2]=s*l*u+a*c*f,t[3]=s*l*f+a*c*u;break;case"yxz":t[0]=a*l*f+s*c*u,t[1]=s*c*f-a*l*u,t[2]=s*l*u-a*c*f,t[3]=s*l*f+a*c*u;break;case"yzx":t[0]=a*l*f+s*c*u,t[1]=s*c*f+a*l*u,t[2]=s*l*u-a*c*f,t[3]=s*l*f-a*c*u;break;case"zxy":t[0]=a*l*f-s*c*u,t[1]=s*c*f+a*l*u,t[2]=s*l*u+a*c*f,t[3]=s*l*f-a*c*u;break;case"zyx":t[0]=a*l*f-s*c*u,t[1]=s*c*f+a*l*u,t[2]=s*l*u-a*c*f,t[3]=s*l*f+a*c*u;break;default:throw new Error("Unknown angle order "+i)}return t}te(),function(){var t=be()}();var _e=xe,Ae=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Te=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Pe=Oe,Ce=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};function Ne(){var t=new pt(2);return pt!=Float32Array&&(t[0]=0,t[1]=0),t}te(),re(1,0,0),re(0,1,0),ke(),ke(),gt(),function(){var t=Ne()}();var Le=function(t,e){return Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Le(t,e)};function je(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Le(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Re=function(){return Re=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Re.apply(this,arguments)};function Ie(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function De(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function Be(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())})}function Fe(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ze(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function $e(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function We(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var Ge={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function He(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ye={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qe(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return Ye[e]===t.length-1&&"achlmqstvz".includes(e)})}function Ve(t){return qe(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function Ue(t){return Ve(t)&&t.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function Xe(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Ye[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Ye[n]))),Ye[n]););}function Ke(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function Ze(t){return t>=48&&t<=57||43===t||45===t||46===t}function Qe(t){return t>=48&&t<=57}function Je(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index ".concat(o,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),Qe(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Qe(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;o<n&&Qe(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Qe(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid float exponent'));if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&Qe(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid integer exponent'));for(;o<n&&Qe(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" is not a number')}function tn(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function en(t){for(var e=t.pathValue,n=t.max;t.index<n&&tn(e.charCodeAt(t.index));)t.index+=1}function nn(t){return 97==(32|t)}function rn(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Ye[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,en(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(!nn(i)||3!==a&&4!==a?Je(t):Ke(t),t.err.length)return;t.data.push(t.param),en(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,en(t))}if(t.index>=t.max)break;if(!Ze(n.charCodeAt(t.index)))break}Xe(t)}else Xe(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var on=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function an(t){if(Ve(t))return[].concat(t);var e=function(t){if(qe(t))return[].concat(t);var e=new on(t);for(en(e);e.index<e.max&&!e.err.length;)rn(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map(function(t){var e,a=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map(function(t,e){return t+(e%2?r:n)});e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e})}function sn(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function cn(t){if(Ue(t))return[].concat(t);for(var e=an(t),n=Re({},Ge),r=0;r<e.length;r+=1){e[r]=sn(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function ln(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function un(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,v=e,m=n,y=r,b=s,x=c,w=120*Math.PI/180,k=Math.PI/180*(+i||0),M=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=ln(g,v,-k)).x,v=u.y;var O=(g-(b=(u=ln(b,x,-k)).x))/2,E=(v-(x=u.y))/2,S=O*O/(m*m)+E*E/(y*y);S>1&&(m*=S=Math.sqrt(S),y*=S);var _=m*m,A=y*y,T=(o===a?-1:1)*Math.sqrt(Math.abs((_*A-_*E*E-A*O*O)/(_*E*E+A*O*O)));d=T*m*E/y+(g+b)/2,p=T*-y*O/m+(v+x)/2,f=Math.asin(((v-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),h=Math.asin(((x-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),a&&f>h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var C=h,N=b,L=x;h=f+w*(a&&h>f?1:-1),M=un(b=d+m*Math.cos(h),x=p+y*Math.sin(h),m,y,i,0,a,N,L,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*m*B,z=4/3*y*B,$=[g,v],W=[g+F*R,v-z*j],G=[b+F*D,x-z*I],H=[b,x];if(W[0]=2*$[0]-W[0],W[1]=2*$[1]-W[1],l)return W.concat(G,H,M);for(var Y=[],q=0,V=(M=W.concat(G,H,M)).length;q<V;q+=1)Y[q]=q%2?ln(M[q-1],M[q],k).y:ln(M[q],M[q+1],k).x;return Y}function fn(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var hn=function(t,e,n,r){return $e($e([],fn([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function dn(t,e){var n,r=t[0],i=t.slice(1).map(Number),o=i[0],a=i[1],s=e.x1,c=e.y1,l=e.x,u=e.y;switch("TQ".includes(r)||(e.qx=null,e.qy=null),r){case"M":return e.x=o,e.y=a,t;case"A":return n=[s,c].concat(i),["C"].concat(un(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=o,e.qy=a,n=[s,c].concat(i),["C"].concat(function(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}(n[0],n[1],n[2],n[3],n[4],n[5]));case"L":return["C"].concat(hn(s,c,o,a));case"Z":return s===l&&c===u?["C",s,c,l,u,l,u]:["C"].concat(hn(s,c,l,u))}return t}function pn(t,e){if(void 0===e&&(e=!1),function(t){return Ue(t)&&t.every(function(t){var e=t[0];return"MC".includes(e)})}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=cn(t),a=Re({},Ge),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=dn(o[f],a);o[f]=h,He(o,s,f),l=o.length,"Z"===c&&u.push(f),i=(r=o[f]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function gn(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function vn(t,e,n,r,i){var o=gn([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=fn([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function mn(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function yn(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),v=u(r),m=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===v)return vn(t,e,s,c,l).point;var y=(t-s)/2,b=(e-c)/2,x={x:h(m)*y+f(m)*b,y:-f(m)*y+h(m)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(v,2);w>1&&(g*=d(w),v*=d(w));var k=(Math.pow(g,2)*Math.pow(v,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2)),M=(o!==a?1:-1)*d(k=k<0?0:k),O=M*(g*x.y/v),E=M*(-v*x.x/g),S=h(m)*O-f(m)*E+(t+s)/2,_=f(m)*O+h(m)*E+(e+c)/2,A={x:(x.x-O)/g,y:(x.y-E)/v},T=mn({x:1,y:0},A),P=mn(A,{x:(-x.x-O)/g,y:(-x.y-E)/v});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,N=g*h(C),L=v*f(C);return{x:h(m)*N-f(m)*L+S,y:f(m)*N+h(m)*L+_}}function bn(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,v=u.sampleSize,m=void 0===v?30:v,y="number"==typeof l,b=t,x=e,w=0,k=[b,x,w],M=[b,x],O={x:0,y:0},E=[{x:b,y:x}];y&&l<=0&&(O={x:b,y:x});for(var S=0;S<=m;S+=1){if(b=(f=yn(t,e,n,r,i,o,a,s,c,S/m)).x,x=f.y,d&&E.push({x:b,y:x}),g&&(w+=gn(M,[b,x])),M=[b,x],y&&w>=l&&l>k[2]){var _=(w-l)/(w-k[2]);O={x:M[0]*(1-_)+k[0]*_,y:M[1]*(1-_)+k[1]*_}}k=[b,x,w]}return y&&l>=w&&(O={x:s,y:c}),{length:w,point:O,min:{x:Math.min.apply(null,E.map(function(t){return t.x})),y:Math.min.apply(null,E.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function xn(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function wn(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,v=void 0===g?10:g,m="number"==typeof c,y=t,b=e,x=0,w=[y,b,x],k=[y,b],M={x:0,y:0},O=[{x:y,y:b}];m&&c<=0&&(M={x:y,y:b});for(var E=0;E<=v;E+=1){if(y=(u=xn(t,e,n,r,i,o,a,s,E/v)).x,b=u.y,h&&O.push({x:y,y:b}),p&&(x+=gn(k,[y,b])),k=[y,b],m&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);M={x:k[0]*(1-S)+w[0]*S,y:k[1]*(1-S)+w[1]*S}}w=[y,b,x]}return m&&c>=x&&(M={x:a,y:s}),{length:x,point:M,min:{x:Math.min.apply(null,O.map(function(t){return t.x})),y:Math.min.apply(null,O.map(function(t){return t.y}))},max:{x:Math.max.apply(null,O.map(function(t){return t.x})),y:Math.max.apply(null,O.map(function(t){return t.y}))}}}function kn(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Mn(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,v=t,m=e,y=0,b=[v,m,y],x=[v,m],w={x:0,y:0},k=[{x:v,y:m}];g&&a<=0&&(w={x:v,y:m});for(var M=0;M<=p;M+=1){if(v=(c=kn(t,e,n,r,i,o,M/p)).x,m=c.y,u&&k.push({x:v,y:m}),h&&(y+=gn(x,[v,m])),x=[v,m],g&&y>=a&&a>b[2]){var O=(y-a)/(y-b[2]);w={x:x[0]*(1-O)+b[0]*O,y:x[1]*(1-O)+b[1]*O}}b=[v,m,y]}return g&&a>=y&&(w={x:i,y:o}),{length:y,point:w,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,k.map(function(t){return t.x})),y:Math.max.apply(null,k.map(function(t){return t.y}))}}}function On(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=cn(t),d="number"==typeof e,p=[],g=0,v=0,m=0,y=0,b=[],x=[],w=0,k={x:0,y:0},M=k,O=k,E=k,S=0,_=0,A=h.length;_<A;_+=1)p=(l="M"===(u=(f=h[_])[0]))?p:[g,v].concat(f.slice(1)),l?(M=k={x:m=f[1],y:y=f[2]},w=0,d&&e<.001&&(E=k)):"L"===u?(w=(r=vn(p[0],p[1],p[2],p[3],(e||0)-S)).length,k=r.min,M=r.max,O=r.point):"A"===u?(w=(i=bn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,k=i.min,M=i.max,O=i.point):"C"===u?(w=(o=wn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,k=o.min,M=o.max,O=o.point):"Q"===u?(w=(a=Mn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,k=a.min,M=a.max,O=a.point):"Z"===u&&(w=(s=vn((p=[g,v,m,y])[0],p[1],p[2],p[3],(e||0)-S)).length,k=s.min,M=s.max,O=s.point),d&&S<e&&S+w>=e&&(E=O),x.push(M),b.push(k),S+=w,g=(c="Z"!==u?f.slice(-2):[m,y])[0],v=c[1];return d&&e>=S&&(E={x:g,y:v}),{length:S,point:E,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,x.map(function(t){return t.x})),y:Math.max.apply(null,x.map(function(t){return t.y}))}}}function En(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map(function(r,i){return t.map(function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])})})}(t);return o.forEach(function(o,a){t.slice(1).forEach(function(r,o){i+=gn(t[(a+o)%n].slice(-2),e[o%n].slice(-2))}),r[a]=i,i=0}),o[r.indexOf(Math.min.apply(null,r))]}function Sn(t){return function(t){var e=0,n=0,r=0;return pn(t).map(function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r}).reduce(function(t,e){return t+e},0)}(t)>=0}function _n(t){return t.map(function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?wn(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=fn(n,r,e),s=fn(r,i,e),c=fn(i,o,e),l=fn(a,s,e),u=fn(s,c,e),f=fn(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}})}function An(t,e,n,r){if(void 0===r&&(r=0),r>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var i=_n(t),o=_n(e),a=i.length,s=o.length,c=i.filter(function(t){return t.l}).length,l=o.filter(function(t){return t.l}).length,u=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/c||0,f=o.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,h=n||Math.max(a,s),d=[u,f],p=[h-a,h-s],g=0,v=[i,o].map(function(t,e){return t.l===h?t.map(function(t){return t.s}):t.map(function(t,n){return g=n&&p[e]&&t.l>=d[e],p[e]-=g?1:0,g?t.ss:[t.s]}).flat()});return v[0].length===v[1].length?v:An(v[0],v[1],h,r+1)}function Tn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function Pn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function Cn(t,e){const n=Pn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function Nn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function Ln(t,e){const n=Pn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function jn(t,e){const n=[];for(const r of t)n[r]=e;return n}function Rn(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function In(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=Rn(t,n);if(null!==e)return[e,r]}}return[null,null]}function Dn(t){return!(t instanceof Date)&&"object"==typeof t}const Bn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{y1:Cn(jn(t,0))}})]};function Fn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $n(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=Fn,n=(e,n)=>Fn(t(e),n),r=(e,n)=>t(e)-n):(e=t===Fn||t===zn?t:Wn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function Wn(){return 0}function Gn(t){return null===t?NaN:+t}Bn.props={};const Hn=$n(Fn),Yn=Hn.right,qn=Hn.left,Vn=$n(Gn).center;var Un=Yn;function Xn(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function Kn(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function Zn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Qn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}class Jn extends Map{constructor(t,e=er){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(tr(this,t))}has(t){return super.has(tr(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function tr({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function er(t){return null!==t&&"object"==typeof t?t.valueOf():t}function nr(t){return t}function rr(t,...e){return sr(t,nr,nr,e)}function ir(t,...e){return sr(t,Array.from,nr,e)}function or(t,e,...n){return sr(t,nr,e,n)}function ar(t,e,...n){return sr(t,Array.from,e,n)}function sr(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Jn,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function cr(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,(t,e)=>e);return e.length>1?(e=e.map(e=>t.map(e)),r.sort((t,n)=>{for(const r of e){const e=ur(r[t],r[n]);if(e)return e}})):(n=t.map(n),r.sort((t,e)=>ur(n[t],n[e]))),function(t,e){return Array.from(e,e=>t[e])}(t,r)}return t.sort(lr(n))}function lr(t=Fn){if(t===Fn)return ur;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function ur(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var fr=Array.prototype.slice;function hr(t){return()=>t}const dr=Math.sqrt(50),pr=Math.sqrt(10),gr=Math.sqrt(2);function vr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=dr?10:o>=pr?5:o>=gr?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?vr(t,e,2*n):[s,c,l]}function mr(t,e,n){return vr(t=+t,e=+e,n=+n)[2]}function yr(t){return Math.max(1,Math.ceil(Math.log(Xn(t))/Math.LN2)+1)}function br(){var t=nr,e=Zn,n=yr;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===Zn&&([u,f]=function(t,e,n){let r;for(;;){const i=mr(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,o,a]=r?vr(e,t,n):vr(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),h[0]<=u&&(a=mr(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===Zn){const t=mr(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var v,m=new Array(d+1);for(i=0;i<=d;++i)(v=m[i]=[]).x0=i>0?h[i-1]:u,v.x1=i<d?h[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&m[Math.min(d,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);m[Math.min(d,t+(h[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&m[Un(h,o,0,d)].push(r[i]);return m}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:hr(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:hr([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:hr(Array.isArray(t)?fr.call(t):t),r):n},r}function xr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function wr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function kr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Mr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Or(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?ur:lr(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);Or(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(Er(t,n,e),i(t[r],o)>0&&Er(t,n,r);a<s;){for(Er(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?Er(t,n,s):(++s,Er(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Er(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Sr(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return kr(t);if(e>=1)return xr(t);var r,i=(r-1)*e,o=Math.floor(i),a=xr(Or(t,o).subarray(0,o+1));return a+(kr(t.subarray(o+1))-a)*(i-o)}}function _r(t,e,n=Gn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(e,r)=>Gn(n(t[r],r,t))),e<=0)return Mr(r);if(e>=1)return wr(r);var r,i=Uint32Array.from(t,(t,e)=>e),o=r.length-1,a=Math.floor(o*e);return Or(i,a,0,o,(t,e)=>ur(r[t],r[e])),a=function(t,e=Fn){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?Fn(t,i)>0:0===Fn(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),t=>r[t]),a>=0?a:-1}}function Ar(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Tr(t,e){return Sr(t,.5,e)}function Pr(t,e){return _r(t,.5,e)}function Cr(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Nr(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Lr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function jr(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function Rr(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Ir(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}const Dr=Math.sqrt(50),Br=Math.sqrt(10),Fr=Math.sqrt(2);function zr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=Dr?10:o>=Br?5:o>=Fr?2:1)*10**i:-(10**-i)/(o>=Dr?10:o>=Br?5:o>=Fr?2:1)}function $r(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=Dr?i*=10:o>=Br?i*=5:o>=Fr&&(i*=2),e<t?-i:i}const Wr=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=zr(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=zr(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=zr(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},Gr=1e3,Hr=6e4,Yr=36e5,qr=864e5,Vr=6048e5,Ur=2592e6,Xr=31536e6;function Kr(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e===0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);l<e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const Zr=Kr(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Qr=Kr(Gr,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Gr*e)},t=>t.getSeconds()),Jr=Kr(Hr,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Hr*e)},t=>t.getMinutes()),ti=Kr(Yr,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Yr*e)},t=>t.getHours()),ei=Kr(qr,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qr*e)},t=>t.getDate()-1),ni=Kr(Ur,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth()),ri=Kr(Vr,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setDate(t.getDate()+7*e)},t=>{const e=ni.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Vr)}),ii=Kr(Xr,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear()),oi={millisecond:Zr,second:Qr,minute:Jr,hour:ti,day:ei,week:ri,month:ni,year:ii},ai=Kr(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),si=Kr(Gr,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Gr*e)},t=>t.getUTCSeconds()),ci=Kr(Hr,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Hr*e)},t=>t.getUTCMinutes()),li=Kr(Yr,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Yr*e)},t=>t.getUTCHours()),ui=Kr(qr,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qr*e)},t=>t.getUTCDate()-1),fi=Kr(Ur,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth()),hi=Kr(Vr,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Vr*e)},t=>{const e=fi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Vr)}),di=Kr(Xr,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear()),pi={millisecond:ai,second:si,minute:ci,hour:li,day:ui,week:hi,month:fi,year:di};function gi(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?pi:oi,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,h=r||(a-o)/f,d=s.length,p=Ir(s,h,0,d,u);let g;if(p===d){g=[c,$r(o/c.duration,a/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max($r(o,a,f),1)]}return g}const vi=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=gi(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};function mi(t){return!q(t)&&!Y(t)&&!Number.isNaN(t)}const yi=t=>e=>-t(-e),bi=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?yi(r):r},xi=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?yi(n):n},wi=(t,e,n,r)=>{const i=t<0,o=bi(r,i),a=xi(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};var ki={exports:{}},Mi={exports:{}},Oi=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},Ei=Array.prototype.concat,Si=Array.prototype.slice,_i=Mi.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];Oi(i)?e=Ei.call(e,Si.call(i)):e.push(i)}return e};_i.wrap=function(t){return function(){return t(_i(arguments))}};var Ai={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ti=Mi.exports,Pi=Object.hasOwnProperty,Ci=Object.create(null);for(var Ni in Ai)Pi.call(Ai,Ni)&&(Ci[Ai[Ni]]=Ni);var Li=ki.exports={to:{},get:{}};function ji(t,e,n){return Math.min(Math.max(e,t),n)}function Ri(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}Li.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Li.get.hsl(t),n="hsl";break;case"hwb":e=Li.get.hwb(t),n="hwb";break;default:e=Li.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Li.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Pi.call(Ai,e[1])?((i=Ai[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=ji(i[n],0,255);return i[3]=ji(i[3],0,1),i},Li.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ji(parseFloat(e[2]),0,100),ji(parseFloat(e[3]),0,100),ji(isNaN(n)?1:n,0,1)]}return null},Li.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ji(parseFloat(e[2]),0,100),ji(parseFloat(e[3]),0,100),ji(isNaN(n)?1:n,0,1)]}return null},Li.to.hex=function(){var t=Ti(arguments);return"#"+Ri(t[0])+Ri(t[1])+Ri(t[2])+(t[3]<1?Ri(Math.round(255*t[3])):"")},Li.to.rgb=function(){var t=Ti(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Li.to.rgb.percent=function(){var t=Ti(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},Li.to.hsl=function(){var t=Ti(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Li.to.hwb=function(){var t=Ti(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Li.to.keyword=function(t){return Ci[t.slice(0,3)]};var Ii=ki.exports;function Di(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Bi(t){const e=Ii.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*Di(a,o,e+1/3),255*Di(a,o,e),255*Di(a,o,e-1/3),i]}(r):null}const Fi=(t,e)=>n=>t*(1-n)+e*n,zi=(t,e)=>"number"==typeof t&&"number"==typeof e?Fi(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Bi(t),r=Bi(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,$i=(t,e)=>{const n=Fi(t,e);return t=>Math.round(n(t))};function Wi({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Gi(t){return"object"==typeof t?t.valueOf():t}class Hi extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Gi,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Wi({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Wi({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Yi{transformBreaks(t){return t}constructor(t){var e;this.options=tt({},this.getDefaultOptions()),this.update((null===(e=null==t?void 0:t.breaks)||void 0===e?void 0:e.length)?this.transformBreaks(t):t)}getOptions(){return this.options}update(t={}){const e=t.breaks?this.transformBreaks(t):t;this.options=tt({},this.options,e),this.rescale(e)}rescale(t){}}const qi=Symbol("defaultUnknown");function Vi(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Ui(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==qi)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Xi(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Ki extends Yi{getDefaultOptions(){return{domain:[],range:[],unknown:qi}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Vi(this.domainIndexMap,this.getDomain(),this.domainKey),Ui({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Vi(this.rangeIndexMap,this.getRange(),this.rangeKey),Ui({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Xi(e),this.rangeKey=Xi(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Ki(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Zi(t){return Math.round(1e12*t)/1e12}function Qi(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,v=function(t){const e=t.reduce((t,e)=>Math.min(t,e),1/0);return e===1/0?[]:t.map(t=>t/e)}(l),m=v.reduce((t,e)=>t+e),y=g/m,b=new Hi(e.map((t,e)=>{const n=v[e]*y;return[t,a?Math.floor(n):n]})),x=new Hi(e.map((t,e)=>{const n=v[e]*y+p;return[t,a?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(h-(w-w/c*i))*s;let M=a?Math.round(k):k;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=Zi(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Ji extends Ki{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:qi,flex:[]}}constructor(t){super(t)}clone(){return new Ji(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Qi(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*l);return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const to=(t,e,n,r)=>{let i,o,a=t,s=e;if(a===s&&n>0)return[a];let c=zr(a,s,n);if(0===c||!Number.isFinite(c))return[];if(c>0){a=Math.ceil(a/c),s=Math.floor(s/c),o=new Array(i=Math.ceil(s-a+1));for(let t=0;t<i;t+=1)o[t]=(a+t)*c}else{c=-c,a=Math.ceil(a*c),s=Math.floor(s*c),o=new Array(i=Math.ceil(s-a+1));for(let t=0;t<i;t+=1)o[t]=(a+t)/c}return((t,e)=>{if(!(null==e?void 0:e.length))return t;const n=[...t,...e.flatMap(t=>[t.start,t.end])],r=Array.from(new Set(n)).sort((t,e)=>t-e),i=r.filter(t=>!e.some(({start:e,end:n})=>t>e&&t<n));return i.length?i:t})(o,r)};class eo extends Yi{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:to}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return I(r)&&I(i)?t(r,i,n):[]}clone(){return new eo(this.options)}}function no(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const ro=[1,5,2,2.5,4,3],io=100*Number.EPSILON;function oo(t,e,n,r,i,o){const a=ht(e),s=et(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<io||o-l<io)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function ao(t,e,n){const r=ht(e);return 1-et(e,t)/(r-1)-n+1}function so(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function co(t,e){return t>=e?2-(t-1)/(e-1):1}function lo(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function uo(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}function fo(){return 1}const ho=(t,e,n=5,r=!0,i=ro,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=ao(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=co(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=uo(t,e,h*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,v=Math.ceil(t/h)*c;if(g<=v){const n=v-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,v=oo(l,i,c,n,d,p),m=lo(t,e,n,d),y=so(f,a,t,e,n,d),b=fo(),x=o[0]*v+o[1]*m+o[2]*y+o[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=no(s.lmax),u=no(s.lmin),f=no(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=no(u);for(let t=1;t<h;t+=1)d[t]=no(d[t-1]+f);return d};class po extends Yi{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:ho}}map(t){return mi(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new po(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return I(r)&&I(i)?n(r,i,e):[]}}const go=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=Rr(r,i),c=n(o,a)):(s=Rr(i,r),c=n(a,o)),jr(c,s)},vo=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Rr(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=Ir(t,e,1,r)-1,a=i[n];return jr(o[n],a)(e)}},mo=(t,e,n,r)=>(Math.min(t.length,e.length)>2?vo:go)(t,e,r?$i:n);class yo extends Yi{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Fi,tickCount:5}}map(t){return mi(t)?this.output(t):this.options.unknown}invert(t){return mi(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice||x(this.options.breaks))return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Wr}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):ft}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=mo(n.map(t),r,o,i);this.output=jr(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=mo(i,r.map(t),Fi);this.input=jr(e,n,o)}}class bo extends yo{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:zi,tickMethod:to,tickCount:5}}removeUnsortedValues(t,e,n){let r=-1/0;const i=e.reduce((t,i,o)=>{if(0===o)return t;const a=r>0?r:i;if(r>0&&(n?i>r:i<r))t.push(o);else{(a-e[o-1])*(n?-1:1)<0?(r<0&&(r=e[o-1]),t.push(o)):r=-1/0}return t},[]);return i.slice().reverse().forEach(n=>{t.splice(n,1),e.splice(n,1)}),{breaksDomain:t,breaksRange:e}}transformDomain(t){const{domain:e=[],range:n=[1,0],breaks:r=[],tickCount:i=5,nice:o}=t,[a,s]=[Math.min(...e),Math.max(...e)];let c=a,l=s;if(o&&r.length<2){const t=this.chooseNice()(a,s,i);c=t[0],l=t[t.length-1]}const u=Math.min(c,a);let f=Math.max(l,s);const h=r.filter(({end:t})=>t<f).sort((t,e)=>t.start-e.start),d=to(u,f,i,h);if(j(d)<f){const t=Wr(0,f-j(d),3);d.push(j(d)+j(t)),f=j(d)}const[p,g]=[n[0],j(n)],v=f-u,m=Math.abs(g-p),y=p>g,b=d.map(t=>{const e=(t-u)/v;return y?p-e*m:p+e*m}),[x,w]=[.2,.8];return h.forEach(({start:t,end:e,gap:n=.03,compress:r="middle"})=>{const i=d.indexOf(t),o=d.indexOf(e);let a=(b[i]+b[o])/2;"start"===r&&(a=b[i]),"end"===r&&(a=b[o]);const s=n*m/2;let c=y?a+s:a-s,l=y?a-s:a+s;c<x&&(l+=x-c,c=x),l>w&&(c-=l-w,l=w),c>w&&(l-=c-w,c=w),l<x&&(c+=x-l,l=x),b[i]=c,b[o]=l}),this.removeUnsortedValues(d,b,y)}transformBreaks(t){const{domain:e,breaks:n=[]}=t;if(!x(t.breaks))return t;const r=Math.max(...e),i=n.filter(({end:t})=>t<r),o={...t,breaks:i},{breaksDomain:a,breaksRange:s}=this.transformDomain(o);return{...t,domain:a,range:s,breaks:i,tickMethod:()=>[...a]}}chooseTransforms(){return[ft,ft]}clone(){return new bo(this.options)}}class xo extends Ji{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:qi,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new xo(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const wo=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ko extends yo{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:zi,tickMethod:to,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[ft,ft];const e=.5===t?wo:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new ko(this.options)}}class Mo extends ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:zi,tickMethod:to,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Mo(this.options)}}class Oo extends Yi{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!mi(t))return this.options.unknown;const e=Ir(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new Oo(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const Eo=(t,e,n,r=10)=>{const i=t<0,o=xi(r,i),a=bi(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=to(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=to(u,f,t).map(o)}return s?h.reverse():h};class So extends yo{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:zi,tickMethod:Eo,tickCount:5}}chooseNice(){return wi}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[bi(t,n),xi(t,n)]}clone(){return new So(this.options)}}class _o extends Oo{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:ho}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Wr(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new _o(this.options)}}function Ao(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class To extends Oo{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:ho}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort((t,e)=>t-e);const i=[];for(let t=1;t<e;t+=1)i.push(Ao(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new To(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Po=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Co=/\[([^]*?)\]/gm;function No(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Lo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var jo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ro=["January","February","March","April","May","June","July","August","September","October","November","December"],Io=No(Ro,3),Do=Lo({},{dayNamesShort:No(jo,3),dayNames:jo,monthNamesShort:Io,monthNames:Ro,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),Bo=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Fo={D:function(t){return String(t.getDate())},DD:function(t){return Bo(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Bo(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Bo(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Bo(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Bo(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Bo(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Bo(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Bo(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Bo(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Bo(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Bo(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Bo(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Bo(Math.floor(Math.abs(e)/60),2)+":"+Bo(Math.abs(e)%60,2)}},zo={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const $o=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=gi(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Wo(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Go extends yo{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:$o,interpolate:Fi,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return vi}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?pi:oi,r=e?Wo:ft;return e=>function(t,e,n){if(void 0===e&&(e=zo.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=zo[e]||e).replace(Co,function(t,e){return r.push(e),"@@@"});var i=Lo(Lo({},Do),n);return(e=e.replace(Po,function(e){return Fo[e](t,i)})).replace(/@@@/g,function(){return r.shift()})}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new Go(this.options)}}var Ho,Yo=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let qo=Ho=class extends bo{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:ft,tickMethod:to,tickCount:5}}constructor(t){super(t)}clone(){return new Ho(this.options)}};function Vo(t){var e;let n=t;for(;n;){if("view"===(null===(e=n.attributes)||void 0===e?void 0:e.class))return n;n=n.parentNode}return null}function Uo(t){const{markType:e,nodeName:n}=t;return"heatmap"===e&&"image"===n}function Xo(t,e){const n=null!=e?e:Vo(t).__data__,r=t.__data__,{markKey:i,index:o,seriesIndex:a,normalized:s={x:0}}=r,{markState:c}=n,l=Array.from(c.keys()).find(t=>t.key===i);if(l)return a?a.map(t=>l.data[t]):Uo(t)?l.data[Math.round(l.data.length*s.x)]:l.data[o]}function Ko(t,e){const{color:n,facet:r=!1}=t,{color:i,series:o}=e,a=function(t,e){var n,r,i,o;const a=null!==(n=e.markKey)&&void 0!==n?n:null===(i=null===(r=e.element)||void 0===r?void 0:r.__data__)||void 0===i?void 0:i.markKey,s=Object.keys(t).find(e=>{if(e.startsWith("series")){const n=t[e].getOptions();return"series"===n.name&&n.markerKey===a}});return null!==(o=t[s])&&void 0!==o?o:t.series}(t,e),s=t=>t&&t.invert&&!(t instanceof Ji)&&!(t instanceof eo);if(s(a)){return a.clone().invert(o)}if(o&&a instanceof Ji&&a.invert(o)!==i&&!r)return a.invert(o);if(s(n)){const t=n.invert(i);return Array.isArray(t)?null:t}return null}function Zo(t){return t}function Qo(t){return t.reduce((t,e)=>(n,...r)=>e(t(n,...r),...r),Zo)}function Jo(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function ta(t=""){throw new Error(t)}function ea(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||t.attr(e,i)}function na(t){return null!=t&&!Number.isNaN(t)}function ra(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function ia(t,e){return oa(t,e)||{}}function oa(t,e){const n=Object.entries(t||{}).filter(([t])=>t.startsWith(e)).map(([t,n])=>[W(t.replace(e,"").trim()),n]).filter(([t])=>!!t);return 0===n.length?null:Object.fromEntries(n)}function aa(t,...e){return Object.fromEntries(Object.entries(t).filter(([t])=>e.every(e=>!t.startsWith(e))))}function sa(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function ca(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function la(t){return null===t||!1===t}function ua(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];_(o)&&_(t[i])?ua(t[i],o,n,r+1):t[i]=o}return t}}function fa(t,e){return Object.entries(t).reduce((n,[r,i])=>(n[r]=e(i,r,t),n),{})}function ha(t){return t.map((t,e)=>e)}function da(t){return t[0]}function pa(t){return t[t.length-1]}function ga(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function va(t,e=t.length){if(1===e)return t.map(t=>[t]);const n=[];for(let r=0;r<t.length;r++){va(t.slice(r+1),e-1).forEach(e=>{n.push([t[r],...e])})}return n}function ma(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map(t=>{var e;return[t,null===(e=Rn(r,t))||void 0===e?void 0:e[0]]}).filter(([,t])=>na(t));return Array.from(rr(e,t=>i.map(([,e])=>e[t]).join("-")).values())}function ya(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce((t,i)=>0!==t?t:Fn(e[n][i],e[r][i]),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Ea(n=>t(e[n]))}(t):"series"===t?wa:"value"===t?ka:"sum"===t?Ma:"maxIndex"===t?Oa:null}function ba(t,e){for(const n of t)n.sort(e)}function xa(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function wa(t,e,n){return Ea(t=>n[t])}function ka(t,e,n){return Ea(t=>e[t])}function Ma(t,e,n){const r=ha(t),i=Array.from(rr(r,t=>n[+t]).entries()),o=new Map(i.map(([t,n])=>[t,n.reduce((t,n)=>t+ +e[n])]));return Ea(t=>o.get(n[t]))}function Oa(t,e,n){const r=ha(t),i=Array.from(rr(r,t=>n[+t]).entries()),o=new Map(i.map(([t,n])=>[t,wr(n,t=>e[t])]));return Ea(t=>o.get(n[t]))}function Ea(t){return(e,n)=>Fn(t(e),t(n))}qo=Ho=Yo([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return I(n)?Math.round(n):n})(i):i;this.output=jr(s,a,n,t)},n.prototype.invert=void 0}}(function(t){return[t(0),t(1)]},t=>{const[e,n]=t;return jr(Fi(0,1),Rr(e,n))})],qo);const Sa=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{var c;const{data:l,encode:u,style:f={}}=s,[h,d]=Rn(u,"y"),[p,g]=Rn(u,"y1"),[v]=a?In(u,"series","color"):Rn(u,"color"),m=ma(e,t,s),y=(null!==(c=ya(n))&&void 0!==c?c:()=>null)(l,h,v);y&&ba(m,y);const b=new Array(t.length),x=new Array(t.length),w=new Array(t.length),k=[],M=[];for(const t of m){r&&t.reverse();const e=p?+p[t[0]]:0,n=[],i=[];for(const r of t){const t=w[r]=+h[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===h[o[s]];)s--;for(;c<a.length-1&&0===h[a[c]];)c++;k.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=w[t];l=b[t]=(x[t]=l)+e}let u=e;for(const t of n){const e=w[t];e>0?u=b[t]=(x[t]=u)+e:b[t]=x[t]=u}}const O=new Set(k),E=new Set(M),S="y"===i?b:x,_="y"===o?b:x;let A;return A="point"===s.type?{y0:Cn(h,d),y:Pn(S,d)}:{y0:Cn(h,d),y:Pn(S,d),y1:Pn(_,g)},[t,tt({},s,{encode:Object.assign({},A),style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},f)})]}};function _a(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Sa.props={};const Aa=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(_a))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Sa({groupBy:c?["x","series"]:"x"})(e,n,r)};function Ta(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Pa(t){const e=`${t.getFullYear()}-${Ta(t.getMonth()+1)}-${Ta(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Ta(n)}:${Ta(r)}:${Ta(i)}`:e}Aa.props={};const Ca=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(la(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter(t=>t.startsWith(e)).filter(t=>!r[t].inferred).map(t=>Rn(r,t)).filter(([t])=>t).map(t=>t[0]);if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map(t=>t[e]instanceof Date?Pa(t[e]):t[e]).join(", ")};return[t,tt({},n,{tooltip:{title:s}})]}};Ca.props={};const Na=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{x:Cn(jn(t,0))},scale:{x:{guide:null}}})]};Na.props={};const La=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{y:Cn(jn(t,0))},scale:{y:{guide:null}}})]};La.props={};const ja=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{z:Cn(jn(t,0))},scale:{z:{guide:null}}})]};ja.props={};const Ra=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,tt({},e,{encode:{size:Nn(jn(t,3))}})]};Ra.props={};const Ia=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Ie(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map(({value:t})=>t),a=t.map(t=>o.filter(Array.isArray).map(e=>e[t]).join("-"));return[t,tt({},e,{encode:{key:Pn(a)}})]};Ia.props={};const Da=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=Rn(n,"color");return[t,tt({},e,{encode:{series:Pn(o,a)}})]};Da.props={};const Ba=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Dn)?[t,e]:[t,tt({},e,{encode:{y:Pn(n)}})]};Ba.props={};const Fa=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Dn)?[t,e]:[t,tt({},e,{encode:{x:Pn(n)}})]};Fa.props={};const za=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=Rn(n,"y");return[t,tt({},e,{encode:{y1:Pn([...i])}})]};za.props={};const $a=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=Rn(n,"x");return[t,tt({},e,{encode:{x1:Pn([...i])}})]};$a.props={};const Wa=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Dn))){const r=(t,e)=>Array.isArray(t[0])?t.map(t=>t[e]):[t[e]];return[t,tt({},e,{encode:{x:Pn(r(n,0)),x1:Pn(r(n,1))}})]}return[t,e]};Wa.props={};const Ga=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Dn))){const r=(t,e)=>Array.isArray(t[0])?t.map(t=>t[e]):[t[e]];return[t,tt({},e,{encode:{y:Pn(r(n,0)),y1:Pn(r(n,1))}})]}return[t,e]};Ga.props={};const Ha=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(la(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap(t=>Object.keys(r).filter(e=>e.startsWith(t)).map(t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t));return[t,tt({},n,{tooltip:{items:a}})]}};Ha.props={};const Ya=()=>(t,e)=>[t,tt({scale:{x:{padding:0},y:{padding:0}}},e)];Ya.props={};const qa=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Ie(e,["data","style"]),{x:o,y:a}=r,s=Ie(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],tt({},i,{data:[0],cartesian:!0,encode:{x:Pn([o||0]),y:Pn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};qa.props={};const Va=()=>(t,e)=>{const{style:n={}}=e;return[t,tt({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]};Va.props={};const Ua=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(Dn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map(t=>t[0]),o=r.map(t=>t[1]);return[t,tt({},e,{encode:{x:Pn(i),y:Pn(o)}})]};Ua.props={};const Xa=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,tt({},e,{encode:{series:Nn(jn(t,void 0))}})]};Xa.props={};const Ka=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Ie(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=Rn(s,"y"),[f]=In(s,"series","color"),h=xa(f,l),d=tt({},o,{scale:{series:{domain:h,paddingInner:i}}}),p=ma(e,t,o),g=ya(r);if(!g)return[t,tt(d,{encode:{series:Pn(f)}})];const v=g(a,u,f);v&&ba(p,v);const m=new Array(t.length);for(const t of p){n&&t.reverse();for(let e=0;e<t.length;e++)m[t[e]]=h[e]}return[t,tt(d,{encode:{series:Pn(r?m:f)}})]}};Ka.props={};const Za=t=>{const{groupBy:e=["x"],reducer:n=(t,e)=>e[t[0]],orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map(t=>[t,Rn(s,t)[0]]);if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(rr(n,e=>t[e]).values());e.push(...r)}l=e}if(r){const[t]=Rn(s,r);t&&l.sort((e,r)=>n(e,t)-n(r,t)),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[jn(t,u)]:In(s,"enterDuration",jn(t,u)),[h]=In(s,"enterDelay",jn(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=xr(n,t=>+f[t]);for(const t of n)d[t]=+h[t]+e;e+=r}return[t,tt({},a,{encode:{enterDuration:Nn(f),enterDelay:Nn(d)}})]}};Za.props={};const Qa=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=Ie(i,["x"]),s=Object.entries(a).filter(([t])=>t.startsWith("y")).map(([t])=>[t,Rn(i,t)[0]]),[,c]=s.find(([t])=>"y"===t),l=s.map(([e])=>[e,new Array(t.length)]),u=ma(e,t,r),f=function(t){if("function"==typeof t)return t;const e={min:(t,e)=>kr(t,t=>e[+t]),max:(t,e)=>xr(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>Ar(t,t=>e[+t]),median:(t,e)=>Tr(t,t=>e[+t]),sum:(t,e)=>Lr(t,t=>e[+t]),deviation:(t,e)=>Kn(t,t=>e[+t])};return e[t]||xr}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=la(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,tt({},r,Object.assign({encode:Object.fromEntries(l.map(([t,e])=>[t,Pn(e,Rn(i,t)[1])]))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Ja(t,e,n){if(null===t)return[-.5,.5];const r=xa(t,e),i=new Ji({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function ts(t,e,n){return e*(1-t)+n*t}Qa.props={};const es=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=Rn(o,"x"),[u]=Rn(o,"y"),f=Ja(l,s,n),h=Ja(u,c,r),d=t.map(()=>ts(i(),...h)),p=t.map(()=>ts(i(),...f));return[t,tt({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:Pn(d),dx:Pn(p)}})]}};es.props={};const ns=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=Rn(i,"x"),c=Ja(s,a,e),l=t.map(()=>ts(n(),...c));return[t,tt({scale:{x:{padding:.5}}},r,{encode:{dx:Pn(l)}})]}};ns.props={};const rs=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=Rn(i,"y"),c=Ja(s,a,e),l=t.map(()=>ts(n(),...c));return[t,tt({scale:{y:{padding:.5}}},r,{encode:{dy:Pn(l)}})]}};rs.props={};const is=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Ie(r,["x"]),o=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,Rn(r,t)[0]]),a=o.map(([e])=>[e,new Array(t.length)]),s=ma(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap(t=>o.map(([,e])=>+e[t])),[n,r]=Zn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<o.length;n++){const[,r]=o[n],[,i]=a[n];i[t]=+r[t]+e}}return[t,tt({},n,{encode:Object.fromEntries(a.map(([t,e])=>[t,Pn(e,Rn(r,t)[1])]))})]}};is.props={};const os=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,[i]=Rn(r,"y"),[o,a]=Rn(r,"y1"),s=ma(e,t,n),c=new Array(t.length);for(const t of s){const e=t.map(t=>+i[t]);for(let n=0;n<t.length;n++){const r=t[n],o=Math.max(...e.filter((t,e)=>e!==n));c[r]=+i[r]>o?o:i[r]}}return[t,tt({},n,{encode:{y1:Pn(c,a)}})]}};function as(t,e){return[t[0]]}function ss(t,e){return[t[t.length-1]]}function cs(t,e){return[t[wr(t,t=>e[t])]]}function ls(t,e){return[t[Mr(t,t=>e[t])]]}os.props={};const us=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=ma(e,t,i),[s]=Rn(o,n),c=function(t){return"function"==typeof t?t:{first:as,last:ss,max:cs,min:ls}[t]||as}(r);return[a.flatMap(t=>c(t,s)),i]}};us.props={};const fs=(t={})=>{const{selector:e}=t,n=Ie(t,["selector"]);return us(Object.assign({channel:"x",selector:e},n))};fs.props={};const hs=(t={})=>{const{selector:e}=t,n=Ie(t,["selector"]);return us(Object.assign({channel:"y",selector:e},n))};function ds(t){return e=>null===e?t:`${t} of ${e}`}function ps(){return[(t,e)=>Ar(t,t=>+e[t]),ds("mean")]}function gs(){return[(t,e)=>Tr(t,t=>+e[t]),ds("median")]}function vs(){return[(t,e)=>xr(t,t=>+e[t]),ds("max")]}function ms(){return[(t,e)=>kr(t,t=>+e[t]),ds("min")]}function ys(){return[(t,e)=>t.length,ds("count")]}function bs(){return[(t,e)=>Lr(t,t=>+e[t]),ds("sum")]}function xs(){return[(t,e)=>e[t[0]],ds("first")]}function ws(){return[(t,e)=>e[t[t.length-1]],ds("last")]}hs.props={};const ks=(t={})=>{const{groupBy:e}=t,n=Ie(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:ps,max:vs,count:ys,first:xs,last:ws,sum:bs,min:ms,median:gs}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=Rn(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=Rn(o,n);return r})(c,e),u=a.map(t=>n(t,null!=s?s:i));return[t,Object.assign(Object.assign({},Ln(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]}),c=Object.keys(o).map(t=>{const[e,n]=Rn(o,t),r=a.map(t=>e[t[0]]);return[t,Pn(r,n)]}),l=a.map(t=>i[t[0]]);return[ha(a),tt({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};ks.props={};const Ms=(t={})=>{const{channels:e=["x","y"]}=t,n=Ie(t,["channels"]);return ks(Object.assign(Object.assign({},n),{groupBy:(t,n)=>ma(e,t,n)}))};Ms.props={};const Os=(t={})=>Ms(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));Os.props={};const Es=(t={})=>Ms(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));Es.props={};const Ss=(t={})=>Ms(Object.assign(Object.assign({},t),{channels:["color"]}));Ss.props={};const _s=(t={})=>(e,n)=>{const{reverse:r,slice:i,channel:o,by:a,ordinal:s=!0,reducer:c}=t,{encode:l,scale:u={}}=n,f=u[o].domain,[h]=Rn(l,null!=a?a:o),[d]=Rn(l,o),p=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=Rn(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>xr(t,t=>+o[t]);if("min"===i)return t=>kr(t,t=>+o[t]);if("sum"===i)return t=>Lr(t,t=>+o[t]);if("median"===i)return t=>Tr(t,t=>+o[t]);if("mean"===i)return t=>Ar(t,t=>+o[t]);if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(o,{by:a,reducer:c},l),g=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(e,d,f),v=function(t,e,n){return(2!==e.length?cr(or(t,e,n),([t,e],[n,r])=>Fn(e,r)||Fn(t,n)):cr(rr(t,n),([t,n],[r,i])=>e(n,i)||Fn(t,r))).map(([t])=>t)}(g,p,t=>d[t]),m=s?e:cr(e,t=>h[t]);r&&(!s&&m.reverse(),v.reverse());const y="number"==typeof i?[0,i]:i,b=i?v.slice(...y):v;return[m,tt(n,{scale:{[o]:{domain:b}}})]};_s.props={};const As=(t={})=>_s(Object.assign(Object.assign({},t),{channel:"x"}));As.props={};const Ts=(t={})=>_s(Object.assign(Object.assign({},t),{channel:"color"}));Ts.props={};const Ps=(t={})=>_s(Object.assign(Object.assign({},t),{channel:"y"}));Ps.props={};const Cs=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=Rn(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map(t=>t[e]):t.map(e)}(o,e):Rn(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>Lr(t,t=>+e[t]);throw new Error(`Unknown reducer: ${t}`)}(r,c),u=ar(t,l,t=>s[t]).map(t=>t[1]);return[t,tt({},i,{scale:{x:{flex:u}}})]}};function Ns([t,e],[n,r]){return[t-n,e-r]}function Ls([t,e],[n,r]){return[t+n,e+r]}function js([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Rs([t,e]){return Math.atan2(e,t)}function Is([t,e]){return Rs([t,e])+Math.PI/2}function Ds(t,e){const n=Rs(t),r=Rs(e);return n<r?r-n:2*Math.PI-(n-r)}function Bs(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function Fs([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function zs(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const o=t.length;if(0===o)return[];const{innerWidth:a,innerHeight:s}=i,c=s/a;let l=Math.ceil(Math.sqrt(r/c)),u=a/l,f=Math.ceil(r/l),h=f*u;for(;h>s;)l+=1,u=a/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[g,v]=f<=1?[(a-o*u)/(o-1),(s-u)/2]:[0,0];return t.map((t,r)=>{const[i,o,a,s]=Bs(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-h-1)*u+d-o-p*h-v+.5*e}) scale(${(u-e)/a}, ${(u-e)/s})`})}}Cs.props={};const $s=t=>(e,n)=>[e,tt({},n,{modifier:zs(t),axis:!1})];$s.props={};const Ws="thresholds";function Gs(t){const[e,n]=Zn(t);return Math.min(200,function(t,e,n){const r=Xn(t),i=Kn(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const Hs=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Ie(t,["groupChannels","binChannels"]),i={};return ks(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter(([t])=>!t.startsWith(Ws)))),Object.fromEntries(n.flatMap(t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]}))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map(t=>{const[e]=Rn(a,t);return e}),c=ia(r,Ws),l=t.filter(t=>s.every(e=>na(e[t]))),u=[...e.map(t=>{const[e]=Rn(a,t);return e}).filter(na).map(t=>e=>t[e]),...n.map((t,e)=>{const n=s[e],r=c[t]||Gs(n),o=br().thresholds(r).value(t=>+n[t])(l),a=new Map(o.flatMap(t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map(t=>[t,r])}));return i[t]=a,t=>a.get(t)})];return Array.from(rr(l,t=>u.map(e=>e(t)).join("-")).values())}}))};Hs.props={};const Ys=(t={})=>{const{thresholds:e}=t;return Hs(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function qs(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const v=Math.floor((t+1)*c)+1,m=[o(h),a(h)];for(l=u=-1;g<v;g++)u=.5*Math.abs((m[0]-e)*(o(g)-m[1])-(m[0]-a(g))*(n-m[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map(e=>t[e])}Ys.props={};const Vs=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return qs;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Mr(t,t=>n[t])]],max:(t,e,n)=>[t[wr(t,t=>n[t])]],median:(t,e,n)=>[t[Pr(t,t=>n[t])]]},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap(t=>n(t,e,r))}}(e);return(t,e)=>{const{encode:o}=e,a=ma(r,t,e),[s]=Rn(o,"x"),[c]=Rn(o,"y");return[a.flatMap(t=>i(t,s,c,n)),e]}};Vs.props={};const Us=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map(([t,e])=>{const[n]=Rn(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}}).filter(na),a=e.filter(t=>o.every(e=>e(t))),s=a.map((t,e)=>e);if(0===o.length){const t=function(t){var e;const{encode:n}=t,r=Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),{y:Object.assign(Object.assign({},t.encode.y),{value:[]})})}),i=null===(e=null==n?void 0:n.color)||void 0===e?void 0:e.field;if(!n||!i)return r;let o;for(const[t,e]of Object.entries(n))"x"!==t&&"y"!==t||e.field!==i||(o=Object.assign(Object.assign({},o),{[t]:Object.assign(Object.assign({},e),{value:[]})}));return o?Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),o)}):r}(n);return[e,t]}const c=Object.entries(r).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map(t=>e.value[a[t]]).filter(t=>void 0!==t)})]);return[s,tt({},n,{encode:Object.fromEntries(c),data:a.map(t=>i[t])})]};function Xs(t){return function(){return t}}Us.props={};const Ks=Math.abs,Zs=Math.atan2,Qs=Math.cos,Js=Math.max,tc=Math.min,ec=Math.sin,nc=Math.sqrt,rc=1e-12,ic=Math.PI,oc=ic/2,ac=2*ic;function sc(t){return t>=1?oc:t<=-1?-oc:Math.asin(t)}const cc=Math.PI,lc=2*cc,uc=1e-6,fc=lc-uc;function hc(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class dc{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?hc:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return hc;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>uc)if(Math.abs(u*s-c*l)>uc&&i){let h=n-o,d=r-a,p=s*s+c*c,g=h*h+d*d,v=Math.sqrt(p),m=Math.sqrt(f),y=i*Math.tan((cc-Math.acos((p+f-g)/(2*v*m)))/2),b=y/m,x=y/v;Math.abs(b-1)>uc&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>uc||Math.abs(this._y1-l)>uc)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%lc+lc),f>fc?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>uc&&this._append`A${n},${n},0,${+(f>=cc)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function pc(){return new dc}function gc(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new dc(e)}function vc(t){return t.innerRadius}function mc(t){return t.outerRadius}function yc(t){return t.startAngle}function bc(t){return t.endAngle}function xc(t){return t&&t.padAngle}function wc(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/nc(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,v=(h+p)/2,m=(d+g)/2,y=p-h,b=g-d,x=y*y+b*b,w=i-o,k=h*g-p*d,M=(b<0?-1:1)*nc(Js(0,w*w*x-k*k)),O=(k*b-y*M)/x,E=(-k*y-b*M)/x,S=(k*b+y*M)/x,_=(-k*y+b*M)/x,A=O-v,T=E-m,P=S-v,C=_-m;return A*A+T*T>P*P+C*C&&(O=S,E=_),{cx:O,cy:E,x01:-u,y01:-f,x11:O*(i/w-1),y11:E*(i/w-1)}}function kc(){var t=vc,e=mc,n=Xs(0),r=null,i=yc,o=bc,a=xc,s=null,c=gc(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-oc,p=o.apply(this,arguments)-oc,g=Ks(p-d),v=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>rc)if(g>ac-rc)s.moveTo(h*Qs(d),h*ec(d)),s.arc(0,0,h,d,p,!v),f>rc&&(s.moveTo(f*Qs(p),f*ec(p)),s.arc(0,0,f,p,d,v));else{var m,y,b=d,x=p,w=d,k=p,M=g,O=g,E=a.apply(this,arguments)/2,S=E>rc&&(r?+r.apply(this,arguments):nc(f*f+h*h)),_=tc(Ks(h-f)/2,+n.apply(this,arguments)),A=_,T=_;if(S>rc){var P=sc(S/f*ec(E)),C=sc(S/h*ec(E));(M-=2*P)>rc?(w+=P*=v?1:-1,k-=P):(M=0,w=k=(d+p)/2),(O-=2*C)>rc?(b+=C*=v?1:-1,x-=C):(O=0,b=x=(d+p)/2)}var N=h*Qs(b),L=h*ec(b),j=f*Qs(k),R=f*ec(k);if(_>rc){var I,D=h*Qs(x),B=h*ec(x),F=f*Qs(w),z=f*ec(w);if(g<ic)if(I=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<rc))return[t+(h=(u*(e-o)-f*(t-i))/h)*c,e+h*l]}(N,L,F,z,D,B,j,R)){var $=N-I[0],W=L-I[1],G=D-I[0],H=B-I[1],Y=1/ec(function(t){return t>1?0:t<-1?ic:Math.acos(t)}(($*G+W*H)/(nc($*$+W*W)*nc(G*G+H*H)))/2),q=nc(I[0]*I[0]+I[1]*I[1]);A=tc(_,(f-q)/(Y-1)),T=tc(_,(h-q)/(Y+1))}else A=T=0}O>rc?T>rc?(m=wc(F,z,N,L,h,T,v),y=wc(D,B,j,R,h,T,v),s.moveTo(m.cx+m.x01,m.cy+m.y01),T<_?s.arc(m.cx,m.cy,T,Zs(m.y01,m.x01),Zs(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,T,Zs(m.y01,m.x01),Zs(m.y11,m.x11),!v),s.arc(0,0,h,Zs(m.cy+m.y11,m.cx+m.x11),Zs(y.cy+y.y11,y.cx+y.x11),!v),s.arc(y.cx,y.cy,T,Zs(y.y11,y.x11),Zs(y.y01,y.x01),!v))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!v)):s.moveTo(N,L),f>rc&&M>rc?A>rc?(m=wc(j,R,D,B,f,-A,v),y=wc(N,L,F,z,f,-A,v),s.lineTo(m.cx+m.x01,m.cy+m.y01),A<_?s.arc(m.cx,m.cy,A,Zs(m.y01,m.x01),Zs(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,A,Zs(m.y01,m.x01),Zs(m.y11,m.x11),!v),s.arc(0,0,f,Zs(m.cy+m.y11,m.cx+m.x11),Zs(y.cy+y.y11,y.cx+y.x11),v),s.arc(y.cx,y.cy,A,Zs(y.y11,y.x11),Zs(y.y01,y.x01),!v))):s.arc(0,0,f,k,w,v):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-ic/2;return[Qs(r)*n,ec(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Xs(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Xs(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Xs(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Xs(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Xs(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function Mc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Oc(t){this._context=t}function Ec(t){return new Oc(t)}function Sc(t){return t[0]}function _c(t){return t[1]}function Ac(t,e){var n=Xs(!0),r=null,i=Ec,o=null,a=gc(s);function s(s){var c,l,u,f=(s=Mc(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Sc:Xs(t),e="function"==typeof e?e:void 0===e?_c:Xs(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Xs(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function Tc(t,e,n){var r=null,i=Xs(!0),o=null,a=Ec,s=null,c=gc(l);function l(l){var u,f,h,d,p,g=(l=Mc(l)).length,v=!1,m=new Array(g),y=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===v)if(v=!v)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(m[h],y[h]);s.lineEnd(),s.areaEnd()}v&&(m[u]=+t(d,u,l),y[u]=+e(d,u,l),s.point(r?+r(d,u,l):m[u],n?+n(d,u,l):y[u]))}if(p)return s=null,p+""||null}function u(){return Ac().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Sc:Xs(+t),e="function"==typeof e?e:Xs(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?_c:Xs(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Xs(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Xs(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Xs(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Xs(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Xs(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}pc.prototype=dc.prototype,Oc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Pc=Nc(Ec);function Cc(t){this._curve=t}function Nc(t){function e(e){return new Cc(t(e))}return e._curve=t,e}function Lc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Nc(t)):e()._curve},t}function jc(){}function Rc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ic(t,e){this._context=t,this._k=(1-e)/6}function Dc(t,e){this._context=t,this._k=(1-e)/6}function Bc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>rc){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>rc){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Fc(t,e){this._context=t,this._alpha=e}function zc(t,e){this._context=t,this._alpha=e}Cc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Ic.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Rc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Rc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new Ic(t,e)}return n.tension=function(e){return t(+e)},n}(0),Dc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Rc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new Dc(t,e)}return n.tension=function(e){return t(+e)},n}(0),Fc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Bc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return e?new Fc(t,e):new Ic(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),zc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $c=function t(e){function n(t){return e?new zc(t,e):new Dc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Wc(t){this._context=t}function Gc(t){return new Wc(t)}function Hc(t){return t<0?-1:1}function Yc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Hc(o)+Hc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function qc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Vc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Uc(t){this._context=t}function Xc(t){this._context=new Kc(t)}function Kc(t){this._context=t}function Zc(t){return new Uc(t)}function Qc(t){return new Xc(t)}function Jc(t,e){this._context=t,this._t=e}function tl(t){return new Jc(t,.5)}function el(t){return new Jc(t,0)}function nl(t){return new Jc(t,1)}function rl(t){const{transformations:e}=t.getOptions();return e.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function il(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"polar"===t)}function ol(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"reflect"===t)&&e.some(([t])=>t.startsWith("transpose"))}function al(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"helix"===t)}function sl(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"parallel"===t)}function cl(t){const{transformations:e}=t.getOptions();return e.some(([t])=>"fisheye"===t)}function ll(t){return al(t)||il(t)}function ul(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find(t=>"polar"===t[0]);return[+n,+r]}function fl(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find(t=>"polar"===t[0]);return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}Wc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Uc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Vc(this,this._t0,qc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Vc(this,qc(this,n=Yc(this,t,e)),n);break;default:Vc(this,this._t0,n=Yc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Xc.prototype=Object.create(Uc.prototype)).point=function(t,e){Uc.prototype.point.call(this,e,t)},Kc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},Jc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var hl="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function dl(t){return dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(t)}function pl(t){var e=function(t,e){if("object"!=dl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=dl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dl(e)?e:e+""}function gl(t,e,n){return(e=pl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ml(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vl(Object(n),!0).forEach(function(e){gl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function yl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pl(r.key),r)}}function xl(t,e,n){return e&&bl(t.prototype,e),n&&bl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function wl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function kl(t,e){if(t){if("string"==typeof t)return wl(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wl(t,e):void 0}}function Ml(t){return function(t){if(Array.isArray(t))return wl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||kl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ol(t){return Ol=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ol(t)}function El(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(El=function(){return!!t})()}function Sl(t,e){if(e&&("object"==dl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _l(t,e,n){return e=Ol(e),Sl(t,El()?Reflect.construct(e,n||[],Ol(t).constructor):e.apply(t,n))}function Al(t,e){return Al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Al(t,e)}function Tl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Al(t,e)}function Pl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||kl(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Cl={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(Cl);var Nl=Cl.exports;function Ll(){return Ll="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ol(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ll.apply(null,arguments)}function jl(t,e,n,r){var i=Ll(Ol(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}
2
2
  /*!
3
3
  * @antv/g-math
4
4
  * @description Geometry util
@@ -17,7 +17,7 @@ var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toS
17
17
  * @author AntVis
18
18
  * @docs https://g.antv.antgroup.com/
19
19
  */
20
- var jv=function(t){function e(t,n,r,i){var o;return yl(this,e),(o=_l(this,e,[t])).currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return Tl(e,t),xl(e)}(Xp),Rv=0,Iv=function(){return xl(function t(e,n){var r;yl(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(Rv++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new jv(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(e)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Pu)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Pu)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Pu)}},{key:"dispatchEvent",value:function(t){throw new Error(Pu)}},{key:"commitStyles",value:function(){throw new Error(Pu)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new jv(null,this,this.currentTime,t);setTimeout(function(){e.onfinish&&e.onfinish(n)})}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new jv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),Dv=.1,Bv="function"==typeof Float32Array,Fv=function(t,e){return 1-3*e+3*t},zv=function(t,e){return 3*e-6*t},$v=function(t){return 3*t},Wv=function(t,e,n){return((Fv(e,n)*t+zv(e,n))*t+$v(e))*t},Gv=function(t,e,n){return 3*Fv(e,n)*t*t+2*zv(e,n)*t+$v(e)},Hv=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Bv?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Wv(o*Dv,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Dv;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Dv,s=Gv(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Gv(e,n,r);if(0===o)return e;e-=(Wv(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Wv(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+Dv,t,n)};return function(t){return 0===t||1===t?t:Wv(a(t),e,r)}},Yv=function(t){return Math.pow(t,2)},qv=function(t){return Math.pow(t,3)},Vv=function(t){return Math.pow(t,4)},Uv=function(t){return Math.pow(t,5)},Xv=function(t){return Math.pow(t,6)},Kv=function(t){return 1-Math.cos(t*Math.PI/2)},Zv=function(t){return 1-Math.sqrt(1-t*t)},Qv=function(t){return t*t*(3*t-2)},Jv=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},tm=function(t){var e=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],o=void 0===i?.5:i,a=R(Number(r),1,10),s=R(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/a))*(2*Math.PI)/s)},em=function(t){var e=arguments.length>2?arguments[2]:void 0,n=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?100:o,s=n[2],c=void 0===s?10:s,l=n[3],u=void 0===l?0:l;i=R(i,.1,1e3),a=R(a,.1,1e3),c=R(c,.1,1e3),u=R(u,.1,1e3);var f=Math.sqrt(a/i),h=c/(2*Math.sqrt(a*i)),d=h<1?f*Math.sqrt(1-h*h):0,p=h<1?(h*f-u)/d:-u+f,g=e?e*t/1e3:t;return g=h<1?Math.exp(-g*h*f)*(1*Math.cos(d*g)+p*Math.sin(d*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},nm=function(t){var e=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(R(t,0,1)*r)/r},rm=function(t){var e=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],o=e[3];return Hv(n,r,i,o)(t)},im=Hv(.42,0,1,1),om=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},am=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},sm=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},cm={steps:nm,"step-start":function(t){return nm(t,[1,"start"])},"step-end":function(t){return nm(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":rm,ease:function(t){return rm(t,[.25,.1,.25,1])},in:im,out:om(im),"in-out":am(im),"out-in":sm(im),"in-quad":Yv,"out-quad":om(Yv),"in-out-quad":am(Yv),"out-in-quad":sm(Yv),"in-cubic":qv,"out-cubic":om(qv),"in-out-cubic":am(qv),"out-in-cubic":sm(qv),"in-quart":Vv,"out-quart":om(Vv),"in-out-quart":am(Vv),"out-in-quart":sm(Vv),"in-quint":Uv,"out-quint":om(Uv),"in-out-quint":am(Uv),"out-in-quint":sm(Uv),"in-expo":Xv,"out-expo":om(Xv),"in-out-expo":am(Xv),"out-in-expo":sm(Xv),"in-sine":Kv,"out-sine":om(Kv),"in-out-sine":am(Kv),"out-in-sine":sm(Kv),"in-circ":Zv,"out-circ":om(Zv),"in-out-circ":am(Zv),"out-in-circ":sm(Zv),"in-back":Qv,"out-back":om(Qv),"in-out-back":am(Qv),"out-in-back":sm(Qv),"in-bounce":Jv,"out-bounce":om(Jv),"in-out-bounce":am(Jv),"out-in-bounce":sm(Jv),"in-elastic":tm,"out-elastic":om(tm),"in-out-elastic":am(tm),"out-in-elastic":sm(tm),spring:em,"spring-in":em,"spring-out":om(em),"spring-in-out":am(em),"spring-out-in":sm(em)},lm=function(t){return t};function um(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var fm="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",hm=new RegExp("cubic-bezier\\(".concat(fm,",").concat(fm,",").concat(fm,",").concat(fm,"\\)")),dm=/steps\(\s*(\d+)\s*\)/,pm=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function gm(t){var e=hm.exec(t);if(e)return Hv.apply(void 0,Ml(e.slice(1).map(Number)));var n=dm.exec(t);if(n)return um(Number(n[1]),0);var r=pm.exec(t);return r?um(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):cm[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||cm.linear}function vm(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function mm(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function ym(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(bm(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:gm(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,c=i[a].computedOffset,l=i[s].computedOffset,u=c,f=l;0===o&&(u=-1/0,0===l&&(s=a)),o===i.length-2&&(f=1/0,1===c&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:wm(r,i[a].value,i[s].value,e)})}return n.sort(function(t,e){return t.startOffset-e.startOffset}),n}(r,n);return function(t,e){if(null!==e)i.filter(function(t){return e>=t.applyFrom&&e<t.applyTo}).forEach(function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(o),!1,!1)});else for(var n in r)bm(n)&&t.setAttribute(n,null)}}function bm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var xm=function(t,e,n){return function(r){var i=km(t,e,r);return I(i)?i:n(i)}};function wm(t,e,n,r){var i=Ld[t];if(i&&i.syntax&&i.int){var o=Fg.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=o.parser,s=a?a(e,r):e,c=a?a(n,r):n,l=o.mixer(s,c,r);if(l){var u=xm.apply(void 0,Ml(l));return function(t){return 0===t?e:1===t?n:u(t)}}}}return xm(!1,!0,function(t){return t?n:e})}function km(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(km(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var Mm=function(){return xl(function t(){yl(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=lm,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null},[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=gm(t),this._easing=t}}])}();function Om(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),e}(t));for(var n=t.map(function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(b(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter(function(t){return Number(t.offset)>=0&&Number(t.offset)<=1}),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var s=n[a].computedOffset;if(!b(s)&&!b(o)){for(var c=1;c<a-i;c++)n[i+c].computedOffset=o+(Number(s)-o)*c/(a-i);i=a,o=Number(s)}}}(),n}var Em="backwards|forwards|both|none".split("|"),Sm="reverse|alternate|alternate-reverse".split("|");function _m(t,e){return function(t,e){var n=new Mm;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach(function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Em.indexOf(t[e]))return;if("direction"===e&&-1===Sm.indexOf(t[e]))return;n[e]=t[e]}}):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Am=function(){return xl(function t(e,n,r){var i=this;yl(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=_m(r,!1),this.timing.effect=this,this.timing.activeDuration=vm(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Om(n,this.timing),this.interpolations=ym(this.normalizedKeyframes,this.timing,this.target);var o=Fg.globalThis.Proxy;this.computedTiming=o?new o(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing},[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=mm(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=Om(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach(function(n){e.timing[n]=t[n]})}}])}();function Tm(t,e){return Number(t.id)-Number(e.id)}var Pm=function(){return xl(function t(e){var n=this;yl(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(Tm),n.animations=n.tick(t,!0,n.animations)[0],e.forEach(function(e){e[1](t)}),n.applyPendingEffects()},this.document=e},[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new Am(t,e,n),i=new Iv(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Tm),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach(function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){null==t||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF(function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()})}},{key:"tick",value:function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],l=[];return n.forEach(function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)}),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,l]}}])}();function Cm(t){return new Nm([t],null,t,t.ownerDocument)}Fg.EasingFunction=gm,Fg.AnimationTimeline=Pm;class Nm{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Nm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Nm(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Nm([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,o]=Array.isArray(r)?r:[r,null],a=e(i,t);a.__data__=i,null!==o&&(a.__fromElements__=o),this._parent.appendChild(a),n.push(a)}return new Nm(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new Nm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Nm([i],null,this._parent,this._document);const o="string"==typeof e?this.createElement(e):e();return o.id=t,n&&(o.className=n),r.appendChild(o),new Nm([o],null,this._parent,this._document)}data(t,e=t=>t,n=()=>null){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,c=new Map(this._elements.map((t,n)=>[e(t.__data__,n),t])),l=new Map(this._facetElements.map((t,n)=>[e(t.__data__,n),t])),u=rr(this._elements,t=>n(t.__data__));for(let f=0;f<t.length;f++){const h=t[f],d=e(h,f),p=n(h,f);if(c.has(d)){const t=c.get(d);t.__data__=h,t.__facet__=!1,i.push(t),o.delete(t),c.delete(d)}else if(l.has(d)){const t=l.get(d);t.__data__=h,t.__facet__=!0,i.push(t),l.delete(d)}else if(u.has(d)){const t=u.get(d);a.push([h,t]);for(const e of t)o.delete(e);u.delete(d)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(h):t.__toData__=[h],s.add(t),o.delete(t)}else r.push(h)}const f=[new Nm([],r,this._parent,this._document),new Nm(i,null,this._parent,this._document),new Nm(o,null,this._parent,this._document),new Nm([],a,this._parent,this._document),new Nm(s,null,this._parent,this._document)];return new Nm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Nm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Nm.registry[t];return e?new e:ta(`Unknown node type: ${t}`)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){const o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(this._elements[t].__removed__=!0,e){const n=Array.isArray(e)?e:[e];Promise.all(n.map(t=>t.finished)).then(()=>{const e=this._elements[t];e.__removed__&&e.remove()})}else{const e=this._elements[t];e.__removed__&&e.remove()}}return new Nm([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,o){void 0!==e&&(o[t]=n(r,i,o))})}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,o){void 0!==e&&(o.style[t]=n(r,i,o))})}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each(function(t,r,i){n[r]=e(t,r,i)})}on(t,e){return this.each(function(n,r,i){i.addEventListener(t,e)}),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function Lm(t,e,n){return Math.max(e,Math.min(t,n))}function jm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Rm(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Im(t,e,n,r,i){const o=Rs(Ns(r,e))+Math.PI,a=Rs(Ns(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function Dm(t,e,n,r="y",i="between",o=!1){const a="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,o),c=ha(a),[l,u]=Zn(c,t=>a[t]),f=new bo({domain:[l,u],range:[0,100]}),h=t=>I(a[t])&&!Number.isNaN(a[t])?f.map(a[t]):0,d={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`},p=c.sort((t,e)=>h(t)-h(e)).map(d[i]||d.between).join(",");return`linear-gradient(${s}deg, ${p})`}function Bm(t){const[e,n,r,i]=t;return[i,e,n,r]}function Fm(t,e,n){const[r,i,,o]=rl(t)?Bm(e):e,[a,s]=n,c=t.getCenter(),l=Is(Ns(r,c)),u=Is(Ns(i,c)),f=u===l&&a!==s?u+2*Math.PI:u,h=1e-4;return{startAngle:l+h,endAngle:(f-l>=0?f:2*Math.PI+f)-h,innerRadius:js(o,c),outerRadius:js(r,c)}}function zm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function $m(t,e){if(!il(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Wm(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}function Gm(t,e,n,r,i={}){const{inset:o=0,radius:a=0,insetLeft:s=o,insetTop:c=o,insetRight:l=o,insetBottom:u=o,radiusBottomLeft:f=a,radiusBottomRight:h=a,radiusTopLeft:d=a,radiusTopRight:p=a,minWidth:g=-1/0,maxWidth:v=1/0,minHeight:m=-1/0}=i,y=Ie(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!il(r)&&!al(r)){const n=!!rl(r),[i,,o]=n?Bm(e):e,[a,b]=i,[x,w]=Ns(o,i),k=(x>0?a:a+x)+s,M=(w>0?b:b+w)+c,O=Math.abs(x)-(s+l),E=Math.abs(w)-(c+u),S=n?Lm(O,m,1/0):Lm(O,g,v),_=n?Lm(E,g,v):Lm(E,m,1/0),A=n?k:k-(S-O)/2,T=n?M-(_-E)/2:M-(_-E);return Cm(t.createElement("rect",{})).style("x",A).style("y",T).style("width",S).style("height",_).style("radius",[d,p,h,f]).call(Rm,y).node()}const{y:b,y1:x}=n,w=r.getCenter(),k=Fm(r,e,[b,x]),M=kc().cornerRadius(a).padAngle(o*Math.PI/180);return Cm(t.createElement("path",{})).style("d",M(k)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(Rm,y).node()}Nm.registry={g:rv,rect:gv,circle:Jg,path:uv,text:mv,ellipse:nv,image:av,line:cv,polygon:hv,polyline:pv,html:ov};const Hm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Ie(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Ie(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:m=g,radiusBottomRight:y=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:k=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:O=x,lineWidth:E=("stroke"===n||p?d:0),inset:S=0,insetLeft:_=S,insetRight:A=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:N,minHeight:L}=a,j=Ie(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,D=[i?v:w,i?m:k,o?y:M,o?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];rl(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map((t,e)=>[t,D[e]]))),{inset:S,insetLeft:_,insetRight:A,insetBottom:T,insetTop:P,minWidth:C,maxWidth:N,minHeight:L});return Cm(Gm(c,e,r,s,F)).call(Rm,h).style("fill","transparent").style(n,R).style(zm(t),I).style("lineWidth",E).style("stroke",void 0===p?R:p).call(Rm,j).node()}};Hm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ym=(t,e)=>Hm(Object.assign({colorAttribute:"fill"},t),e);Ym.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"square"});const qm=(t,e)=>Hm(Object.assign({colorAttribute:"stroke"},t),e);function Vm(t,e,n){const[r,i,o,a]=t;if(rl(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}qm.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"hollowSquare"});const Um=(t,e)=>{const{adjustPoints:n=Vm}=t,r=Ie(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Ie(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!rl(i),[p,g,v,m]=d?Bm(h):h,{color:y=l,opacity:b}=e,x=Ac().curve(Gc)([p,g,v,m]);return Cm(o.createElement("path",{})).call(Rm,u).style("d",x).style("fill",y).style("fillOpacity",b).call(Rm,r).node()}};function Xm(t,e,n){const[r,i,o,a]=t;if(rl(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}Um.props={defaultMarker:"square"};const Km=(t,e)=>Um(Object.assign({adjustPoints:Xm},t),e);function Zm(t){const e="function"==typeof t?t:t.render;return class extends ev{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Km.props={defaultMarker:"square"};const Qm=Zm(t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;Cm(t).maybeAppend("line",()=>o.createElement("path",{})).style("d",e).call(Rm,r),Cm(t).maybeAppend("line1",()=>o.createElement("path",{})).style("d",n).call(Rm,i)});const Jm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,s=Ie(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Ie(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:v,seriesX:m,seriesY:y}=e,b=$m(c,e),x=rl(c),w=r&&v?Dm(v,m,y,r,i,x):p,k=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(il(c)){const t=c.getCenter();M=e=>Lc(Ac().curve(Pc)).angle((n,r)=>Is(Ns(e[r],t))).radius((n,r)=>js(e[r],t)).defined(([t,e])=>o(t)&&o(e)).curve(n)(e)}else M=Ac().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>o(t)&&o(e)).curve(n);const[O,E]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),S=ia(k,"connect"),_=!!E.length;if(!_||a&&!Object.keys(S).length)return Cm(l.createElement("path",{})).style("d",M(O)||[]).call(Rm,k).node();if(_&&!a)return Cm(l.createElement("path",{})).style("d",M(t)).call(Rm,k).node();return Cm(new Qm).style("style1",Object.assign(Object.assign({},k),S)).style("style2",k).style("d1",(A=E,A.map(M).join(","))).style("d2",M(t)).node();var A}};Jm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ty=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=il(n)?Gc:Ec;return Jm(Object.assign({curve:i},t),e)(...r)}};ty.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"line"});const ey=(t,e)=>{const n=Ie(t,[]),{coordinate:r}=e;return(...t)=>{const i=il(r)?$c:rl(r)?Qc:Zc;return Jm(Object.assign({curve:i},n),e)(...t)}};ey.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"smooth"});const ny=(t,e)=>Jm(Object.assign({curve:nl},t),e);ny.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"hv"});const ry=(t,e)=>Jm(Object.assign({curve:el},t),e);ry.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"vh"});const iy=(t,e)=>Jm(Object.assign({curve:tl},t),e);function oy(t,e,n,r,i){const o=Rs(Ns(n,e)),a=o+Math.PI/2,s=[r/2*Math.cos(a),r/2*Math.sin(a)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],u=[r/2*Math.cos(o),r/2*Math.sin(o)],f=Ls(e,s),h=Ls(n,c),d=Ls(h,l),p=Ls(n,l),g=Ns(p,c),v=Ns(n,c),m=Ns(e,s),y=Ns(m,u),b=Ns(e,u),x=Ns(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...m),t.arcTo(...y,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}iy.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"hvh"});const ay=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Ie(i,["color"]),l=pc();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=o[t],a=o[t+1];[...n,...r].every(na)&&oy(l,n,r,i,a)}return Cm(n.createElement("path",{})).call(Rm,c).style("fill",a||s).style("d",l.toString()).call(Rm,t).node()}};ay.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"line"});const sy=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];sy.style=["fill"];const cy=sy.bind(void 0);cy.style=["stroke","lineWidth"];const ly=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];ly.style=["fill"];const uy=ly.bind(void 0);uy.style=["fill"];const fy=ly.bind(void 0);fy.style=["stroke","lineWidth"];const hy=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};hy.style=["fill"];const dy=hy.bind(void 0);dy.style=["stroke","lineWidth"];const py=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};py.style=["fill"];const gy=py.bind(void 0);gy.style=["stroke","lineWidth"];const vy=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};vy.style=["fill"];const my=vy.bind(void 0);my.style=["stroke","lineWidth"];const yy=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};yy.style=["fill"];const by=yy.bind(void 0);by.style=["stroke","lineWidth"];const xy=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};xy.style=["fill"];const wy=xy.bind(void 0);wy.style=["stroke","lineWidth"];const ky=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];ky.style=["stroke","lineWidth"];const My=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];My.style=["stroke","lineWidth"];const Oy=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];Oy.style=["stroke","lineWidth"];const Ey=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];Ey.style=["stroke","lineWidth"];const Sy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Sy.style=["stroke","lineWidth"];const _y=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];_y.style=["stroke","lineWidth"];const Ay=_y.bind(void 0);Ay.style=["stroke","lineWidth"];const Ty=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];Ty.style=["stroke","lineWidth"];const Py=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];Py.style=["stroke","lineWidth"];const Cy=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];Cy.style=["stroke","lineWidth"];const Ny=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];Ny.style=["stroke","lineWidth"];const Ly=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];Ly.style=["stroke","lineWidth"];const jy=new Map([["bowtie",xy],["cross",My],["dash",Ay],["diamond",hy],["dot",_y],["hexagon",yy],["hollowBowtie",wy],["hollowDiamond",dy],["hollowHexagon",by],["hollowPoint",cy],["hollowSquare",fy],["hollowTriangle",gy],["hollowTriangleDown",my],["hv",Py],["hvh",Ny],["hyphen",Sy],["line",ky],["plus",Ey],["point",sy],["rect",uy],["smooth",Ty],["square",ly],["tick",Oy],["triangleDown",vy],["triangle",py],["vh",Cy],["vhv",Ly]]);function Ry(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function Iy(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||cl(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}const Dy=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Ie(t,["colorAttribute","symbol","mode"]),a=jy.get(Ry(r))||jy.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=o.stroke?u||1:u,{color:d=f,transform:p,opacity:g}=r,[v,m]=Wm(e),y=Iy(i,e,r,s)||o.r||l.r;return Cm(c.createElement("path",{})).call(Rm,l).style("fill","transparent").style("d",a(v,m,y)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${v-y} ${m-y}`).style("stroke",d).style(zm(t),g).style(n,d).call(Rm,o).node()}};Dy.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const By=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);By.props=Object.assign({defaultMarker:"hollowBowtie"},Dy.props);const Fy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Fy.props=Object.assign({defaultMarker:"hollowDiamond"},Dy.props);const zy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);zy.props=Object.assign({defaultMarker:"hollowHexagon"},Dy.props);const $y=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);$y.props=Object.assign({defaultMarker:"hollowPoint"},Dy.props);const Wy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Wy.props=Object.assign({defaultMarker:"hollowSquare"},Dy.props);const Gy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Gy.props=Object.assign({defaultMarker:"hollowTriangle"},Dy.props);const Hy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Hy.props=Object.assign({defaultMarker:"hollowTriangleDown"},Dy.props);const Yy=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Ie(t,["colorAttribute","mode"]),{coordinate:o,document:a}=e;return(e,s,c)=>{const{lineWidth:l,color:u}=c,f=i.stroke?l||1:l,{color:h=u,transform:d,opacity:p}=s,[g,v]=Wm(e),m=Iy(r,e,s,o)||i.r||c.r;return Cm(a.createElement("circle",{})).call(Rm,c).style("fill","transparent").style("cx",g).style("cy",v).style("r",m).style("lineWidth",f).style("transform",d).style("transformOrigin",`${g} ${v}`).style("stroke",h).style(zm(t),p).style(n,h).call(Rm,i).node()}},qy=(t,e)=>Yy(Object.assign({colorAttribute:"fill"},t),e);qy.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Vy=(t,e)=>Yy(Object.assign({colorAttribute:"stroke"},t),e);Vy.props=Object.assign({defaultMarker:"hollowPoint"},qy.props);const Uy=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Uy.props=Object.assign({defaultMarker:"bowtie"},Dy.props);const Xy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Xy.props=Object.assign({defaultMarker:"cross"},Dy.props);const Ky=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Ky.props=Object.assign({defaultMarker:"diamond"},Dy.props);const Zy=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Zy.props=Object.assign({defaultMarker:"hexagon"},Dy.props);const Qy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Qy.props=Object.assign({defaultMarker:"hyphen"},Dy.props);const Jy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Jy.props=Object.assign({defaultMarker:"line"},Dy.props);const tb=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);tb.props=Object.assign({defaultMarker:"plus"},Dy.props);const eb=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);eb.props=Object.assign({defaultMarker:"point"},Dy.props);const nb=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);nb.props=Object.assign({defaultMarker:"square"},Dy.props);const rb=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);rb.props=Object.assign({defaultMarker:"tick"},Dy.props);const ib=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);ib.props=Object.assign({defaultMarker:"triangle"},Dy.props);const ob=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);ob.props=Object.assign({defaultMarker:"triangleDown"},Dy.props);const ab=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Ie(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Ie(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=pc();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*js(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...t),d.lineTo(...h),d.lineTo(...e)}return Cm(o.createElement("path",{})).call(Rm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Rm,i).node()}};function sb(t,e){e(t),t.children&&t.children.forEach(function(t){t&&sb(t,e)})}function cb(t){ub(t,!0)}function lb(t){ub(t,!1)}function ub(t,e){var n=e?"visible":"hidden";sb(t,function(t){t.attr("visibility",n)})}ab.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var fb=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,$e([],ze(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(cg.INSERTED,function(){lb(r)}),r}return je(e,t),e}(rv);function hb(t){var e=t.appendChild(new fb({class:"offscreen"}));return lb(e),e}var db=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Ie(e,["style"]);return t.call(this,Re({style:Re({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return je(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hb(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(mv);function pb(t){return t*Math.PI/180}function gb(t){return Number((180*t/Math.PI).toPrecision(5))}var vb=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function mb(t,e){return y(t)?t.apply(void 0,$e([],ze(e),!1)):t}var yb,bb,xb,wb,kb=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map(function(t){var e=ze(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]}));return Object.assign(r,{prefix:n}),r},Mb=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach(function(i){var o=ze(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?_(s)?(_(t[a])||(c[a]={}),n<r?Mb(t[a],s,n+1,r):c[a]=e[a]):x(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)})},Ob=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Mb(t,e[r]);return t},Eb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},Sb=(bb=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return yb||(yb=Fg.offscreenCanvasCreator.getOrCreateContext(void 0)),yb.font=[o,a,i,"".concat(n,"px"),r].join(" "),yb.measureText(t).width},xb=function(t,e){return[t,Object.values(e||_b(t)).join()].join("")},void 0===(wb=4096)&&(wb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=xb?xb.apply(this,t):t[0];Z.has(bb)||Z.set(bb,function(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}(wb));var r=Z.get(bb);if(r.has(n))return r.get(n);var i=bb.apply(this,t);return r.set(n,i),i}),_b=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function Ab(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Tb(t,e){var n=Ab(t);n&&n.attr(e)}function Pb(t,e,n){void 0===n&&(n="..."),Tb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Cb(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function Nb(t){return"function"==typeof t?t():L(t)||I(t)?new db({style:{text:String(t)}}):t}function Lb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function jb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}function Rb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=Rb(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach(function(e){var i=ze(e,2),o=i[0],a=i[1];o in t?n[o]=Rb(t[o],a):r[o]=a}),function(t){return Object.entries(n).forEach(function(e){var n=ze(e,2),i=n[0],o=n[1];return r[i]=o(t)}),r}}(t,e):function(e){return t}}function Ib(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,c=a.y,l=ze([s+a.width,c+a.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new vb(e,n,r-e,i-n)}var Db=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=ze([0,0],2),g=p[0],v=p[1],m=e.map(function(t){var e,n=t.width,r=t.height,i=ze([g,v],2),o=i[0],a=i[1];return e=ze([g+n*d[0],v+r*d[1]],2),g=e[0],v=e[1],new vb(o,a,n,r)}),y=Ib(m),b={"flex-start":0,"flex-end":f?r-y.width:i-y.height,center:f?(r-y.width)/2:(i-y.height)/2},x=m.map(function(t){var e=t.x,n=t.y,r=vb.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r});Ib(x);var w=function(t){var e=ze(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},k=x.map(function(t){var e=t.x,n=t.y,r=vb.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r}),M=k.map(function(e){var n,r,i=vb.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i});return M},Bb=function(t,e,n){return[]};function Fb(t,e){return[t[0]*e,t[1]*e]}function zb(t,e){return[t[0]+e[0],t[1]+e[1]]}function $b(t,e){return[t[0]-e[0],t[1]-e[1]]}function Wb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Gb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Hb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Yb(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function qb(t,e){return+t.toPrecision(e)}function Vb(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Ub(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,c,l,u=function(t,e,n,r){var i,o,a,s,c,l,u=[],f=!!r,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=ze(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=Wb(h,m=t[p]),d=Gb(d,m)}p=0;for(var v=t.length;p<v;p+=1){var m=t[p];if(0!==p||n)if(p!==v-1||n){o=t[[p?p-1:v-1,p-1][n?0:1]];var y=[0,0];y=Fb(y=$b(a=t[n?(p+1)%v:p+1],o),e);var b=Hb(m,o),x=Hb(m,a),w=b+x;0!==w&&(b/=w,x/=w);var k=Fb(y,-b),M=Fb(y,x);c=zb(m,k),s=Wb(s=zb(m,M),Gb(a,m)),s=Gb(s,Wb(a,m)),c=Wb(c=zb(m,k=Fb(k=$b(s,m),-b/x)),Gb(o,m)),s=zb(m,M=Fb(M=$b(m,c=Gb(c,Wb(o,m))),x/b)),f&&(c=Wb(c=Gb(c,h),d),s=Wb(s=Gb(s,h),d)),u.push(l),u.push(c),l=s}else c=m,u.push(l),u.push(c);else l=m}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,h=[];for(o=0;o<f-1;o+=1)s=u[2*o],c=u[2*o+1],l=i[o+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=ze(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var Xb=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Kb(t){return Xb.includes(t)}function Zb(t){var e={};for(var n in t)Kb(n)&&(e[n]=t[n]);return e}function Qb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&(t.style.transform="scale(".concat(a,")")),a}var Jb=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=ze(Array.isArray(a)?a:[a,null],2),c=s[0],l=s[1];(f=r(c,o)).__data__=c,null!==l&&(f.__fromElements__=l),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var u=this._elements[o],f=r(c=u.__data__,o);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=We(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),o=We(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,n){var i=We(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,o;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var a=[],s=[],c=new Set(this._elements),l=[],u=new Set,f=new Map(this._elements.map(function(t,n){return[e(t.__data__,n),t]})),h=new Map(this._facetElements.map(function(t,n){return[e(t.__data__,n),t]})),d=function(t,e){var n=new Map;return t.forEach(function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)}),n}(this._elements,function(t){return r(t.__data__)}),p=0;p<t.length;p++){var g=t[p],v=e(g,p),m=r(g,p);if(f.has(v))(w=f.get(v)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(v);else if(h.has(v)){(w=h.get(v)).__data__=g,w.__facet__=!0,s.push(w),h.delete(v)}else if(d.has(v)){var y=d.get(v);l.push([g,y]);try{for(var b=(i=void 0,Fe(y)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(v)}else if(f.has(m)){(w=f.get(m)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var k=[new n([],a,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,k)},t.prototype.merge=function(t){var e=$e($e([],ze(this._elements),!1),ze(t._elements),!1),r=$e($e([],ze(this._transitions),!1),ze(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then(function(){return n.remove()}):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each(function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))})},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each(function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))})},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each(function(n,r){var i=this;Object.entries(t).forEach(function(t){var o=ze(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))})})},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.transition=function(t){var e=new Array(this._elements.length);return this.each(function(n,r){e[r]=t.call(this,n,r)}),this._transitions=T(e),this},t.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,$e([this._parent,this],ze(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var o="string"==typeof e?this.createElement(e):e();return r.appendChild(o),new n([o],null,this._parent,this._document)},t.registry={g:rv,rect:gv,circle:Jg,path:uv,text:db,ellipse:nv,image:av,line:cv,polygon:hv,polyline:pv,html:ov},t}();function tx(t){return new Jb([t],null,t,t.ownerDocument)}function ex(t){if(I(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function nx(t){var e=t.getLocalBounds(),n=ze([e.min,e.max],2),r=ze(n[0],2),i=r[0],o=r[1],a=ze(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function rx(t,e){var n=ze(t,2),r=n[0],i=n[1],o=ze(e,2),a=o[0],s=o[1];return r!==a&&i===s}function ix(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function ox(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var ax=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function sx(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach(function(t){var i=ze(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(ax(o,"show")&&ax(ox(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(ix(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(ix(e)),"")]=a;else if(!ax(o,"show")&&ax(o,e)!==n){var s=ox(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}}),r}function cx(t,e){return Object.entries(t).reduce(function(t,n){var r=ze(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(ix(i))]=o,t},{})}function lx(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach(function(t){var o=ze(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)}),[r,i]}function ux(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=ze([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t}),2);return[a[0],a[1]]}(t,n,r),")")});t.attr("transform",n)}catch(t){}}var fx=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,$e([],ze(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach(function(e){return t.appendChild(e)}):t.appendChild(e)):t.innerHTML=""};function hx(){ub(this,"hidden"!==this.attributes.visibility)}var dx=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,Ob({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return je(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hb(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&hx.call(this)},e.prototype.update=function(t,e){var n;return this.attr(Ob({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return Ie(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(ev),px=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},gx=px,vx=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},mx=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},yx=mx;var bx=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function xx(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(y(t))e="symbol";else if(L(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var wx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return je(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=Ie(s,["symbol","size"]),h=xx(c);Lb(!!h,tx(n),function(t){t.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call(function(t){if("image"===h){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:a-u})}else{n=u/2;var r=y(c)?c:e.getSymbol(c);t.styles(Re({d:null==r?void 0:r(i,a,n)},f))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(dx);function kx(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function Mx(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}wx.registerSymbol("cross",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]}),wx.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),wx.registerSymbol("line",vx),wx.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),wx.registerSymbol("tick",function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]}),wx.registerSymbol("circle",px),wx.registerSymbol("point",gx),wx.registerSymbol("bowtie",function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),wx.registerSymbol("hexagon",function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),wx.registerSymbol("square",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]}),wx.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),wx.registerSymbol("triangle",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),wx.registerSymbol("triangle-down",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),wx.registerSymbol("line",vx),wx.registerSymbol("dot",mx),wx.registerSymbol("dash",yx),wx.registerSymbol("smooth",function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}),wx.registerSymbol("hv",function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]}),wx.registerSymbol("vh",function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]}),wx.registerSymbol("hvh",function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]}),wx.registerSymbol("vhv",function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]});const Ox=Math.sqrt(50),Ex=Math.sqrt(10),Sx=Math.sqrt(2);function _x(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=Ox?10:o>=Ex?5:o>=Sx?2:1)*10**i:-(10**-i)/(o>=Ox?10:o>=Ex?5:o>=Sx?2:1)}const Ax=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=_x(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=_x(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=_x(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r};function Tx(t){return!q(t)&&!Y(t)&&!Number.isNaN(t)}function Px(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Cx(t){const e=Ii.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*Px(a,o,e+1/3),255*Px(a,o,e),255*Px(a,o,e-1/3),i]}(r):null}const Nx=(t,e)=>n=>t*(1-n)+e*n,Lx=(t,e)=>"number"==typeof t&&"number"==typeof e?Nx(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Cx(t),r=Cx(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,jx=(t,e)=>{const n=Nx(t,e);return t=>Math.round(n(t))};function Rx({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ix(t){return"object"==typeof t?t.valueOf():t}class Dx extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Ix,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Rx({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Rx({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Bx{constructor(t){this.options=tt({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=tt({},this.options,t),this.rescale(t)}rescale(t){}}const Fx=Symbol("defaultUnknown");function zx(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function $x(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Fx)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Wx(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Gx extends Bx{getDefaultOptions(){return{domain:[],range:[],unknown:Fx}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&zx(this.domainIndexMap,this.getDomain(),this.domainKey),$x({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&zx(this.rangeIndexMap,this.getRange(),this.rangeKey),$x({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Wx(e),this.rangeKey=Wx(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Gx(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Hx(t){return Math.round(1e12*t)/1e12}function Yx(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,v=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(l),m=v.reduce((t,e)=>t+e),y=g/m,b=new Dx(e.map((t,e)=>{const n=v[e]*y;return[t,a?Math.floor(n):n]})),x=new Dx(e.map((t,e)=>{const n=v[e]*y+p;return[t,a?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(h-(w-w/c*i))*s;let M=a?Math.round(k):k;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=Hx(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class qx extends Gx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Fx,flex:[]}}constructor(t){super(t)}clone(){return new qx(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Yx(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*l);return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const Vx=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=_x(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i},Ux=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=Mx(r,i),c=n(o,a)):(s=Mx(i,r),c=n(a,o)),kx(c,s)},Xx=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Mx(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=function(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}(t,e,1,r)-1,a=i[n];return kx(o[n],a)(e)}},Kx=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Xx:Ux)(t,e,r?jx:n);class Zx extends Bx{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Nx,tickCount:5}}map(t){return Tx(t)?this.output(t):this.options.unknown}invert(t){return Tx(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Ax}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):ft}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=Kx(n.map(t),r,o,i);this.output=kx(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=Kx(i,r.map(t),Nx);this.input=kx(e,n,o)}}class Qx extends Zx{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Lx,tickMethod:Vx,tickCount:5}}chooseTransforms(){return[ft,ft]}clone(){return new Qx(this.options)}}var Jx=function(t){function e(e){var n=this,r=e.style,i=Ie(e,["style"]);return(n=t.call(this,tt({},{type:"column"},Re({style:r},i)))||this).columnsGroup=new rv({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return je(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),tx(this.columnsGroup).selectAll(".column").data(e.flat()).join(function(t){return t.append("rect").attr("className","column").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.update=function(t){this.attr(Ob({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Qg),tw=function(t){function e(e){var n=this,r=e.style,i=Ie(e,["style"]);return(n=t.call(this,tt({},{type:"lines"},Re({style:r},i)))||this).linesGroup=n.appendChild(new rv),n.areasGroup=n.appendChild(new rv),n.render(),n}return je(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(Ob({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){tx(this.linesGroup).selectAll(".line").data(t).join(function(t){return t.append("path").attr("className","line").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.renderAreas=function(t){tx(this.linesGroup).selectAll(".area").data(t).join(function(t){return t.append("path").attr("className","area").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.style(t)})},function(t){return t.remove()})},e}(Qg);function ew(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map(function(t,e){return $e([e===n?"M":"L"],ze(t),!1)});return e?r.reverse():r}function nw(t,e){if(void 0===e&&(e=!1),t.length<=2)return ew(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];rt(o,n.slice(-2))||n.push.apply(n,$e([],ze(o),!1))}var a=Ub(n,!1);return e?a.unshift($e(["M"],ze(t[r-1]),!1)):a.unshift($e(["M"],ze(t[0]),!1)),a}function rw(t,e,n){var r=X(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function iw(t){return 0===t.length?[0,0]:[C(F(t,function(t){return C(t)||0})),P(B(t,function(t){return P(t)||0}))]}function ow(t){for(var e=X(t),n=e[0].length,r=ze([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=o[c],o[c]=s[c]);return e}var aw=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return je(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=X(t);return I(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?ow(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=ze(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=sx(this.attributes,"area"),a=sx(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=ze(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=ze([a,s],2),s=n[0],a=n[1]),t.map(function(t){return t.map(function(t,e){return[r.map(e),R(i.map(t),s,a)]})})}(c,{type:"line",x:l.x,y:l.y}),f=[];if(o){var h=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=nw(o),s=void 0;if(0===i)s=rw(a,e,n);else{var c=nw(t[i-1],!0),l=o[0];c[0][0]="L",s=$e($e($e([],ze(a),!1),ze(c),!1),[$e(["M"],ze(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=ew(t[i]),a=void 0;if(0===i)a=rw(o,e,n);else{var s=ew(t[i-1],!0);s[0][0]="L",a=$e($e($e([],ze(o),!1),ze(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map(function(t){return rw(e?nw(t):ew(t),n,r)})}(u,i,s,h)}return{lines:u.map(function(e,n){return Re({stroke:t.getColor(n),d:i?nw(e):ew(e)},a)}),areas:f.map(function(e,n){return Re({d:e,fill:t.getColor(n)},o)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=sx(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=ow(s));var c=this.createScales(s),l=c.x,u=c.y,f=ze(iw(s),2),h=f[0],d=f[1],p=new Qx({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),v=this.rawData;return{columns:s.map(function(n,i){return n.map(function(n,o){var a=g/s.length;return Re(Re({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(v[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?tx(n).select(r):tx(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=Re({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);tx(e).selectAll(".spark").data([o]).join(function(t){return t.append(function(t){return"line"===t?new tw({className:c,style:l}):new Jx({className:c,style:l})}).attr("className","spark ".concat(c))},function(t){return t.update(l)},function(t){return t.remove()})},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:y(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.scale,a=r.range,s=void 0===a?[]:a,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,h=ze(iw(t),2),d=h[0],p=h[1],g=new Qx({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-o)]});return"line"===i?{type:i,x:new Qx({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new qx({domain:t[0].map(function(t,e){return e}),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(dx);function sw(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter(function(t){var n=ze(t,1)[0];return!e.includes(n)}));return Object.fromEntries(e.map(function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,Re(Re({},t[e]),n)]:[e,n]}))}function cw(t,e){t?t.finished.then(e):e()}function lw(t,e){"update"in t?t.update(e):t.attr(e)}function uw(t,e,n){return 0===e.length?null:n?t.animate(e,n):(lw(t,{style:e.slice(-1)[0]}),null)}function fw(t,e,n){var r={},i={};return Object.entries(e).forEach(function(e){var n=ze(e,2),o=n[0],a=n[1];if(!b(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}}),n?uw(t,[r,i],Re({fill:"both"},n)):(lw(t,i),null)}function hw(t,e){return t.style.opacity||(t.style.opacity=1),fw(t,{opacity:0},e)}var dw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},pw={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},gw={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},vw=kb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),mw=kb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),yw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return je(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,o=void 0===i?10:i,a=t.radius,s=void 0===a?o/4:a,c=t.orientation,l=Ie(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,h=tx(e).maybeAppendByClassName(mw.iconRect,"rect").styles(Re(Re({},l),{width:u,height:f,radius:s,x:n-u/2,y:r-f/2,transformOrigin:"center"})),d=n+1/3*u-u/2,p=n+2/3*u-u/2,g=r+1/4*f-f/2,v=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(mw.iconLine,"-1"),"line").styles(Re({x1:d,x2:d,y1:g,y2:v},l)),h.maybeAppendByClassName("".concat(mw.iconLine,"-2"),"line").styles(Re({x1:p,x2:p,y1:g,y2:v},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(dx),bw=function(t){function e(e){return t.call(this,e,gw)||this}return je(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=sx(this.attributes,"label"),s=a.x,c=void 0===s?0:s,l=a.y,u=void 0===l?0:l,f=a.transform,h=a.transformOrigin,d=ze(lx(Ie(a,["x","y","transform","transformOrigin"]),[]),2),p=d[0],g=d[1],v=tx(t).maybeAppendByClassName(mw.labelGroup,"g").styles(g),m=Re(Re({},pw),p),y=m.text,b=Ie(m,["text"]);Lb(!!o,v,function(t){e.label=t.maybeAppendByClassName(mw.label,"text").styles(Re(Re({},b),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(y)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.type,a=Re(Re({x:n,y:r,orientation:i},dw),sx(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new yw({style:a})}:s;tx(t).maybeAppendByClassName(mw.iconGroup,"g").selectAll(mw.icon.class).data([c]).join(function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",mw.icon.name)},function(t){return t.update(a)},function(t){return t.remove()})},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(dx),xw=function(t){function e(e){var n=t.call(this,e,Re(Re(Re({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},cx(gw,"handle")),cx(dw,"handleIcon")),cx(pw,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Cb(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.getBBox(),s=a.x,c=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,o=e.type;t.stopPropagation();var a=n.getOrientVal(Cb(t)),s=a-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===o?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=a}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,o="range"===i?t:t[1],a="range"===i?n.getValues():n.getValues()[1],s=new Jp("valuechange",{detail:{oldValue:o,value:a}});n.dispatchEvent(s),null==r||r(a)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return je(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=sx(this.attributes,"sparkline");return Re(Re({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=ze(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=ze(ex(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(vw.selection.class).each(function(n,r){fw(this,e[r],t)})},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&fw(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&fw(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=sx(this.attributes,"track");this.trackShape=tx(t).maybeAppendByClassName(vw.track,"rect").styles(Re(Re({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=tx(t).maybeAppendByClassName(vw.brushArea,"rect").styles(Re({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;Lb("horizontal"===n.orientation,tx(t).maybeAppendByClassName(vw.sparklineGroup,"g"),function(t){var n=Re(Re({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(vw.sparkline,function(){return new aw({style:n})}).update(n)})},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,o=r?"range"===i?["start","end"]:["end"]:[],a=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(vw.handle.class).data(o.map(function(t){return{type:t}}),function(t){return t.type}).join(function(t){return t.append(function(t){var n=t.type;return new bw({style:e.getHandleStyle(n)})}).each(function(t){var e=t.type;this.attr("class","".concat(vw.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");a[n]=this,this.addEventListener("pointerdown",a.onDragStart(e))})},function(t){return t.each(function(t){var e=t.type;this.update(a.getHandleStyle(e))})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");a[n]=void 0}).remove()})},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,o=e.selectionType;this.foregroundGroup=tx(t).maybeAppendByClassName(vw.foreground,"g");var a=sx(this.attributes,"selection"),s=function(t){return t.style("visibility",function(t){return t.show?"visible":"hidden"}).style("cursor",function(t){return"select"===o?"grab":"invert"===o?"crosshair":"default"}).styles(Re(Re({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(vw.selection.class).data("value"===i?[]:this.calcSelectionArea().map(function(t,e){return{style:Re({},t),index:e,show:"select"===o?1===e:1!==e}}),function(t){return t.index}).join(function(t){return t.append("rect").attr("className",vw.selection.name).call(s).each(function(t,e){var n=this;1===e?(c.selectionShape=tx(this),this.on("pointerdown",function(t){n.attr("cursor","grabbing"),c.onDragStart("selection")(t)}),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){n.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){n.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){n.attr("cursor","pointer")})):this.on("pointerdown",c.onDragStart("track"))})},function(t){return t.call(s)},function(t){return t.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=ze(this.range,2),i=r[0],o=r[1],a=ze(this.getValues().map(function(t){return qb(t,e)}),2),s=a[0],c=a[1],l=ze(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map(function(t){return qb(t,e)}),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,R(f,i,o)];u>f&&(u=(n=ze([f,u],2))[0],f=n[1]);var h=f-u;return h>o-i?[i,o]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>o?c===o&&s===u?[u,o]:[o-h,o]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=ze(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:a,height:c,x:o,width:n*s},{y:a,height:c,x:n*s+o,width:(r-n)*s},{y:a,height:c,x:r*s,width:(1-r)*s}],[{x:o,width:s,y:a,height:n*c},{x:o,width:s,y:n*c+a,height:(r-n)*c},{x:o,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,o=n.width,a=n.height,s=ze(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([f,o/2]),y:i+this.getOrientVal([a/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=sx(this.attributes,"handle"),c=sx(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new db({style:Re(Re(Re({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,v=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-v-l};var m=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var y=0,b=0,x=this.availableSpace,w=x.width,k=x.height,M=this.calcSelectionArea()[1],O=M.x,E=M.y,S=M.width,_=M.height,A=l+u;if("horizontal"===i){var T=A+g/2;if("start"===t)y=O-A-g>0?-T:T;else y=w-O-S-A>g?T:-T}else{var P=v+A;b="start"===t?E-u>v?-P:A:k-(E+_)-u>v?P:-A}return{x:y,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=sx(this.attributes,"handleLabel");return Re(Re(Re({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=sx(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Re({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,o=e.showLabelOnInteraction,a=e.orientation,s=this.calcHandlePosition(t),c=s.x,l=s.y,u=this.calcHandleText(t),f=i;return!i&&o&&(f=!!this.target),Re(Re(Re({},cx(this.getHandleIconStyle(),"icon")),cx(Re(Re({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(c+n,", ").concat(l+r,")"),orientation:a,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=ze(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=this.attributes.type,i=ze(this.getValues(),2),o=[i[0]+("range"===r?t:0),i[1]+e].sort();n?this.setValues(o):this.innerSetValues(o,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new Jp(n,{detail:t}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(dx),ww=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Jp("scroll",r)),n.dispatchEvent(new Jp("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=ze(n.getLocalPosition(),2),r=e[0],i=e[1],o=ze(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(Cb(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Jp("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Jp("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Jp("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Jp("trackMouseleave",{detail:t.detail}))},n}return je(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return ex(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=ze(this.range,2),n=e[0],r=e[1];return R(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=ze(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ze(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=ze(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.trackSize,a=e.padding,s=e.slidable,c=sx(this.attributes,"track"),l=sx(this.attributes,"thumb"),u=Re(Re({x:n,y:r,brushable:!1,orientation:i,padding:a,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:o,values:this.getValues()},cx(c,"track")),cx(l,"selection"));this.slider=tx(t).maybeAppendByClassName("scrollbar",function(){return new xw({style:u})}).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=ze(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(R(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",function(e){e.stopPropagation(),t.onTrackClick(e.detail)}),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(dx),kw={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new uv({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};tt({},kw,{style:{type:"arc"}}),tt({},kw,{style:{}});var Mw=kb({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Ow=kb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Ew(t){return t.reduce(function(t,e,n){return t.push($e([0===n?"M":"L"],ze(e),!1)),t},[])}function Sw(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return Ew(t);if(!o)return[];var a=Hb(t[0],o),s=n?0:1;return t.reduce(function(t,e,n){return 0===n?t.push($e(["M"],ze(e),!1)):t.push($e(["A",a,a,0,0,s],ze(e),!1)),t},[])}(t,e,n):Ew(t)}function _w(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=ze([Sw(t,n),Sw(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=ze([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return d([$e(["L"],ze(h),!1)],[$e(["L"],ze(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=ze([Hb(h,o),Hb(f,o)],2),g=p[0],v=p[1];return d([$e(["A",g,g,0,0,1],ze(h),!1),$e(["L"],ze(h),!1)],[$e(["A",v,v,0,0,0],ze(f),!1),$e(["L"],ze(f),!1)])}var Aw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return je(e,t),e.prototype.render=function(t,e){var n=Ie(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map(function(t){var e=t.points,n=ze(e,1)[0];return Re(Re({},t),{points:$e($e([],ze(e),!1),[n],!1)})}):n}(t),i=tx(e).maybeAppendByClassName(Ow.lineGroup,"g"),o=tx(e).maybeAppendByClassName(Ow.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map(function(t,e){return{id:t.id||"grid-line-".concat(e),d:Sw(t.points,n)}});return t.selectAll(Ow.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){var n=mb(Zb(Re({d:t.d},r)),[t,e,a]);this.attr(Re({class:Ow.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))})},function(t){return t.transition(function(t,e){return fw(this,mb(Zb(Re({d:t.d},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=hw(this,i.exit);return cw(e,function(){return t.remove()}),e})}).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},c=[],l=0;l<e.length-1;l++){var u=ze([e[l].points,e[l+1].points],2),f=_w(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(Ow.region.class).data(c,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){var n=mb(t,[t,e,c]);this.attr(n)}).attr("className",Ow.region.name)},function(t){return t.transition(function(t,e){return fw(this,mb(t,[t,e,c]),r.update)})},function(t){return t.transition(function(){var t=this,e=hw(this,r.exit);return cw(e,function(){return t.remove()}),e})}).transitions()}(o,r,t);return $e($e([],ze(a),!1),ze(s),!1)},e}(dx);function Tw(t,e){return Object.fromEntries(Object.entries(t).map(function(t){var n=ze(t,2);return[n[0],mb(n[1],e)]}))}function Pw(t,e){return e&&y(e)?t.filter(e):t}function Cw(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Nw(t,e){if("linear"===e.type){var n=ze(e.startPos,2),r=n[0],i=n[1],o=ze(e.endPos,2),a=ze([o[0]-r,o[1]-i],2);return Yb([a[0],a[1]])}var s=pb(Cw(t,e));return[-Math.sin(s),Math.cos(s)]}function Lw(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Nw(t,n),"positive"!==e)}function jw(t,e){return Lw(t,e.labelDirection,e)}function Rw(t,e){return"linear"===e.type?function(t,e){var n=ze(e.startPos,2),r=n[0],i=n[1],o=ze(e.endPos,2),a=ze([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}(t,e):function(t,e){var n=e.radius,r=ze(e.center,2),i=r[0],o=r[1],a=pb(Cw(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Iw(t){return 0===Nw(0,t)[1]}function Dw(t){return 0===Nw(0,t)[0]}function Bw(t,e){return e-t===360}function Fw(t,e,n,r,i){var o=e-t,a=ze([i,i],2),s=a[0],c=a[1],l=ze([pb(t),pb(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=ze(h(u),2),p=d[0],g=d[1],v=ze(h(f),2),m=v[0],y=v[1];if(Bw(t,e)){var b=ze(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,m,y]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(m,",").concat(y)}function zw(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Mw.line.class).data([{d:Fw.apply(void 0,$e($e([i,o],ze(a),!1),[s],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",Mw.line.name).styles(e).styles({d:function(t){return t.d}})},function(t){return t.transition(function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=Rb(e,n),s=Math.ceil(+o/16),c=new Array(s).fill(0).map(function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}});return t.animate(c,Re({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return $e($e([n,r],ze(i),!1),[o],!1)}(this),$e($e([i,o],ze(a),!1),[s],!1),r.update);if(e){var n=function(){var e=ot(t.attributes,"__keyframe_data__");t.style.d=Fw.apply(void 0,$e([],ze(e),!1))};e.onframe=n,e.onfinish=n}return e}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function $w(t){var e=ze(t,2),n=ze(e[0],2),r=n[0],i=n[1],o=ze(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function Ww(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=ze([o,a],2),u=ze(l[0],2),f=u[0],h=u[1],d=ze(l[1],2),p=d[0],g=d[1],v=ze(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=ze([t,e,n],3),i=ze(r[0],2),o=i[0],a=i[1],s=ze(r[1],2),c=s[0],l=s[1],u=ze(r[2],2),f=u[0],h=u[1],d=ze([c-o,l-a],2),p=d[0],g=d[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=ze([-f/v,h/v],2),y=m[0],b=m[1];return[y*p,y*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),m=v[0],y=v[1],b=v[2],x=v[3],w=function(e){return t.selectAll(Mw.line.class).data(e,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(Mw.line.name," ").concat(t.className)}).styles(n).transition(function(t){return fw(this,$w(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return fw(this,$w(t.line),r.update)})},function(t){return t.remove()}).transitions()};if(!i||!s)return w([{line:[[f+m,h+y],[p+b,g+x]],className:Mw.line.name}]);var k=ze(s,2),M=k[0],O=k[1],E=p-f,S=g-h,_=ze([f+E*M,h+S*M],2),A=_[0],T=_[1],P=ze([f+E*O,h+S*O],2),C=P[0],N=P[1];return w([{line:[[f+m,h+y],[A,T]],className:Mw.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:Mw.lineSecond.name}])}function Gw(t,e,n){var r,i=e.type,o=sx(e,"line");return r="linear"===i?Ww(t,e,Vb(o,"arrow"),n):zw(t,e,Vb(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(Mw.line.class):a?t.select(Mw.lineSecond.class):t.select(Mw.line.class),!o||!s||"arc"===n.type&&Bw(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Nb(s);f.attr(r),Qb(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Hw(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Yw(t,e){var n=e.gridLength;return t.map(function(t,r){var i=t.value,o=ze(Rw(i,e),2),a=o[0],s=o[1],c=ze(Fb(function(t,e){return Lw(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}})}function qw(t,e,n,r){var i=sx(n,"grid"),o=i.type,a=i.areaFill,s=Hw(n),c=Pw(e,n.gridFilter),l="segment"===o?Yw(c,n):function(t,e){var n=e.gridControlAngles,r=Hw(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=ze(r,2),o=i[0],a=i[1];return t.map(function(t,r){var i=ze(Rw(t.value,e),2),s=i[0],c=i[1],l=ze([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach(function(t){var e=pb(t),n=ze([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+o,c=u*i+f*r+a;h.push([s,c])}),{points:h,id:r}})}(c,n),u=Re(Re({},i),{center:s,areaFill:y(a)?c.map(function(t,e){return mb(a,[t,e,c])}):a,animate:r,data:l});return t.selectAll(Mw.grid.class).data([1]).join(function(t){return t.append(function(){return new Aw({style:u})}).attr("className",Mw.grid.name)},function(t){return t.transition(function(){return this.update(u)})},function(t){return t.remove()}).transitions()}var Vw=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*a-l*s+u,l*a+c*s+f],[c*i-l*o+u,l*i+c*o+f],[c*a-l*o+u,l*a+c*o+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function Uw(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=ze(r.min,2),o=i[0],a=i[1],s=ze(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=o,v=a,m=Ab(t);if(m){h-=1.5;var y=m.style.textAlign,b=m.style.textBaseline;"center"===y?g=(o+c)/2:"right"!==y&&"end"!==y||(g=c),"middle"===b?v=(a+l)/2:"bottom"===b&&(v=l)}var x=ze(ex(e),4),w=x[0],k=void 0===w?0:w,M=x[1],O=void 0===M?0:M,E=x[2],S=void 0===E?k:E,_=x[3],A=new Vw((d+=o)-(void 0===_?O:_),(p+=a)-k,d+f+O,p+h+S);return t.setEulerAngles(n),A.rotatedPoints(pb(n),g,v)}function Xw(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function Kw(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function Zw(t,e){var n=Kw(t[0],t[1],e[0]),r=Kw(t[0],t[1],e[1]),i=Kw(e[0],e[1],t[0]),o=Kw(e[0],e[1],t[1]);return n!==r&&i!==o||(!(0!==n||!Xw(t,e[0]))||(!(0!==r||!Xw(t,e[1]))||(!(0!==i||!Xw(e,t[0]))||!(0!==o||!Xw(e,t[1])))))}function Qw(t,e){return e.every(function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r=[e,[9999,e[1]]],i=0,o=0;do{var a=[t[o],t[(o+1)%n]];if(Zw(a,r)){if(0===Kw(a[0],e,a[1]))return Xw(a,e);i++}o=(o+1)%n}while(0!==o);return!!(1&i)}(t,e)})}function Jw(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(function(t){return function(t,e){var n=ze(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ze(e,4),c=s[0],l=s[1],u=o-r,f=a-i,h=s[2]-c,d=s[3]-l,p=u*d-h*f;if(0===p)return!1;var g=p>0,v=r-c,m=i-l,y=u*m-f*v;if(y<0===g)return!1;var b=h*m-d*v;return b<0!==g&&y>p!==g&&b>p!==g}(e,t)})}function tk(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=ze(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=ze(ex(e),4),p=d[0],g=d[1],v=d[2],m=d[3];return new Vw(c+f-m,l+f-p,c+h+g,l+h+v)}var y=ze(t.startPos,2),b=y[0],x=y[1],w=ze(t.endPos,2),k=w[0],M=w[1],O=ze(Dw(t)?[-e,0,e,0]:[0,e,0,-e],4),E=O[0],S=O[1],_=O[2],A=O[3],T=Fb(jw(0,t),i),P=new Vw(b,x,k,M);return P.x1+=A,P.y1+=E,P.x2+=S+T[0],P.y2+=_+T[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return Qw([[r,o],[i,o],[i,a],[r,a]],Uw(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=Uw(t,n).flat(1),a=Uw(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var c=Fe(s),l=c.next();!l.done;l=c.next())if(Jw(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,ex(n))};try{for(var f=Fe(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(a.add(s),a.add(d)):a.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function ek(t,e){return void 0===e&&(e={}),b(t)?0:"number"==typeof t?t:Math.floor(Sb(t,e))}var nk=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter(function(t,e){return!(e%r)||(lb(t),!1)})},rk=function(t){return t.filter(Eb)};var ik=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,c,l=nk,u=function(t){return t.forEach(r.show),t},f=2,h=t.slice(),d=t.slice(),p=Math.min.apply(Math,$e([1],ze(t.map(function(t){return t.getBBox().width})),!1));if("linear"===n.type&&(Iw(n)||Dw(n))){var g=nx(t[0]).left,v=nx(t[i-1]).right,m=Math.abs(v-g)||1;f=Math.max(Math.floor(i*p/m),f)}for(o&&(s=h.splice(0,1)[0]),a&&(c=h.splice(-1,1)[0],h.reverse()),u(h);f<t.length&&tk(rk(c?$e($e([c],ze(d),!1),[s],!1):$e([s],ze(d),!1)),n,null==e?void 0:e.margin).length;){if(c&&!s&&f%2==0)h.splice(0,1).forEach(r.hide);else if(c&&s){h.splice(0,1).forEach(r.hide)}d=l(u(h),{seq:f}),f++}}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,c=e.margin,l=e.recoverWhenFailed,u=void 0===l||l,f=t.map(function(t){return t.getLocalEulerAngles()}),h=function(){return tk(t,n,c).length<1},d=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)})};try{for(var p=Fe(s),g=p.next();!g.done;g=p.next()){if(d(g.value),h())return}}catch(t){i={error:t}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}u&&d(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=0)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,u=void 0===l?" ":l,f=e.margin,h=void 0===f?[0,0,0,0]:f,d=_b(r.getTextShape(t[0])),p=ek(u,d),g=a?ek(a,d):p,v=ek(c,d);(b(v)||v===1/0)&&(v=Math.max.apply(null,t.map(function(t){return t.getBBox().width})));var m=t.slice();ze(h,4);for(var y=function(e){if(m.forEach(function(t){r.ellipsis(r.getTextShape(t),e,o)}),(m=tk(t,n,h)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var w=y(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r,i){var o,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=mb(null!==(o=e.wordWrapWidth)&&void 0!==o?o:50,[i]),d=t.map(function(t){return t.attr("maxLines")||1}),p=Math.min.apply(Math,$e([],ze(d),!1)),g=function(){return tk(t,n,f).length<1},v=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Iw(t)?"negative"===n?"bottom":"top":"middle"}(n),m=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,h,i,v)})};if(!(p>s)){if("linear"===n.type&&Iw(n)){if(m(s),g())return}else for(var y=p;y<=s;y++)if(m(y),g())return;l&&m(d)}}]]);function ok(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*function(t){return"positive"===t?-1:1}(e)},1)}function ak(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function sk(t,e){var n=ze(t,2),r=n[0],i=n[1],o=ze(e,2),a=o[0],s=o[1],c=ze([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function ck(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o=jw(t.value,n),a=Nw(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return jb(e,-90,90)||(e+=180),e}(gb("perpendicular"===i?sk([1,0],o):sk([a[0]<0?-1:1,0],a)))}function lk(t,e,n){var r=n.type,i=n.labelAlign,o=jw(t,n),a=ak(e),s=ak(gb(sk([1,0],o))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===a?(c="center",l=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(jb(a,0,90,!1,!0)||jb(a,0,90)||jb(a,270,360))&&(c="start"):90===s?jb(a,0,90,!1,!0)?c="start":(jb(a,90,180)||jb(a,270,360))&&(c="end"):270===s?jb(a,0,90,!1,!0)?c="end":(jb(a,90,180)||jb(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(jb(a,0,90)||jb(a,270,360))&&(c="end")):c="center":"parallel"===i?l=jb(s,0,180,!0)?"top":"bottom":"horizontal"===i?jb(s,90,270,!1)?c="end":(jb(s,270,360,!1)||jb(s,0,90))&&(c="start"):"perpendicular"===i&&(c=jb(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function uk(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=mb(s,[t,c,e]),u=ze([jw(t.value,n),ok(a,o)],2),f=ze(zb(Fb(u[0],l+(1===u[1]?mb(r?i:0,[t,c,e]):0)),Rw(t.value,n)),2);return{x:f[0],y:f[1]}}function fk(t,e){"text"===t.nodeName&&t.attr(e)}function hk(t,e){!function(t,e,n,r){var i=e.labelOverlap,o=void 0===i?[]:i;o.length&&o.forEach(function(i){var o=i.type,a=ik.get(o);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some(function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||t.filter(function(t){return t.querySelector("text")}).length>=1)})(t,e,o)&&(null==a||a(t,i,e,r,n))})}(this.node().childNodes,t,e,{hide:lb,show:cb,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=lk(e.__data__.value,t,n),i=e.querySelector(Mw.labelItem.class);i&&fk(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Pb(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),Tb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function dk(t,e,n,r,i){var o=n.indexOf(e),a=tx(t).append(function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return Nb(mb(i,[t,e,n,jw(t.value,r)]))}:function(){return Nb(t.label||"")}}(e,o,n,i)).attr("className",Mw.labelItem.name).node(),s=ze(lx(Tw(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=Ie(l,["transform"]);ux(a,u);var h=ck(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(h),fk(a,Re(Re({},lk(e.value,h,i)),c)),t.attr(f),a}function pk(t,e,n,r,i){var o,a,s,c=Pw(e,n.labelFilter),l=sx(n,"label"),u=t.selectAll(Mw.label.class).data(c,function(t,e){return e}).join(function(t){return t.append("g").attr("className",Mw.label.name).transition(function(t){dk(this,t,e,l,n);var r=uk(t,e,n),i=r.x,o=r.y;return this.style.transform="translate(".concat(i,", ").concat(o,")"),null})},function(t){return t.transition(function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&lb(t),e.isVisible()&&cb(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+a/2),u=+a/4,f=ze(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=ze(e.getGeometryBounds().center,2),g=ze([(h+p[0])/2-h,(d+p[1])/2-d],2),v=g[0],m=g[1],y=t.style.opacity,b=void 0===y?1:y,x=e.style.opacity,w=void 0===x?1:x,k=t.style.transform||"",M=e.style.transform||"",O=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(k)},{opacity:0,transform:"translate(".concat(v,", ").concat(m,") ").concat(k)}],Re(Re({fill:"both"},n),{duration:c+l+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-m,") ").concat(M),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(M)}],Re(Re({fill:"both"},n),{duration:l+u,delay:c+l-u}));return cw(E,i),[O,E]}(this.querySelector(Mw.labelItem.class),dk(this,t,e,l,n),r.update),o=uk(t,e,n),a=o.x,s=o.y,c=fw(this,{transform:"translate(".concat(a,", ").concat(s,")")},r.update);return $e($e([],ze(i),!1),[c],!1)})},function(t){return o=t,t.transition(function(){var t=this,e=hw(this.childNodes[0],r.exit);return cw(e,function(){return tx(t).remove()}),e}),o}).transitions();return s=function(){hk.call(t,n,i)},0===(a=u).length?s():Promise.all(a.map(function(t){return null==t?void 0:t.finished})).then(s),u}function gk(t,e){return Lw(t,e.tickDirection,e)}function vk(t,e,n,r,i){var o=ze(function(t,e){var n=ze(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,mb(i.tickLength,[t,e,n])),2),a=ze(o[0],2),s=a[0],c=a[1],l=ze(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function mk(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=gk(e.value,i),s="line";return y(o)&&(s=function(){return mb(o,[e,n,r,a])}),t.append(s).attr("className",Mw.tickItem.name)}(tx(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=gk(t.value,o),c=vk(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=ze(lx(Tw(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(Re({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=ze(Rw(t.value,r),2),c=s[0],l=s[1];return fw(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var yk=kb({text:"text"},"title");function bk(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):t.length>2?[t[0]]:t.split("")}function xk(t,e){var n=Object.entries(e).reduce(function(e,n){var r=ze(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e},{});t.styles(n)}var wk=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return je(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(yk.text.class);if(!a)return new vb(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=ze(ex(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ze([0,0,+e,+n],4),v=g[0],m=g[1],y=g[2],b=g[3],x=bk(r);if(x.includes("i"))return new vb(v,m,y,b);x.forEach(function(t,r){var i,o,a,s;"t"===t&&(i=ze(0===r?[l+d,+n-l-d]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(o=ze([+e-c-p],1),y=o[0]),"b"===t&&(a=ze([+n-l-f],1),b=a[0]),"l"===t&&(s=ze(0===r?[c+h,+e-c-h]:[0,+e],2),v=s[0],y=s[1])});var w=ze(ex(o),4),k=w[0],M=w[1],O=w[2],E=w[3],S=ze([E+M,k+O],2),_=S[0],A=S[1];return new vb(v+E,m+k,y-_,b-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new vb(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Ie(t,["width","height","position","spacing"]),i=ze(lx(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=ze([+a/2,+s/2],2),u=ze([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=bk(c);return g.includes("l")&&(f=(e=ze([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=ze([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=ze([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=ze([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;Lb(!!r.text,tx(e),function(t){n.title=t.maybeAppendByClassName(yk.text,"text").styles(i).call(xk,{x:a,y:s,textAlign:c,textBaseline:l}).node()})},e}(dx);function kk(t,e,n,r,i){var o=ze(lx(sx(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Ie(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),a.direction,a.position);t.styles(Re(Re({},a),{transformOrigin:l})),ux(t.node(),f);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=bk(i),s=t.node().getLocalBounds(),c=ze(s.min,2),l=c[0],u=c[1],f=ze(s.halfExtents,2),h=f[0],d=f[1],p=ze(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],m=ze([l+h,u+d],2),y=m[0],b=m[1],x=ze(ex(o),4),w=x[0],k=x[1],M=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var E=n.startPos,S=n.endPos,_=ze("start"===i?[E,S]:[S,E],2),A=_[0],T=_[1],P=ze(Fb(Yb([-T[0]+A[0],-T[1]+A[1]]),w),2),C=P[0],N=P[1];return{x:A[0]+C,y:A[1]+N}}return a.includes("t")&&(b-=d+v+w),a.includes("r")&&(y+=h+g+k),a.includes("l")&&(y-=h+g+O),a.includes("b")&&(b+=d+v+M),{x:y,y:b}}(tx(n._offscreen||n.querySelector(Mw.mainGroup.class)),e,r),d=h.x,p=h.y;return fw(e.node(),{transform:"translate(".concat(d,", ").concat(p,")")},i)}function Mk(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Lb(i,e.maybeAppendByClassName(Mw.lineGroup,"g"),function(e){return Gw(e,t,r)})||[],c=Lb(o,e.maybeAppendByClassName(Mw.tickGroup,"g"),function(e){return function(t,e,n,r){var i=Pw(e,n.tickFilter),o=sx(n,"tick");return t.selectAll(Mw.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",Mw.tick.name).transition(function(t,e){return mk.call(this,t,e,i,n,o,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),mk.call(this,t,e,i,n,o,r.update)})},function(t){return t.transition(function(){var t=this,e=hw(this.childNodes[0],r.exit);return cw(e,function(){return t.remove()}),e})}).transitions()}(e,n,t,r)})||[],l=Lb(a,e.maybeAppendByClassName(Mw.labelGroup,"g"),function(i){return pk(i,n,t,r,e.node())})||[];return $e($e($e([],ze(s),!1),ze(c),!1),ze(l),!1).filter(function(t){return!!t})}var Ok=function(t){function e(e){return t.call(this,e,kw)||this}return je(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(o,l).filter(function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])}),h=sw(void 0===n?a:n),d=Lb(c,tx(e).maybeAppendByClassName(Mw.gridGroup,"g"),function(e){return qw(e,f,t,h)})||[],p=tx(e).maybeAppendByClassName(Mw.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Mk(t,tx(this.offscreenGroup),f,sw(!1));var g=Mk(t,tx(p.node()),f,h),v=Lb(s,tx(e).maybeAppendByClassName(Mw.titleGroup,"g"),function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Mw.title.class).data([{title:i}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(o){return o.append(function(){return Nb(i)}).attr("className",Mw.title.name).transition(function(){return kk(tx(this),t,e,n,r.enter)})},function(i){return i.transition(function(){return kk(tx(this),t,e,n,r.update)})},function(t){return t.remove()}).transitions()}(e,r,t,h)})||[];return $e($e($e([],ze(d),!1),ze(g),!1),ze(v),!1).flat().filter(function(t){return!!t})},e}(dx),Ek=kb({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Sk=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:bx(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new rv({class:Ek.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new rv({class:Ek.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return je(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return R(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=ze(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map(function(e,n){return t.map(function(t){return t[n]})}))||[]}(this.pageViews.map(function(t){var e=t.getBBox();return[e.width,e.height]})).map(function(t){return Math.max.apply(Math,$e([],ze(t),!1))}),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new vb(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=ze(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=uw(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return cw(f,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:R(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:R(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(Ek.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach(function(e,n){t.includes(n)?cb(e):lb(e)})},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox().width,c=ze("horizontal"===o?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,v=p.height,m=Math.max(h,s,g),y="horizontal"===o?{offset:[[0,0],[h/2+a,0],[h+s+2*a,0]],textAlign:"start"}:{offset:[[m/2,-d-a],[m/2,0],[m/2,v+a]],textAlign:"center"},b=ze(y.offset,3),x=ze(b[0],2),w=x[0],k=x[1],M=ze(b[1],2),O=M[0],E=M[1],S=ze(b[2],2),_=S[0],A=S[1],T=y.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,k),r.setLocalPosition(O,E),n.setLocalPosition(_,A)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(Ek.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=ze(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=this.pageViews.length>=2,s=t.maybeAppendByClassName(Ek.controller,"g");if(ub(s.node(),a),a){var c=sx(this.attributes,"button"),l=sx(this.attributes,"pageNum"),u=ze(lx(c),2),f=u[0],h=u[1],d=f.size,p=Ie(f,["size"]),g=!s.select(Ek.prevBtnGroup.class).node(),v=s.maybeAppendByClassName(Ek.prevBtnGroup,"g").styles(h);this.prevBtnGroup=v.node();var m=v.maybeAppendByClassName(Ek.prevBtn,"path"),y=s.maybeAppendByClassName(Ek.nextBtnGroup,"g").styles(h);this.nextBtnGroup=y.node(),[m,y.maybeAppendByClassName(Ek.nextBtn,"path")].forEach(function(t){t.styles(Re(Re({},p),{transformOrigin:"center"})),Qb(t.node(),d,!0)});var b=s.maybeAppendByClassName(Ek.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Ek.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),g&&(this.prevBtnGroup.addEventListener("click",function(){e.prev()}),this.nextBtnGroup.addEventListener("click",function(){e.next()}))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(o,")"));var a=tx(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=K(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(cg.INSERTED,e),this.playWindow.addEventListener(cg.REMOVED,e)},e}(dx);var _k;function Ak(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}wx.registerSymbol("hiddenHandle",function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]}),wx.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]}),wx.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]});var Tk="component-poptip",Pk="component-poptip-arrow",Ck="component-poptip-text",Nk=((_k={})[".".concat(Tk)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},_k[".".concat(Ck)]={"text-align":"center"},_k[".".concat(Tk,"[data-position='top']")]={transform:"translate(-50%, -100%)"},_k[".".concat(Tk,"[data-position='left']")]={transform:"translate(-100%, -50%)"},_k[".".concat(Tk,"[data-position='right']")]={transform:"translate(0, -50%)"},_k[".".concat(Tk,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},_k[".".concat(Tk,"[data-position='top-left']")]={transform:"translate(0,-100%)"},_k[".".concat(Tk,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},_k[".".concat(Tk,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},_k[".".concat(Tk,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},_k[".".concat(Tk,"[data-position='right-top']")]={transform:"translate(0, 0)"},_k[".".concat(Tk,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},_k[".".concat(Tk,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},_k[".".concat(Tk,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},_k[".".concat(Pk)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},_k[".".concat(Tk,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},_k["[data-position='top'] .".concat(Pk)]={bottom:"-2px"},_k[".".concat(Tk,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},_k["[data-position='left'] .".concat(Pk)]={right:"-2px"},_k[".".concat(Tk,"[data-position='right']")]={transform:"translate(5px, -50%)"},_k["[data-position='right'] .".concat(Pk)]={left:"-2px"},_k[".".concat(Tk,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},_k["[data-position='bottom'] .".concat(Pk)]={top:"-2px"},_k[".".concat(Tk,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},_k["[data-position='top-left'] .".concat(Pk)]={left:"10px",bottom:"-2px"},_k[".".concat(Tk,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},_k["[data-position='top-right'] .".concat(Pk)]={right:"10px",bottom:"-2px"},_k[".".concat(Tk,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},_k["[data-position='left-top'] .".concat(Pk)]={right:"-2px",top:"8px"},_k[".".concat(Tk,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},_k["[data-position='left-bottom'] .".concat(Pk)]={right:"-2px",bottom:"8px"},_k[".".concat(Tk,"[data-position='right-top']")]={transform:"translate(5px, 0)"},_k["[data-position='right-top'] .".concat(Pk)]={left:"-2px",top:"8px"},_k[".".concat(Tk,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},_k["[data-position='right-bottom'] .".concat(Pk)]={left:"-2px",bottom:"8px"},_k[".".concat(Tk,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},_k["[data-position='bottom-left'] .".concat(Pk)]={top:"-2px",left:"8px"},_k[".".concat(Tk,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},_k["[data-position='bottom-right'] .".concat(Pk)]={top:"-2px",right:"8px"},_k),Lk=window;function jk(t){var e=t&&document.getElementById(t);return e||((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),e}function Rk(t){var e=function(t){var e;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e||(e=t.apply(Lk,n)),e}}(jk)(t);return e}var Ik=function(t){function e(n){var r=t.call(this,tt({style:{id:"component-poptip"}},e.defaultOptions,n))||this;return r.visibility="visible",r.map=new Map,r.domStyles="",r.initShape(),r.render(r.attributes,r),r}return je(e,t),Object.defineProperty(e.prototype,"visible",{get:function(){return"visible"===this.visibility},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()},e.prototype.update=function(t){this.attr(tt({},this.style,t)),this.render(this.attributes,this)},e.prototype.bind=function(t,e){var n=this;if(t){var r=this.style.text,i=function(i){var o=t,a=n.style,s=r;if(e){var c="function"==typeof e?e.call(null,i):e,l=c.html,u=c.target,f=Ie(c,["html","target"]);a=function(t,e,n,r){return e&&V(t,e),n&&V(t,n),r&&V(t,r),t}({},n.style,f),(u||!1===u)&&(o=u),"string"==typeof l&&(s=l)}var h=a.position,d=a.arrowPointAtCenter,p=a.follow,g=a.offset;if(o){var v=i,m=ze(function(t,e,n,r,i,o){if(void 0===i&&(i=!1),void 0===o&&(o=!1),o)return[t,e];var a=n.getBoundingClientRect(),s=a.x,c=a.y,l=a.width,u=a.height;switch(r){case"top":return i?[s+l/2,c]:[t,c];case"left":return i?[s,c+u/2]:[s,e];case"bottom":return i?[s+l/2,c+u]:[t,c+u];case"right":return i?[s+l,c+u/2]:[s+l,e];case"top-right":case"right-top":return[s+l,c];case"left-bottom":case"bottom-left":return[s,c+u];case"right-bottom":case"bottom-right":return[s+l,c+u];default:return[s,c]}}(v.clientX,v.clientY,o,h,d,p),2),y=m[0],b=m[1];n.showTip(y,b,{text:s,position:h,offset:g})}else n.hideTip()},o=function(){n.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",o),this.map.set(t,[i,o])}},e.prototype.unbind=function(t){if(this.map.has(t)){var e=ze(this.map.get(t)||[],2),n=e[0],r=e[1];n&&t.removeEventListener("mousemove",n),r&&t.removeEventListener("mouseleave",r),this.map.delete(t)}},e.prototype.clear=function(){this.container.innerHTML=""},e.prototype.destroy=function(){var e,n=this;$e([],ze(this.map.keys()),!1).forEach(function(t){return n.unbind(t)}),null===(e=this.container)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.showTip=function(t,e,n){var r=ot(n,"text");if((!r||"string"==typeof r)&&(this.applyStyles(),t&&e&&n)){var i=n.offset,o=n.position;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(t,e,i),"string"==typeof r){var a=this.container.querySelector(".".concat(Ck));a&&(a.innerHTML=r)}this.visibility="visible",this.container.style.visibility="visible"}},e.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},e.prototype.getContainer=function(){return this.container},e.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(Tk).concat(t?" ".concat(t):"")},e.prototype.initShape=function(){var t=this,e=this.style.id;this.container=Rk(e),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return t.showTip()}),this.container.addEventListener("mouseleave",function(){return t.hideTip()})},e.prototype.updatePoptipElement=function(){var t=this.container;this.clear();var e=this.style,n=e.id,r=e.template,i=e.text;this.container.setAttribute("id",n),this.container.className=this.getClassName();var o='<span class="'.concat(Pk,'"></span>');t.innerHTML=o,L(r)?t.innerHTML+=r:r&&function(t){return t instanceof Element||t instanceof Document}(r)&&t.appendChild(r),i&&(t.getElementsByClassName(Ck)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility},e.prototype.applyStyles=function(){var t=Ob({},Nk,this.style.domStyles),e=Object.entries(t).reduce(function(t,e){var n=ze(e,2),r=n[0],i=n[1],o=Object.entries(i).reduce(function(t,e){var n=ze(e,2),r=n[0],i=n[1];return"".concat(t).concat(r,": ").concat(i,";")},"");return"".concat(t).concat(r,"{").concat(o,"}")},"");if(this.domStyles!==e){this.domStyles=e;var n=this.container.querySelector("style");n&&this.container.removeChild(n),(n=document.createElement("style")).innerHTML=e,this.container.appendChild(n)}},e.prototype.setOffsetPosition=function(t,e,n){void 0===n&&(n=this.style.offset);var r=ze(n,2),i=r[0],o=void 0===i?0:i,a=r[1],s=void 0===a?0:a;this.container.style.left="".concat(t+o,"px"),this.container.style.top="".concat(e+s,"px")},e.tag="poptip",e.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:Nk,template:'<div class="'.concat(Ck,'"></div>')}},e}(dx),Dk=kb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),Bk={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};var Fk=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Jg({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return je(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,o=r.height,a=e.node().getBBox(),s=a.width,c=a.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,o,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=ze(ex(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,u=ze(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=ze(this.span,2);c=(t=ze([p[0]*d,p[1]*d],2))[0],l=t[1]}return{width:o+c+l+f+h,height:a,markerWidth:o,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=ze(ex(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,o=t.height,a=ze(this.spacing,2),s=a[0];return{height:o,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(Dk.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||a||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=sx(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Dk.markerGroup,"g").style("zIndex",0),Lb(!!n,this.markerGroup,function(){var t,i=e.markerGroup.node(),o=null===(t=i.childNodes)||void 0===t?void 0:t[0],a="string"==typeof n?new wx({style:{symbol:n},className:Dk.marker.name}):n();o?a.nodeName===o.nodeName?o instanceof wx?o.update(Re(Re({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var o=Fe(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=ze(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(o,a),tx(o).styles(r)):(o.remove(),tx(a).attr("className",Dk.marker.name).styles(r),i.appendChild(a)):(a instanceof wx||tx(a).attr("className",Dk.marker.name).styles(r),i.appendChild(a)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=Qb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")})},e.prototype.renderLabel=function(t){var e=sx(this.attributes,"label"),n=e.text,r=Ie(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Dk.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Dk.label,function(){return Nb(n)}).styles(r)},e.prototype.renderValue=function(t){var e=this,n=sx(this.attributes,"value"),r=n.text,i=Ie(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Dk.valueGroup,"g").style("zIndex",0),Lb(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(Dk.value,function(){return Nb(r)}).styles(i)})},e.prototype.createPoptip=function(){var t=Ie(this.attributes.poptip||{},["render"]),e=new Ik({style:Ob(Bk,t)});return this.poptipGroup=e,e},e.prototype.bindPoptip=function(t){var e=this,n=this.attributes.poptip;n&&(this.poptipGroup||this.createPoptip()).bind(t,function(){var t=e.attributes,r=t.labelText,i=t.valueText,o=t.markerFill,a="string"==typeof r?r:null==r?void 0:r.attr("text"),s="string"==typeof i?i:null==i?void 0:i.attr("text");if("function"==typeof n.render)return{html:n.render({label:a,value:s,color:o})};var c="";return"string"!=typeof a&&"number"!=typeof a||(c+='<div class="component-poptip-label">'.concat(a,"</div>")),"string"!=typeof s&&"number"!=typeof s||(c+='<div class="component-poptip-value">'.concat(s,"</div>")),{html:c}})},e.prototype.renderPoptip=function(t){var e=this;this.attributes.poptip&&[t.maybeAppendByClassName(Dk.value,"g").node(),t.maybeAppendByClassName(Dk.label,"g").node()].forEach(function(t){t&&e.bindPoptip(t)})},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=sx(this.attributes,"background");this.background=t.maybeAppendByClassName(Dk.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Dk.background,"rect").styles(Re({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=ze(t.position,3),o=i[0],a=i[1],s=i[2],c=r/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(a,", ").concat(c,")")}),Pb(this.labelGroup.select(Dk.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),Pb(this.valueGroup.select(Dk.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=tx(e),r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o;n.styles({transform:"translate(".concat(i,", ").concat(a,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.renderPoptip(n),this.adjustLayout()},e}(dx),zk=kb({page:"item-page",navigator:"navigator",item:"item"},"items"),$k=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Wk=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:ut,mouseenter:ut,mouseleave:ut})||this;return n.navigatorShape=[0,0],n}return je(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=t.poptip,i=sx(this.attributes,"item"),o=e.map(function(t,o){var a=t.id,s=void 0===a?o:a,c=t.label,l=t.value;return{id:"".concat(s),index:o,style:Re({layout:n,labelText:c,valueText:l,poptip:r},Object.fromEntries(Object.entries(i).map(function(n){var r=ze(n,2);return[r[0],mb(r[1],[t,o,e])]})))}});return o},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=ze(this.navigatorShape,1)[0],s=ze(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map(function(e,s){var h,d,p=Math.floor(s/u),g=s%u,v=t.ifHorizontal(l,c),m=[Math.floor(g/v),g%v];"vertical"===n&&m.reverse();var y=ze(m,2),b=y[0],x=y[1],w=(r-a-(l-1)*o)/l,k=e.getBBox().height,M=ze([0,0],2),O=M[0],E=M[1];return"horizontal"===n?(O=(h=ze([f,b*(k+i)],2))[0],E=h[1],f=x===l-1?0:f+w+o):(O=(d=ze([x*(w+o),f],2))[0],E=d[1],f=b===c-1?0:f+k+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:k,x:O,y:E}})},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=ze(this.navigatorShape,1)[0],a=ze(this.grid,2),s=a[0],c=a[1],l=ze([e-o,n],2),u=l[0],f=l[1],h=ze([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],v=h[3],m=h[4],y=h[5],b=h[6],x=h[7];return this.pageViews.children.map(function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,k=h.height,M=0===b?0:i,O=b+M+w;return O<=u&&$k(m,function(t){return t<c})?(n=ze([b+M,x,O],3),d=n[0],p=n[1],b=n[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(o=ze([y+1,0,0,x+k+r],4),y=o[0],m=o[1],b=o[2],(x=o[3])+k<=f&&$k(y,function(t){return t<s})?(a=ze([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(l=ze([0,0,w,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],v=l[5],y=l[6],m=l[7],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}))})},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Ak(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(zk.item.class).forEach(function(e){t.appendChild(e)}),t.querySelectorAll(zk.page.class).forEach(function(e){t.removeChild(e).destroy()})},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);tx(t).selectAll(zk.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){var e=t.style;return new Fk({style:e})}).attr("className",zk.item.name).on("click",function(){null==n||n(this),o("itemClick",{item:this})}).on("pointerenter",function(){null==r||r(this),o("itemMouseenter",{item:this})}).on("pointerleave",function(){null==i||i(this),o("itemMouseleave",{item:this})})},function(t){return t.each(function(t){var e=t.style;this.update(e)})},function(t){return t.remove()})},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=ze(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce(function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t},{}))).map(function(t){var e=ze(t,2);return{page:e[0],layouts:e[1]}}),i=$e([],ze(this.navigator.getContainer().children),!1);r.forEach(function(t){var e=t.layouts,r=n.pageViews.appendChild(new rv({className:zk.page.name}));e.forEach(function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,c=i[o];r.appendChild(c),at(c,"__layout__",t),c.update({x:e,y:n,width:a,height:s})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=sx(this.attributes,"nav"),r=Ob({orientation:e},n),i=this;return t.selectAll(zk.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new Sk({style:r})}).attr("className",zk.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(tx(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Jp(t,{detail:e});this.dispatchEvent(n)},e}(dx),Gk=kb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Hk={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Yk=function(t){function e(e){return t.call(this,e,Hk)||this}return je(e,t),e.prototype.render=function(t,e){var n=tx(e).maybeAppendByClassName(Gk.markerGroup,"g");this.renderMarker(n);var r=tx(e).maybeAppendByClassName(Gk.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?Ak(r,"horizontalHandle","verticalHandle"):i;Lb(!!o,t,function(t){var n=sx(e.attributes,"marker"),r=Re({symbol:o},n);e.marker=t.maybeAppendByClassName(Gk.marker,function(){return new wx({style:r})}).update(r)})},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;Lb(r,t,function(t){var n,r=sx(e.attributes,"label"),o=r.text,c=Ie(r,["text"]),l=(null===(n=t.select(Gk.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=ze(Ak(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],v=d[2],m=d[3];t.maybeAppendByClassName(Gk.label,"text").styles(Re(Re({},c),{x:p,y:g,text:s(o).toString(),textAlign:v,textBaseline:m}))})},e}(dx),qk={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Vk=Ob({},qk,{}),Uk=Ob({},qk,cx(Hk,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),Xk=kb({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),Kk=function(t){function e(e){return t.call(this,e,Vk)||this}return je(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=ze(lx(sx(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Xk.titleGroup,"g").styles(c);var l=Re(Re({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Xk.title,function(){return new wk({style:l})}).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=ze(lx(sx(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=Re(Re({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Xk.itemsGroup,"g").styles(Re(Re({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Xk.items.class).data(["items"]).join(function(t){return t.append(function(){return new Wk({style:l})}).attr("className",Xk.items.name).each(function(){u.items=tx(this)})},function(t){return t.update(l)},function(t){return t.remove()})},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new vb(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),c=e.getBBox(),l=bk(r),u=ze(ex(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ze(ex(o),4),v=g[0],m=g[1],y=g[2],b=g[3],x=ze([p+h,f+d],2),w=x[0],k=x[1],M=ze([b+m,v+y],2),O=M[0],E=M[1];if("l"===l[0])return new vb(s.x,s.y,c.width+s.width+w+O,Math.max(c.height+E,s.height));if("t"===l[0])return new vb(s.x,s.y,Math.max(c.width+O,s.width),c.height+s.height+k+E);var S=ze([e.attributes.width||c.width,e.attributes.height||c.height],2),_=S[0],A=S[1];return new vb(c.x,c.y,_+s.width+w+O,A+s.height+k+E)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,o=n.x,a=void 0===o?0:o,s=n.y,c=void 0===s?0:s,l=tx(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(dx),Zk={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},Qk=kb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Jk=function(t){function e(e){var n=t.call(this,e,Zk)||this;return n.point=[0,0],n.group=n.appendChild(new rv({})),n.isMutationObserved=!0,n}return je(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=ze(ex(t.padding),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new vb(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=sx(this.attributes,"background");this.background=tx(this.group).maybeAppendByClassName(Qk.background,"path").styles(Re(Re({},h),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=ze(lx(sx(this.attributes,"label")),2),i=r[0],o=r[1],a=Ie(i,["text"]);(this.label=tx(this.group).maybeAppendByClassName(Qk.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Qk.label,function(){return Nb(e(n))}).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=ze(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,o=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(o-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,o=e.width,a=e.height,s=[["M",r+n,i],["L",r+o-n,i],["A",n,n,0,0,1,r+o,i+n],["L",r+o,i+a-n],["A",n,n,0,0,1,r+o-n,i+a],["L",r+n,i+a],["A",n,n,0,0,1,r,i+a-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,$e([c+1,1],ze(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=rx.apply(void 0,$e([],ze(t),!1)),r=ze(t,2),i=ze(r[0],2),o=i[0],a=i[1],s=ze(r[1],2),c=s[0],l=s[1],u=ze(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=ze(u[1],2),d=h[0],p=h[1],g=f/2,v=e*(f/Math.abs(f)),m=v/2,y=v*Math.sqrt(3)/2*.8,b=ze([d,d+g-m,d+g,d+g+m,p],5),x=b[0],w=b[1],k=b[2],M=b[3],O=b[4];return n?(this.point=[k,a-y],[["L",x,a],["L",w,a],["L",k,a-y],["L",M,a],["L",O,a]]):(this.point=[o+y,k],[["L",o,x],["L",o,w],["L",o+y,k],["L",o,M],["L",o,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?lb(this):cb(this)},e.prototype.bindEvents=function(){this.label.on(cg.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(dx);function tM(t,e){var n=ze(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var eM=kb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function nM(t){var e=t.orientation,n=t.size,r=t.length;return Ak(e,[r,n],[n,r])}function rM(t){var e=t.type,n=ze(nM(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function iM(t){return rM(t)}function oM(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(y(r)){e=new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))})}else e=r;var a=e.length,s=e.map(function(t){return _h(t).toString()});return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce(function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")},"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce(function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)},"l(".concat(Ak(n,"0","270"),")")):""}function aM(t){var e=t.orientation,n=t.range;if(!n)return[];var r=ze(nM(t),2),i=r[0],o=r[1],a=ze(n,2),s=a[0],c=a[1],l=Ak(e,s*i,0),u=Ak(e,0,s*o),f=Ak(e,c*i,i),h=Ak(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var sM=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return je(e,t),e.prototype.render=function(t,e){!function(t,e){var n=sx(e,"track");t.maybeAppendByClassName(eM.track,"path").styles(Re({d:rM(e)},n))}(tx(e).maybeAppendByClassName(eM.trackGroup,"g"),t),function(t,e){var n=sx(e,"selection"),r=oM(e),i=t.maybeAppendByClassName(eM.selection,"path").styles(Re({d:iM(e),fill:r},n)),o=i.maybeAppendByClassName(eM.clipPath,"path").styles({d:aM(e)}).node();i.style("clipPath",o)}(tx(e).maybeAppendByClassName(eM.selectionGroup,"g"),t)},e}(dx);var cM=function(t){function e(e){var n=t.call(this,e,Uk)||this;return n.eventToOffsetScale=new Qx({}),n.innerRibbonScale=new Qx({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=tM(r.map(function(t){return t.value}),o).range,s=n.getRealSelection(a);n.showIndicator((a[0]+a[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(o,a)}else{var c=n.getTickValue(o);n.showIndicator(c,"".concat(n.getRealValue(c))),n.dispatchIndicated(c)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=ze(n.selection,2),i=r[0],o=r[1],a=n.getTickValue(n.getValueByCanvasPoint(t)),s=a-n.prevValue;"start"===e?i!==a&&n.updateSelection(a,o):"end"===e?o!==a&&n.updateSelection(i,a):"ribbon"===e&&0!==s&&(n.prevValue=a,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="pointer",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return je(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new vb(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(tx(e));var i=this.availableSpace,o=i.x,a=i.y,s=tx(e).maybeAppendByClassName(Xk.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});Lb(!!r,s.maybeAppendByClassName(Xk.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)});var c=s.maybeAppendByClassName(Xk.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Xk.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,$e([],ze(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,$e([],ze(t.map(function(t){return t.value})),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=ze(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=ze(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Ak(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=sx(this.attributes,"title"),s=Re(Re({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Xk.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new wk({style:s})}).attr("className",Xk.title.name).each(function(){c.title=this})},function(t){return t.update(s)},function(t){return t.each(function(){c.title=void 0}).remove()})},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new vb(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new vb(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Mw.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new vb(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=ze(this.ifHorizontal([o,i],[i,o]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,v=0,m=this.labelPosition;v=n||(["bottom","right"].includes(m)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var y=Math.max(p,c),b=f-y,x=ze(this.ifHorizontal([b,v],[v,b]),2),w=x[0],k=x[1],M=["top","left"].includes(m)?s:0,O=ze(this.ifHorizontal([y/2,M],[M,y/2]),2),E=O[0],S=O[1];return new vb(E,S,w,k)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=sx(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,g=p.length,v=p.size,m=Ob({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:v,type:r,orientation:i,color:o,block:a,partition:n.map(function(t){return(t.value-l)/(u-l)}),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(Xk.ribbon,function(){return new sM({style:m})}).update(m)},e.prototype.getHandleClassName=function(t){return"".concat(Xk.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=sx(this.attributes,"handle"),i=ze(this.selection,2),o=i[0],a=i[1],s=Re(Re({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Yk:bw,u=this;this.handlesGroup.selectAll(Xk.handle.class).data(e?[{value:o,type:"start"},{value:a,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new l({style:s})}).attr("className",function(t){var e=t.type;return"".concat(Xk.handle," ").concat(u.getHandleClassName(e))}).each(function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))})},function(t){return t.update(s).each(function(t){var e=t.value;this.update({labelText:e})})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0}).remove()})},e.prototype.adjustHandles=function(){var t=ze(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new vb(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=ze([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new vb(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=ze(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),c=ze(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(l,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=sx(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Xk.indicator,function(){return new Jk({})}).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce(function(e,n,r,i){var o,a,s=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:r.toString();if(e.push(Re(Re({},n),{id:s,index:r,type:"value",label:null!==(a=null==n?void 0:n.label)&&void 0!==a?a:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var c=i[r+1],l=ze([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(Re(Re({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(h)}))}return e},[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=ze(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,o=e.labelFormatter,a=sx(this.attributes,"tick"),s=sx(this.attributes,"label"),c=s.align,l=Ob(Re({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),cx(a,"tick"),cx(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===c&&(!i||i(t,t.index,n.filter(function(t){return t.type===c})))},labelFormatter:o},f=Re(Re(Re({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Xk.label,function(){return new Ok({style:f})}).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,o=this.ribbonShape.size,a=this.labelPosition,s=this.labelFixedSpacing,c=ze([0,0,0],3),l=c[0],u=c[1],f=c[2],h=null!=i?i:o;return e?(f=h,u=s,"positive"===n?"right"===a?(l=h,f=h):"bottom"===a&&(l=f):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n?"right"===a?u=h:"bottom"===a&&(l=o+s,u=r):"negative"===n&&("left"===a||"top"===a)&&(u=r),{offset:l,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=ze(this.ifHorizontal([[e,n+a],[e+r,n+a]],[[e+a,n+i],[e+a,n]]),2),u=l[0],f=l[1];this.label.update({startPos:u,endPos:f,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,o=this.ribbonBBox,a=o.x,s=o.y,c=R(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+a,s],[a,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),cb(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){lb(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=ze(this.selection,2),o=i[0],a=i[1],s=ze([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=ze(function(t,e,n){var r,i=ze(t,2),o=i[0],a=i[1],s=ze(e,2),c=s[0],l=s[1],u=ze(n,2),f=u[0],h=u[1],d=ze([c,l],2),p=d[0],g=d[1],v=g-p;return p>g&&(p=(r=ze([g,p],2))[0],g=r[1]),v>a-o?[o,a]:p<o?f===o&&h===g?[o,g]:[o,v+o]:g>a?h===a&&f===p?[p,a]:[a-v,a]:[p,g]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return q(e)?qb(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?tM(n.map(function(t){return t.value}),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=ze(this.ribbon.node().getPosition(),2),o=i[0],a=i[1],s=this.ifHorizontal(o,a),c=this.ifHorizontal.apply(this,$e([],ze(Cb(t)),!1))-s;return R(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=ze(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Jp("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal(function(){return{value:t,range:e}},function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}}),o=new Jp("indicate",{detail:i});this.dispatchEvent(o)},e}(dx);function lM(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var uM={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function fM(t){var e;void 0===t&&(t="");var n=lM(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=Re({flex:1},uM),e[".".concat(n.VALUE)]=Re({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},uM),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var hM=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=lM(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:fM(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return je(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map(function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=Ie(t,["name","color","index"]),l=Re({name:i,color:a,index:null!=s?s:e},c);return Tn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]}):t}(n.item,l))})},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=Tn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:fx(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=lM(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,fx(f,u);var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach(function(e){var n=ze(e,2),r=n[0],i=n[1];$e([t],ze(t.querySelectorAll(r)),!1).filter(function(t){return t.matches(r)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(i).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,c=a.height,l=[-s/2,-c/2];return i.forEach(function(t){var e=ze(l,2),n=e[0],i=e[1],a=ze(o[t],2),u=a[0],f=a[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]}),l},e.prototype.setOffsetPosition=function(t){var e=ze(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+a+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=ze(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,u=l.offsetWidth,f=l.offsetHeight,h=ze([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,m=s.y,y={left:d<v,right:d+u>v+s.width,top:p<m,bottom:p+f>m+s.height},b=[];c.split("-").forEach(function(t){y[t]?b.push(g[t]):b.push(t)});var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height;return new vb(r,i,o,a).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout(function(){e.element.style.transition=n},10)},e.tag="tooltip",e}(dx),dM=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[cg.BOUNDS_CHANGED,cg.INSERTED,cg.REMOVED],n.$margin=ex(0),n.$padding=ex(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return je(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=ex(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=ex(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=ze(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new vb(n-f,i-c,o+f+l,a+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=ze(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=ze(this.$margin,4),l=c[0],u=c[3];return new vb(s+u,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:Db,grid:Bb},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map(function(t){return t.getBBox()}),this.attributes);this.children.forEach(function(t,e){var n=r[e],i=n.x,o=n.y;t.style.transform="translate(".concat(i,", ").concat(o,")")})}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach(function(e){t.addEventListener(e,function(e){e.target&&(e.target.isMutationObserved=!0,t.layout())})})},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(rv);function pM(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}const gM=Zm(t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:o,labelTransform:a,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:h,background:d,connector:p,startMarker:g,endMarker:v,coordCenter:m,innerHTML:y}=e,b=Ie(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${c}, ${l})`,[c,l,u,f].some(t=>!I(t)))return void t.children.forEach(t=>t.remove());const x=ia(b,"background"),{padding:w}=x,k=Ie(x,["padding"]),M=ia(b,"connector"),{points:O=[]}=M,E=Ie(M,["points"]);let S;S=y?Cm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",y).call(Rm,Object.assign({transform:a,transformOrigin:s},b)).node():Cm(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(Rm,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=Cm(t).maybeAppend("background","rect").style("zIndex",-1).call(Rm,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[h,d]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*h+o+r,height:2*d+n+i}}(S,w)).call(Rm,d?k:{}).node(),A=function(t,e,n,r,i=!0,o=!0){const a=t=>Ac()(t);if(!e[0]&&!e[1])return a([pM(t),e]);if(!n.length)return a([[0,0],e]);const[s,c]=n,l=[...c],u=[...s];if(c[0]!==s[0]){const t=i?-4:4;l[1]=c[1],o&&!i&&(l[0]=Math.max(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),o||i||(l[0]=Math.max(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),!o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t))),o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t)))}return a([c,l,u,s,e])}(_,[+u-+c,+f-+l],O,0,+u<m[0],+f<m[1]),T=g&&new wx({id:"startMarker",style:Object.assign({x:0,y:0},ia(b,"startMarker"))}),P=v&&new wx({id:"endMarker",style:Object.assign({x:0,y:0},ia(b,"endMarker"))});Cm(t).maybeAppend("connector","path").style("zIndex",0).style("d",A).style("markerStart",T).style("markerEnd",P).call(Rm,p?E:{})}),vM=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s},[[f,h]]=e;return Cm(new gM).style("x",f).style("y",h).call(Rm,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Rm,u).call(Rm,t).node()}};vM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mM=Zm(t=>{const e=Ie(t.attributes,["class","x","y","transform"]),n=ia(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),o=Cm(t).maybeAppend("marker",()=>new wx({})).call(t=>t.node().update(Object.assign({symbol:i},n))).node(),[a,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(o);Cm(t).maybeAppend("text","text").style("x",a).style("y",s).call(Rm,e)}),yM=(t,e)=>{const n=Ie(t,[]);return(t,e,r)=>{const{color:i}=r,o=Ie(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return Cm(new mM).call(Rm,o).style("transform",`translate(${l},${u})`).call(Rm,c).call(Rm,n).node()}};yM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bM=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,h]]=e;return Cm(new mv).style("x",f).style("y",h).call(Rm,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(Rm,u).call(Rm,t).node()}};bM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM=Zm(t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;Cm(t).maybeAppend("connect-path",()=>o.createElement("path",{})).style("d",n).call(Rm,i),Cm(t).maybeAppend("area-path",()=>o.createElement("path",{})).style("d",e).call(Rm,r)}),wM=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,a=Ie(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,g=rl(s),v=$m(s,e),m=r&&h?Dm(h,d,p,r,void 0,g):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:m,fill:m}),v&&{transform:v}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some(t=>!e(t)))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=ia(y,"connect"),k=!!x.length,M=t=>Cm(c.createElement("path",{})).style("d",t||"").call(Rm,y).node();if(il(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=Tc().curve(Pc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Lc(n())},delete t.lineX0,t.lineEndAngle=function(){return Lc(r())},delete t.lineX1,t.lineInnerRadius=function(){return Lc(i())},delete t.lineY0,t.lineOuterRadius=function(){return Lc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Nc(t)):e()._curve},t}().angle((t,n)=>Is(Ns(r[n],e))).outerRadius((t,n)=>js(r[n],e)).innerRadius((t,n)=>js(o[n],e)).defined((t,e)=>[...r[e],...o[e]].every(i)).curve(n)(o)};return!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):Cm(new xM).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?Tc().y((t,n)=>e[n][1]).x1((t,n)=>e[n][0]).x0((t,e)=>r[e][0]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e):Tc().x((t,n)=>e[n][0]).y1((t,n)=>e[n][1]).y0((t,e)=>r[e][1]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e)};return!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):Cm(new xM).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};wM.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kM=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=il(n)?Gc:Ec;return wM(Object.assign({curve:i},t),e)(...r)}};kM.props=Object.assign(Object.assign({},wM.props),{defaultMarker:"square"});const MM=(t,e)=>{const n=Ie(t,[]),{coordinate:r}=e;return(...t)=>{const i=il(r)?$c:rl(r)?Qc:Zc;return wM(Object.assign({curve:i},n),e)(...t)}};MM.props=Object.assign(Object.assign({},wM.props),{defaultMarker:"smooth"});const OM=(t,e)=>(...n)=>wM(Object.assign({curve:tl},t),e)(...n);OM.props=Object.assign(Object.assign({},wM.props),{defaultMarker:"hvh"});const EM=(t,e)=>(...n)=>wM(Object.assign({curve:el},t),e)(...n);EM.props=Object.assign(Object.assign({},wM.props),{defaultMarker:"vh"});const SM=(t,e)=>(...n)=>wM(Object.assign({curve:nl},t),e)(...n);SM.props=Object.assign(Object.assign({},wM.props),{defaultMarker:"hv"});const _M=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>ab(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};_M.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const AM=(t,e)=>{const n=Ie(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Ie(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=pc();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),Cm(r.createElement("path",{})).call(Rm,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Rm,n).node()}};function TM(t,e,n,r){const i=pc();if(il(n)){const o=n.getCenter(),a=js(t,o),s=(js(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Im(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return rl(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}AM.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const PM=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Ie(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Ie(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=TM(f,h,i,n);return Cm(o.createElement("path",{})).call(Rm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Rm,r).node()}};PM.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CM=(t,e)=>{const n=Ie(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=pc();if(h.moveTo(u[0],u[1]),il(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Im(h,u,f,Fs(u,f),js(u,f)/2)}return Cm(i.createElement("path",{})).call(Rm,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(Rm,n).node()}};function NM(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function LM(t={}){return[...NM(t),{name:"title",scale:"identity"}]}function jM(){return[{type:Ca,channel:"color"},{type:Ha,channel:["x","y"]}]}function RM(){return[{type:Ca,channel:"x"},{type:Ha,channel:["y"]}]}function IM(t={}){return NM(t)}function DM(){return[{type:Ia}]}function BM(t,e){return t.getBandWidth(t.invert(e))}function FM(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,h=!!(null==a?void 0:a.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?BM(a,r[e]):0,l=d?BM(s,i[e]):0,g=p&&o?(BM(c,o[e])/2+ +o[e])*n:0,[v,m]=t;return[v+u*n+g,m+f*l]}:t=>t}function zM(t){return parseFloat(t)/100}function $M(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions(),c=Array.from(t,t=>{const e=i[t],n=o[t];return[["string"==typeof e?zM(e)*a:+e,"string"==typeof n?zM(n)*s:+n]]});return[t,c]}function WM(t){return"function"==typeof t?t:e=>e[t]}function GM(t,e){return Array.from(t,WM(e))}function HM(t,e){const n=function(t){return Array.isArray(t)?{links:t}:t&&"object"==typeof t?{links:t.links||[],nodes:t.nodes}:{links:[]}}(t),{source:r=t=>t.source,target:i=t=>t.target,value:o=t=>t.value}=e,{links:a,nodes:s}=n;if(!a.length)return{links:[],nodes:s||[]};const c=GM(a,r),l=GM(a,i),u=GM(a,o);return{links:a.map((t,e)=>({target:l[e],source:c[e],value:u[e]})),nodes:s||Array.from(new Set([...c,...l]),t=>({key:t}))}}CM.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const YM=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,g]]=e,[v,m]=n.getSize();h="string"==typeof h?zM(h)*v:h,d="string"==typeof d?zM(d)*m:d;const y=p-Number(h)/2,b=g-Number(d)/2;return Cm(r.createElement("image",{})).call(Rm,s).style("x",y).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(Rm,t).style("width",h).style("height",d).node()}};function qM(t,e){const n=pc();if(il(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map(t=>js(t,r));return i.forEach((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?Im(n,s,e,r,a):n.lineTo(e[0],e[1])}),n.closePath(),n}return function(t,e){return e.forEach((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])),t.closePath(),t}(n,t)}YM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const VM=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,transform:l}=i,u=qM(e,n);return Cm(r.createElement("path",{})).call(Rm,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Rm,t).node()}};function UM(t,e){const[n,r,i,o]=t,a=pc();if(il(e)){const t=e.getCenter(),s=js(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Im(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Im(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}VM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const XM=(t,e)=>{const n=Ie(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,transform:l}=e,u=UM(t,r);return Cm(i.createElement("path",{})).call(Rm,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Rm,n).node()}};function KM(t,e){const n=pc();if(il(e)){const r=e.getCenter(),[i,o]=r,a=Rs(Ns(t[0],r)),s=Rs(Ns(t[1],r)),c=js(r,t[2]),l=js(r,t[3]),u=js(r,t[8]),f=js(r,t[10]),h=js(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,h,a,s),n.arc(i,o,h,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}XM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ZM=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=Ie(o,["color","fill","stroke"]),h=KM(e,n);return Cm(r.createElement("path",{})).call(Rm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Rm,t).node()}};function QM(t,e,n=4){const r=pc();if(!il(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=js(i,t[3]),c=js(i,t[8]),l=js(i,t[10]),u=Rs(Ns(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.arc(o,a,s,h,d),r.lineTo(Math.cos(d)*l+o,Math.sin(d)*l+a),r.arc(o,a,l,d,h,!0),r.lineTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/2;return r.moveTo(Math.cos(p)*(c+n/2)+o,Math.sin(p)*(c+n/2)+a),r.arc(Math.cos(p)*c+o,Math.sin(p)*c+a,n/2,p,2*Math.PI+p),r.closePath(),r}ZM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const JM=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=Ie(o,["color","fill","stroke"]),h=QM(e,n,4);return Cm(r.createElement("path",{})).call(Rm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Rm,t).node()}};JM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tO=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Ie(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Ie(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(a,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},ia(i,"arrow"))):null,p=function(t,e){if(!il(e))return Ac().x(t=>t[0]).y(t=>t[1])(t);const n=e.getCenter();return kc()({startAngle:0,endAngle:2*Math.PI,outerRadius:js(t[0],n),innerRadius:js(t[1],n)})}(t,o),g=function(t,e){if(!il(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return Cm(a.createElement("path",{})).call(Rm,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(Rm,i).node()}};function eO(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}tO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nO=(t,e)=>{const{offsetX:n=0,sourceOffsetX:r=n,targetOffsetX:i=n,offsetY:o=0,sourceOffsetY:a=o,targetOffsetY:s=o,connectLength1:c,endMarker:l=!0}=t,u=Ie(t,["offsetX","sourceOffsetX","targetOffsetX","offsetY","sourceOffsetY","targetOffsetY","connectLength1","endMarker"]),{coordinate:f}=e;return(t,e,n)=>{const{color:o,connectLength1:h}=n,d=Ie(n,["color","connectLength1"]),{color:p,transform:g}=e,v=function(t,e,n,r,i,o,a=0){const[[s,c],[l,u]]=e;if(rl(t)){const t=s+n,e=t+a,f=c+i,h=u+o;return[[t,f],[e,f],[e,h],[l+r,h]]}const f=c-n,h=f-a,d=s-i,p=l-o;return[[d,f],[d,h],[p,h],[p,u-r]]}(f,t,a,s,r,i,null!=c?c:h),m=ia(Object.assign(Object.assign({},u),n),"endMarker");return Cm(new uv).call(Rm,d).style("d",function(t){return Ac().x(t=>t[0]).y(t=>t[1])(t)}(v)).style("stroke",p||o).style("transform",g).style("markerEnd",l?new wx({className:"marker",style:Object.assign(Object.assign({},m),{symbol:eO})}):null).call(Rm,u).node()}};function rO(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=sa(n.x,l),s=sa(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function iO(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Fm(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=aO(p,a,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?oO(c,p,i):Fs(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function oO(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function aO(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function sO(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Fm(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:aO(p,a,s)},{innerRadius:v,outerRadius:m}=u,y=v+(m-v)*c+l,[b,x]=oO(d,p,y);return Object.assign({x:b,y:x},g)}function cO(t){return void 0===t?null:t}function lO(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:cO(o[0]),y:cO(o[1])}}function uO(t,e,n,r){const{bounds:i}=n;if(1===i.length)return lO(0,0,n);return(ol(r)?iO:ll(r)?sO:rO)(t,e,n,r)}function fO(t,e,n){const r=Fm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function hO(t,e,n){const r=Fm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function dO(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:c=a,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),h=hO(e,n,r),d=Math.sin(h)>0?1:-1,p=aO(h,i,o),g={textAlign:d>0||ol(r)?"start":"end",textBaseline:"middle",rotate:p},v=fO(e,n,r),m=v+(s?c:a),[[y,b],[x,w],[k,M]]=function(t,e,n,r,i){const[o,a]=oO(t,e,n),[s,c]=oO(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,v,m,s?l:0),O=s?+u*d:0,E=k+O,S={connector:s,connectorPoints:[[x-E,w-M],[k-E,M-M]]};return Object.assign(Object.assign({x0:y,y0:b,x:k+O,y:M},g),S)}function pO(t,e={}){const{labelHeight:n=14,height:r}=e,i=cr(t,t=>t.y),o=i.length,a=new Array(o);for(let t=0;t<o;t++){const e=i[t],{y:r}=e;a[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=a.length-1;t>0;t--){const e=a[t],n=a[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),a.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let c=0;for(const t of a){const{y:e,labels:r}=t;let o=e-n;for(const t of r){const e=i[c++],r=o+n-t;e.connectorPoints[0][1]-=r,e.y=o+n,o+=n}}}function gO(t,e){const n=cr(t,t=>t.y),{height:r,labelHeight:i=14}=e,o=Math.ceil(r/i);if(n.length<=o)return pO(n,e);const a=[];for(let t=0;t<n.length;t++)t<n.length-o?(n[t].opacity=0,n[t].connector=!1):a.push(n[t]);pO(a,e)}nO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const vO=new WeakMap;var mO=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=wr(o,(t,e)=>Math.abs(t[1]-a[e][1]));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=Rs(Ns(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:uO,bottomLeft:uO,bottomRight:uO,inside:uO,left:uO,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?lO(0,0,n):(ol(r)?iO:ll(r)?dO:rO)(t,e,n,r)},right:uO,spider:function(t,e,n,r,i,o){if(!ll(r))return{};if(vO.has(e))return vO.get(e);const a=o.map(t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:o}=e,a=Ie(dO(0,t,e,n),[]),s=n.getCenter(),c=fO(t,e,n),l=hO(t,e,n),u=c+r+i,f=Math.sin(l)>0?1:-1,h=s[0]+(u+ +o)*f,{x:d}=a,p=h-d;return a.x+=p,a.connectorPoints[0][0]-=p,a}(t,n,r)),{width:s,height:c}=r.getOptions(),l=a.filter(t=>t.x<s/2),u=a.filter(t=>t.x>=s/2),f=Object.assign(Object.assign({},i),{height:c});return gO(l,f),gO(u,f),a.forEach((t,e)=>vO.set(o[e],t)),vO.get(e)},surround:function(t,e,n,r){if(!ll(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Ie(dO(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(ll(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find(t=>"polar"===t[0]);if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=Is([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,v]=oO(u,d,h);return s.x=g+(o+a)*p,s.y=v,s},top:uO,topLeft:uO,topRight:uO});function yO(t,e,n,r,i,o){const{position:a}=e,{render:s}=i,c=function(t,e){return void 0!==t?t:ll(e)?"inside":rl(e)?"right":"top"}(a,n),l=r[s?"htmlLabel":"inside"===c?"innerLabel":"label"],u=Object.assign({},l,e),f=mO[Ry(c)];if(!f)throw new Error(`Unknown position: ${c}`);return Object.assign(Object.assign({},l),f(c,t,u,n,i,o))}const bO=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o,a,s)=>{const{text:c,x:l,y:u,transform:f="",transformOrigin:h,className:d=""}=o,p=Ie(o,["text","x","y","transform","transformOrigin","className"]),g=yO(e,o,n,r,t,s),{rotate:v=0,transform:m=""}=g,y=Ie(g,["rotate","transform"]);return Cm(new gM).call(Rm,y).style("text",`${c}`).style("className",`${d} g2-label`).style("innerHTML",i?i(c,o.datum,o.index):void 0).style("labelTransform",`${m} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",h).style("coordCenter",n.getCenter()).call(Rm,p).node()}};bO.props={defaultMarker:"point"};const xO=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Ie(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Ie(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return Cm(a.createElement("path",{})).call(Rm,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(Rm,i).node()}};xO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wO=(t,e)=>xO(Object.assign({colorAttribute:"fill"},t),e);wO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kO=(t,e)=>xO(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);kO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const MO=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Ie(i,["color"]),{color:c=a}=r,[l,...u]=e,f=pc();return f.moveTo(...l),u.forEach(([t,e])=>{f.lineTo(t,e)}),f.closePath(),Cm(n.createElement("path",{})).call(Rm,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Rm,t).node()}};function OO(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function EO(t,e=(...t)=>`${t[0]}`,n=16){const r=OO(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}function SO(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}MO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},OO(3);const _O=EO((t,e,n)=>{const r=SO(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r},t=>`${t}`);function AO(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=SO(a,t,e).getContext("2d"),l=function(t,e){const n=SO(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map(t=>{const[e,n]=t.split(":");return[+e,n]}):t}(t).forEach(([t,e])=>{r.addColorStop(t,e)}),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);c.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),h=i-u,d=c-u,p=_O(u,1-a,o),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,h,d)}}(c,n,r,i,s,a);const u=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),h=f.data,d=h.length;for(let t=3;t<d;t+=4){const e=h[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));h[t-3]=r[n],h[t-2]=r[n+1],h[t-1]=r[n+2],h[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=SO(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const TO=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Ie(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,g]=l.getSize(),v=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),m=kr(t,t=>t[2]),y=xr(t,t=>t[2]),b=p&&g?AO(p,g,m,y,v,function(t,e){return Object.keys(t).reduce((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n},{})}({gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},t=>void 0===t),u):{canvas:null};return Cm(f.createElement("image",{})).call(Rm,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas.toDataURL()).style("transform",d).call(Rm,c).node()}};TO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const PO=(t,e)=>{const{render:n}=t,r=Ie(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};PO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};function CO(t,e,n){return t+(e-t)*n}function NO(t,e,n,r){return 0===e?[[t+.5*n/Math.PI/2,r/2],[t+.5*n/Math.PI,r],[t+n/4,r]]:1===e?[[t+.5*n/Math.PI/2*(Math.PI-2),r],[t+.5*n/Math.PI/2*(Math.PI-1),r/2],[t+n/4,0]]:2===e?[[t+.5*n/Math.PI/2,-r/2],[t+.5*n/Math.PI,-r],[t+n/4,-r]]:[[t+.5*n/Math.PI/2*(Math.PI-2),-r],[t+.5*n/Math.PI/2*(Math.PI-1),-r/2],[t+n/4,0]]}function LO(t,e,n,r,i,o,a){const s=4*Math.ceil(2*t/n*4),c=[];let l=r;for(;l<2*-Math.PI;)l+=2*Math.PI;for(;l>0;)l-=2*Math.PI;l=l/Math.PI/2*n;const u=o-t+l-2*t;c.push(["M",u,e]);let f=0;for(let t=0;t<s;++t){const r=NO(t*n/4,t%4,n,i);c.push(["C",r[0][0]+u,-r[0][1]+e,r[1][0]+u,-r[1][1]+e,r[2][0]+u,-r[2][1]+e]),t===s-1&&(f=r[2][0])}return c.push(["L",f+u,a+t]),c.push(["L",u,a+t]),c.push(["Z"]),c}const jO={pin:function(t,e,n){const r=4*n/3,i=Math.max(r,2*n),o=r/2,a=t,s=o+e-i/2,c=Math.asin(o/(.85*(i-o))),l=Math.sin(c)*o,u=Math.cos(c)*o,f=a-u,h=s+l,d=t,p=s+o/Math.sin(c);return`\n M ${f} ${h}\n A ${o} ${o} 0 1 1 ${f+2*u} ${h}\n Q ${d} ${p} ${t} ${e+i/2}\n Q ${d} ${p} ${f} ${h}\n Z \n `},rect:function(t,e,n){const r=.618*n;return`\n M ${t-r} ${e-n}\n L ${t+r} ${e-n}\n L ${t+r} ${e+n}\n L ${t-r} ${e+n}\n Z\n `},circle:function(t,e,n){return`\n M ${t} ${e-n} \n a ${n} ${n} 0 1 0 0 ${2*n}\n a ${n} ${n} 0 1 0 0 ${2*-n}\n Z\n `},diamond:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e}\n L ${t} ${e+n}\n L ${t-n} ${e}\n Z\n `},triangle:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e+n}\n L ${t-n} ${e+n}\n Z\n `}},RO=(t,e)=>{if(!e)return;const{coordinate:n}=e,{liquidOptions:r,styleOptions:i}=t,{liquidShape:o,percent:a}=r,{background:s,outline:c={},wave:l={}}=i,u=Ie(i,["background","outline","wave"]),{border:f=2,distance:h=0}=c,d=Ie(c,["border","distance"]),{length:p=192,count:g=3}=l;return(t,r,i)=>{const{document:c}=e.canvas,{color:l,fillOpacity:v}=i,m=Object.assign(Object.assign({fill:l},i),u),b=c.createElement("g",{}),[x,w]=n.getCenter(),k=n.getSize(),M=Math.min(...k)/2,O=y(o)?o:((t="circle")=>jO[t]||jO.circle)(o),E=O(x,w,M,...k),S=O(x,w,M+f/2,...k);if(Object.keys(s).length){const t=c.createElement("path",{style:Object.assign({d:E,fill:"#fff"},s)});b.appendChild(t)}if(a>0){const t=c.createElement("path",{style:{d:S}});b.appendChild(t),b.style.clipPath=t,function(t,e,n,r,i,o,a,s,c,l,u){const{fill:f,fillOpacity:h,opacity:d}=i;for(let i=0;i<r;i++){const p=r<=1?1:i/(r-1),g=LO(s,a+s*n,c,0,s/40,t,e),v=u.createElement("path",{style:{d:g,fill:f,opacity:CO(.2,.9,p)*Number(d||h)}});o.appendChild(v);try{if(!1===l)return;const t=[{transform:"translate(0, 0)"},{transform:`translate(${2*c}, 0)`}];v.animate(t,{duration:2*CO(2500,5e3,p),iterations:1/0})}catch(t){console.warn("off-screen group animate error!")}}}(x,w,1-a,g,m,b,t.getBBox().y,2*M,p,!0,c)}const _=c.createElement("path",{style:{d:E,fill:"transparent",lineWidth:f+2*h,stroke:"#fff"}}),A=c.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:E,stroke:l,strokeOpacity:v,lineWidth:f},m),d),{fill:"transparent"})});return b.appendChild(_),b.appendChild(A),b}};RO.props={};const IO=(t,e)=>Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))/2,DO=(t,e)=>{if(!e)return;const{coordinate:n}=e;if(!(null==n?void 0:n.getCenter))return;const r=n.getCenter();return(n,i,o)=>{const{document:a}=e.canvas,{color:s,index:c}=i,l=a.createElement("g",{}),u=IO(n[0],n[1]),f=2*IO(n[0],r),h=((t,e,n)=>{const r=Math.atan2(t[1]-n[1],t[0]-n[0]);let i=Math.atan2(e[1]-n[1],e[0]-n[0])-r;return i<0&&(i+=2*Math.PI),i})(n[3],n[0],r)>Math.PI,d=a.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:[["M",...n[0]],["A",u,u,0,1,0,...n[1]],["A",f+2*u,f+2*u,0,h?1:0,0,...n[2]],["A",u,u,0,1,0===c?0:1,...n[3]],["A",f,f,0,h?1:0,1,...n[0]],["Z"]]},o),ct(t,["shape","last","first"])),{fill:s||o.color})});return l.appendChild(d),l}},BO="main-layer",FO="label-layer",zO="element",$O="view",WO="plot",GO="component",HO="label",YO="area",qO="axis-breaks",VO="axis-breaks-group",UO=.05,XO={fill:"#fff",stroke:"#aaa",lineDash:"4 3",lineWidth:.5,fillOpacity:1,strokeOpacity:1},KO=(t,e,n,r,i,o)=>{const a=[],s=[],c=r-1;for(let r=1;r<c;r++){const l=r/c*e,u=t+(r%2==0?n:-n);a.push(`${l},${u}`),s.push(`${l},${i?u-o:u+o}`)}return a.push(`${e},${t}`),s.push(`${e+o},${t}`),[a,s]},ZO=(t,e)=>{const{context:n,selection:r,view:i,transitions:o,update:a}=e,s=r.select(`.${WO}`).node(),{document:c}=n.canvas,{scale:l}=i;return t=>{const{key:e,start:u,end:f,gap:h=UO,vertices:d=50,lineWidth:p=.5,verticeOffset:g=3}=t,v=Ie(t,["key","start","end","gap","vertices","lineWidth","verticeOffset"]),m=c.createElement("g",{id:`break-group-${e}`,className:VO}),y=ot(l,"x.sortedDomain",[]),b=l.y.getOptions(),{range:x,domain:w}=b,k=w.indexOf(u),M=w.indexOf(f),{width:O,height:E}=s.getBBox();if(-1===k||-1===M||!y.length)return m;const S=x[k]*E,_=x[M]*E;let A="",T="";for(const[t,{y:e,isLower:n}]of[{y:_,isLower:!1},{y:S,isLower:!0}].entries()){const[r,i]=KO(e,O-0,g,d,n,p);0===t?(A=`M 0,${e} L ${r.join(" L ")} `,T=`M ${0-p},${e+p} L ${i.join(" L ")} `):(A+=`L ${O-0},${e} L ${[...r].reverse().join(" L ")} L 0,${e} Z`,T+=`L ${O-0+p},${e-p} L ${[...i].reverse().join(" L ")} L ${0-p},${e-p} Z`)}const P=Object.assign(Object.assign({},XO),v);try{const t=new uv({style:Object.assign(Object.assign({},P),{d:A})}),e=new uv({style:Object.assign(Object.assign({},P),{d:T,lineWidth:0})});e.addEventListener("click",s=>Be(void 0,void 0,void 0,function*(){if(2===s.detail){((t,e)=>{const n=ot(t,"scale.y"),r=ot(n,"options",{}),{breaks:i}=r,o=i.filter(t=>t.start!==e[0]&&t.end!==e[1]);n.update(Object.assign(Object.assign({},r),{breaks:o}))})(i,[u,f]),e.setAttribute("fill","transparent");const s=t.animate([{d:A},{d:`M ${O/2},${(_+S)/2} L${O/2},${(_+S)/2}`}],{duration:300,easing:"linear"});yield s.finished,a(i,r,o,n)}})),m.appendChild(t),m.appendChild(e),s.appendChild(m)}catch(t){console.error("Failed to create break path:",t)}return m}};function QO(t,e){return t.getBandWidth(t.invert(e))}ZO.props={};const JO={rect:Ym,hollow:qm,funnel:Um,pyramid:Km},tE=()=>(t,e,n,r)=>{const{x:i,y1:o,series:a,size:s}=n;let{y:c}=n;c=c.map(t=>void 0!==t?t:1);const l=e.x,u=e.series,[f]=r.getSize(),h=s?s.map(t=>+t/f):null,d=s?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,t=>{const e=QO(l,i[t]),n=e*(u?QO(u,null==a?void 0:a[t]):1),s=(+(null==a?void 0:a[t])||0)*e,f=+i[t]+s,[h,p]=d(f,n,t),g=+c[t],v=+o[t];return[[h,g],[p,g],[p,v],[h,v]].map(t=>r.map(t))});return[t,p]};tE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:JO,channels:[...LM({shapes:Object.keys(JO)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...DM(),{type:Bn},{type:Na}],postInference:[...RM()],interaction:{shareTooltip:!0}};const eE={rect:Ym,hollow:qm},nE=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t)));return[t,c]};nE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:eE,channels:[...LM({shapes:Object.keys(eE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...DM(),{type:Bn}],postInference:[...RM()],interaction:{shareTooltip:!0}};const rE={line:ty,smooth:ey,hv:ny,vh:ry,hvh:iy,trail:ay},iE=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=a?Array.from(rr(t,t=>a[t]).values()):[t],h=f.map(t=>t[0]).filter(t=>void 0!==t),d=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(o=null==u?void 0:u.getBandWidth)||void 0===o?void 0:o.call(u))||0)/2,g=Array.from(f,t=>t.map(t=>r.map([+s[t]+d,+c[t]+p])));return[h,g,f]},oE=(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===i.length)throw new Error("Missing encode for position channel.");il(r)&&i.push(i[0]);const o=Array.from(t,t=>{const e=i.map(e=>+e[t]),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o});return[t,o]},aE=()=>(t,e,n,r)=>(sl(r)?oE:iE)(t,e,n,r);aE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:rE,channels:[...LM({shapes:Object.keys(rE)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...DM(),{type:Xa},{type:Da}],postInference:[...RM(),{type:Ca,channel:"color"},{type:Ha,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const sE={hollow:$y,hollowDiamond:Fy,hollowHexagon:zy,hollowSquare:Wy,hollowTriangleDown:Hy,hollowTriangle:Gy,hollowBowtie:By,hollowCircle:Vy,point:eb,plus:tb,diamond:Ky,square:nb,triangle:ib,hexagon:Zy,cross:Xy,bowtie:Uy,hyphen:Qy,line:Jy,tick:rb,triangleDown:ob,circle:qy},cE=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=FM(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]},v=l?Array.from(e,t=>{const[e,n]=g(t),r=+l[t],o=r/h,a=r/d,s=[e-o,n-a],c=[e+o,n+a];return[i.map(p(s,t)),i.map(p(c,t))]}):Array.from(e,t=>[i.map(p(g(t),t))]);return[e,v]};cE.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:sE,channels:[...LM({shapes:Object.keys(sE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...DM(),{type:Na},{type:La}],postInference:[{type:Ra},...jM()]};const lE={text:vM,badge:yM,tag:bM},uE=t=>{const{cartesian:e=!1}=t;return e?$M:(e,n,r,i)=>{const{x:o,y:a}=r,s=FM(n,r,t),c=Array.from(e,t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]});return[e,c]}};uE.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:lE,channels:[...LM({shapes:Object.keys(lE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...DM(),{type:Ua},{type:qa}],postInference:[...jM()]};const fE={cell:Ym,hollow:qm},hE=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map(t=>r.map(t))});return[t,c]};hE.props={defaultShape:"cell",defaultLabelShape:"label",shape:fE,composite:!1,channels:[...LM({shapes:Object.keys(fE)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...DM(),{type:Na},{type:La},{type:Ya}],postInference:[...jM()]};const dE={area:kM,smooth:MM,hvh:OM,vh:EM,hv:SM},pE=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(rr(t,t=>l[t]).values()):[t],d=h.map(t=>t[0]).filter(t=>void 0!==t),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2,v=Array.from(h,t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n});return[d,v,h]};pE.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:dE,channels:[...LM({shapes:Object.keys(dE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...DM(),{type:Da},{type:Bn},{type:Ya}],postInference:[...RM()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const gE={link:_M,arc:CM,smooth:AM,vhv:PM},vE=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=FM(n,r,t),u=e.map(t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+c[t]],t))]);return[e,u]};vE.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:gE,channels:[...LM({shapes:Object.keys(gE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...DM(),{type:za},{type:$a}],postInference:[...jM()]};const mE={image:YM},yE=t=>{const{cartesian:e}=t;return e?$M:(e,n,r,i)=>{const{x:o,y:a}=r,s=FM(n,r,t),c=Array.from(e,t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]});return[e,c]}};yE.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:mE,channels:[...LM({shapes:Object.keys(mE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...DM(),{type:Ua},{type:qa}],postInference:[...jM()]};const bE={polygon:VM,ribbon:XM},xE=()=>(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),o=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),a=t.map(t=>{const e=[];for(let n=0;n<i.length;n++){const a=i[n][t];if(void 0===a)break;const s=o[n][t];e.push(r.map([+a,+s]))}return e});return[t,a]};xE.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:bE,channels:[...LM({shapes:Object.keys(bE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...DM()],postInference:[...jM()]};const wE={box:ZM,violin:JM},kE=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[g,v,m,y,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,y],[p-n/2,y],[p+n/2,y],[p+n/2,v],[p-n/2,v],[p-n/2,m],[p+n/2,m],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map(t=>r.map(t))});return[t,d]};kE.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:wE,channels:[...LM({shapes:Object.keys(wE)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...DM(),{type:Na}],postInference:[...RM()],interaction:{shareTooltip:!0}};const ME={vector:ab},OE=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[c,l]=r.getSize(),u=t.map(t=>{const e=+s[t]/180*Math.PI,n=+a[t],u=n/l,f=n/c*Math.cos(e),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-h/2]),r.map([+i[t]+f/2,+o[t]+h/2])]});return[t,u]};OE.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:ME,channels:[...LM({shapes:Object.keys(ME)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...DM()],postInference:[...jM()]};const EE={line:tO},SE=t=>(e,n,r,i)=>{const{y:o}=r,a=FM(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[0,o[t]],[1,o[t]]].map(e=>i.map(a(e,t))));return[e,s]};SE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:EE,channels:[...IM({shapes:Object.keys(EE)}),{name:"y",required:!0}],preInference:[...DM(),{type:Ba}],postInference:[]};const _E={line:tO},AE=t=>(e,n,r,i)=>{const{x:o}=r,a=FM(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[o[t],1],[o[t],0]].map(e=>i.map(a(e,t))));return[e,s]};AE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:_E,channels:[...IM({shapes:Object.keys(_E)}),{name:"x",required:!0}],preInference:[...DM(),{type:Fa}],postInference:[]};const TE={connector:nO},PE=(...t)=>vE(...t);function CE(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function NE(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=CE("x",e,i,r.x),s=CE("y",n,i,r.y),c=Array.from(t,t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map(t=>o.map(t))});return[t,c]}}PE.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:TE,channels:[...IM({shapes:Object.keys(TE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...DM()],postInference:[]};const LE={range:Ym},jE=()=>NE();jE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:LE,channels:[...IM({shapes:Object.keys(LE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...DM()],postInference:[]};const RE={range:Ym},IE=()=>NE({extendY:!0});IE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:RE,channels:[...IM({shapes:Object.keys(RE)}),{name:"x",required:!0}],preInference:[...DM(),{type:Wa}],postInference:[]};const DE={range:Ym},BE=()=>NE({extendX:!0});function FE(t){return t.target.depth}function zE(t,e){return t.sourceLinks.length?t.depth:e-1}function $E(t){return function(){return t}}function WE(t,e){return HE(t.source,e.source)||t.index-e.index}function GE(t,e){return HE(t.target,e.target)||t.index-e.index}function HE(t,e){return t.y0-e.y0}function YE(t){return t.value}function qE(t){return t.index}function VE(t){return t.nodes}function UE(t){return t.links}function XE(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function KE({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function ZE(){let t,e,n,r,i=0,o=0,a=1,s=1,c=24,l=8,u=qE,f=zE,h=VE,d=UE,p=6;function g(g){const y={nodes:h(g),links:d(g)};return function({nodes:t,links:e}){t.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const n=new Map(t.map(t=>[u(t),t]));if(e.forEach((t,e)=>{t.index=e;let{source:r,target:i}=t;"object"!=typeof r&&(r=t.source=XE(n,r)),"object"!=typeof i&&(i=t.target=XE(n,i)),r.sourceLinks.push(t),i.targetLinks.push(t)}),null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}(y),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(Lr(e.sourceLinks,YE),Lr(e.targetLinks,YE)):e.fixedValue}(y),function({nodes:t}){const n=t.length;let r=new Set(t),i=new Set,o=0;for(;r.size;){if(r.forEach(t=>{t.depth=o;for(const{target:e}of t.sourceLinks)i.add(e)}),++o>n)throw new Error("circular link");r=i,i=new Set}if(e){const n=Math.max(xr(t,t=>t.depth)+1,0);let r;for(let i=0;i<t.length;i++)r=t[i],r.depth=e.call(null,r,n)}}(y),function({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){if(n.forEach(t=>{t.height=i;for(const{source:e}of t.targetLinks)r.add(e)}),++i>e)throw new Error("circular link");n=r,r=new Set}}(y),function(e){const r=function({nodes:t}){const e=Math.max(xr(t,t=>t.depth)+1,0),r=(a-i-c)/(e-1),o=new Array(e).fill(0).map(()=>[]);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(f.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+c,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(s-o)/(xr(r,t=>t.length)-1)),function(e){const n=kr(e,e=>(s-o-(e.length-1)*t)/Lr(e,YE));for(const r of e){let e=o;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(s-e+t)/(r.length+1);for(let t=0;t<r.length;++t){const n=r[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}k(r)}}(r);for(let t=0;t<p;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/p);m(r,e,n),v(r,e,n)}}(y),KE(y),y}function v(t,e,r){for(let i=1,o=t.length;i<o;++i){const o=t[i];for(const t of o){let n=0,r=0;for(const{source:e,value:i}of t.targetLinks){const o=i*(t.layer-e.layer);n+=M(e,t)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,w(t)}void 0===n&&o.sort(HE),o.length&&y(o,r)}}function m(t,e,r){for(let i=t.length-2;i>=0;--i){const o=t[i];for(const t of o){let n=0,r=0;for(const{target:e,value:i}of t.sourceLinks){const o=i*(e.layer-t.layer);n+=O(t,e)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,w(t)}void 0===n&&o.sort(HE),o.length&&y(o,r)}}function y(e,n){const r=e.length>>1,i=e[r];x(e,i.y0-t,r-1,n),b(e,i.y1+t,r+1,n),x(e,s,e.length-1,n),b(e,o,0,n)}function b(e,n,r,i){for(;r<e.length;++r){const o=e[r],a=(n-o.y0)*i;a>1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+t}}function x(e,n,r,i){for(;r>=0;--r){const o=e[r],a=(o.y1-n)*i;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-t}}function w({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(GE);for(const{target:{targetLinks:e}}of t)e.sort(WE)}}function k(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(GE),n.sort(WE)}function M(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:o}of e.sourceLinks){if(i===n)break;r+=o+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function O(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:o}of n.targetLinks){if(i===e)break;r+=o+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return g.update=function(t){return KE(t),t},g.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:$E(t),g):u},g.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:$E(t),g):f},g.nodeDepth=function(t){return arguments.length?(e=t,g):e},g.nodeSort=function(t){return arguments.length?(n=t,g):n},g.nodeWidth=function(t){return arguments.length?(c=+t,g):c},g.nodePadding=function(e){return arguments.length?(l=t=+e,g):l},g.nodes=function(t){return arguments.length?(h="function"==typeof t?t:$E(t),g):h},g.links=function(t){return arguments.length?(d="function"==typeof t?t:$E(t),g):d},g.linkSort=function(t){return arguments.length?(r=t,g):r},g.size=function(t){return arguments.length?(i=o=0,a=+t[0],s=+t[1],g):[a-i,s-o]},g.extent=function(t){return arguments.length?(i=+t[0][0],a=+t[1][0],o=+t[0][1],s=+t[1][1],g):[[i,o],[a,s]]},g.iterations=function(t){return arguments.length?(p=+t,g):p},g}BE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:DE,channels:[...IM({shapes:Object.keys(DE)}),{name:"y",required:!0}],preInference:[...DM(),{type:Ga}],postInference:[]};const QE={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},JE={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?kr(t.sourceLinks,FE)-1:0},justify:zE};const tS=t=>e=>{const{nodeId:n,nodeSort:r,nodeAlign:i,nodeWidth:o,nodePadding:a,nodeDepth:s,nodes:c,links:l,linkSort:u,iterations:f}=Object.assign({},QE,t),h=ZE().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?JE[t]||zE:"function"===e?t:zE}(i)).iterations(f).extent([[0,0],[1,1]]);"function"==typeof n&&h.nodeId(n);const d=h(e),{nodes:p,links:g}=d,v=p.map(t=>{const{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),m=g.map(t=>{const{source:e,target:n}=t,r=e.x1,i=n.x0,o=t.width/2;return Object.assign(Object.assign({},t),{x:[r,r,i,i],y:[t.y0+o,t.y0-o,t.y1+o,t.y1-o]})});return{nodes:v,links:m}};function eS(t,e,n={},r=!1){if(la(t))return t;if(Array.isArray(t)&&r)return t;const i=ia(t,e);return tt(n,i)}function nS(t,e={}){return la(t)||Array.isArray(t)?t:rS(t)?tt(e,t):t}function rS(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}function iS(t,e){return"object"==typeof t?ia(t,e):t}tS.props={};const oS={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},aS={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},sS={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},cS={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},lS=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={},interaction:u,state:f={}}=t,{links:h,nodes:d}=HM(e,n);if(!h||0===h.length)return[tt({},aS,{data:[],encode:{},scale:r,style:ia(i,"node"),labels:[],tooltip:!1,animate:!1,axis:!1,interaction:u,state:{}}),tt({},sS,{data:[],encode:{},labels:[],style:ia(i,"link"),tooltip:!1,animate:!1,interaction:u,state:{}})];const p=ia(n,"node"),g=ia(n,"link"),{key:v=t=>t.key,color:m=v}=p,{links:y,nodes:b}=tS(Object.assign(Object.assign(Object.assign({},oS),{nodeId:WM(v)}),o))({links:h,nodes:d}),x=ia(i,"label"),{text:w=v,spacing:k=5}=x,M=Ie(x,["text","spacing"]),O=WM(v),E=eS(l,"node",{title:O,items:[{field:"value"}]},!0),S=eS(l,"link",{title:"",items:[t=>({name:"source",value:O(t.source)}),t=>({name:"target",value:O(t.target)})]}),[_,A]=Object.entries(f).reduce((t,[e,n])=>{const r=aa(n,"node","link"),i=ia(n,"node");t[0][e]=Object.assign(Object.assign({},r),i);const o=ia(n,"link");return t[1][e]=Object.assign(Object.assign({},r),o),t},[{},{}]);return[tt({},aS,{data:b,encode:Object.assign(Object.assign({},p),{color:m}),scale:r,style:ia(i,"node"),labels:[Object.assign(Object.assign(Object.assign({},cS),{text:w,dx:t=>t.x[0]<.5?k:-k}),M),...a],tooltip:E,animate:iS(c,"node"),axis:!1,interaction:u,state:_}),tt({},sS,{data:y,encode:g,labels:s,style:Object.assign({fill:g.color?void 0:"#aaa",lineWidth:0},ia(i,"link")),tooltip:S,animate:iS(c,"link"),interaction:u,state:A})]};lS.props={};var uS=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return`${t.id}`.localeCompare(`${e.id}`)},name:function(t,e){return`${t.name}`.localeCompare(`${e.name}`)}});const fS={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function hS(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:o,source:a,target:s,sourceWeight:c,targetWeight:l,sortBy:u}=Object.assign(Object.assign({},fS),t);return function(t){const f=t.nodes.map(t=>Object.assign({},t)),h=t.edges.map(t=>Object.assign({},t));return function(t,e){e.forEach(t=>{t.source=a(t),t.target=s(t),t.sourceWeight=c(t),t.targetWeight=l(t)});const n=rr(e,t=>t.source),r=rr(e,t=>t.target);t.forEach(t=>{t.id=o(t);const e=n.has(t.id)?n.get(t.id):[],i=r.has(t.id)?r.get(t.id):[];t.frequency=e.length+i.length,t.value=Lr(e,t=>t.sourceWeight)+Lr(i,t=>t.targetWeight)})}(f,h),function(t){const e="function"==typeof u?u:uS[u];e&&t.sort(e)}(f),function(t,o){const a=t.length;if(!a)throw ta("Invalid nodes: it's empty!");if(!r){const n=1/a;return t.forEach((t,r)=>{t.x=(r+.5)*n,t.y=e}),{nodes:t,edges:o}}const s=i/(2*a),c=t.reduce((t,e)=>t+e.value,0);t.reduce((t,r)=>{r.weight=r.value/c,r.width=r.weight*(1-i),r.height=n;const o=s+t,a=o+r.width,l=e-n/2,u=l+n;return r.x=[o,a,a,o],r.y=[l,l,u,u],t+r.width+2*s},0)}(f,h),function(t,n){const i=new Map(t.map(t=>[t.id,t]));if(!r)return n.forEach(t=>{const e=a(t),n=s(t),r=i.get(e),o=i.get(n);r&&o&&(t.x=[r.x,o.x],t.y=[r.y,o.y])}),{nodes:t,edges:n};n.forEach(t=>{t.x=[0,0,0,0],t.y=[e,e,e,e]});const o=rr(n,t=>t.source),c=rr(n,t=>t.target);t.forEach(t=>{const{edges:e,width:n,x:r,y:i,value:a,id:s}=t,l=o.get(s)||[],u=c.get(s)||[];let f=0;l.map(t=>{const e=t.sourceWeight/a*n;t.x[0]=r[0]+f,t.x[1]=r[0]+f+e,f+=e}),u.forEach(t=>{const e=t.targetWeight/a*n;t.x[3]=r[0]+f,t.x[2]=r[0]+f+e,f+=e})})}(f,h),{nodes:f,edges:h}}}const dS=t=>e=>hS(t)(e);dS.props={};const pS={y:0,thickness:.05,marginRatio:.1,id:t=>t.key,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null},gS={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{opacity:1,fillOpacity:1,lineWidth:1}},vS={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{opacity:.5,lineWidth:1}},mS={position:"outside",fontSize:10},yS=(t,e)=>{const{data:n,encode:r={},scale:i,style:o={},layout:a={},nodeLabels:s=[],linkLabels:c=[],animate:l={},tooltip:u={}}=t,{nodes:f,links:h}=HM(n,r),d=ia(r,"node"),p=ia(r,"link"),{key:g=t=>t.key,color:v=g}=d,{linkEncodeColor:m=t=>t.source}=p,{nodeWidthRatio:y=pS.thickness,nodePaddingRatio:b=pS.marginRatio}=a,x=Ie(a,["nodeWidthRatio","nodePaddingRatio"]),{nodes:w,edges:k}=dS(Object.assign(Object.assign(Object.assign(Object.assign({},pS),{id:WM(g),thickness:y,marginRatio:b}),x),{weight:!0}))({nodes:f,edges:h}),M=ia(o,"label"),{text:O=g}=M,E=Ie(M,["text"]),S=eS(u,"node",{title:"",items:[t=>({name:t.key,value:t.value})]},!0),_=eS(u,"link",{title:"",items:[t=>({name:`${t.source} -> ${t.target}`,value:t.value})]}),{height:A,width:T}=e,P=Math.min(A,T);return[tt({},vS,{data:k,encode:Object.assign(Object.assign({},p),{color:m}),labels:c,style:Object.assign({fill:m?void 0:"#aaa"},ia(o,"link")),tooltip:_,animate:iS(l,"link")}),tt({},gS,{data:w,encode:Object.assign(Object.assign({},d),{color:v}),scale:i,style:ia(o,"node"),coordinate:{type:"polar",outerRadius:(P-20)/P,startAngle:2*-Math.PI,endAngle:0},labels:[Object.assign(Object.assign(Object.assign({},mS),{text:O}),E),...s],tooltip:S,animate:iS(l,"node"),axis:!1})]};yS.props={};const bS={path:wO,hollow:kO},xS=t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])];function wS(t,e){return t.parent===e.parent?1:2}function kS(t,e){return t+e.x}function MS(t,e){return Math.max(t,e.y)}function OS(){var t=wS,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter(function(e){var n=e.children;n?(e.x=function(t){return t.reduce(kS,0)/t.length}(n),e.y=function(t){return 1+t.reduce(MS,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)});var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function ES(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function SS(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=AS)):void 0===e&&(e=_S);for(var n,r,i,o,a,s=new CS(t),c=[s];n=c.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new CS(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(PS)}function _S(t){return t.children}function AS(t){return Array.isArray(t)?t[1]:null}function TS(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function PS(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function CS(t){this.data=t,this.depth=this.height=0,this.parent=null}function NS(t){return null==t?null:LS(t)}function LS(t){if("function"!=typeof t)throw new Error;return t}function jS(){return 0}function RS(t){return function(){return t}}xS.props={defaultShape:"path",defaultLabelShape:"label",shape:bS,composite:!1,channels:[...LM({shapes:Object.keys(bS)}),{name:"d",scale:"identity"}],preInference:[...DM()],postInference:[]},CS.prototype=SS.prototype={constructor:CS,count:function(){return this.eachAfter(ES)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return SS(this).eachBefore(TS)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};const IS=4294967296;function DS(t,e){var n,r;if(zS(e,t))return[e];for(n=0;n<t.length;++n)if(BS(e,t[n])&&zS(WS(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(BS(WS(t[n],t[r]),e)&&BS(WS(t[n],e),t[r])&&BS(WS(t[r],e),t[n])&&zS(GS(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function BS(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function FS(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function zS(t,e){for(var n=0;n<e.length;++n)if(!FS(t,e[n]))return!1;return!0}function $S(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return WS(t[0],t[1]);case 3:return GS(t[0],t[1],t[2])}}function WS(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,c=o-n,l=a-r,u=s-i,f=Math.sqrt(c*c+l*l);return{x:(n+o+c/f*u)/2,y:(r+a+l/f*u)/2,r:(f+i+s)/2}}function GS(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,c=e.r,l=n.x,u=n.y,f=n.r,h=r-a,d=r-l,p=i-s,g=i-u,v=c-o,m=f-o,y=r*r+i*i-o*o,b=y-a*a-s*s+c*c,x=y-l*l-u*u+f*f,w=d*p-h*g,k=(p*x-g*b)/(2*w)-r,M=(g*v-p*m)/w,O=(d*b-h*x)/(2*w)-i,E=(h*m-d*v)/w,S=M*M+E*E-1,_=2*(o+k*M+O*E),A=k*k+O*O-o*o,T=-(Math.abs(S)>1e-6?(_+Math.sqrt(_*_-4*S*A))/(2*S):A/_);return{x:r+k+M*T,y:i+O+E*T,r:T}}function HS(t,e,n){var r,i,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*c,n.y=t.y-r*c+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*c,n.y=e.y+r*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function YS(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function qS(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function VS(t){this._=t,this.next=null,this.previous=null}function US(t,e){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,c,l,u,f,h;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;HS(r,n,i=t[2]),n=new VS(n),r=new VS(r),i=new VS(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(c=3;c<o;++c){HS(n._,r._,i=t[c]),i=new VS(i),l=r.next,u=n.previous,f=r._.r,h=n._.r;do{if(f<=h){if(YS(l._,i._)){r=l,n.next=r,r.previous=n,--c;continue t}f+=l._.r,l=l.next}else{if(YS(u._,i._)){(n=u).next=r,r.previous=n,--c;continue t}h+=u._.r,u=u.previous}}while(l!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=qS(n);(i=i.next)!==r;)(s=qS(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=function(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i<o;)n=t[i],r&&FS(r,n)?++i:(r=$S(a=DS(a,n)),i=0);return r}(n,e),c=0;c<o;++c)(n=t[c]).x-=i.x,n.y-=i.y;return i.r}function XS(t){return Math.sqrt(t.value)}function KS(){var t=null,e=1,n=1,r=jS;function i(i){const o=function(){let t=1;return()=>(t=(1664525*t+1013904223)%IS)/IS}();return i.x=e/2,i.y=n/2,t?i.eachBefore(ZS(t)).eachAfter(QS(r,.5,o)).eachBefore(JS(1)):i.eachBefore(ZS(XS)).eachAfter(QS(jS,1,o)).eachAfter(QS(r,i.r/Math.min(e,n),o)).eachBefore(JS(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=NS(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:RS(+t),i):r},i}function ZS(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function QS(t,e,n){return function(r){if(i=r.children){var i,o,a,s=i.length,c=t(r)*e||0;if(c)for(o=0;o<s;++o)i[o].r+=c;if(a=US(i,n),c)for(o=0;o<s;++o)i[o].r-=c;r.r=a+c}}}function JS(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function t_(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function e_(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(r-e)/t.value;++s<c;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}var n_={depth:-1},r_={},i_={};function o_(t){return t.id}function a_(t){return t.parentId}function s_(){var t,e=o_,n=a_;function r(r){var i,o,a,s,c,l,u,f,h=Array.from(r),d=e,p=n,g=new Map;if(null!=t){const e=h.map((e,n)=>function(t){t=`${t}`;let e=t.length;l_(t,e-1)&&!l_(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r))),n=e.map(c_),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(c_(t)),h.push(i_));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=h.length;a<i;++a)o=h[a],l=h[a]=new CS(o),null!=(u=d(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?r_:l)),null!=(u=p(o,a,r))&&(u+="")&&(l.parent=u);for(a=0;a<i;++a)if(u=(l=h[a]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===r_)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===i_&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===i_;--t)l.data=null}if(s.parent=n_,s.eachBefore(function(t){t.depth=t.parent.depth+1,--i}).eachBefore(PS),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=NS(t),r):e},r.parentId=function(t){return arguments.length?(n=NS(t),r):n},r.path=function(e){return arguments.length?(t=NS(e),r):t},r}function c_(t){let e=t.length;if(e<2)return"";for(;--e>1&&!l_(t,e););return t.slice(0,e)}function l_(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function u_(t,e){return t.parent===e.parent?1:2}function f_(t){var e=t.children;return e?e[0]:t.t}function h_(t){var e=t.children;return e?e[e.length-1]:t.t}function d_(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function p_(t,e,n){return t.a.parent===e.parent?t.a:n}function g_(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function v_(){var t=u_,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new g_(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new g_(r[i],i)),n.parent=e;return(a.parent=new g_(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(s);else{var l=i,u=i,f=i;i.eachBefore(function(t){t.x<l.x&&(l=t),t.x>u.x&&(u=t),t.depth>f.depth&&(f=t)});var h=l===u?1:t(l,u)/2,d=h-l.x,p=e/(u.x+h+d),g=n/(f.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*g})}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,f=s.m,h=c.m;s=h_(s),o=f_(o),s&&o;)c=f_(c),(a=h_(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(d_(p_(s,e,r),e,i),l+=i,u+=i),f+=s.m,l+=o.m,h+=c.m,u+=a.m;s&&!h_(a)&&(a.t=s,a.m+=f-u),o&&!f_(c)&&(c.t=o,c.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function m_(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}g_.prototype=Object.create(CS.prototype);var y_=(1+Math.sqrt(5))/2;function b_(t,e,n,r,i,o){for(var a,s,c,l,u,f,h,d,p,g,v,m=[],y=e.children,b=0,x=0,w=y.length,k=e.value;b<w;){c=i-n,l=o-r;do{u=y[x++].value}while(!u&&x<w);for(f=h=u,v=u*u*(g=Math.max(l/c,c/l)/(k*t)),p=Math.max(h/v,v/f);x<w;++x){if(u+=s=y[x].value,s<f&&(f=s),s>h&&(h=s),v=u*u*g,(d=Math.max(h/v,v/f))>p){u-=s;break}p=d}m.push(a={value:u,dice:c<l,children:y.slice(b,x)}),a.dice?e_(a,n,r,i,k?r+=l*u/k:o):m_(a,n,r,k?n+=c*u/k:i,o),k-=u,b=x}return m}var x_=function t(e){function n(t,n,r,i,o){b_(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(y_);function w_(t,e,n,r,i){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var v=l[d]-f,m=r-v;if(a-i>c-o){var y=r?(i*m+a*v)/r:a;t(e,d,v,i,o,y,c),t(d,n,m,y,o,a,c)}else{var b=r?(o*m+c*v)/r:c;t(e,d,v,i,o,a,b),t(d,n,m,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function k_(t,e,n,r,i){(1&t.depth?m_:e_)(t,e,n,r,i)}var M_=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,f=-1,h=a.length,d=t.value;++f<h;){for(c=(s=a[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?e_(s,n,r,i,d?r+=(o-r)*s.value/d:o):m_(s,n,r,d?n+=(i-n)*s.value/d:i,o),d-=s.value}else t._squarify=a=b_(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(y_);function O_(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach(n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],O_(n,n.path)})}function E_(t){const e=ot(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach(t=>{E_(t)})}function S_(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:w_,treemapDice:e_,treemapSlice:m_,treemapSliceDice:k_,treemapSquarify:x_,treemapResquarify:M_},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),o=function(t,e){return Array.isArray(t)?"function"==typeof e?s_().path(e)(t):s_()(t):SS(t)}(t,e.path);x(t)?E_(o):O_(o),r?o.sum(t=>e.ignoreParentValue&&t.children?0:WM(r)(t)).sort(e.sort):o.count(),function(){var t=x_,e=!1,n=1,r=1,i=[0],o=jS,a=jS,s=jS,c=jS,l=jS;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(t_),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<u&&(u=h=(u+h)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=h,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,u+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(h-=c(e)-n)<u&&(u=h=(u+h)/2),t(e,r,u,f,h))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=LS(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:RS(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:RS(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:RS(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:RS(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:RS(+t),u):l},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(o);const a=o.descendants().map(t=>Object.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]})),s=a.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,a]}const __={fontSize:10,text:t=>j(t.path),position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0,isTreemapLabel:!0},A_={title:t=>{var e,n;return null===(n=null===(e=t.path)||void 0===e?void 0:e.join)||void 0===n?void 0:n.call(e,".")},items:[{field:"value"}]},T_={title:t=>j(t.path),items:[{field:"value"}]},P_=(t,e)=>{const{width:n,height:r,options:i}=e,{data:o,encode:a={},scale:s,style:c={},layout:l={},labels:u=[],tooltip:f={}}=t,h=Ie(t,["data","encode","scale","style","layout","labels","tooltip"]),d=ot(i,["interaction","treemapDrillDown"])||ot(i,["marks",0,"interaction","treemapDrillDown"]),p=tt({},((t,e)=>({tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}))(n,r),l,{layer:d?t=>1===t.depth:l.layer}),[g,v]=S_(o,p,a),m=ia(c,"label");return tt({},((t,e)=>({type:"rect",axis:!1,encode:{x:"x",y:"y",key:"id",color:t=>t.path[1]},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"},state:{active:{opacity:.6},inactive:{opacity:1}}}))(n,r),Object.assign(Object.assign({data:g,scale:s,style:c,labels:[Object.assign(Object.assign(Object.assign({},__),m),d&&{cursor:"pointer"}),...u]},h),{encode:a,tooltip:nS(f,A_),axis:!1}),d?{interaction:Object.assign(Object.assign({},h.interaction),{treemapDrillDown:d?Object.assign(Object.assign({},d),{originData:v,layout:p}):void 0}),encode:Object.assign({color:t=>j(t.path)},a),tooltip:nS(f,T_)}:{})};P_.props={};const C_={text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r},N_={title:t=>t.data.name,items:[{field:"value"}]},L_=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:o={},scale:a={},style:s={},layout:c={},labels:l=[],tooltip:u={}}=t,f=Ie(t,["data","encode","scale","style","layout","labels","tooltip"]),h=((t,e,n)=>({type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:n.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:n.color?void 0:t=>0===t.height?"":"#000"}}))(n,r,o),d=((t,e,n)=>{const{value:r}=n,i=x(t)?s_().path(e.path)(t):SS(t);return r?i.sum(t=>WM(r)(t)).sort(e.sort):i.count(),KS().size(e.size).padding(e.padding)(i),i.descendants()})(i,tt({},((t,e)=>({size:[t,e],padding:0,sort:(t,e)=>e.value-t.value}))(n,r),c),tt({},h.encode,o)),p=ia(s,"label");return tt({},h,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},C_),p),...l]},f),{tooltip:nS(u,N_),axis:!1}))};function j_(t,e){return kr(t,t=>e[t])}function R_(t,e){return xr(t,t=>e[t])}function I_(t,e){const n=2.5*D_(t,e)-1.5*F_(t,e);return kr(t,t=>e[t]>=n?e[t]:NaN)}function D_(t,e){return Sr(t,.25,t=>e[t])}function B_(t,e){return Sr(t,.5,t=>e[t])}function F_(t,e){return Sr(t,.75,t=>e[t])}function z_(t,e){const n=2.5*F_(t,e)-1.5*D_(t,e);return xr(t,t=>e[t]<=n?e[t]:NaN)}function $_(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(rr(t,t=>a[+t]).values()),c=s.flatMap(t=>{const e=I_(t,o),n=z_(t,o);return t.filter(t=>o[t]<e||o[t]>n)});return[c,e]}}L_.props={};const W_=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:o,animate:a}=t,s=Ie(t,["data","encode","style","tooltip","transform","animate"]),{point:c=!0}=r,l=Ie(r,["point"]),{y:u}=n,f={y:u,y1:u,y2:u,y3:u,y4:u},h={y1:D_,y2:B_,y3:F_},d=eS(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),p=eS(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});if(!c)return Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:j_},h),{y4:R_})],encode:Object.assign(Object.assign({},n),f),style:l,tooltip:d},s);const g=ia(l,"box"),v=ia(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:I_},h),{y4:z_})],encode:Object.assign(Object.assign({},n),f),style:g,tooltip:d,animate:iS(a,"box")},s),{type:"point",data:e,transform:[{type:$_}],encode:n,style:Object.assign({},v),tooltip:p,animate:iS(a,"point")}]};W_.props={};const G_=t=>{const{cartesian:e}=t;return e?$M:(e,n,r,i)=>{const{x:o,y:a}=r,s=FM(n,r,t),c=Array.from(e,t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]});return[e,c]}};function H_(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,c,l,u,f,h,d=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(v+y)/2))?v=a:y=a,i=d,!(d=d[f=u<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),c=+t._y.call(null,d.data),e===s&&n===c)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(v+y)/2))?v=a:y=a}while((f=u<<1|l)==(h=(c>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function Y_(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function q_(t){return t[0]}function V_(t){return t[1]}function U_(t,e,n){var r=new X_(null==e?q_:e,null==n?V_:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function X_(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function K_(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}G_.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:PO},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...DM(),{type:Ua},{type:qa},{type:Va}]};var Z_=U_.prototype=X_.prototype;function Q_(t){return function(){return t}}function J_(t){return 1e-6*(t()-.5)}function tA(t){return t.index}function eA(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}Z_.copy=function(){var t,e,n=new X_(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=K_(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=K_(e));return n},Z_.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return H_(this.cover(e,n),e,n,t)},Z_.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<c&&(c=r),r>u&&(u=r),i<l&&(l=i),i>f&&(f=i));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;n<o;++n)H_(this,a[n],s[n],t[n]);return this},Z_.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,c=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,c*=2,s){case 0:i=n+c,o=r+c;break;case 1:n=i-c,o=r+c;break;case 2:i=n+c,r=o-c;break;case 3:n=i-c,r=o-c}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},Z_.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},Z_.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Z_.find=function(t,e,n){var r,i,o,a,s,c,l,u=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new Y_(g,u,f,h,d)),null==n?n=1/0:(u=t-n,f=e-n,h=t+n,d=e+n,n*=n);c=p.pop();)if(!(!(g=c.node)||(i=c.x0)>h||(o=c.y0)>d||(a=c.x1)<u||(s=c.y1)<f))if(g.length){var v=(i+a)/2,m=(o+s)/2;p.push(new Y_(g[3],v,m,a,s),new Y_(g[2],i,m,v,s),new Y_(g[1],v,o,a,m),new Y_(g[0],i,o,v,m)),(l=(e>=m)<<1|t>=v)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=y*y+b*b;if(x<n){var w=Math.sqrt(n=x);u=t-w,f=e-w,h=t+w,d=e+w,r=g.data}}return r},Z_.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,c,l,u,f,h,d=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+v)/2))?p=s:v=s,(u=a>=(c=(g+m)/2))?g=c:m=c,e=d,!(d=d[f=u<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},Z_.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Z_.root=function(){return this._root},Z_.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},Z_.visit=function(t){var e,n,r,i,o,a,s=[],c=this._root;for(c&&s.push(new Y_(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&c.length){var l=(r+o)/2,u=(i+a)/2;(n=c[3])&&s.push(new Y_(n,l,u,o,a)),(n=c[2])&&s.push(new Y_(n,r,u,l,a)),(n=c[1])&&s.push(new Y_(n,l,i,o,u)),(n=c[0])&&s.push(new Y_(n,r,i,l,u))}return this},Z_.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Y_(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,c=e.x1,l=e.y1,u=(a+c)/2,f=(s+l)/2;(o=i[0])&&n.push(new Y_(o,a,s,u,f)),(o=i[1])&&n.push(new Y_(o,u,s,c,f)),(o=i[2])&&n.push(new Y_(o,a,f,u,l)),(o=i[3])&&n.push(new Y_(o,u,f,c,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Z_.x=function(t){return arguments.length?(this._x=t,this):this._x},Z_.y=function(t){return arguments.length?(this._y=t,this):this._y};var nA={value:()=>{}};function rA(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new iA(r)}function iA(t){this._=t}function oA(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function aA(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=nA,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}iA.prototype=rA.prototype={constructor:iA,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=aA(i[n],t.name,e);else if(null==e)for(n in i)i[n]=aA(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=oA(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new iA(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var sA,cA,lA=0,uA=0,fA=0,hA=0,dA=0,pA=0,gA="object"==typeof performance&&performance.now?performance:Date,vA="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mA(){return dA||(vA(yA),dA=gA.now()+pA)}function yA(){dA=0}function bA(){this._call=this._time=this._next=null}function xA(t,e,n){var r=new bA;return r.restart(t,e,n),r}function wA(){dA=(hA=gA.now())+pA,lA=uA=0;try{!function(){mA(),++lA;for(var t,e=sA;e;)(t=dA-e._time)>=0&&e._call.call(void 0,t),e=e._next;--lA}()}finally{lA=0,function(){var t,e,n=sA,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:sA=e);cA=t,MA(r)}(),dA=0}}function kA(){var t=gA.now(),e=t-hA;e>1e3&&(pA-=e,hA=t)}function MA(t){lA||(uA&&(uA=clearTimeout(uA)),t-dA>24?(t<1/0&&(uA=setTimeout(wA,t-gA.now()-pA)),fA&&(fA=clearInterval(fA))):(fA||(hA=gA.now(),fA=setInterval(kA,1e3)),lA=1,vA(wA)))}bA.prototype=xA.prototype={constructor:bA,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?mA():+n)+(null==e?0:+e),this._next||cA===this||(cA?cA._next=this:sA=this,cA=this),this._call=t,this._time=n,MA()},stop:function(){this._call&&(this._call=null,this._time=1/0,MA())}};const OA=4294967296;function EA(t){return t.x}function SA(t){return t.y}var _A=Math.PI*(3-Math.sqrt(5));function AA(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,c=xA(f),l=rA("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%OA)/OA}();function f(){h(),l.call("tick",e),n<r&&(c.stop(),l.call("end",e))}function h(r){var c,l,u=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach(function(t){t(n)}),c=0;c<u;++c)null==(l=t[c]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*_A;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return c.restart(f),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,c,l=0,u=t.length;for(null==r?r=1/0:r*=r,l=0;l<u;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(c=s,r=a);return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}const TA={joint:!0},PA={type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},CA={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},NA={text:""};function LA(t,e,n){const{nodes:r,links:i}=t,{joint:o,nodeStrength:a,linkStrength:s}=e,{nodeKey:c=t=>t.id,linkKey:l=t=>t.id}=n,u=function(){var t,e,n,r,i,o=Q_(-30),a=1,s=1/0,c=.81;function l(n){var i,o=t.length,a=U_(t,EA,SA).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function u(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,c=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,c+=n,r+=n*e.x,o+=n*e.y);t.x=r/c,t.y=o/c}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,u){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=u-o,p=f*f+h*h;if(d*d/c<p)return p<s&&(0===f&&(p+=(f=J_(n))*f),0===h&&(p+=(h=J_(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=J_(n))*f),0===h&&(p+=(h=J_(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,u()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:Q_(+t),u(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l}(),f=function(t){var e,n,r,i,o,a,s=tA,c=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=Q_(30),u=1;function f(r){for(var i=0,s=t.length;i<u;++i)for(var c,l,f,h,d,p,g,v=0;v<s;++v)l=(c=t[v]).source,h=(f=c.target).x+f.vx-l.x-l.vx||J_(a),d=f.y+f.vy-l.y-l.vy||J_(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[v])/p*r*e[v],d*=p,f.vx-=h*(g=o[v]),f.vy-=d*g,l.vx+=h*(g=1-g),l.vy+=d*g}function h(){if(r){var a,c,l=r.length,u=t.length,f=new Map(r.map((t,e)=>[s(t,e,r),t]));for(a=0,i=new Array(l);a<u;++a)(c=t[a]).index=a,"object"!=typeof c.source&&(c.source=eA(f,c.source)),"object"!=typeof c.target&&(c.target=eA(f,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)c=t[a],o[a]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);e=new Array(u),d(),n=new Array(u),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+c(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(u=+t,f):u},f.strength=function(t){return arguments.length?(c="function"==typeof t?t:Q_(+t),d(),f):c},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:Q_(+t),p(),f):l},f}(i).id(WM(l));"function"==typeof a&&u.strength(a),"function"==typeof s&&f.strength(s);const h=AA(r).force("link",f).force("charge",u);o?h.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,c=0;for(i=0;i<a;++i)s+=(o=n[i]).x,c+=o.y;for(s=(s/a-t)*r,c=(c/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=c}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}()):h.force("x",function(t){var e,n,r,i=Q_(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Q_(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Q_(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:Q_(+e),a(),o):t},o}()).force("y",function(t){var e,n,r,i=Q_(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Q_(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Q_(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:Q_(+e),a(),o):t},o}()),h.stop();const d=Math.ceil(Math.log(h.alphaMin())/Math.log(1-h.alphaDecay()));for(let t=0;t<d;t++)h.tick();return{nodesData:r,linksData:i}}const jA=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,{nodeKey:u=t=>t.id,linkKey:f=t=>t.id}=n,h=Ie(n,["nodeKey","linkKey"]),d=Object.assign({nodeKey:u,linkKey:f},h),p=ia(d,"node"),g=ia(d,"link"),{links:v,nodes:m}=HM(e,d),{nodesData:y,linksData:b}=LA({links:v,nodes:m},tt({},TA,o),d),x=eS(l,"link",{items:[t=>({name:"source",value:WM(f)(t.source)}),t=>({name:"target",value:WM(f)(t.target)})]}),w=eS(l,"node",{items:[t=>({name:"key",value:WM(u)(t)})]},!0);return[tt({},PA,{data:b,encode:g,labels:s,style:ia(i,"link"),tooltip:x,animate:iS(c,"link")}),tt({},CA,{data:y,encode:Object.assign({},p),scale:r,style:ia(i,"node"),tooltip:w,labels:[Object.assign(Object.assign({},NA),ia(i,"label")),...a],animate:iS(c,"link")})]};jA.props={};const RA=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[c,l]=s,u=SS(n,t=>t.children).sum(t=>t[r]).sort(a),f=t();f.size([1,1]),i&&f.nodeSize(i),o&&f.separation(o),f(u);const h=[];u.each(t=>{t[c]=t.x,t[l]=t.y,t.name=t.data.name,h.push(t)});const d=u.links();return d.forEach(t=>{t[c]=[t.source[c],t.target[c]],t[l]=[t.source[l],t.target[l]]}),{nodes:h,edges:d}},IA=t=>RA(OS)(t);IA.props={};const DA=t=>RA(v_)(t);DA.props={};const BA={sortBy:(t,e)=>e.value-t.value},FA={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},zA={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},$A={text:"",fontSize:10},WA=t=>{const{data:e,encode:n={},scale:r={},style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,u=null==n?void 0:n.value,{nodes:f,edges:h}=DA(Object.assign(Object.assign(Object.assign({},BA),o),{field:u}))(e),d=eS(l,"node",{title:"name",items:["value"]},!0),p=eS(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[tt({},zA,{data:h,encode:ia(n,"link"),scale:ia(r,"link"),labels:s,style:Object.assign({stroke:"#999"},ia(i,"link")),tooltip:p,animate:iS(c,"link")}),tt({},FA,{data:f,scale:ia(r,"node"),encode:ia(n,"node"),labels:[Object.assign(Object.assign({},$A),ia(i,"label")),...a],style:Object.assign({},ia(i,"node")),tooltip:d,animate:iS(c,"node")})]};WA.props={};const GA=(t,e)=>Be(void 0,void 0,void 0,function*(){const{width:n,height:r}=e,{data:i,encode:o={},scale:a,style:s={},layout:c={}}=t,l=Ie(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(i,o);return tt({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily},tooltip:{items:[t=>({name:t.text,value:t.value})]}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},c)]},encode:o,scale:a,style:s},l),{axis:!1}))});GA.props={};const HA={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},YA={style:{shape:(t,e)=>{const{shape:n,radius:r}=t,i=Ie(t,["shape","radius"]),o=ia(i,"pointer"),a=ia(i,"pin"),{shape:s}=o,l=Ie(o,["shape"]),{shape:u}=a,f=Ie(a,["shape"]),{coordinate:h,theme:d}=e;return(t,e)=>{const n=t.map(t=>h.invert(t)),[o,a,p]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find(t=>t[0]===e);return r}(h,"polar"),g=h.clone(),{color:v}=e,m=c({startAngle:o,endAngle:a,innerRadius:p,outerRadius:r});m.push(["cartesian"]),g.update({transformations:m});const y=n.map(t=>g.map(t)),[b,x]=Wm(y),[w,k]=h.getCenter(),M=Object.assign(Object.assign({x1:b,y1:x,x2:w,y2:k,stroke:v},l),i),O=Object.assign(Object.assign({cx:w,cy:k,stroke:v},f),i),E=Cm(new rv);return la(s)||("function"==typeof s?E.append(()=>s(y,e,g,d)):E.append("line").call(Rm,M).node()),la(u)||("function"==typeof u?E.append(()=>u(y,e,g,d)):E.append("circle").call(Rm,O).node()),E.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},qA={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},tooltip:!1};function VA(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=function(t){if(I(t)){const e=Math.max(0,Math.min(t,1));return{percent:e,target:e,total:1}}return t}(t),s=o||r,c=o?1:i,l=Object.assign({y:{domain:[0,c]}},e);return a.length?{targetData:[{x:n,y:s,color:"target"}],totalData:a.map((t,e)=>({x:n,y:e>=1?t-a[e-1]:t,color:e})),target:s,total:c,scale:l}:{targetData:[{x:n,y:s,color:"target"}],totalData:[{x:n,y:s,color:"target"},{x:n,y:c-s,color:"total"}],target:s,total:c,scale:l}}function UA(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const XA=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:o=[]}=t,a=Ie(t,["data","scale","style","animate","transform"]),{targetData:s,totalData:c,target:l,total:u,scale:f}=VA(e,n),h=ia(r,"text"),{tooltip:d}=h,p=Ie(h,["tooltip"]),g=(v=r,m=["pointer","pin"],Object.fromEntries(Object.entries(v).filter(([t])=>m.find(e=>t.startsWith(e)))));var v,m;const y=ia(r,"arc"),b=y.shape;return[tt({},HA,Object.assign({type:"interval",transform:[{type:"stackY"}],data:c,scale:f,style:"round"===b?Object.assign(Object.assign({},y),{shape:DO}):y,animate:"object"==typeof i?ia(i,"arc"):i},a)),tt({},HA,YA,Object.assign({type:"point",data:s,scale:f,style:g,animate:"object"==typeof i?ia(i,"indicator"):i},a)),tt({},qA,{style:Object.assign({text:UA(p,{target:l,total:u})},p),tooltip:d,animate:"object"==typeof i?ia(i,"text"):i})]};XA.props={};const KA={density:MO},ZA=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),f=(+(null==o?void 0:o[e])||0)*n,h=+i[e]+f+u/2;return[...a.map((n,r)=>[h+ +s[r][e]/t.length,+a[r][e]]),...a.map((n,r)=>[h-+s[r][e]/t.length,+a[r][e]]).reverse()].map(t=>r.map(t))});return[t,u]};ZA.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:KA,channels:[...LM({shapes:Object.keys(KA)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...DM(),{type:Bn},{type:Na}],postInference:[...RM()],interaction:{shareTooltip:!0}};const QA={heatmap:TO},JA=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n,c=Array.from(t,t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]});return[[0],[c]]};JA.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:QA,channels:[...LM({shapes:Object.keys(QA)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...DM(),{type:Na},{type:La}],postInference:[...jM()]};const tT={axis:{x:!1,y:!1},legend:!1,tooltip:!1,encode:{x:"type",y:"percent"},scale:{y:{domain:[0,1]}},style:{shape:RO},animate:{enter:{type:"fadeIn"}}},eT={type:"text",style:{x:"50%",y:"50%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},animate:{enter:{type:"fadeIn"}}},nT=t=>{const{data:e={},style:n={},animate:r}=t,i=Ie(t,["data","style","animate"]),o=Math.max(0,I(e)?e:null==e?void 0:e.percent),a=[{percent:o,type:"liquid"}],s=Object.assign(Object.assign({},ia(n,"text")),ia(n,"content")),c=ia(n,"outline"),l=ia(n,"wave"),u=ia(n,"background");return[tt({},tT,Object.assign({type:"interval",data:a,style:{liquidOptions:{percent:o,liquidShape:null==n?void 0:n.shape},styleOptions:Object.assign(Object.assign({},n),{outline:c,wave:l,background:u})},animate:r},i)),tt({},eT,{style:Object.assign({text:`${jm(100*o)} %`},s),animate:r})]};nT.props={};const rT=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];rT.props={};const iT=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];iT.props={};const oT=t=>new Ji(t);oT.props={};const aT=t=>new bo(t);aT.props={};const sT=t=>new Ki(t);sT.props={};const cT=t=>new po(t);cT.props={};const lT=t=>new xo(t);lT.props={};const uT=t=>new Go(t);uT.props={};const fT=t=>new So(t);fT.props={};const hT=t=>new ko(t);hT.props={};const dT=t=>new Oo(t);dT.props={};const pT=t=>new To(t);pT.props={};const gT=t=>new _o(t);gT.props={};const vT=t=>new Mo(t);vT.props={};const mT=t=>new qo(t);mT.props={};const yT=t=>new eo(t);function bT({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:o,padding2:a,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:h,category10:d,category20:p,sizeDefault:g=1,padding:v="auto",margin:m=16}){return{padding:v,margin:m,size:g,color:t,category10:d,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:h,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:o,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,focusMarkerSize:12,itemSpacing:[o,o,o/2],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}yT.props={};const xT=bT({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),wT=t=>tt({},xT,t);wT.props={};const kT=t=>tt({},wT(),{category10:"category10",category20:"category20"},t);kT.props={};const MT=bT({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),OT=t=>tt({},MT,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),ET=t=>Object.assign({},OT(),{category10:"category10",category20:"category20"},t);ET.props={};const ST=bT({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),_T=t=>tt({},ST,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function AT(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}_T.props={};var TT,PT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function CT(t){if(!(e=PT.exec(t)))throw new Error("invalid format: "+t);var e;return new NT({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function NT(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function LT(t,e){var n=AT(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}CT.prototype=NT.prototype,NT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var jT={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>LT(100*t,e),r:LT,s:function(t,e){var n=AT(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(TT=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+AT(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function RT(t){return t}var IT,DT,BT=Array.prototype.map,FT=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zT(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?RT:(e=BT.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?RT:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(BT.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=CT(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(g=!0,y="g"):jT[y]||(void 0===v&&(v=12),m=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===h?o:/[%p]/.test(y)?c:"",w=jT[y],k=/[defgprs%]/.test(y);function M(t){var i,o,c,h=b,M=x;if("c"===y)M=w(t)+M,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0===+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:l:"-"===f||"("===f?"":f)+h,M=("s"===y?FT[8+TT/3]:"")+M+(O&&"("===f?")":""),k)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<p?new Array(p-E+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=CT(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=AT(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=FT[8+r/3];return function(t){return n(i*t)+o}}}}function $T(t,e,n){return t.querySelector(e)?Cm(t).select(e):Cm(t).append(n)}function WT(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function GT(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const o={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","flex-start","center"],right:["column","flex-start","center"],center:["column","center","center"]};return t in o&&([n,r,i]=o[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}IT=zT({thousands:",",grouping:[3],currency:["$",""]}),DT=IT.format;class HT extends dM{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class YT extends HT{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function qT(t,e){var n;return null===(n=t.filter(t=>t.getOptions().name===e))||void 0===n?void 0:n[0]}function VT(t){return"vertical"===t||t===-Math.PI/2}function UT(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,h=o||u||c,d=a||f||l,p=s?"horizontal":"vertical",[g,v]=s?[d,h]:[h,d];return{orientation:p,width:g,height:v,size:h,length:d}}function XT(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Ie(t,["style"]),i={};return Object.entries(r).forEach(([t,n])=>{e.includes(t)?i[`show${G(t)}`]=n:i[t]=n}),Object.assign(Object.assign({},i),n)}function KT(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function ZT(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function QT(t,e,n,r,i,o,a,s){var c;void 0===n&&void 0===o||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),o&&{tickMethod:o}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=Zn(e,t=>+t),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(il(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],h=new bo({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!cl(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new bo({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new bo({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return il(s)||rl(s)?u.map((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:ol(s)&&"center"===a||rl(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||rl(s)&&g(a)?1-l:l,label:f(h(jm(e),n,r)),id:String(n)}}):u.map((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(d(t.map(e)+o));return{value:g(a)?1-s:s,label:f(h(jm(e),n,r)),id:String(n)}})}function JT(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function tP(t,e,n){return!function(t){return il(t)&&rl(t)}(e)&&!sl(e)&&(void 0===t?!!n.getTicks:t)}function eP(t,e,n,r,i,o){const a=function(t,e,n,r,i){const o=n.axis,a=["top","right","bottom","left"].includes(i)?n[`axis${Jo(i)}`]:n.axisLinear,s=t.getOptions().name,c=n[`axis${G(s)}`]||{};return Object.assign({},o,a,c)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:VT(o)?10:0,tick:"center"!==r&&void 0}):a}const nP=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,c="string"==typeof n?DT(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:a});return t(l)(i)}},rP=nP(t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:o,actualPosition:a,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:h,tickMethod:d,tickLength:p,transform:g,indexBBox:v}=t,m=Ie(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","tickLength","transform","indexBBox"]);return({scales:i,value:y,coordinate:b,theme:x})=>{const{bbox:w}=y,[k]=i,{domain:M,xScale:O}=k.getOptions(),E=eP(k,0,x,e,s,o),S=Object.assign(Object.assign(Object.assign({},E),l),m),_=function(t,e,n="xy"){const[r,i,o]=ZT(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,b,t.plane),A=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=n;if("bottom"===t)return{startPos:[o,a],endPos:[o+s,a]};if("left"===t)return{startPos:[o+s,a+c],endPos:[o+s,a]};if("right"===t)return{startPos:[o,a+c],endPos:[o,a]};if("top"===t)return{startPos:[o,a+c],endPos:[o+s,a+c]};if("center"===t){if("vertical"===e)return{startPos:[o,a],endPos:[o,a+c]};if("horizontal"===e)return{startPos:[o,a],endPos:[o+s,a]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=ul(r),[f,h]=fl(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=l*d,m=u*d,[y,b]=[t+o-p,n+a-g],[x,w]=[Math.cos(e),Math.sin(e)],k=[y+m*x,b+m*w],M=[y+v*x,b+v*w],O=()=>{const{domain:t}=i.getOptions();return t.length},E=il(r)&&i?O():3;return{startPos:k,endPos:M,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[y,b],gridControlAngles:new Array(E).fill(0).map((t,e,n)=>(h-f)/E*e)}}}return{}}(s,o,w,b,O),T=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(b),P=QT(k,M,f,r,h,d,s,b),C=v?P.map((t,e)=>{const n=v.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):P,N=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},S),{type:"linear",data:C,crossSize:c,titleText:WT(u),labelOverlap:JT(g,S),grid:tP(S.grid,b,k),gridLength:_,line:!0,indexBBox:v}),void 0!==p?{tickLength:p}:null),S.line?null:{lineOpacity:0}),A),T),n),L=N.labelOverlap.find(t=>"hide"===t.type);return L&&(N.crossSize=!1),new Ok({className:"axis",style:XT(N)})}}),iP=nP(t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:o,tickFilter:a,tickCount:s,tickMethod:c,tickLength:l,important:u={},style:f={},indexBBox:h,title:d,grid:p=!1}=t,g=Ie(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","tickLength","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:f}=e,{domain:v}=t.getOptions(),m=QT(t,v,s,o,a,c,r,n),y=h?m.map((t,e)=>{const n=h.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):m,[b,x]=ul(n),w=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,h]=fl(i),[d,p]=ZT(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,f,b,x,n),{axis:k,axisArc:M={}}=i,O=XT(tt({},k,M,w,Object.assign(Object.assign(Object.assign({type:"arc",data:y,titleText:WT(d),grid:p},void 0!==l?{tickLength:l}:null),g),u)));return new Ok({style:ct(O,["transform"])})}});rP.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},iP.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const oP=t=>(...e)=>{const n=rP(Object.assign({},{crossPadding:50},t))(...e);return KT(n,t),n};oP.props=Object.assign(Object.assign({},rP.props),{defaultPosition:"bottom"});const aP=t=>(...e)=>{const n=rP(Object.assign({},{crossPadding:10},t))(...e);return KT(n,t),n};function sP(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=fl(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===a,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>(c-s)/i.count*e)})}aP.props=Object.assign(Object.assign({},rP.props),{defaultPosition:"left"});const cP=t=>{const{important:e={}}=t,n=Ie(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return rP(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},sP(t,i,o,a)),e)}))(r)}};function lP(t,e){const n=qT(t,"shape"),r=qT(t,"color"),i=n?n.clone():null,o=[];for(const[t,n]of e){const e=t.type,a=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map((e,r)=>{var o;return i?i.map(e||"point"):(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.shape)||n.defaultShape||"point"});"string"==typeof e&&o.push([e,a])}if(0===o.length)return["point",["point"]];if(1===o.length)return o[0];if(!n)return o[0];const{range:a}=n.getOptions();return o.map(([t,e])=>{let n=0;for(let t=0;t<o.length;t++){const r=a[t%a.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}function uP(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=lP(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,a;const s=(null===(a=null===(i=null===(n=r[`mark.${o}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===a?void 0:a.props.defaultMarker)||j(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:o,stroke:a,color:s}=e,c=Ie(e,["d","fill","lineWidth","path","stroke","color"]);const l=jy.get(t)||jy.get("point");return(...t)=>new uv({style:Object.assign(Object.assign({},c),{d:l(...t),stroke:l.style.includes("stroke")?s||a:"",fill:l.style.includes("fill")?s||r:"",lineWidth:l.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${a[t]}`;return qT(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function fP(t){const e=qT(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function hP(t,e){const{scales:n,markState:r}=e,[i,o]=lP(n,r),{itemMarker:a,itemMarkerLineWidth:s}=t;if(void 0!==s)return s;const c=["line","hyphen","dash","smooth","hv","hvh","vh","vhv"];if("string"==typeof a&&c.includes(a))return 4;if("function"==typeof a)return(t,e)=>{const n=a(t.id,e);if("string"==typeof n&&c.includes(n))return 4};const l=(Array.isArray(o)?o:[o]).some(t=>c.includes(t));return l?4:void 0}function dP(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,o=function(t,e){const n=qT(t,"size");return n instanceof po?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:uP(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:fP(r),itemMarkerLineWidth:hP(t,e)},s="string"==typeof n?DT(n):n,c=qT(r,"color"),l=function(t){return t.find(t=>t.getOptions().domain.length>0).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},a),{data:l.map(t=>({id:t,label:s(t),color:u(t)}))})}cP.props=Object.assign(Object.assign({},rP.props),{defaultPosition:"center"});const pP=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Ie(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:a}=r,{width:l,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=UT(t,e,n);return{width:i,height:o}}(r,t,pP),d=GT(o,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:WT(s)}),dP(t,e)),{legendCategory:g={}}=i,v=XT(Object.assign({},g,function(t){return Object.assign(Object.assign({},t),{data:(null==t?void 0:t.data.filter(t=>""!==t.id))||[]})}(p),u)),m=new YT({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:v})});return m.appendChild(new Kk({className:"legend-category",style:v})),m}};function gP(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function vP(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],pa(e)];return[n,r]}function mP(t,e,n,r,i,o){const{length:a}=t,s=n||r,c=i.color?o.legendContinuous.ribbonFill||"black":o.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[_h(e).toString()]})),r}(s,c),[u,f]=vP(l),[h,d]=vP([e,n,r].filter(t=>void 0!==t).find(t=>!(t instanceof eo)));return Object.assign(Object.assign({},t),{domain:[h,d],data:l.getTicks().map(t=>({value:t})),color:new Array(Math.floor(a)).fill(0).map((t,e)=>{const n=(f-u)/(a-1)*e+u,i=l.map(n)||c,o=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${o})`)})})}function yP(t,e,n,r,i,o){const a=qT(t,"color"),s=function(t,e,n){const{size:r}=e,i=UT(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof Oo){const{range:t}=a.getOptions(),[e,n]=vP(a);return a instanceof _o||a instanceof To?gP(s,a,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,a,t)}return mP(s,a,qT(t,"size"),qT(t,"opacity"),e,o)}pP.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const bP=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Ie(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:a,scale:l})=>{const{bbox:u}=i,{x:h,y:d,width:p,height:g}=u,v=GT(o,n),{legendContinuous:m={}}=a,y=XT(Object.assign({},m,Object.assign(Object.assign({titleText:WT(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>DT(e)(t.label):e},yP(r,l,i,t,bP,a)),c),f)),b=new HT({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},v),{subOptions:y})});return b.appendChild(new cM({className:"legend-continuous",style:y})),b}};bP.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const xP=t=>(...e)=>bP(Object.assign({},{block:!0},t))(...e);xP.props=Object.assign(Object.assign({},bP.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const wP=t=>e=>{const{scales:n}=e,r=qT(n,"size");return bP(Object.assign({},{type:"size",data:r.getTicks().map((t,e)=>({value:t,label:String(t)}))},t))(e)};wP.props=Object.assign(Object.assign({},bP.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const kP=t=>wP(Object.assign({},{block:!0},t));function MP(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}kP.props=Object.assign(Object.assign({},bP.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const OP=(EP={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Ie(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=ia(l,"title"),f=ia(l,"subtitle"),h=$T(e,".title","text").attr("className","title").call(Rm,Object.assign(Object.assign(Object.assign({},MP(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();$T(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},MP(0,h.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))})}},class extends ev{constructor(t){super(t),this.descriptor=EP}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(tt({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var EP;const SP=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new OP({style:tt({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function _P(t){return!!t.getBandWidth}function AP(t,e,n){if(!_P(t))return t.invert(e);const{adjustedRange:r}=t;if(r.includes(e))return t.invert(e);const{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map(t=>t+a),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(qn(s,e)+o,0,i.length-1);return i[c]}function TP(t,e,n){if(!e)return t.getOptions().domain;if(!_P(t)){const r=cr(e);if(!n)return r;const[i]=r,{range:o}=t.getOptions(),[a,s]=o,c=a>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],o=r.indexOf(i);if(n){const t=o+Math.round(r.length*n);return r.slice(o,t)}const a=e[e.length-1],s=r.indexOf(a);return r.slice(o,s+1)}function PP(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[AP(a,n,e),AP(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[TP(a,[l[0],u[0]]),TP(s,[l[1],u[1]])]}function CP(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}SP.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const NP=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Ie(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[c],value:l,theme:u,coordinate:f}=r,{bbox:h}=l,{width:d,height:p}=h,{slider:g={}}=u,v=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),m="string"==typeof n?DT(n):n,y="horizontal"===e,b=rl(f)&&y,{trackSize:x=g.trackSize}=i,[w,k]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(h,o,x);return new xw({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:k,trackLength:y?d:p,orientation:e,formatter:t=>(m||v)(AP(c,b?1-t:t,!0)),sparklineData:LP(t,r)},i),a))})}};function LP(t,e){const{markState:n}=e;return x(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter(([t])=>"line"===t.type||"area"===t.type).filter(([t])=>t.slider).map(([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}});if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t),{});return Object.values(r)}(n,["y","series"])}NP.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const jP=t=>NP(Object.assign(Object.assign({},t),{orientation:"horizontal"}));jP.props=Object.assign(Object.assign({},NP.props),{defaultPosition:"bottom"});const RP=t=>NP(Object.assign(Object.assign({},t),{orientation:"vertical"}));RP.props=Object.assign(Object.assign({},NP.props),{defaultPosition:"left"});const IP=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Ie(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:o})=>{const{bbox:a}=n,{x:s,y:c,width:l,height:u}=a,{scrollbar:f={}}=o,{ratio:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,g=p/h,[v,m]=d,y=m>v?0:1;return new ww({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:y}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};IP.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const DP=t=>IP(Object.assign(Object.assign({},t),{orientation:"horizontal"}));DP.props=Object.assign(Object.assign({},IP.props),{defaultPosition:"bottom"});const BP=t=>IP(Object.assign(Object.assign({},t),{orientation:"vertical"}));BP.props=Object.assign(Object.assign({},IP.props),{defaultPosition:"left"});const FP=t=>()=>new rv;FP.props={};const zP=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=rl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(h,Object.assign(Object.assign({},i),t))}},$P=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=rl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},WP=(t,e)=>{const n=1e-4,{coordinate:r}=e;return bv({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:lf.NUMBER}),(e,i,o)=>{const[a]=e;return il(r)?(e=>{const{__data__:i,style:a}=e,{fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a,{points:u,y:f,y1:h}=i,d=Fm(r,u,[f,h]),{innerRadius:p,outerRadius:g}=d,v=[{scaleInYRadius:p+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:p+n,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{scaleInYRadius:g,fillOpacity:s,strokeOpacity:c,opacity:l}];return e.animate(v,Object.assign(Object.assign({},o),t))})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=rl(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return e.animate(f,Object.assign(Object.assign({},o),t))})(a)}},GP=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=rl(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},HP=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};HP.props={};const YP=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:o,strokeOpacity:a,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};YP.props={};const qP={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},VP={[pu.CIRCLE]:["cx","cy","r"],[pu.ELLIPSE]:["cx","cy","rx","ry"],[pu.RECT]:["x","y","width","height"],[pu.IMAGE]:["x","y","width","height"],[pu.LINE]:["x1","y1","x2","y2"],[pu.POLYLINE]:["points"],[pu.POLYGON]:["points"]};function UP(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=qP[i])}return r}const XP=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function KP(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function ZP(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function QP(t,e){const[n,r,i,o]=KP(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),c=[],l=o/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,o=r+u*l;c.push(ZP([t,o,e,l]))}f-=t,u+=1}return c}function JP(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function tC(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function eC(t){const e=od(t);if(e&&!function(t){return!tC(t,"m")||!tC(t,"M")}(e))return e}function nC(t){const{nodeName:e}=t;if("path"===e){const e=ot(t,"attributes");return e.markerEnd||e.markerStart}return!1}function rC(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=eC(e),s=eC(n),{opacity:c=1,strokeOpacity:l=1,fillOpacity:u=1}=e.style,{opacity:f=1,strokeOpacity:h=1,fillOpacity:d=1}=n.style,p=i===o&&"path"!==i,g=void 0===a||void 0===s,v=nC(e)||nC(n);if(p||g||v)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;JP(e,t);let o=XP;if(t.nodeName===pu.GROUP){const[n,i,o,a]=KP(t),[s,c,l,u]=KP(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(VP[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},UP(t,o,!0)),Object.assign({transform:null!=i?i:"none"},UP(e,o,!0))];return e.animate(a,n)}(e,n,r);const m=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new uv({style:Object.assign(Object.assign({},UP(t,XP)),{d:e})});return JP(r,t),r}(t,a),y=Object.assign(Object.assign({},UP(e,XP)),{opacity:c,strokeOpacity:l,fillOpacity:u}),b=Object.assign(Object.assign({},UP(n,XP)),{opacity:f,strokeOpacity:h,fillOpacity:d}),x=[y,b];if(a!==s){x[0].d=a,x[1].d=s;const t=m.animate(x,r);return t.onfinish=()=>{ea(m,n),m.style.d=s,m.style.transform="none"},m.style.transform="none",t}return rt(y,b)?null:m.animate(x,r)}const iC=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:QP}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return rC(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map((e,r)=>rC(e,new uv({style:Object.assign({d:i[r]},UP(t,XP))}),e,n))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map((t,r)=>rC(t,t,new uv({style:{d:i[r],fill:e.style.fill}}),n));return[...u,l]}(e,t,o,i)}return null};iC.props={};const oC=(t,e)=>{const n=1e-4;bv({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:lf.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!il(r))return zP(t,e)(i,o,a);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:h=1,strokeOpacity:d=1,opacity:p=1}=l,{points:g,y:v,y1:m}=c,y=kc().cornerRadius(u).padAngle(f*Math.PI/180),b=Fm(r,g,[v,m]),{startAngle:x,endAngle:w}=b,k=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:h,strokeOpacity:d,opacity:p}],M=s.animate(k,Object.assign(Object.assign({},a),t));return M.onframe=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:w}))},M}};oC.props={};const aC=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},sC=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(1)`.trimStart(),transformOrigin:l},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},cC=t=>(e,n,r)=>{var i,o;const[a]=e,s=(null===(o=(i=a).getTotalLength)||void 0===o?void 0:o.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(c,Object.assign(Object.assign({},r),t))};cC.props={};const lC=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new uv({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return zP(t,e)([f],r,i)};lC.props={};const uC=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new uv({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return WP(t,e)([f],r,i)};
20
+ var jv=function(t){function e(t,n,r,i){var o;return yl(this,e),(o=_l(this,e,[t])).currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return Tl(e,t),xl(e)}(Xp),Rv=0,Iv=function(){return xl(function t(e,n){var r;yl(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(Rv++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new jv(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(e)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Pu)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Pu)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Pu)}},{key:"dispatchEvent",value:function(t){throw new Error(Pu)}},{key:"commitStyles",value:function(){throw new Error(Pu)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new jv(null,this,this.currentTime,t);setTimeout(function(){e.onfinish&&e.onfinish(n)})}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new jv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),Dv=.1,Bv="function"==typeof Float32Array,Fv=function(t,e){return 1-3*e+3*t},zv=function(t,e){return 3*e-6*t},$v=function(t){return 3*t},Wv=function(t,e,n){return((Fv(e,n)*t+zv(e,n))*t+$v(e))*t},Gv=function(t,e,n){return 3*Fv(e,n)*t*t+2*zv(e,n)*t+$v(e)},Hv=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Bv?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Wv(o*Dv,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Dv;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Dv,s=Gv(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Gv(e,n,r);if(0===o)return e;e-=(Wv(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Wv(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+Dv,t,n)};return function(t){return 0===t||1===t?t:Wv(a(t),e,r)}},Yv=function(t){return Math.pow(t,2)},qv=function(t){return Math.pow(t,3)},Vv=function(t){return Math.pow(t,4)},Uv=function(t){return Math.pow(t,5)},Xv=function(t){return Math.pow(t,6)},Kv=function(t){return 1-Math.cos(t*Math.PI/2)},Zv=function(t){return 1-Math.sqrt(1-t*t)},Qv=function(t){return t*t*(3*t-2)},Jv=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},tm=function(t){var e=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],o=void 0===i?.5:i,a=R(Number(r),1,10),s=R(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/a))*(2*Math.PI)/s)},em=function(t){var e=arguments.length>2?arguments[2]:void 0,n=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?100:o,s=n[2],c=void 0===s?10:s,l=n[3],u=void 0===l?0:l;i=R(i,.1,1e3),a=R(a,.1,1e3),c=R(c,.1,1e3),u=R(u,.1,1e3);var f=Math.sqrt(a/i),h=c/(2*Math.sqrt(a*i)),d=h<1?f*Math.sqrt(1-h*h):0,p=h<1?(h*f-u)/d:-u+f,g=e?e*t/1e3:t;return g=h<1?Math.exp(-g*h*f)*(1*Math.cos(d*g)+p*Math.sin(d*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},nm=function(t){var e=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(R(t,0,1)*r)/r},rm=function(t){var e=Pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],o=e[3];return Hv(n,r,i,o)(t)},im=Hv(.42,0,1,1),om=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},am=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},sm=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},cm={steps:nm,"step-start":function(t){return nm(t,[1,"start"])},"step-end":function(t){return nm(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":rm,ease:function(t){return rm(t,[.25,.1,.25,1])},in:im,out:om(im),"in-out":am(im),"out-in":sm(im),"in-quad":Yv,"out-quad":om(Yv),"in-out-quad":am(Yv),"out-in-quad":sm(Yv),"in-cubic":qv,"out-cubic":om(qv),"in-out-cubic":am(qv),"out-in-cubic":sm(qv),"in-quart":Vv,"out-quart":om(Vv),"in-out-quart":am(Vv),"out-in-quart":sm(Vv),"in-quint":Uv,"out-quint":om(Uv),"in-out-quint":am(Uv),"out-in-quint":sm(Uv),"in-expo":Xv,"out-expo":om(Xv),"in-out-expo":am(Xv),"out-in-expo":sm(Xv),"in-sine":Kv,"out-sine":om(Kv),"in-out-sine":am(Kv),"out-in-sine":sm(Kv),"in-circ":Zv,"out-circ":om(Zv),"in-out-circ":am(Zv),"out-in-circ":sm(Zv),"in-back":Qv,"out-back":om(Qv),"in-out-back":am(Qv),"out-in-back":sm(Qv),"in-bounce":Jv,"out-bounce":om(Jv),"in-out-bounce":am(Jv),"out-in-bounce":sm(Jv),"in-elastic":tm,"out-elastic":om(tm),"in-out-elastic":am(tm),"out-in-elastic":sm(tm),spring:em,"spring-in":em,"spring-out":om(em),"spring-in-out":am(em),"spring-out-in":sm(em)},lm=function(t){return t};function um(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var fm="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",hm=new RegExp("cubic-bezier\\(".concat(fm,",").concat(fm,",").concat(fm,",").concat(fm,"\\)")),dm=/steps\(\s*(\d+)\s*\)/,pm=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function gm(t){var e=hm.exec(t);if(e)return Hv.apply(void 0,Ml(e.slice(1).map(Number)));var n=dm.exec(t);if(n)return um(Number(n[1]),0);var r=pm.exec(t);return r?um(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):cm[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||cm.linear}function vm(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function mm(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function ym(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(bm(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:gm(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,c=i[a].computedOffset,l=i[s].computedOffset,u=c,f=l;0===o&&(u=-1/0,0===l&&(s=a)),o===i.length-2&&(f=1/0,1===c&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:wm(r,i[a].value,i[s].value,e)})}return n.sort(function(t,e){return t.startOffset-e.startOffset}),n}(r,n);return function(t,e){if(null!==e)i.filter(function(t){return e>=t.applyFrom&&e<t.applyTo}).forEach(function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(o),!1,!1)});else for(var n in r)bm(n)&&t.setAttribute(n,null)}}function bm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var xm=function(t,e,n){return function(r){var i=km(t,e,r);return I(i)?i:n(i)}};function wm(t,e,n,r){var i=Ld[t];if(i&&i.syntax&&i.int){var o=Fg.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=o.parser,s=a?a(e,r):e,c=a?a(n,r):n,l=o.mixer(s,c,r);if(l){var u=xm.apply(void 0,Ml(l));return function(t){return 0===t?e:1===t?n:u(t)}}}}return xm(!1,!0,function(t){return t?n:e})}function km(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(km(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var Mm=function(){return xl(function t(){yl(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=lm,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null},[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=gm(t),this._easing=t}}])}();function Om(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),e}(t));for(var n=t.map(function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(b(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter(function(t){return Number(t.offset)>=0&&Number(t.offset)<=1}),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var s=n[a].computedOffset;if(!b(s)&&!b(o)){for(var c=1;c<a-i;c++)n[i+c].computedOffset=o+(Number(s)-o)*c/(a-i);i=a,o=Number(s)}}}(),n}var Em="backwards|forwards|both|none".split("|"),Sm="reverse|alternate|alternate-reverse".split("|");function _m(t,e){return function(t,e){var n=new Mm;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach(function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Em.indexOf(t[e]))return;if("direction"===e&&-1===Sm.indexOf(t[e]))return;n[e]=t[e]}}):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Am=function(){return xl(function t(e,n,r){var i=this;yl(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=_m(r,!1),this.timing.effect=this,this.timing.activeDuration=vm(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Om(n,this.timing),this.interpolations=ym(this.normalizedKeyframes,this.timing,this.target);var o=Fg.globalThis.Proxy;this.computedTiming=o?new o(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing},[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=mm(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=Om(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach(function(n){e.timing[n]=t[n]})}}])}();function Tm(t,e){return Number(t.id)-Number(e.id)}var Pm=function(){return xl(function t(e){var n=this;yl(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(Tm),n.animations=n.tick(t,!0,n.animations)[0],e.forEach(function(e){e[1](t)}),n.applyPendingEffects()},this.document=e},[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new Am(t,e,n),i=new Iv(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Tm),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach(function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){null==t||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF(function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()})}},{key:"tick",value:function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],l=[];return n.forEach(function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)}),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,l]}}])}();function Cm(t){return new Nm([t],null,t,t.ownerDocument)}Fg.EasingFunction=gm,Fg.AnimationTimeline=Pm;class Nm{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Nm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Nm(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Nm([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,o]=Array.isArray(r)?r:[r,null],a=e(i,t);a.__data__=i,null!==o&&(a.__fromElements__=o),this._parent.appendChild(a),n.push(a)}return new Nm(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new Nm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Nm([i],null,this._parent,this._document);const o="string"==typeof e?this.createElement(e):e();return o.id=t,n&&(o.className=n),r.appendChild(o),new Nm([o],null,this._parent,this._document)}data(t,e=t=>t,n=()=>null){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,c=new Map(this._elements.map((t,n)=>[e(t.__data__,n),t])),l=new Map(this._facetElements.map((t,n)=>[e(t.__data__,n),t])),u=rr(this._elements,t=>n(t.__data__));for(let f=0;f<t.length;f++){const h=t[f],d=e(h,f),p=n(h,f);if(c.has(d)){const t=c.get(d);t.__data__=h,t.__facet__=!1,i.push(t),o.delete(t),c.delete(d)}else if(l.has(d)){const t=l.get(d);t.__data__=h,t.__facet__=!0,i.push(t),l.delete(d)}else if(u.has(d)){const t=u.get(d);a.push([h,t]);for(const e of t)o.delete(e);u.delete(d)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(h):t.__toData__=[h],s.add(t),o.delete(t)}else r.push(h)}const f=[new Nm([],r,this._parent,this._document),new Nm(i,null,this._parent,this._document),new Nm(o,null,this._parent,this._document),new Nm([],a,this._parent,this._document),new Nm(s,null,this._parent,this._document)];return new Nm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Nm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Nm.registry[t];return e?new e:ta(`Unknown node type: ${t}`)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){const o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(this._elements[t].__removed__=!0,e){const n=Array.isArray(e)?e:[e];Promise.all(n.map(t=>t.finished)).then(()=>{const e=this._elements[t];e.__removed__&&e.remove()})}else{const e=this._elements[t];e.__removed__&&e.remove()}}return new Nm([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,o){void 0!==e&&(o[t]=n(r,i,o))})}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,o){void 0!==e&&(o.style[t]=n(r,i,o))})}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each(function(t,r,i){n[r]=e(t,r,i)})}on(t,e){return this.each(function(n,r,i){i.addEventListener(t,e)}),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function Lm(t,e,n){return Math.max(e,Math.min(t,n))}function jm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Rm(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Im(t,e,n,r,i){const o=Rs(Ns(r,e))+Math.PI,a=Rs(Ns(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function Dm(t,e,n,r="y",i="between",o=!1){const a="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,o),c=ha(a),[l,u]=Zn(c,t=>a[t]),f=new bo({domain:[l,u],range:[0,100]}),h=t=>I(a[t])&&!Number.isNaN(a[t])?f.map(a[t]):0,d={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`},p=c.sort((t,e)=>h(t)-h(e)).map(d[i]||d.between).join(",");return`linear-gradient(${s}deg, ${p})`}function Bm(t){const[e,n,r,i]=t;return[i,e,n,r]}function Fm(t,e,n){const[r,i,,o]=rl(t)?Bm(e):e,[a,s]=n,c=t.getCenter(),l=Is(Ns(r,c)),u=Is(Ns(i,c)),f=u===l&&a!==s?u+2*Math.PI:u,h=1e-4;return{startAngle:l+h,endAngle:(f-l>=0?f:2*Math.PI+f)-h,innerRadius:js(o,c),outerRadius:js(r,c)}}function zm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function $m(t,e){if(!il(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Wm(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}function Gm(t,e,n,r,i={}){const{inset:o=0,radius:a=0,insetLeft:s=o,insetTop:c=o,insetRight:l=o,insetBottom:u=o,radiusBottomLeft:f=a,radiusBottomRight:h=a,radiusTopLeft:d=a,radiusTopRight:p=a,minWidth:g=-1/0,maxWidth:v=1/0,minHeight:m=-1/0}=i,y=Ie(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!il(r)&&!al(r)){const n=!!rl(r),[i,,o]=n?Bm(e):e,[a,b]=i,[x,w]=Ns(o,i),k=(x>0?a:a+x)+s,M=(w>0?b:b+w)+c,O=Math.abs(x)-(s+l),E=Math.abs(w)-(c+u),S=n?Lm(O,m,1/0):Lm(O,g,v),_=n?Lm(E,g,v):Lm(E,m,1/0),A=n?k:k-(S-O)/2,T=n?M-(_-E)/2:M-(_-E);return Cm(t.createElement("rect",{})).style("x",A).style("y",T).style("width",S).style("height",_).style("radius",[d,p,h,f]).call(Rm,y).node()}const{y:b,y1:x}=n,w=r.getCenter(),k=Fm(r,e,[b,x]),M=kc().cornerRadius(a).padAngle(o*Math.PI/180);return Cm(t.createElement("path",{})).style("d",M(k)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(Rm,y).node()}Nm.registry={g:rv,rect:gv,circle:Jg,path:uv,text:mv,ellipse:nv,image:av,line:cv,polygon:hv,polyline:pv,html:ov};const Hm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Ie(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Ie(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:m=g,radiusBottomRight:y=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:k=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:O=x,lineWidth:E=("stroke"===n||p?d:0),inset:S=0,insetLeft:_=S,insetRight:A=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:N,minHeight:L}=a,j=Ie(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,D=[i?v:w,i?m:k,o?y:M,o?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];rl(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map((t,e)=>[t,D[e]]))),{inset:S,insetLeft:_,insetRight:A,insetBottom:T,insetTop:P,minWidth:C,maxWidth:N,minHeight:L});return Cm(Gm(c,e,r,s,F)).call(Rm,h).style("fill","transparent").style(n,R).style(zm(t),I).style("lineWidth",E).style("stroke",void 0===p?R:p).call(Rm,j).node()}};Hm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ym=(t,e)=>Hm(Object.assign({colorAttribute:"fill"},t),e);Ym.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"square"});const qm=(t,e)=>Hm(Object.assign({colorAttribute:"stroke"},t),e);function Vm(t,e,n){const[r,i,o,a]=t;if(rl(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}qm.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"hollowSquare"});const Um=(t,e)=>{const{adjustPoints:n=Vm}=t,r=Ie(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Ie(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!rl(i),[p,g,v,m]=d?Bm(h):h,{color:y=l,opacity:b}=e,x=Ac().curve(Gc)([p,g,v,m]);return Cm(o.createElement("path",{})).call(Rm,u).style("d",x).style("fill",y).style("fillOpacity",b).call(Rm,r).node()}};function Xm(t,e,n){const[r,i,o,a]=t;if(rl(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}Um.props={defaultMarker:"square"};const Km=(t,e)=>Um(Object.assign({adjustPoints:Xm},t),e);function Zm(t){const e="function"==typeof t?t:t.render;return class extends ev{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Km.props={defaultMarker:"square"};const Qm=Zm(t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;Cm(t).maybeAppend("line",()=>o.createElement("path",{})).style("d",e).call(Rm,r),Cm(t).maybeAppend("line1",()=>o.createElement("path",{})).style("d",n).call(Rm,i)});const Jm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,s=Ie(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Ie(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:v,seriesX:m,seriesY:y}=e,b=$m(c,e),x=rl(c),w=r&&v?Dm(v,m,y,r,i,x):p,k=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(il(c)){const t=c.getCenter();M=e=>Lc(Ac().curve(Pc)).angle((n,r)=>Is(Ns(e[r],t))).radius((n,r)=>js(e[r],t)).defined(([t,e])=>o(t)&&o(e)).curve(n)(e)}else M=Ac().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>o(t)&&o(e)).curve(n);const[O,E]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),S=ia(k,"connect"),_=!!E.length;if(!_||a&&!Object.keys(S).length)return Cm(l.createElement("path",{})).style("d",M(O)||[]).call(Rm,k).node();if(_&&!a)return Cm(l.createElement("path",{})).style("d",M(t)).call(Rm,k).node();return Cm(new Qm).style("style1",Object.assign(Object.assign({},k),S)).style("style2",k).style("d1",(A=E,A.map(M).join(","))).style("d2",M(t)).node();var A}};Jm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ty=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=il(n)?Gc:Ec;return Jm(Object.assign({curve:i},t),e)(...r)}};ty.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"line"});const ey=(t,e)=>{const n=Ie(t,[]),{coordinate:r}=e;return(...t)=>{const i=il(r)?$c:rl(r)?Qc:Zc;return Jm(Object.assign({curve:i},n),e)(...t)}};ey.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"smooth"});const ny=(t,e)=>Jm(Object.assign({curve:nl},t),e);ny.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"hv"});const ry=(t,e)=>Jm(Object.assign({curve:el},t),e);ry.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"vh"});const iy=(t,e)=>Jm(Object.assign({curve:tl},t),e);function oy(t,e,n,r,i){const o=Rs(Ns(n,e)),a=o+Math.PI/2,s=[r/2*Math.cos(a),r/2*Math.sin(a)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],u=[r/2*Math.cos(o),r/2*Math.sin(o)],f=Ls(e,s),h=Ls(n,c),d=Ls(h,l),p=Ls(n,l),g=Ns(p,c),v=Ns(n,c),m=Ns(e,s),y=Ns(m,u),b=Ns(e,u),x=Ns(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...m),t.arcTo(...y,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}iy.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"hvh"});const ay=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Ie(i,["color"]),l=pc();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=o[t],a=o[t+1];[...n,...r].every(na)&&oy(l,n,r,i,a)}return Cm(n.createElement("path",{})).call(Rm,c).style("fill",a||s).style("d",l.toString()).call(Rm,t).node()}};ay.props=Object.assign(Object.assign({},Jm.props),{defaultMarker:"line"});const sy=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];sy.style=["fill"];const cy=sy.bind(void 0);cy.style=["stroke","lineWidth"];const ly=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];ly.style=["fill"];const uy=ly.bind(void 0);uy.style=["fill"];const fy=ly.bind(void 0);fy.style=["stroke","lineWidth"];const hy=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};hy.style=["fill"];const dy=hy.bind(void 0);dy.style=["stroke","lineWidth"];const py=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};py.style=["fill"];const gy=py.bind(void 0);gy.style=["stroke","lineWidth"];const vy=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};vy.style=["fill"];const my=vy.bind(void 0);my.style=["stroke","lineWidth"];const yy=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};yy.style=["fill"];const by=yy.bind(void 0);by.style=["stroke","lineWidth"];const xy=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};xy.style=["fill"];const wy=xy.bind(void 0);wy.style=["stroke","lineWidth"];const ky=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];ky.style=["stroke","lineWidth"];const My=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];My.style=["stroke","lineWidth"];const Oy=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];Oy.style=["stroke","lineWidth"];const Ey=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];Ey.style=["stroke","lineWidth"];const Sy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Sy.style=["stroke","lineWidth"];const _y=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];_y.style=["stroke","lineWidth"];const Ay=_y.bind(void 0);Ay.style=["stroke","lineWidth"];const Ty=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];Ty.style=["stroke","lineWidth"];const Py=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];Py.style=["stroke","lineWidth"];const Cy=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];Cy.style=["stroke","lineWidth"];const Ny=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];Ny.style=["stroke","lineWidth"];const Ly=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];Ly.style=["stroke","lineWidth"];const jy=new Map([["bowtie",xy],["cross",My],["dash",Ay],["diamond",hy],["dot",_y],["hexagon",yy],["hollowBowtie",wy],["hollowDiamond",dy],["hollowHexagon",by],["hollowPoint",cy],["hollowSquare",fy],["hollowTriangle",gy],["hollowTriangleDown",my],["hv",Py],["hvh",Ny],["hyphen",Sy],["line",ky],["plus",Ey],["point",sy],["rect",uy],["smooth",Ty],["square",ly],["tick",Oy],["triangleDown",vy],["triangle",py],["vh",Cy],["vhv",Ly]]);function Ry(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function Iy(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||cl(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}const Dy=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Ie(t,["colorAttribute","symbol","mode"]),a=jy.get(Ry(r))||jy.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=o.stroke?u||1:u,{color:d=f,transform:p,opacity:g}=r,[v,m]=Wm(e),y=Iy(i,e,r,s)||o.r||l.r;return Cm(c.createElement("path",{})).call(Rm,l).style("fill","transparent").style("d",a(v,m,y)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${v-y} ${m-y}`).style("stroke",d).style(zm(t),g).style(n,d).call(Rm,o).node()}};Dy.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const By=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);By.props=Object.assign({defaultMarker:"hollowBowtie"},Dy.props);const Fy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Fy.props=Object.assign({defaultMarker:"hollowDiamond"},Dy.props);const zy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);zy.props=Object.assign({defaultMarker:"hollowHexagon"},Dy.props);const $y=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);$y.props=Object.assign({defaultMarker:"hollowPoint"},Dy.props);const Wy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Wy.props=Object.assign({defaultMarker:"hollowSquare"},Dy.props);const Gy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Gy.props=Object.assign({defaultMarker:"hollowTriangle"},Dy.props);const Hy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Hy.props=Object.assign({defaultMarker:"hollowTriangleDown"},Dy.props);const Yy=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Ie(t,["colorAttribute","mode"]),{coordinate:o,document:a}=e;return(e,s,c)=>{const{lineWidth:l,color:u}=c,f=i.stroke?l||1:l,{color:h=u,transform:d,opacity:p}=s,[g,v]=Wm(e),m=Iy(r,e,s,o)||i.r||c.r;return Cm(a.createElement("circle",{})).call(Rm,c).style("fill","transparent").style("cx",g).style("cy",v).style("r",m).style("lineWidth",f).style("transform",d).style("transformOrigin",`${g} ${v}`).style("stroke",h).style(zm(t),p).style(n,h).call(Rm,i).node()}},qy=(t,e)=>Yy(Object.assign({colorAttribute:"fill"},t),e);qy.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Vy=(t,e)=>Yy(Object.assign({colorAttribute:"stroke"},t),e);Vy.props=Object.assign({defaultMarker:"hollowPoint"},qy.props);const Uy=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Uy.props=Object.assign({defaultMarker:"bowtie"},Dy.props);const Xy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Xy.props=Object.assign({defaultMarker:"cross"},Dy.props);const Ky=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Ky.props=Object.assign({defaultMarker:"diamond"},Dy.props);const Zy=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Zy.props=Object.assign({defaultMarker:"hexagon"},Dy.props);const Qy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Qy.props=Object.assign({defaultMarker:"hyphen"},Dy.props);const Jy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Jy.props=Object.assign({defaultMarker:"line"},Dy.props);const tb=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);tb.props=Object.assign({defaultMarker:"plus"},Dy.props);const eb=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);eb.props=Object.assign({defaultMarker:"point"},Dy.props);const nb=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);nb.props=Object.assign({defaultMarker:"square"},Dy.props);const rb=(t,e)=>Dy(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);rb.props=Object.assign({defaultMarker:"tick"},Dy.props);const ib=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);ib.props=Object.assign({defaultMarker:"triangle"},Dy.props);const ob=(t,e)=>Dy(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);ob.props=Object.assign({defaultMarker:"triangleDown"},Dy.props);const ab=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Ie(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Ie(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=pc();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*js(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...t),d.lineTo(...h),d.lineTo(...e)}return Cm(o.createElement("path",{})).call(Rm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Rm,i).node()}};function sb(t,e){e(t),t.children&&t.children.forEach(function(t){t&&sb(t,e)})}function cb(t){ub(t,!0)}function lb(t){ub(t,!1)}function ub(t,e){var n=e?"visible":"hidden";sb(t,function(t){t.attr("visibility",n)})}ab.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var fb=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,$e([],ze(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(cg.INSERTED,function(){lb(r)}),r}return je(e,t),e}(rv);function hb(t){var e=t.appendChild(new fb({class:"offscreen"}));return lb(e),e}var db=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Ie(e,["style"]);return t.call(this,Re({style:Re({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return je(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hb(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(mv);function pb(t){return t*Math.PI/180}function gb(t){return Number((180*t/Math.PI).toPrecision(5))}var vb=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function mb(t,e){return y(t)?t.apply(void 0,$e([],ze(e),!1)):t}var yb,bb,xb,wb,kb=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map(function(t){var e=ze(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]}));return Object.assign(r,{prefix:n}),r},Mb=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach(function(i){var o=ze(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?_(s)?(_(t[a])||(c[a]={}),n<r?Mb(t[a],s,n+1,r):c[a]=e[a]):x(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)})},Ob=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Mb(t,e[r]);return t},Eb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},Sb=(bb=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return yb||(yb=Fg.offscreenCanvasCreator.getOrCreateContext(void 0)),yb.font=[o,a,i,"".concat(n,"px"),r].join(" "),yb.measureText(t).width},xb=function(t,e){return[t,Object.values(e||_b(t)).join()].join("")},void 0===(wb=4096)&&(wb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=xb?xb.apply(this,t):t[0];Z.has(bb)||Z.set(bb,function(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}(wb));var r=Z.get(bb);if(r.has(n))return r.get(n);var i=bb.apply(this,t);return r.set(n,i),i}),_b=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function Ab(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Tb(t,e){var n=Ab(t);n&&n.attr(e)}function Pb(t,e,n){void 0===n&&(n="..."),Tb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Cb(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function Nb(t){return"function"==typeof t?t():L(t)||I(t)?new db({style:{text:String(t)}}):t}function Lb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function jb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}function Rb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=Rb(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach(function(e){var i=ze(e,2),o=i[0],a=i[1];o in t?n[o]=Rb(t[o],a):r[o]=a}),function(t){return Object.entries(n).forEach(function(e){var n=ze(e,2),i=n[0],o=n[1];return r[i]=o(t)}),r}}(t,e):function(e){return t}}function Ib(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,c=a.y,l=ze([s+a.width,c+a.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new vb(e,n,r-e,i-n)}var Db=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=ze([0,0],2),g=p[0],v=p[1],m=e.map(function(t){var e,n=t.width,r=t.height,i=ze([g,v],2),o=i[0],a=i[1];return e=ze([g+n*d[0],v+r*d[1]],2),g=e[0],v=e[1],new vb(o,a,n,r)}),y=Ib(m),b={"flex-start":0,"flex-end":f?r-y.width:i-y.height,center:f?(r-y.width)/2:(i-y.height)/2},x=m.map(function(t){var e=t.x,n=t.y,r=vb.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r});Ib(x);var w=function(t){var e=ze(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},k=x.map(function(t){var e=t.x,n=t.y,r=vb.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r}),M=k.map(function(e){var n,r,i=vb.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i});return M},Bb=function(t,e,n){return[]};function Fb(t,e){return[t[0]*e,t[1]*e]}function zb(t,e){return[t[0]+e[0],t[1]+e[1]]}function $b(t,e){return[t[0]-e[0],t[1]-e[1]]}function Wb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Gb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Hb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Yb(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function qb(t,e){return+t.toPrecision(e)}function Vb(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Ub(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,c,l,u=function(t,e,n,r){var i,o,a,s,c,l,u=[],f=!!r,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=ze(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=Wb(h,m=t[p]),d=Gb(d,m)}p=0;for(var v=t.length;p<v;p+=1){var m=t[p];if(0!==p||n)if(p!==v-1||n){o=t[[p?p-1:v-1,p-1][n?0:1]];var y=[0,0];y=Fb(y=$b(a=t[n?(p+1)%v:p+1],o),e);var b=Hb(m,o),x=Hb(m,a),w=b+x;0!==w&&(b/=w,x/=w);var k=Fb(y,-b),M=Fb(y,x);c=zb(m,k),s=Wb(s=zb(m,M),Gb(a,m)),s=Gb(s,Wb(a,m)),c=Wb(c=zb(m,k=Fb(k=$b(s,m),-b/x)),Gb(o,m)),s=zb(m,M=Fb(M=$b(m,c=Gb(c,Wb(o,m))),x/b)),f&&(c=Wb(c=Gb(c,h),d),s=Wb(s=Gb(s,h),d)),u.push(l),u.push(c),l=s}else c=m,u.push(l),u.push(c);else l=m}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,h=[];for(o=0;o<f-1;o+=1)s=u[2*o],c=u[2*o+1],l=i[o+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=ze(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var Xb=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Kb(t){return Xb.includes(t)}function Zb(t){var e={};for(var n in t)Kb(n)&&(e[n]=t[n]);return e}function Qb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&(t.style.transform="scale(".concat(a,")")),a}var Jb=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=ze(Array.isArray(a)?a:[a,null],2),c=s[0],l=s[1];(f=r(c,o)).__data__=c,null!==l&&(f.__fromElements__=l),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var u=this._elements[o],f=r(c=u.__data__,o);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=We(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),o=We(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,n){var i=We(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,o;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var a=[],s=[],c=new Set(this._elements),l=[],u=new Set,f=new Map(this._elements.map(function(t,n){return[e(t.__data__,n),t]})),h=new Map(this._facetElements.map(function(t,n){return[e(t.__data__,n),t]})),d=function(t,e){var n=new Map;return t.forEach(function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)}),n}(this._elements,function(t){return r(t.__data__)}),p=0;p<t.length;p++){var g=t[p],v=e(g,p),m=r(g,p);if(f.has(v))(w=f.get(v)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(v);else if(h.has(v)){(w=h.get(v)).__data__=g,w.__facet__=!0,s.push(w),h.delete(v)}else if(d.has(v)){var y=d.get(v);l.push([g,y]);try{for(var b=(i=void 0,Fe(y)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(v)}else if(f.has(m)){(w=f.get(m)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var k=[new n([],a,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,k)},t.prototype.merge=function(t){var e=$e($e([],ze(this._elements),!1),ze(t._elements),!1),r=$e($e([],ze(this._transitions),!1),ze(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then(function(){return n.remove()}):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each(function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))})},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each(function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))})},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each(function(n,r){var i=this;Object.entries(t).forEach(function(t){var o=ze(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))})})},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.transition=function(t){var e=new Array(this._elements.length);return this.each(function(n,r){e[r]=t.call(this,n,r)}),this._transitions=T(e),this},t.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,$e([this._parent,this],ze(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var o="string"==typeof e?this.createElement(e):e();return r.appendChild(o),new n([o],null,this._parent,this._document)},t.registry={g:rv,rect:gv,circle:Jg,path:uv,text:db,ellipse:nv,image:av,line:cv,polygon:hv,polyline:pv,html:ov},t}();function tx(t){return new Jb([t],null,t,t.ownerDocument)}function ex(t){if(I(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function nx(t){var e=t.getLocalBounds(),n=ze([e.min,e.max],2),r=ze(n[0],2),i=r[0],o=r[1],a=ze(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function rx(t,e){var n=ze(t,2),r=n[0],i=n[1],o=ze(e,2),a=o[0],s=o[1];return r!==a&&i===s}function ix(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function ox(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var ax=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function sx(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach(function(t){var i=ze(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(ax(o,"show")&&ax(ox(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(ix(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(ix(e)),"")]=a;else if(!ax(o,"show")&&ax(o,e)!==n){var s=ox(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}}),r}function cx(t,e){return Object.entries(t).reduce(function(t,n){var r=ze(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(ix(i))]=o,t},{})}function lx(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach(function(t){var o=ze(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)}),[r,i]}function ux(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=ze([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t}),2);return[a[0],a[1]]}(t,n,r),")")});t.attr("transform",n)}catch(t){}}var fx=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,$e([],ze(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach(function(e){return t.appendChild(e)}):t.appendChild(e)):t.innerHTML=""};function hx(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):t.length>2?[t[0]]:t.split("")}function dx(){ub(this,"hidden"!==this.attributes.visibility)}var px=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,Ob({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return je(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hb(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&dx.call(this)},e.prototype.update=function(t,e){var n;return this.attr(Ob({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return Ie(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(ev),gx=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},vx=gx,mx=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},yx=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},bx=yx;var xx=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function wx(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(y(t))e="symbol";else if(L(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var kx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return je(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=Ie(s,["symbol","size"]),h=wx(c);Lb(!!h,tx(n),function(t){t.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call(function(t){if("image"===h){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:a-u})}else{n=u/2;var r=y(c)?c:e.getSymbol(c);t.styles(Re({d:null==r?void 0:r(i,a,n)},f))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(px);function Mx(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function Ox(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}kx.registerSymbol("cross",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]}),kx.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),kx.registerSymbol("line",mx),kx.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),kx.registerSymbol("tick",function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]}),kx.registerSymbol("circle",gx),kx.registerSymbol("point",vx),kx.registerSymbol("bowtie",function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),kx.registerSymbol("hexagon",function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),kx.registerSymbol("square",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]}),kx.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),kx.registerSymbol("triangle",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),kx.registerSymbol("triangle-down",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),kx.registerSymbol("line",mx),kx.registerSymbol("dot",yx),kx.registerSymbol("dash",bx),kx.registerSymbol("smooth",function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}),kx.registerSymbol("hv",function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]}),kx.registerSymbol("vh",function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]}),kx.registerSymbol("hvh",function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]}),kx.registerSymbol("vhv",function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}),kx.registerSymbol("focus",function(t,e,n){var r=.2*n,i=.7*n;return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"],["M",t-i,e],["L",t-r,e],["M",t+r,e],["L",t+i,e],["M",t,e-i],["L",t,e-r],["M",t,e+r],["L",t,e+i]]});const Ex=Math.sqrt(50),Sx=Math.sqrt(10),_x=Math.sqrt(2);function Ax(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=Ex?10:o>=Sx?5:o>=_x?2:1)*10**i:-(10**-i)/(o>=Ex?10:o>=Sx?5:o>=_x?2:1)}const Tx=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=Ax(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Ax(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Ax(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r};function Px(t){return!q(t)&&!Y(t)&&!Number.isNaN(t)}function Cx(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Nx(t){const e=Ii.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*Cx(a,o,e+1/3),255*Cx(a,o,e),255*Cx(a,o,e-1/3),i]}(r):null}const Lx=(t,e)=>n=>t*(1-n)+e*n,jx=(t,e)=>"number"==typeof t&&"number"==typeof e?Lx(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Nx(t),r=Nx(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,Rx=(t,e)=>{const n=Lx(t,e);return t=>Math.round(n(t))};function Ix({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Dx(t){return"object"==typeof t?t.valueOf():t}class Bx extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Dx,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Ix({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Ix({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Fx{constructor(t){this.options=tt({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=tt({},this.options,t),this.rescale(t)}rescale(t){}}const zx=Symbol("defaultUnknown");function $x(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Wx(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==zx)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Gx(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Hx extends Fx{getDefaultOptions(){return{domain:[],range:[],unknown:zx}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&$x(this.domainIndexMap,this.getDomain(),this.domainKey),Wx({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&$x(this.rangeIndexMap,this.getRange(),this.rangeKey),Wx({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Gx(e),this.rangeKey=Gx(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Hx(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Yx(t){return Math.round(1e12*t)/1e12}function qx(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,v=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(l),m=v.reduce((t,e)=>t+e),y=g/m,b=new Bx(e.map((t,e)=>{const n=v[e]*y;return[t,a?Math.floor(n):n]})),x=new Bx(e.map((t,e)=>{const n=v[e]*y+p;return[t,a?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(h-(w-w/c*i))*s;let M=a?Math.round(k):k;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=Yx(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Vx extends Hx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:zx,flex:[]}}constructor(t){super(t)}clone(){return new Vx(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return qx(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*l);return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const Ux=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=Ax(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i},Xx=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=Ox(r,i),c=n(o,a)):(s=Ox(i,r),c=n(a,o)),Mx(c,s)},Kx=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Ox(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=function(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}(t,e,1,r)-1,a=i[n];return Mx(o[n],a)(e)}},Zx=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Kx:Xx)(t,e,r?Rx:n);class Qx extends Fx{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Lx,tickCount:5}}map(t){return Px(t)?this.output(t):this.options.unknown}invert(t){return Px(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Tx}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):ft}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=Zx(n.map(t),r,o,i);this.output=Mx(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=Zx(i,r.map(t),Lx);this.input=Mx(e,n,o)}}class Jx extends Qx{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:jx,tickMethod:Ux,tickCount:5}}chooseTransforms(){return[ft,ft]}clone(){return new Jx(this.options)}}class tw extends Vx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:zx,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new tw(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}var ew=function(t){function e(e){var n=this,r=e.style,i=Ie(e,["style"]);return(n=t.call(this,tt({},{type:"column"},Re({style:r},i)))||this).columnsGroup=new rv({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return je(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),tx(this.columnsGroup).selectAll(".column").data(e.flat()).join(function(t){return t.append("rect").attr("className","column").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.update=function(t){this.attr(Ob({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Qg),nw=function(t){function e(e){var n=this,r=e.style,i=Ie(e,["style"]);return(n=t.call(this,tt({},{type:"lines"},Re({style:r},i)))||this).linesGroup=n.appendChild(new rv),n.areasGroup=n.appendChild(new rv),n.render(),n}return je(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(Ob({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){tx(this.linesGroup).selectAll(".line").data(t).join(function(t){return t.append("path").attr("className","line").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.renderAreas=function(t){tx(this.linesGroup).selectAll(".area").data(t).join(function(t){return t.append("path").attr("className","area").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.style(t)})},function(t){return t.remove()})},e}(Qg);function rw(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map(function(t,e){return $e([e===n?"M":"L"],ze(t),!1)});return e?r.reverse():r}function iw(t,e){if(void 0===e&&(e=!1),t.length<=2)return rw(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];rt(o,n.slice(-2))||n.push.apply(n,$e([],ze(o),!1))}var a=Ub(n,!1);return e?a.unshift($e(["M"],ze(t[r-1]),!1)):a.unshift($e(["M"],ze(t[0]),!1)),a}function ow(t,e,n){var r=X(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function aw(t){return 0===t.length?[0,0]:[C(F(t,function(t){return C(t)||0})),P(B(t,function(t){return P(t)||0}))]}function sw(t){for(var e=X(t),n=e[0].length,r=ze([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=o[c],o[c]=s[c]);return e}var cw=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return je(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=X(t);return I(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?sw(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=ze(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=sx(this.attributes,"area"),a=sx(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=ze(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=ze([a,s],2),s=n[0],a=n[1]),t.map(function(t){return t.map(function(t,e){return[r.map(e),R(i.map(t),s,a)]})})}(c,{type:"line",x:l.x,y:l.y}),f=[];if(o){var h=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=iw(o),s=void 0;if(0===i)s=ow(a,e,n);else{var c=iw(t[i-1],!0),l=o[0];c[0][0]="L",s=$e($e($e([],ze(a),!1),ze(c),!1),[$e(["M"],ze(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=rw(t[i]),a=void 0;if(0===i)a=ow(o,e,n);else{var s=rw(t[i-1],!0);s[0][0]="L",a=$e($e($e([],ze(o),!1),ze(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map(function(t){return ow(e?iw(t):rw(t),n,r)})}(u,i,s,h)}return{lines:u.map(function(e,n){return Re({stroke:t.getColor(n),d:i?iw(e):rw(e)},a)}),areas:f.map(function(e,n){return Re({d:e,fill:t.getColor(n)},o)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=sx(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=sw(s));var c=this.createScales(s),l=c.x,u=c.y,f=ze(aw(s),2),h=f[0],d=f[1],p=new Jx({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),v=this.rawData;return{columns:s.map(function(n,i){return n.map(function(n,o){var a=g/s.length;return Re(Re({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(v[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?tx(n).select(r):tx(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=Re({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);tx(e).selectAll(".spark").data([o]).join(function(t){return t.append(function(t){return"line"===t?new nw({className:c,style:l}):new ew({className:c,style:l})}).attr("className","spark ".concat(c))},function(t){return t.update(l)},function(t){return t.remove()})},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:y(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.scale,a=r.range,s=void 0===a?[]:a,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,h=ze(aw(t),2),d=h[0],p=h[1],g=new Jx({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-o)]});return"line"===i?{type:i,x:new Jx({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Vx({domain:t[0].map(function(t,e){return e}),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(px);function lw(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter(function(t){var n=ze(t,1)[0];return!e.includes(n)}));return Object.fromEntries(e.map(function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,Re(Re({},t[e]),n)]:[e,n]}))}function uw(t,e){t?t.finished.then(e):e()}function fw(t,e){"update"in t?t.update(e):t.attr(e)}function hw(t,e,n){return 0===e.length?null:n?t.animate(e,n):(fw(t,{style:e.slice(-1)[0]}),null)}function dw(t,e,n){var r={},i={};return Object.entries(e).forEach(function(e){var n=ze(e,2),o=n[0],a=n[1];if(!b(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}}),n?hw(t,[r,i],Re({fill:"both"},n)):(fw(t,i),null)}function pw(t,e){return t.style.opacity||(t.style.opacity=1),dw(t,{opacity:0},e)}var gw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},vw={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},mw={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},yw=kb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),bw=kb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),xw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return je(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,o=void 0===i?10:i,a=t.radius,s=void 0===a?o/4:a,c=t.orientation,l=Ie(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,h=tx(e).maybeAppendByClassName(bw.iconRect,"rect").styles(Re(Re({},l),{width:u,height:f,radius:s,x:n-u/2,y:r-f/2,transformOrigin:"center"})),d=n+1/3*u-u/2,p=n+2/3*u-u/2,g=r+1/4*f-f/2,v=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(bw.iconLine,"-1"),"line").styles(Re({x1:d,x2:d,y1:g,y2:v},l)),h.maybeAppendByClassName("".concat(bw.iconLine,"-2"),"line").styles(Re({x1:p,x2:p,y1:g,y2:v},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(px),ww=function(t){function e(e){return t.call(this,e,mw)||this}return je(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=sx(this.attributes,"label"),s=a.x,c=void 0===s?0:s,l=a.y,u=void 0===l?0:l,f=a.transform,h=a.transformOrigin,d=ze(lx(Ie(a,["x","y","transform","transformOrigin"]),[]),2),p=d[0],g=d[1],v=tx(t).maybeAppendByClassName(bw.labelGroup,"g").styles(g),m=Re(Re({},vw),p),y=m.text,b=Ie(m,["text"]);Lb(!!o,v,function(t){e.label=t.maybeAppendByClassName(bw.label,"text").styles(Re(Re({},b),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(y)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.type,a=Re(Re({x:n,y:r,orientation:i},gw),sx(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new xw({style:a})}:s;tx(t).maybeAppendByClassName(bw.iconGroup,"g").selectAll(bw.icon.class).data([c]).join(function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",bw.icon.name)},function(t){return t.update(a)},function(t){return t.remove()})},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(px),kw=function(t){function e(e){var n=t.call(this,e,Re(Re(Re({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},cx(mw,"handle")),cx(gw,"handleIcon")),cx(vw,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Cb(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.getBBox(),s=a.x,c=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,o=e.type;t.stopPropagation();var a=n.getOrientVal(Cb(t)),s=a-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===o?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=a}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,o="range"===i?t:t[1],a="range"===i?n.getValues():n.getValues()[1],s=new Jp("valuechange",{detail:{oldValue:o,value:a}});n.dispatchEvent(s),null==r||r(a)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return je(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=sx(this.attributes,"sparkline");return Re(Re({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=ze(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=ze(ex(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(yw.selection.class).each(function(n,r){dw(this,e[r],t)})},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&dw(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&dw(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=sx(this.attributes,"track");this.trackShape=tx(t).maybeAppendByClassName(yw.track,"rect").styles(Re(Re({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=tx(t).maybeAppendByClassName(yw.brushArea,"rect").styles(Re({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;Lb("horizontal"===n.orientation,tx(t).maybeAppendByClassName(yw.sparklineGroup,"g"),function(t){var n=Re(Re({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(yw.sparkline,function(){return new cw({style:n})}).update(n)})},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,o=r?"range"===i?["start","end"]:["end"]:[],a=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(yw.handle.class).data(o.map(function(t){return{type:t}}),function(t){return t.type}).join(function(t){return t.append(function(t){var n=t.type;return new ww({style:e.getHandleStyle(n)})}).each(function(t){var e=t.type;this.attr("class","".concat(yw.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");a[n]=this,this.addEventListener("pointerdown",a.onDragStart(e))})},function(t){return t.each(function(t){var e=t.type;this.update(a.getHandleStyle(e))})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");a[n]=void 0}).remove()})},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,o=e.selectionType;this.foregroundGroup=tx(t).maybeAppendByClassName(yw.foreground,"g");var a=sx(this.attributes,"selection"),s=function(t){return t.style("visibility",function(t){return t.show?"visible":"hidden"}).style("cursor",function(t){return"select"===o?"grab":"invert"===o?"crosshair":"default"}).styles(Re(Re({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(yw.selection.class).data("value"===i?[]:this.calcSelectionArea().map(function(t,e){return{style:Re({},t),index:e,show:"select"===o?1===e:1!==e}}),function(t){return t.index}).join(function(t){return t.append("rect").attr("className",yw.selection.name).call(s).each(function(t,e){var n=this;1===e?(c.selectionShape=tx(this),this.on("pointerdown",function(t){n.attr("cursor","grabbing"),c.onDragStart("selection")(t)}),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){n.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){n.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){n.attr("cursor","pointer")})):this.on("pointerdown",c.onDragStart("track"))})},function(t){return t.call(s)},function(t){return t.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=ze(this.range,2),i=r[0],o=r[1],a=ze(this.getValues().map(function(t){return qb(t,e)}),2),s=a[0],c=a[1],l=ze(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map(function(t){return qb(t,e)}),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,R(f,i,o)];u>f&&(u=(n=ze([f,u],2))[0],f=n[1]);var h=f-u;return h>o-i?[i,o]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>o?c===o&&s===u?[u,o]:[o-h,o]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=ze(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:a,height:c,x:o,width:n*s},{y:a,height:c,x:n*s+o,width:(r-n)*s},{y:a,height:c,x:r*s,width:(1-r)*s}],[{x:o,width:s,y:a,height:n*c},{x:o,width:s,y:n*c+a,height:(r-n)*c},{x:o,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,o=n.width,a=n.height,s=ze(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([f,o/2]),y:i+this.getOrientVal([a/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=sx(this.attributes,"handle"),c=sx(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new db({style:Re(Re(Re({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,v=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-v-l};var m=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var y=0,b=0,x=this.availableSpace,w=x.width,k=x.height,M=this.calcSelectionArea()[1],O=M.x,E=M.y,S=M.width,_=M.height,A=l+u;if("horizontal"===i){var T=A+g/2;if("start"===t)y=O-A-g>0?-T:T;else y=w-O-S-A>g?T:-T}else{var P=v+A;b="start"===t?E-u>v?-P:A:k-(E+_)-u>v?P:-A}return{x:y,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=sx(this.attributes,"handleLabel");return Re(Re(Re({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=sx(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Re({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,o=e.showLabelOnInteraction,a=e.orientation,s=this.calcHandlePosition(t),c=s.x,l=s.y,u=this.calcHandleText(t),f=i;return!i&&o&&(f=!!this.target),Re(Re(Re({},cx(this.getHandleIconStyle(),"icon")),cx(Re(Re({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(c+n,", ").concat(l+r,")"),orientation:a,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=ze(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e){void 0===e&&(e=0);var n=this.attributes.type,r=ze(this.getValues(),2),i=[r[0]+("range"===n?t:0),r[1]+e].sort();this.innerSetValues(i,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new Jp(n,{detail:t}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r)}},e.tag="slider",e}(px),Mw=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Jp("scroll",r)),n.dispatchEvent(new Jp("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=ze(n.getLocalPosition(),2),r=e[0],i=e[1],o=ze(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(Cb(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Jp("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Jp("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Jp("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Jp("trackMouseleave",{detail:t.detail}))},n}return je(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return ex(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=ze(this.range,2),n=e[0],r=e[1];return R(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=ze(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ze(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=ze(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.trackSize,a=e.padding,s=e.slidable,c=sx(this.attributes,"track"),l=sx(this.attributes,"thumb"),u=Re(Re({x:n,y:r,brushable:!1,orientation:i,padding:a,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:o,values:this.getValues()},cx(c,"track")),cx(l,"selection"));this.slider=tx(t).maybeAppendByClassName("scrollbar",function(){return new kw({style:u})}).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=ze(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(R(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",function(e){e.stopPropagation(),t.onTrackClick(e.detail)}),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(px),Ow={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new uv({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};tt({},Ow,{style:{type:"arc"}}),tt({},Ow,{style:{}});var Ew=kb({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Sw=kb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function _w(t){return t.reduce(function(t,e,n){return t.push($e([0===n?"M":"L"],ze(e),!1)),t},[])}function Aw(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return _w(t);if(!o)return[];var a=Hb(t[0],o),s=n?0:1;return t.reduce(function(t,e,n){return 0===n?t.push($e(["M"],ze(e),!1)):t.push($e(["A",a,a,0,0,s],ze(e),!1)),t},[])}(t,e,n):_w(t)}function Tw(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=ze([Aw(t,n),Aw(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=ze([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return d([$e(["L"],ze(h),!1)],[$e(["L"],ze(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=ze([Hb(h,o),Hb(f,o)],2),g=p[0],v=p[1];return d([$e(["A",g,g,0,0,1],ze(h),!1),$e(["L"],ze(h),!1)],[$e(["A",v,v,0,0,0],ze(f),!1),$e(["L"],ze(f),!1)])}var Pw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return je(e,t),e.prototype.render=function(t,e){var n=Ie(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map(function(t){var e=t.points,n=ze(e,1)[0];return Re(Re({},t),{points:$e($e([],ze(e),!1),[n],!1)})}):n}(t),i=tx(e).maybeAppendByClassName(Sw.lineGroup,"g"),o=tx(e).maybeAppendByClassName(Sw.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map(function(t,e){return{id:t.id||"grid-line-".concat(e),d:Aw(t.points,n)}});return t.selectAll(Sw.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){var n=mb(Zb(Re({d:t.d},r)),[t,e,a]);this.attr(Re({class:Sw.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))})},function(t){return t.transition(function(t,e){return dw(this,mb(Zb(Re({d:t.d},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=pw(this,i.exit);return uw(e,function(){return t.remove()}),e})}).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},c=[],l=0;l<e.length-1;l++){var u=ze([e[l].points,e[l+1].points],2),f=Tw(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(Sw.region.class).data(c,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){var n=mb(t,[t,e,c]);this.attr(n)}).attr("className",Sw.region.name)},function(t){return t.transition(function(t,e){return dw(this,mb(t,[t,e,c]),r.update)})},function(t){return t.transition(function(){var t=this,e=pw(this,r.exit);return uw(e,function(){return t.remove()}),e})}).transitions()}(o,r,t);return $e($e([],ze(a),!1),ze(s),!1)},e}(px);function Cw(t,e){return Object.fromEntries(Object.entries(t).map(function(t){var n=ze(t,2);return[n[0],mb(n[1],e)]}))}function Nw(t,e){return e&&y(e)?t.filter(e):t}function Lw(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function jw(t,e){if("linear"===e.type){var n=ze(e.startPos,2),r=n[0],i=n[1],o=ze(e.endPos,2),a=ze([o[0]-r,o[1]-i],2);return Yb([a[0],a[1]])}var s=pb(Lw(t,e));return[-Math.sin(s),Math.cos(s)]}function Rw(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(jw(t,n),"positive"!==e)}function Iw(t,e){return Rw(t,e.labelDirection,e)}function Dw(t,e){return"linear"===e.type?function(t,e){var n=ze(e.startPos,2),r=n[0],i=n[1],o=ze(e.endPos,2),a=ze([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}(t,e):function(t,e){var n=e.radius,r=ze(e.center,2),i=r[0],o=r[1],a=pb(Lw(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Bw(t){return 0===jw(0,t)[1]}function Fw(t){return 0===jw(0,t)[0]}function zw(t,e){return e-t===360}function $w(t,e,n,r,i){var o=e-t,a=ze([i,i],2),s=a[0],c=a[1],l=ze([pb(t),pb(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=ze(h(u),2),p=d[0],g=d[1],v=ze(h(f),2),m=v[0],y=v[1];if(zw(t,e)){var b=ze(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,m,y]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(m,",").concat(y)}function Ww(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Ew.line.class).data([{d:$w.apply(void 0,$e($e([i,o],ze(a),!1),[s],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",Ew.line.name).styles(e).styles({d:function(t){return t.d}})},function(t){return t.transition(function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=Rb(e,n),s=Math.ceil(+o/16),c=new Array(s).fill(0).map(function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}});return t.animate(c,Re({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return $e($e([n,r],ze(i),!1),[o],!1)}(this),$e($e([i,o],ze(a),!1),[s],!1),r.update);if(e){var n=function(){var e=ot(t.attributes,"__keyframe_data__");t.style.d=$w.apply(void 0,$e([],ze(e),!1))};e.onframe=n,e.onfinish=n}return e}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function Gw(t){var e=ze(t,2),n=ze(e[0],2),r=n[0],i=n[1],o=ze(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function Hw(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=ze([o,a],2),u=ze(l[0],2),f=u[0],h=u[1],d=ze(l[1],2),p=d[0],g=d[1],v=ze(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=ze([t,e,n],3),i=ze(r[0],2),o=i[0],a=i[1],s=ze(r[1],2),c=s[0],l=s[1],u=ze(r[2],2),f=u[0],h=u[1],d=ze([c-o,l-a],2),p=d[0],g=d[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=ze([-f/v,h/v],2),y=m[0],b=m[1];return[y*p,y*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),m=v[0],y=v[1],b=v[2],x=v[3],w=function(e){return t.selectAll(Ew.line.class).data(e,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(Ew.line.name," ").concat(t.className)}).styles(n).transition(function(t){return dw(this,Gw(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return dw(this,Gw(t.line),r.update)})},function(t){return t.remove()}).transitions()};if(!i||!s)return w([{line:[[f+m,h+y],[p+b,g+x]],className:Ew.line.name}]);var k=ze(s,2),M=k[0],O=k[1],E=p-f,S=g-h,_=ze([f+E*M,h+S*M],2),A=_[0],T=_[1],P=ze([f+E*O,h+S*O],2),C=P[0],N=P[1];return w([{line:[[f+m,h+y],[A,T]],className:Ew.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:Ew.lineSecond.name}])}function Yw(t,e,n){var r,i=e.type,o=sx(e,"line");return r="linear"===i?Hw(t,e,Vb(o,"arrow"),n):Ww(t,e,Vb(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(Ew.line.class):a?t.select(Ew.lineSecond.class):t.select(Ew.line.class),!o||!s||"arc"===n.type&&zw(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Nb(s);f.attr(r),Qb(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function qw(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Vw(t,e){var n=e.gridLength;return t.map(function(t,r){var i=t.value,o=ze(Dw(i,e),2),a=o[0],s=o[1],c=ze(Fb(function(t,e){return Rw(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}})}function Uw(t,e,n,r){var i=sx(n,"grid"),o=i.type,a=i.areaFill,s=qw(n),c=Nw(e,n.gridFilter),l="segment"===o?Vw(c,n):function(t,e){var n=e.gridControlAngles,r=qw(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=ze(r,2),o=i[0],a=i[1];return t.map(function(t,r){var i=ze(Dw(t.value,e),2),s=i[0],c=i[1],l=ze([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach(function(t){var e=pb(t),n=ze([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+o,c=u*i+f*r+a;h.push([s,c])}),{points:h,id:r}})}(c,n),u=Re(Re({},i),{center:s,areaFill:y(a)?c.map(function(t,e){return mb(a,[t,e,c])}):a,animate:r,data:l});return t.selectAll(Ew.grid.class).data([1]).join(function(t){return t.append(function(){return new Pw({style:u})}).attr("className",Ew.grid.name)},function(t){return t.transition(function(){return this.update(u)})},function(t){return t.remove()}).transitions()}var Xw=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*a-l*s+u,l*a+c*s+f],[c*i-l*o+u,l*i+c*o+f],[c*a-l*o+u,l*a+c*o+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function Kw(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=ze(r.min,2),o=i[0],a=i[1],s=ze(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=o,v=a,m=Ab(t);if(m){h-=1.5;var y=m.style.textAlign,b=m.style.textBaseline;"center"===y?g=(o+c)/2:"right"!==y&&"end"!==y||(g=c),"middle"===b?v=(a+l)/2:"bottom"===b&&(v=l)}var x=ze(ex(e),4),w=x[0],k=void 0===w?0:w,M=x[1],O=void 0===M?0:M,E=x[2],S=void 0===E?k:E,_=x[3],A=new Xw((d+=o)-(void 0===_?O:_),(p+=a)-k,d+f+O,p+h+S);return t.setEulerAngles(n),A.rotatedPoints(pb(n),g,v)}function Zw(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function Qw(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function Jw(t,e){var n=Qw(t[0],t[1],e[0]),r=Qw(t[0],t[1],e[1]),i=Qw(e[0],e[1],t[0]),o=Qw(e[0],e[1],t[1]);return n!==r&&i!==o||(!(0!==n||!Zw(t,e[0]))||(!(0!==r||!Zw(t,e[1]))||(!(0!==i||!Zw(e,t[0]))||!(0!==o||!Zw(e,t[1])))))}function tk(t,e){return e.every(function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r=[e,[9999,e[1]]],i=0,o=0;do{var a=[t[o],t[(o+1)%n]];if(Jw(a,r)){if(0===Qw(a[0],e,a[1]))return Zw(a,e);i++}o=(o+1)%n}while(0!==o);return!!(1&i)}(t,e)})}function ek(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(function(t){return function(t,e){var n=ze(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ze(e,4),c=s[0],l=s[1],u=o-r,f=a-i,h=s[2]-c,d=s[3]-l,p=u*d-h*f;if(0===p)return!1;var g=p>0,v=r-c,m=i-l,y=u*m-f*v;if(y<0===g)return!1;var b=h*m-d*v;return b<0!==g&&y>p!==g&&b>p!==g}(e,t)})}function nk(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=ze(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=ze(ex(e),4),p=d[0],g=d[1],v=d[2],m=d[3];return new Xw(c+f-m,l+f-p,c+h+g,l+h+v)}var y=ze(t.startPos,2),b=y[0],x=y[1],w=ze(t.endPos,2),k=w[0],M=w[1],O=ze(Fw(t)?[-e,0,e,0]:[0,e,0,-e],4),E=O[0],S=O[1],_=O[2],A=O[3],T=Fb(Iw(0,t),i),P=new Xw(b,x,k,M);return P.x1+=A,P.y1+=E,P.x2+=S+T[0],P.y2+=_+T[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return tk([[r,o],[i,o],[i,a],[r,a]],Kw(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=Kw(t,n).flat(1),a=Kw(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var c=Fe(s),l=c.next();!l.done;l=c.next())if(ek(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,ex(n))};try{for(var f=Fe(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(a.add(s),a.add(d)):a.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function rk(t,e){return void 0===e&&(e={}),b(t)?0:"number"==typeof t?t:Math.floor(Sb(t,e))}var ik=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter(function(t,e){return!(e%r)||(lb(t),!1)})},ok=function(t){return t.filter(Eb)};var ak=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,c,l=ik,u=function(t){return t.forEach(r.show),t},f=2,h=t.slice(),d=t.slice(),p=Math.min.apply(Math,$e([1],ze(t.map(function(t){return t.getBBox().width})),!1));if("linear"===n.type&&(Bw(n)||Fw(n))){var g=nx(t[0]).left,v=nx(t[i-1]).right,m=Math.abs(v-g)||1;f=Math.max(Math.floor(i*p/m),f)}for(o&&(s=h.splice(0,1)[0]),a&&(c=h.splice(-1,1)[0],h.reverse()),u(h);f<t.length&&nk(ok(c?$e($e([c],ze(d),!1),[s],!1):$e([s],ze(d),!1)),n,null==e?void 0:e.margin).length;){if(c&&!s&&f%2==0)h.splice(0,1).forEach(r.hide);else if(c&&s){h.splice(0,1).forEach(r.hide)}d=l(u(h),{seq:f}),f++}}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,c=e.margin,l=e.recoverWhenFailed,u=void 0===l||l,f=t.map(function(t){return t.getLocalEulerAngles()}),h=function(){return nk(t,n,c).length<1},d=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)})};try{for(var p=Fe(s),g=p.next();!g.done;g=p.next()){if(d(g.value),h())return}}catch(t){i={error:t}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}u&&d(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=0)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,u=void 0===l?" ":l,f=e.margin,h=void 0===f?[0,0,0,0]:f,d=_b(r.getTextShape(t[0])),p=rk(u,d),g=a?rk(a,d):p,v=rk(c,d);(b(v)||v===1/0)&&(v=Math.max.apply(null,t.map(function(t){return t.getBBox().width})));var m=t.slice();ze(h,4);for(var y=function(e){if(m.forEach(function(t){r.ellipsis(r.getTextShape(t),e,o)}),(m=nk(t,n,h)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var w=y(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r,i){var o,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=mb(null!==(o=e.wordWrapWidth)&&void 0!==o?o:50,[i]),d=t.map(function(t){return t.attr("maxLines")||1}),p=Math.min.apply(Math,$e([],ze(d),!1)),g=function(){return nk(t,n,f).length<1},v=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Bw(t)?"negative"===n?"bottom":"top":"middle"}(n),m=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,h,i,v)})};if(!(p>s)){if("linear"===n.type&&Bw(n)){if(m(s),g())return}else for(var y=p;y<=s;y++)if(m(y),g())return;l&&m(d)}}]]);function sk(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*function(t){return"positive"===t?-1:1}(e)},1)}function ck(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function lk(t,e){var n=ze(t,2),r=n[0],i=n[1],o=ze(e,2),a=o[0],s=o[1],c=ze([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function uk(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o=Iw(t.value,n),a=jw(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return jb(e,-90,90)||(e+=180),e}(gb("perpendicular"===i?lk([1,0],o):lk([a[0]<0?-1:1,0],a)))}function fk(t,e,n){var r=n.type,i=n.labelAlign,o=Iw(t,n),a=ck(e),s=ck(gb(lk([1,0],o))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===a?(c="center",l=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(jb(a,0,90,!1,!0)||jb(a,0,90)||jb(a,270,360))&&(c="start"):90===s?jb(a,0,90,!1,!0)?c="start":(jb(a,90,180)||jb(a,270,360))&&(c="end"):270===s?jb(a,0,90,!1,!0)?c="end":(jb(a,90,180)||jb(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(jb(a,0,90)||jb(a,270,360))&&(c="end")):c="center":"parallel"===i?l=jb(s,0,180,!0)?"top":"bottom":"horizontal"===i?jb(s,90,270,!1)?c="end":(jb(s,270,360,!1)||jb(s,0,90))&&(c="start"):"perpendicular"===i&&(c=jb(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function hk(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=mb(s,[t,c,e]),u=ze([Iw(t.value,n),sk(a,o)],2),f=ze(zb(Fb(u[0],l+(1===u[1]?mb(r?i:0,[t,c,e]):0)),Dw(t.value,n)),2);return{x:f[0],y:f[1]}}function dk(t,e,n,r){var i=r.labelRender,o=(ot(r,"endPos.0",400)-ot(r,"startPos.0",0))/n.length,a=y(i)?mb(i,[t,e,n,Iw(t.value,r)]):t.label||"",s=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body.firstElementChild;if(console.log(null==e?void 0:e.getClientRects(),11),!e)return 0;var n=e.getAttribute("style")||"",r=Object.fromEntries(n.split(";").map(function(t){return t.trim()}).filter(function(t){return t.includes(":")}).map(function(t){var e=ze(t.split(":").map(function(t){return t.trim()}),2),n=e[0],r=e[1];return[n.toLowerCase(),r]})),i=function(t){if(!t)return 0;var e=t.match(/([\d.]+)px/);return e?parseFloat(e[1]):0};if(r.height)return i(r.height);var o,a=i(r["font-size"])||16,s=r["line-height"];o=s&&"normal"!==s?s.endsWith("px")?i(s):/^[\d.]+$/.test(s)?parseFloat(s)*a:a:1.2*a;var c=i(r["padding-top"]),l=i(r["padding-bottom"]);r.padding&&(1===(u=r.padding.split(/\s+/).map(i)).length||2===u.length?(c=u[0],l=u[0]):(3===u.length||4===u.length)&&(c=u[0],l=u[2]));var u,f=i(r["border-top-width"]),h=i(r["border-bottom-width"]);if(r.border){var d=r.border.match(/([\d.]+)px/);d&&(f=parseFloat(d[1]),h=parseFloat(d[1]))}return r["border-width"]&&(1===(u=r["border-width"].split(/\s+/).map(i)).length||2===u.length?(f=u[0],h=u[0]):(3===u.length||4===u.length)&&(f=u[0],h=u[2])),o+c+l+f+h}(a)||30;return function(){return e={width:o,height:s},"function"==typeof(t=a)?t():L(t)||I(t)?new ov({style:Re(Re({},e),{innerHTML:String(t)})}):t;var t,e}}function pk(t,e){["text","html"].includes(t.nodeName)&&t.attr(e)}function gk(t,e){!function(t,e,n,r){var i=e.labelOverlap,o=void 0===i?[]:i;o.length&&o.forEach(function(i){var o=i.type,a=ak.get(o);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some(function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||t.filter(function(t){return t.querySelector("text")}).length>=1)})(t,e,o)&&(null==a||a(t,i,e,r,n))})}(this.node().childNodes,t,e,{hide:lb,show:cb,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=fk(e.__data__.value,t,n),i=e.querySelector(Ew.labelItem.class);i&&pk(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Pb(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),Tb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function vk(t,e,n,r,i){var o=n.indexOf(e),a=i.labelRender,s=tx(t).append(a?dk(e,o,n,i):function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return Nb(mb(i,[t,e,n,Iw(t.value,r)]))}:function(){return Nb(t.label||"")}}(e,o,n,i)).attr("className",Ew.labelItem.name).node(),c=ze(lx(Cw(r,[e,o,n])),2),l=c[0],u=c[1],f=u.transform,h=Ie(u,["transform"]);ux(s,f);var d=uk(e,s,i);return s.getLocalEulerAngles()||s.setLocalEulerAngles(d),pk(s,Re(Re({},fk(e.value,d,i)),l)),t.attr(h),s}function mk(t,e,n,r,i){var o,a,s,c=Nw(e,n.labelFilter),l=sx(n,"label"),u=t.selectAll(Ew.label.class).data(c,function(t,e){return e}).join(function(t){return t.append("g").attr("className",Ew.label.name).transition(function(t){vk(this,t,e,l,n);var r=hk(t,e,n),i=r.x,o=r.y;return this.style.transform="translate(".concat(i,", ").concat(o,")"),null})},function(t){return t.transition(function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&lb(t),e.isVisible()&&cb(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+a/2),u=+a/4,f=ze(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=ze(e.getGeometryBounds().center,2),g=ze([(h+p[0])/2-h,(d+p[1])/2-d],2),v=g[0],m=g[1],y=t.style.opacity,b=void 0===y?1:y,x=e.style.opacity,w=void 0===x?1:x,k=t.style.transform||"",M=e.style.transform||"",O=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(k)},{opacity:0,transform:"translate(".concat(v,", ").concat(m,") ").concat(k)}],Re(Re({fill:"both"},n),{duration:c+l+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-m,") ").concat(M),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(M)}],Re(Re({fill:"both"},n),{duration:l+u,delay:c+l-u}));return uw(E,i),[O,E]}(this.querySelector(Ew.labelItem.class),vk(this,t,e,l,n),r.update),o=hk(t,e,n),a=o.x,s=o.y,c=dw(this,{transform:"translate(".concat(a,", ").concat(s,")")},r.update);return $e($e([],ze(i),!1),[c],!1)})},function(t){return o=t,t.transition(function(){var t=this,e=pw(this.childNodes[0],r.exit);return uw(e,function(){return tx(t).remove()}),e}),o}).transitions();return s=function(){gk.call(t,n,i)},0===(a=u).length?s():Promise.all(a.map(function(t){return null==t?void 0:t.finished})).then(s),u}function yk(t,e){return Rw(t,e.tickDirection,e)}function bk(t,e,n,r,i){var o=ze(function(t,e){var n=ze(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,mb(i.tickLength,[t,e,n])),2),a=ze(o[0],2),s=a[0],c=a[1],l=ze(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function xk(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=yk(e.value,i),s="line";return y(o)&&(s=function(){return mb(o,[e,n,r,a])}),t.append(s).attr("className",Ew.tickItem.name)}(tx(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=yk(t.value,o),c=bk(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=ze(lx(Cw(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(Re({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=ze(Dw(t.value,r),2),c=s[0],l=s[1];return dw(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}function wk(t,e,n,r,i){var o=ze(lx(sx(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Ie(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),a.direction,a.position);t.styles(Re(Re({},a),{transformOrigin:l})),ux(t.node(),f);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=hx(i),s=t.node().getLocalBounds(),c=ze(s.min,2),l=c[0],u=c[1],f=ze(s.halfExtents,2),h=f[0],d=f[1],p=ze(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],m=ze([l+h,u+d],2),y=m[0],b=m[1],x=ze(ex(o),4),w=x[0],k=x[1],M=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var E=n.startPos,S=n.endPos,_=ze("start"===i?[E,S]:[S,E],2),A=_[0],T=_[1],P=ze(Fb(Yb([-T[0]+A[0],-T[1]+A[1]]),w),2),C=P[0],N=P[1];return{x:A[0]+C,y:A[1]+N}}return a.includes("t")&&(b-=d+v+w),a.includes("r")&&(y+=h+g+k),a.includes("l")&&(y-=h+g+O),a.includes("b")&&(b+=d+v+M),{x:y,y:b}}(tx(n._offscreen||n.querySelector(Ew.mainGroup.class)),e,r),d=h.x,p=h.y;return dw(e.node(),{transform:"translate(".concat(d,", ").concat(p,")")},i)}function kk(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Lb(i,e.maybeAppendByClassName(Ew.lineGroup,"g"),function(e){return Yw(e,t,r)})||[],c=Lb(o,e.maybeAppendByClassName(Ew.tickGroup,"g"),function(e){return function(t,e,n,r){var i=Nw(e,n.tickFilter),o=sx(n,"tick");return t.selectAll(Ew.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",Ew.tick.name).transition(function(t,e){return xk.call(this,t,e,i,n,o,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),xk.call(this,t,e,i,n,o,r.update)})},function(t){return t.transition(function(){var t=this,e=pw(this.childNodes[0],r.exit);return uw(e,function(){return t.remove()}),e})}).transitions()}(e,n,t,r)})||[],l=Lb(a,e.maybeAppendByClassName(Ew.labelGroup,"g"),function(i){return mk(i,n,t,r,e.node())})||[];return $e($e($e([],ze(s),!1),ze(c),!1),ze(l),!1).filter(function(t){return!!t})}var Mk=function(t){function e(e){return t.call(this,e,Ow)||this}return je(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(o,l).filter(function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])}),h=lw(void 0===n?a:n),d=Lb(c,tx(e).maybeAppendByClassName(Ew.gridGroup,"g"),function(e){return Uw(e,f,t,h)})||[],p=tx(e).maybeAppendByClassName(Ew.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&kk(t,tx(this.offscreenGroup),f,lw(!1));var g=kk(t,tx(p.node()),f,h),v=Lb(s,tx(e).maybeAppendByClassName(Ew.titleGroup,"g"),function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Ew.title.class).data([{title:i}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(o){return o.append(function(){return Nb(i)}).attr("className",Ew.title.name).transition(function(){return wk(tx(this),t,e,n,r.enter)})},function(i){return i.transition(function(){return wk(tx(this),t,e,n,r.update)})},function(t){return t.remove()}).transitions()}(e,r,t,h)})||[];return $e($e($e([],ze(d),!1),ze(g),!1),ze(v),!1).flat().filter(function(t){return!!t})},e}(px),Ok=kb({text:"text"},"title");function Ek(t,e){var n=Object.entries(e).reduce(function(e,n){var r=ze(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e},{});t.styles(n)}var Sk=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return je(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(Ok.text.class);if(!a)return new vb(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=ze(ex(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ze([0,0,+e,+n],4),v=g[0],m=g[1],y=g[2],b=g[3],x=hx(r);if(x.includes("i"))return new vb(v,m,y,b);x.forEach(function(t,r){var i,o,a,s;"t"===t&&(i=ze(0===r?[l+d,+n-l-d]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(o=ze([+e-c-p],1),y=o[0]),"b"===t&&(a=ze([+n-l-f],1),b=a[0]),"l"===t&&(s=ze(0===r?[c+h,+e-c-h]:[0,+e],2),v=s[0],y=s[1])});var w=ze(ex(o),4),k=w[0],M=w[1],O=w[2],E=w[3],S=ze([E+M,k+O],2),_=S[0],A=S[1];return new vb(v+E,m+k,y-_,b-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new vb(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Ie(t,["width","height","position","spacing"]),i=ze(lx(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=ze([+a/2,+s/2],2),u=ze([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=hx(c);return g.includes("l")&&(f=(e=ze([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=ze([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=ze([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=ze([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;Lb(!!r.text,tx(e),function(t){n.title=t.maybeAppendByClassName(Ok.text,"text").styles(i).call(Ek,{x:a,y:s,textAlign:c,textBaseline:l}).node()})},e}(px),_k=kb({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Ak=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:xx(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new rv({class:_k.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new rv({class:_k.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return je(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return R(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=ze(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map(function(e,n){return t.map(function(t){return t[n]})}))||[]}(this.pageViews.map(function(t){var e=t.getBBox();return[e.width,e.height]})).map(function(t){return Math.max.apply(Math,$e([],ze(t),!1))}),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new vb(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=ze(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=hw(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return uw(f,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:R(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:R(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(_k.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach(function(e,n){t.includes(n)?cb(e):lb(e)})},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox().width,c=ze("horizontal"===o?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,v=p.height,m=Math.max(h,s,g),y="horizontal"===o?{offset:[[0,0],[h/2+a,0],[h+s+2*a,0]],textAlign:"start"}:{offset:[[m/2,-d-a],[m/2,0],[m/2,v+a]],textAlign:"center"},b=ze(y.offset,3),x=ze(b[0],2),w=x[0],k=x[1],M=ze(b[1],2),O=M[0],E=M[1],S=ze(b[2],2),_=S[0],A=S[1],T=y.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,k),r.setLocalPosition(O,E),n.setLocalPosition(_,A)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(_k.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=ze(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=this.pageViews.length>=2,s=t.maybeAppendByClassName(_k.controller,"g");if(ub(s.node(),a),a){var c=sx(this.attributes,"button"),l=sx(this.attributes,"pageNum"),u=ze(lx(c),2),f=u[0],h=u[1],d=f.size,p=Ie(f,["size"]),g=!s.select(_k.prevBtnGroup.class).node(),v=s.maybeAppendByClassName(_k.prevBtnGroup,"g").styles(h);this.prevBtnGroup=v.node();var m=v.maybeAppendByClassName(_k.prevBtn,"path"),y=s.maybeAppendByClassName(_k.nextBtnGroup,"g").styles(h);this.nextBtnGroup=y.node(),[m,y.maybeAppendByClassName(_k.nextBtn,"path")].forEach(function(t){t.styles(Re(Re({},p),{transformOrigin:"center"})),Qb(t.node(),d,!0)});var b=s.maybeAppendByClassName(_k.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(_k.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),g&&(this.prevBtnGroup.addEventListener("click",function(){e.prev()}),this.nextBtnGroup.addEventListener("click",function(){e.next()}))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(o,")"));var a=tx(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=K(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(cg.INSERTED,e),this.playWindow.addEventListener(cg.REMOVED,e)},e}(px);var Tk;function Pk(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}kx.registerSymbol("hiddenHandle",function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]}),kx.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]}),kx.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]});var Ck="component-poptip",Nk="component-poptip-arrow",Lk="component-poptip-text",jk=((Tk={})[".".concat(Ck)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},Tk[".".concat(Lk)]={"text-align":"center"},Tk[".".concat(Ck,"[data-position='top']")]={transform:"translate(-50%, -100%)"},Tk[".".concat(Ck,"[data-position='left']")]={transform:"translate(-100%, -50%)"},Tk[".".concat(Ck,"[data-position='right']")]={transform:"translate(0, -50%)"},Tk[".".concat(Ck,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},Tk[".".concat(Ck,"[data-position='top-left']")]={transform:"translate(0,-100%)"},Tk[".".concat(Ck,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},Tk[".".concat(Ck,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},Tk[".".concat(Ck,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},Tk[".".concat(Ck,"[data-position='right-top']")]={transform:"translate(0, 0)"},Tk[".".concat(Ck,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},Tk[".".concat(Ck,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},Tk[".".concat(Ck,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},Tk[".".concat(Nk)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},Tk[".".concat(Ck,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},Tk["[data-position='top'] .".concat(Nk)]={bottom:"-2px"},Tk[".".concat(Ck,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},Tk["[data-position='left'] .".concat(Nk)]={right:"-2px"},Tk[".".concat(Ck,"[data-position='right']")]={transform:"translate(5px, -50%)"},Tk["[data-position='right'] .".concat(Nk)]={left:"-2px"},Tk[".".concat(Ck,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},Tk["[data-position='bottom'] .".concat(Nk)]={top:"-2px"},Tk[".".concat(Ck,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},Tk["[data-position='top-left'] .".concat(Nk)]={left:"10px",bottom:"-2px"},Tk[".".concat(Ck,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},Tk["[data-position='top-right'] .".concat(Nk)]={right:"10px",bottom:"-2px"},Tk[".".concat(Ck,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},Tk["[data-position='left-top'] .".concat(Nk)]={right:"-2px",top:"8px"},Tk[".".concat(Ck,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},Tk["[data-position='left-bottom'] .".concat(Nk)]={right:"-2px",bottom:"8px"},Tk[".".concat(Ck,"[data-position='right-top']")]={transform:"translate(5px, 0)"},Tk["[data-position='right-top'] .".concat(Nk)]={left:"-2px",top:"8px"},Tk[".".concat(Ck,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},Tk["[data-position='right-bottom'] .".concat(Nk)]={left:"-2px",bottom:"8px"},Tk[".".concat(Ck,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},Tk["[data-position='bottom-left'] .".concat(Nk)]={top:"-2px",left:"8px"},Tk[".".concat(Ck,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},Tk["[data-position='bottom-right'] .".concat(Nk)]={top:"-2px",right:"8px"},Tk),Rk=window;function Ik(t){var e=t&&document.getElementById(t);return e||((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),e}function Dk(t){var e=function(t){var e;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e||(e=t.apply(Rk,n)),e}}(Ik)(t);return e}var Bk=function(t){function e(n){var r=t.call(this,tt({style:{id:"component-poptip"}},e.defaultOptions,n))||this;return r.visibility="visible",r.map=new Map,r.domStyles="",r.initShape(),r.render(r.attributes,r),r}return je(e,t),Object.defineProperty(e.prototype,"visible",{get:function(){return"visible"===this.visibility},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()},e.prototype.update=function(t){this.attr(tt({},this.style,t)),this.render(this.attributes,this)},e.prototype.bind=function(t,e){var n=this;if(t){var r=this.style.text,i=function(i){var o=t,a=n.style,s=r;if(e){var c="function"==typeof e?e.call(null,i):e,l=c.html,u=c.target,f=Ie(c,["html","target"]);a=function(t,e,n,r){return e&&V(t,e),n&&V(t,n),r&&V(t,r),t}({},n.style,f),(u||!1===u)&&(o=u),"string"==typeof l&&(s=l)}var h=a.position,d=a.arrowPointAtCenter,p=a.follow,g=a.offset;if(o){var v=i,m=ze(function(t,e,n,r,i,o){if(void 0===i&&(i=!1),void 0===o&&(o=!1),o)return[t,e];var a=n.getBoundingClientRect(),s=a.x,c=a.y,l=a.width,u=a.height;switch(r){case"top":return i?[s+l/2,c]:[t,c];case"left":return i?[s,c+u/2]:[s,e];case"bottom":return i?[s+l/2,c+u]:[t,c+u];case"right":return i?[s+l,c+u/2]:[s+l,e];case"top-right":case"right-top":return[s+l,c];case"left-bottom":case"bottom-left":return[s,c+u];case"right-bottom":case"bottom-right":return[s+l,c+u];default:return[s,c]}}(v.clientX,v.clientY,o,h,d,p),2),y=m[0],b=m[1];n.showTip(y,b,{text:s,position:h,offset:g})}else n.hideTip()},o=function(){n.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",o),this.map.set(t,[i,o])}},e.prototype.unbind=function(t){if(this.map.has(t)){var e=ze(this.map.get(t)||[],2),n=e[0],r=e[1];n&&t.removeEventListener("mousemove",n),r&&t.removeEventListener("mouseleave",r),this.map.delete(t)}},e.prototype.clear=function(){this.container.innerHTML=""},e.prototype.destroy=function(){var e,n=this;$e([],ze(this.map.keys()),!1).forEach(function(t){return n.unbind(t)}),null===(e=this.container)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.showTip=function(t,e,n){var r=ot(n,"text");if((!r||"string"==typeof r)&&(this.applyStyles(),t&&e&&n)){var i=n.offset,o=n.position;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(t,e,i),"string"==typeof r){var a=this.container.querySelector(".".concat(Lk));a&&(a.innerHTML=r)}this.visibility="visible",this.container.style.visibility="visible"}},e.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},e.prototype.getContainer=function(){return this.container},e.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(Ck).concat(t?" ".concat(t):"")},e.prototype.initShape=function(){var t=this,e=this.style.id;this.container=Dk(e),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return t.showTip()}),this.container.addEventListener("mouseleave",function(){return t.hideTip()})},e.prototype.updatePoptipElement=function(){var t=this.container;this.clear();var e=this.style,n=e.id,r=e.template,i=e.text;this.container.setAttribute("id",n),this.container.className=this.getClassName();var o='<span class="'.concat(Nk,'"></span>');t.innerHTML=o,L(r)?t.innerHTML+=r:r&&function(t){return t instanceof Element||t instanceof Document}(r)&&t.appendChild(r),i&&(t.getElementsByClassName(Lk)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility},e.prototype.applyStyles=function(){var t=Ob({},jk,this.style.domStyles),e=Object.entries(t).reduce(function(t,e){var n=ze(e,2),r=n[0],i=n[1],o=Object.entries(i).reduce(function(t,e){var n=ze(e,2),r=n[0],i=n[1];return"".concat(t).concat(r,": ").concat(i,";")},"");return"".concat(t).concat(r,"{").concat(o,"}")},"");if(this.domStyles!==e){this.domStyles=e;var n=this.container.querySelector("style");n&&this.container.removeChild(n),(n=document.createElement("style")).innerHTML=e,this.container.appendChild(n)}},e.prototype.setOffsetPosition=function(t,e,n){void 0===n&&(n=this.style.offset);var r=ze(n,2),i=r[0],o=void 0===i?0:i,a=r[1],s=void 0===a?0:a;this.container.style.left="".concat(t+o,"px"),this.container.style.top="".concat(e+s,"px")},e.tag="poptip",e.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:jk,template:'<div class="'.concat(Lk,'"></div>')}},e}(px),Fk=kb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),zk={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};var $k=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Jg({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return je(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes,r=n.markerSize,i=n.focus,o=n.focusMarkerSize,a=t.node().getBBox(),s=a.width,c=a.height,l=e.node().getBBox(),u=l.width,f=l.height;return{markerWidth:r,labelWidth:s,valueWidth:u,focusWidth:i?null!=o?o:12:0,height:Math.max(r,c,f)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=ze(ex(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),e.prototype.setAttribute=function(e,n){t.prototype.setAttribute.call(this,e,n)},Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.focusWidth,s=i.height,c=this.actualSpace,l=c.labelWidth,u=c.valueWidth,f=ze(this.spacing,3),h=f[0],d=f[1],p=f[2];if(r){var g=r-n-h-d-a-p,v=ze(this.span,2);l=(t=ze([v[0]*g,v[1]*g],2))[0],u=t[1]}return{width:o+l+u+h+d+a+p,height:s,markerWidth:o,labelWidth:l,valueWidth:u,focusWidth:a}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes,e=t.spacing,n=t.focus;if(!e)return[0,0,0];var r=ze(ex(e),3),i=r[0],o=r[1],a=r[2];return[i,this.showValue?o:0,n?a:0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.focusWidth,o=t.width,a=t.height,s=ze(this.spacing,3),c=s[0],l=s[1];return{height:a,width:o,markerWidth:e,labelWidth:n,valueWidth:r,focusWidth:i,position:[e/2,e+c,e+n+c+l,e+n+r+c+l+s[2]+i/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(Fk.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||a||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=sx(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Fk.markerGroup,"g").style("zIndex",0),Lb(!!n,this.markerGroup,function(){var t,i=e.markerGroup.node(),o=null===(t=i.childNodes)||void 0===t?void 0:t[0],a="string"==typeof n?new kx({style:{symbol:n},className:Fk.marker.name}):n();o?a.nodeName===o.nodeName?o instanceof kx?o.update(Re(Re({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var o=Fe(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=ze(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(o,a),tx(o).styles(r)):(o.remove(),tx(a).attr("className",Fk.marker.name).styles(r),i.appendChild(a)):(a instanceof kx||tx(a).attr("className",Fk.marker.name).styles(r),i.appendChild(a)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=Qb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")})},e.prototype.renderLabel=function(t){var e=sx(this.attributes,"label"),n=e.text,r=Ie(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Fk.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Fk.label,function(){return Nb(n)}).styles(r)},e.prototype.renderValue=function(t){var e=this,n=sx(this.attributes,"value"),r=n.text,i=Ie(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Fk.valueGroup,"g").style("zIndex",0),Lb(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(Fk.value,function(){return Nb(r)}).styles(i)})},e.prototype.createPoptip=function(){var t=Ie(this.attributes.poptip||{},["render"]),e=new Bk({style:Ob(zk,t)});return this.poptipGroup=e,e},e.prototype.bindPoptip=function(t){var e=this,n=this.attributes.poptip;n&&(this.poptipGroup||this.createPoptip()).bind(t,function(){var t=e.attributes,r=t.labelText,i=t.valueText,o=t.markerFill,a="string"==typeof r?r:null==r?void 0:r.attr("text"),s="string"==typeof i?i:null==i?void 0:i.attr("text");if("function"==typeof n.render)return{html:n.render({label:a,value:s,color:o})};var c="";return"string"!=typeof a&&"number"!=typeof a||(c+='<div class="component-poptip-label">'.concat(a,"</div>")),"string"!=typeof s&&"number"!=typeof s||(c+='<div class="component-poptip-value">'.concat(s,"</div>")),{html:c}})},e.prototype.renderFocus=function(t){var e=this,n=this.attributes,r=n.focus,i={x:0,y:0,size:n.focusMarkerSize,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};q(r)||(this.focusGroup=t.maybeAppendByClassName(Fk.focusGroup,"g").style("zIndex",0),Lb(r,this.focusGroup,function(){var n=new kx({style:Re(Re({},i),{symbol:"focus"})}),r=new Jg({style:{r:i.size/2,fill:"transparent"}}),o=e.focusGroup.node();o.appendChild(r),o.appendChild(n),n.update({opacity:0}),t.node().addEventListener("pointerenter",function(){n.update({opacity:1})}),t.node().addEventListener("pointerleave",function(){n.update({opacity:0})})}))},e.prototype.renderPoptip=function(t){var e=this;this.attributes.poptip&&[t.maybeAppendByClassName(Fk.value,"g").node(),t.maybeAppendByClassName(Fk.label,"g").node()].forEach(function(t){t&&e.bindPoptip(t)})},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=sx(this.attributes,"background");this.background=t.maybeAppendByClassName(Fk.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Fk.background,"rect").styles(Re({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=ze(t.position,4),o=i[0],a=i[1],s=i[2],c=i[3],l=r/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(l,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(a,", ").concat(l,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(c,", ").concat(l,")")}),Pb(this.labelGroup.select(Fk.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(l,")")}),Pb(this.valueGroup.select(Fk.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=tx(e),r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o;n.styles({transform:"translate(".concat(i,", ").concat(a,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.renderPoptip(n),this.renderFocus(n),this.adjustLayout()},e}(px),Wk=kb({page:"item-page",navigator:"navigator",item:"item"},"items"),Gk=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Hk=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:ut,mouseenter:ut,mouseleave:ut})||this;return n.navigatorShape=[0,0],n}return je(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=t.poptip,i=t.focus,o=t.focusMarkerSize,a=sx(this.attributes,"item"),s=e.map(function(t,s){var c=t.id,l=void 0===c?s:c,u=t.label,f=t.value;return{id:"".concat(l),index:s,style:Re({layout:n,labelText:u,valueText:f,poptip:r,focus:i,focusMarkerSize:o},Object.fromEntries(Object.entries(a).map(function(n){var r=ze(n,2);return[r[0],mb(r[1],[t,s,e])]})))}});return s},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=ze(this.navigatorShape,1)[0],s=ze(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map(function(e,s){var h,d,p=Math.floor(s/u),g=s%u,v=t.ifHorizontal(l,c),m=[Math.floor(g/v),g%v];"vertical"===n&&m.reverse();var y=ze(m,2),b=y[0],x=y[1],w=(r-a-(l-1)*o)/l,k=e.getBBox().height,M=ze([0,0],2),O=M[0],E=M[1];return"horizontal"===n?(O=(h=ze([f,b*(k+i)],2))[0],E=h[1],f=x===l-1?0:f+w+o):(O=(d=ze([x*(w+o),f],2))[0],E=d[1],f=b===c-1?0:f+k+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:k,x:O,y:E}})},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=ze(this.navigatorShape,1)[0],a=ze(this.grid,2),s=a[0],c=a[1],l=ze([e-o,n],2),u=l[0],f=l[1],h=ze([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],v=h[3],m=h[4],y=h[5],b=h[6],x=h[7];return this.pageViews.children.map(function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,k=h.height,M=0===b?0:i,O=b+M+w;return O<=u&&Gk(m,function(t){return t<c})?(n=ze([b+M,x,O],3),d=n[0],p=n[1],b=n[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(o=ze([y+1,0,0,x+k+r],4),y=o[0],m=o[1],b=o[2],(x=o[3])+k<=f&&Gk(y,function(t){return t<s})?(a=ze([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(l=ze([0,0,w,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],v=l[5],y=l[6],m=l[7],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}))})},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Pk(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Wk.item.class).forEach(function(e){t.appendChild(e)}),t.querySelectorAll(Wk.page.class).forEach(function(e){t.removeChild(e).destroy()})},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);tx(t).selectAll(Wk.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){var e=t.style;return new $k({style:e})}).attr("className",Wk.item.name).on("click",function(){null==n||n(this),o("itemClick",{item:this})}).on("pointerenter",function(){null==r||r(this),o("itemMouseenter",{item:this})}).on("pointerleave",function(){null==i||i(this),o("itemMouseleave",{item:this})})},function(t){return t.each(function(t){var e=t.style;this.update(e)})},function(t){return t.remove()})},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=ze(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce(function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t},{}))).map(function(t){var e=ze(t,2);return{page:e[0],layouts:e[1]}}),i=$e([],ze(this.navigator.getContainer().children),!1);r.forEach(function(t){var e=t.layouts,r=n.pageViews.appendChild(new rv({className:Wk.page.name}));e.forEach(function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,c=i[o];r.appendChild(c),at(c,"__layout__",t),c.update({x:e,y:n,width:a,height:s})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=sx(this.attributes,"nav"),r=Ob({orientation:e},n),i=this;return t.selectAll(Wk.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new Ak({style:r})}).attr("className",Wk.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(tx(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Jp(t,{detail:e});this.dispatchEvent(n)},e}(px),Yk=kb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),qk={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Vk=function(t){function e(e){return t.call(this,e,qk)||this}return je(e,t),e.prototype.render=function(t,e){var n=tx(e).maybeAppendByClassName(Yk.markerGroup,"g");this.renderMarker(n);var r=tx(e).maybeAppendByClassName(Yk.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?Pk(r,"horizontalHandle","verticalHandle"):i;Lb(!!o,t,function(t){var n=sx(e.attributes,"marker"),r=Re({symbol:o},n);e.marker=t.maybeAppendByClassName(Yk.marker,function(){return new kx({style:r})}).update(r)})},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;Lb(r,t,function(t){var n,r=sx(e.attributes,"label"),o=r.text,c=Ie(r,["text"]),l=(null===(n=t.select(Yk.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=ze(Pk(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],v=d[2],m=d[3];t.maybeAppendByClassName(Yk.label,"text").styles(Re(Re({},c),{x:p,y:g,text:s(o).toString(),textAlign:v,textBaseline:m}))})},e}(px),Uk={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Xk=Ob({},Uk,{}),Kk=Ob({},Uk,cx(qk,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),Zk=kb({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),Qk=function(t){function e(e){return t.call(this,e,Xk)||this}return je(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=ze(lx(sx(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Zk.titleGroup,"g").styles(c);var l=Re(Re({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Zk.title,function(){return new Sk({style:l})}).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=ze(lx(sx(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=Re(Re({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Zk.itemsGroup,"g").styles(Re(Re({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Zk.items.class).data(["items"]).join(function(t){return t.append(function(){return new Hk({style:l})}).attr("className",Zk.items.name).each(function(){u.items=tx(this)})},function(t){return t.update(l)},function(t){return t.remove()})},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new vb(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),c=e.getBBox(),l=hx(r),u=ze(ex(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ze(ex(o),4),v=g[0],m=g[1],y=g[2],b=g[3],x=ze([p+h,f+d],2),w=x[0],k=x[1],M=ze([b+m,v+y],2),O=M[0],E=M[1];if("l"===l[0])return new vb(s.x,s.y,c.width+s.width+w+O,Math.max(c.height+E,s.height));if("t"===l[0])return new vb(s.x,s.y,Math.max(c.width+O,s.width),c.height+s.height+k+E);var S=ze([e.attributes.width||c.width,e.attributes.height||c.height],2),_=S[0],A=S[1];return new vb(c.x,c.y,_+s.width+w+O,A+s.height+k+E)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,o=n.x,a=void 0===o?0:o,s=n.y,c=void 0===s?0:s,l=tx(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(px),Jk={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},tM=kb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),eM=function(t){function e(e){var n=t.call(this,e,Jk)||this;return n.point=[0,0],n.group=n.appendChild(new rv({})),n.isMutationObserved=!0,n}return je(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=ze(ex(t.padding),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new vb(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=sx(this.attributes,"background");this.background=tx(this.group).maybeAppendByClassName(tM.background,"path").styles(Re(Re({},h),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=ze(lx(sx(this.attributes,"label")),2),i=r[0],o=r[1],a=Ie(i,["text"]);(this.label=tx(this.group).maybeAppendByClassName(tM.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(tM.label,function(){return Nb(e(n))}).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=ze(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,o=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(o-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,o=e.width,a=e.height,s=[["M",r+n,i],["L",r+o-n,i],["A",n,n,0,0,1,r+o,i+n],["L",r+o,i+a-n],["A",n,n,0,0,1,r+o-n,i+a],["L",r+n,i+a],["A",n,n,0,0,1,r,i+a-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,$e([c+1,1],ze(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=rx.apply(void 0,$e([],ze(t),!1)),r=ze(t,2),i=ze(r[0],2),o=i[0],a=i[1],s=ze(r[1],2),c=s[0],l=s[1],u=ze(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=ze(u[1],2),d=h[0],p=h[1],g=f/2,v=e*(f/Math.abs(f)),m=v/2,y=v*Math.sqrt(3)/2*.8,b=ze([d,d+g-m,d+g,d+g+m,p],5),x=b[0],w=b[1],k=b[2],M=b[3],O=b[4];return n?(this.point=[k,a-y],[["L",x,a],["L",w,a],["L",k,a-y],["L",M,a],["L",O,a]]):(this.point=[o+y,k],[["L",o,x],["L",o,w],["L",o+y,k],["L",o,M],["L",o,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?lb(this):cb(this)},e.prototype.bindEvents=function(){this.label.on(cg.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(px);function nM(t,e){var n=ze(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var rM=kb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function iM(t){var e=t.orientation,n=t.size,r=t.length;return Pk(e,[r,n],[n,r])}function oM(t){var e=t.type,n=ze(iM(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function aM(t){return oM(t)}function sM(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(y(r)){e=new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))})}else e=r;var a=e.length,s=e.map(function(t){return _h(t).toString()});return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce(function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")},"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce(function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)},"l(".concat(Pk(n,"0","270"),")")):""}function cM(t){var e=t.orientation,n=t.range;if(!n)return[];var r=ze(iM(t),2),i=r[0],o=r[1],a=ze(n,2),s=a[0],c=a[1],l=Pk(e,s*i,0),u=Pk(e,0,s*o),f=Pk(e,c*i,i),h=Pk(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var lM=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return je(e,t),e.prototype.render=function(t,e){!function(t,e){var n=sx(e,"track");t.maybeAppendByClassName(rM.track,"path").styles(Re({d:oM(e)},n))}(tx(e).maybeAppendByClassName(rM.trackGroup,"g"),t),function(t,e){var n=sx(e,"selection"),r=sM(e),i=t.maybeAppendByClassName(rM.selection,"path").styles(Re({d:aM(e),fill:r},n)),o=i.maybeAppendByClassName(rM.clipPath,"path").styles({d:cM(e)}).node();i.style("clipPath",o)}(tx(e).maybeAppendByClassName(rM.selectionGroup,"g"),t)},e}(px);var uM=function(t){function e(e){var n=t.call(this,e,Kk)||this;return n.eventToOffsetScale=new Jx({}),n.innerRibbonScale=new Jx({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=nM(r.map(function(t){return t.value}),o).range,s=n.getRealSelection(a);n.showIndicator((a[0]+a[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(o,a)}else{var c=n.getTickValue(o);n.showIndicator(c,"".concat(n.getRealValue(c))),n.dispatchIndicated(c)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=ze(n.selection,2),i=r[0],o=r[1],a=n.getTickValue(n.getValueByCanvasPoint(t)),s=a-n.prevValue;"start"===e?i!==a&&n.updateSelection(a,o):"end"===e?o!==a&&n.updateSelection(i,a):"ribbon"===e&&0!==s&&(n.prevValue=a,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="pointer",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return je(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new vb(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(tx(e));var i=this.availableSpace,o=i.x,a=i.y,s=tx(e).maybeAppendByClassName(Zk.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});Lb(!!r,s.maybeAppendByClassName(Zk.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)});var c=s.maybeAppendByClassName(Zk.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Zk.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,$e([],ze(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,$e([],ze(t.map(function(t){return t.value})),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=ze(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=ze(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Pk(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=sx(this.attributes,"title"),s=Re(Re({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Zk.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new Sk({style:s})}).attr("className",Zk.title.name).each(function(){c.title=this})},function(t){return t.update(s)},function(t){return t.each(function(){c.title=void 0}).remove()})},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new vb(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new vb(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Ew.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new vb(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=ze(this.ifHorizontal([o,i],[i,o]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,v=0,m=this.labelPosition;v=n||(["bottom","right"].includes(m)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var y=Math.max(p,c),b=f-y,x=ze(this.ifHorizontal([b,v],[v,b]),2),w=x[0],k=x[1],M=["top","left"].includes(m)?s:0,O=ze(this.ifHorizontal([y/2,M],[M,y/2]),2),E=O[0],S=O[1];return new vb(E,S,w,k)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=sx(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,g=p.length,v=p.size,m=Ob({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:v,type:r,orientation:i,color:o,block:a,partition:n.map(function(t){return(t.value-l)/(u-l)}),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(Zk.ribbon,function(){return new lM({style:m})}).update(m)},e.prototype.getHandleClassName=function(t){return"".concat(Zk.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=sx(this.attributes,"handle"),i=ze(this.selection,2),o=i[0],a=i[1],s=Re(Re({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Vk:ww,u=this;this.handlesGroup.selectAll(Zk.handle.class).data(e?[{value:o,type:"start"},{value:a,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new l({style:s})}).attr("className",function(t){var e=t.type;return"".concat(Zk.handle," ").concat(u.getHandleClassName(e))}).each(function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))})},function(t){return t.update(s).each(function(t){var e=t.value;this.update({labelText:e})})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0}).remove()})},e.prototype.adjustHandles=function(){var t=ze(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new vb(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=ze([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new vb(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=ze(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),c=ze(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(l,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=sx(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Zk.indicator,function(){return new eM({})}).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce(function(e,n,r,i){var o,a,s=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:r.toString();if(e.push(Re(Re({},n),{id:s,index:r,type:"value",label:null!==(a=null==n?void 0:n.label)&&void 0!==a?a:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var c=i[r+1],l=ze([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(Re(Re({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(h)}))}return e},[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=ze(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,o=e.labelFormatter,a=sx(this.attributes,"tick"),s=sx(this.attributes,"label"),c=s.align,l=Ob(Re({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),cx(a,"tick"),cx(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===c&&(!i||i(t,t.index,n.filter(function(t){return t.type===c})))},labelFormatter:o},f=Re(Re(Re({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Zk.label,function(){return new Mk({style:f})}).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,o=this.ribbonShape.size,a=this.labelPosition,s=this.labelFixedSpacing,c=ze([0,0,0],3),l=c[0],u=c[1],f=c[2],h=null!=i?i:o;return e?(f=h,u=s,"positive"===n?"right"===a?(l=h,f=h):"bottom"===a&&(l=f):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n?"right"===a?u=h:"bottom"===a&&(l=o+s,u=r):"negative"===n&&("left"===a||"top"===a)&&(u=r),{offset:l,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=ze(this.ifHorizontal([[e,n+a],[e+r,n+a]],[[e+a,n+i],[e+a,n]]),2),u=l[0],f=l[1];this.label.update({startPos:u,endPos:f,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,o=this.ribbonBBox,a=o.x,s=o.y,c=R(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+a,s],[a,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),cb(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){lb(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=ze(this.selection,2),o=i[0],a=i[1],s=ze([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=ze(function(t,e,n){var r,i=ze(t,2),o=i[0],a=i[1],s=ze(e,2),c=s[0],l=s[1],u=ze(n,2),f=u[0],h=u[1],d=ze([c,l],2),p=d[0],g=d[1],v=g-p;return p>g&&(p=(r=ze([g,p],2))[0],g=r[1]),v>a-o?[o,a]:p<o?f===o&&h===g?[o,g]:[o,v+o]:g>a?h===a&&f===p?[p,a]:[a-v,a]:[p,g]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return q(e)?qb(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?nM(n.map(function(t){return t.value}),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=ze(this.ribbon.node().getPosition(),2),o=i[0],a=i[1],s=this.ifHorizontal(o,a),c=this.ifHorizontal.apply(this,$e([],ze(Cb(t)),!1))-s;return R(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=ze(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Jp("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal(function(){return{value:t,range:e}},function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}}),o=new Jp("indicate",{detail:i});this.dispatchEvent(o)},e}(px);function fM(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var hM={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function dM(t){var e;void 0===t&&(t="");var n=fM(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=Re({flex:1},hM),e[".".concat(n.VALUE)]=Re({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},hM),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var pM=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=fM(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:dM(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return je(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map(function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=Ie(t,["name","color","index"]),l=Re({name:i,color:a,index:null!=s?s:e},c);return Tn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]}):t}(n.item,l))})},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=Tn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:fx(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=fM(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,fx(f,u);var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach(function(e){var n=ze(e,2),r=n[0],i=n[1];$e([t],ze(t.querySelectorAll(r)),!1).filter(function(t){return t.matches(r)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(i).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,c=a.height,l=[-s/2,-c/2];return i.forEach(function(t){var e=ze(l,2),n=e[0],i=e[1],a=ze(o[t],2),u=a[0],f=a[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]}),l},e.prototype.setOffsetPosition=function(t){var e=ze(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+a+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=ze(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,u=l.offsetWidth,f=l.offsetHeight,h=ze([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,m=s.y,y={left:d<v,right:d+u>v+s.width,top:p<m,bottom:p+f>m+s.height},b=[];c.split("-").forEach(function(t){y[t]?b.push(g[t]):b.push(t)});var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height;return new vb(r,i,o,a).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout(function(){e.element.style.transition=n},10)},e.tag="tooltip",e}(px),gM=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[cg.BOUNDS_CHANGED,cg.INSERTED,cg.REMOVED],n.$margin=ex(0),n.$padding=ex(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return je(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=ex(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=ex(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=ze(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new vb(n-f,i-c,o+f+l,a+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=ze(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=ze(this.$margin,4),l=c[0],u=c[3];return new vb(s+u,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:Db,grid:Bb},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map(function(t){return t.getBBox()}),this.attributes);this.children.forEach(function(t,e){var n=r[e],i=n.x,o=n.y;t.style.transform="translate(".concat(i,", ").concat(o,")")})}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach(function(e){t.addEventListener(e,function(e){e.target&&(e.target.isMutationObserved=!0,t.layout())})})},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(rv);function vM(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}const mM=Zm(t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:o,labelTransform:a,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:h,background:d,connector:p,startMarker:g,endMarker:v,coordCenter:m,innerHTML:y}=e,b=Ie(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${c}, ${l})`,[c,l,u,f].some(t=>!I(t)))return void t.children.forEach(t=>t.remove());const x=ia(b,"background"),{padding:w}=x,k=Ie(x,["padding"]),M=ia(b,"connector"),{points:O=[]}=M,E=Ie(M,["points"]);let S;S=y?Cm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",y).call(Rm,Object.assign({transform:a,transformOrigin:s},b)).node():Cm(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(Rm,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=Cm(t).maybeAppend("background","rect").style("zIndex",-1).call(Rm,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[h,d]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*h+o+r,height:2*d+n+i}}(S,w)).call(Rm,d?k:{}).node(),A=function(t,e,n,r,i=!0,o=!0){const a=t=>Ac()(t);if(!e[0]&&!e[1])return a([vM(t),e]);if(!n.length)return a([[0,0],e]);const[s,c]=n,l=[...c],u=[...s];if(c[0]!==s[0]){const t=i?-4:4;l[1]=c[1],o&&!i&&(l[0]=Math.max(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),o||i||(l[0]=Math.max(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),!o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t))),o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t)))}return a([c,l,u,s,e])}(_,[+u-+c,+f-+l],O,0,+u<m[0],+f<m[1]),T=g&&new kx({id:"startMarker",style:Object.assign({x:0,y:0},ia(b,"startMarker"))}),P=v&&new kx({id:"endMarker",style:Object.assign({x:0,y:0},ia(b,"endMarker"))});Cm(t).maybeAppend("connector","path").style("zIndex",0).style("d",A).style("markerStart",T).style("markerEnd",P).call(Rm,p?E:{})}),yM=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s},[[f,h]]=e;return Cm(new mM).style("x",f).style("y",h).call(Rm,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Rm,u).call(Rm,t).node()}};yM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bM=Zm(t=>{const e=Ie(t.attributes,["class","x","y","transform"]),n=ia(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),o=Cm(t).maybeAppend("marker",()=>new kx({})).call(t=>t.node().update(Object.assign({symbol:i},n))).node(),[a,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(o);Cm(t).maybeAppend("text","text").style("x",a).style("y",s).call(Rm,e)}),xM=(t,e)=>{const n=Ie(t,[]);return(t,e,r)=>{const{color:i}=r,o=Ie(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return Cm(new bM).call(Rm,o).style("transform",`translate(${l},${u})`).call(Rm,c).call(Rm,n).node()}};xM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wM=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,h]]=e;return Cm(new mv).style("x",f).style("y",h).call(Rm,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(Rm,u).call(Rm,t).node()}};wM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kM=Zm(t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;Cm(t).maybeAppend("connect-path",()=>o.createElement("path",{})).style("d",n).call(Rm,i),Cm(t).maybeAppend("area-path",()=>o.createElement("path",{})).style("d",e).call(Rm,r)}),MM=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,a=Ie(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,g=rl(s),v=$m(s,e),m=r&&h?Dm(h,d,p,r,void 0,g):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:m,fill:m}),v&&{transform:v}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some(t=>!e(t)))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=ia(y,"connect"),k=!!x.length,M=t=>Cm(c.createElement("path",{})).style("d",t||"").call(Rm,y).node();if(il(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=Tc().curve(Pc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Lc(n())},delete t.lineX0,t.lineEndAngle=function(){return Lc(r())},delete t.lineX1,t.lineInnerRadius=function(){return Lc(i())},delete t.lineY0,t.lineOuterRadius=function(){return Lc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Nc(t)):e()._curve},t}().angle((t,n)=>Is(Ns(r[n],e))).outerRadius((t,n)=>js(r[n],e)).innerRadius((t,n)=>js(o[n],e)).defined((t,e)=>[...r[e],...o[e]].every(i)).curve(n)(o)};return!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):Cm(new kM).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?Tc().y((t,n)=>e[n][1]).x1((t,n)=>e[n][0]).x0((t,e)=>r[e][0]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e):Tc().x((t,n)=>e[n][0]).y1((t,n)=>e[n][1]).y0((t,e)=>r[e][1]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e)};return!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):Cm(new kM).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};MM.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const OM=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=il(n)?Gc:Ec;return MM(Object.assign({curve:i},t),e)(...r)}};OM.props=Object.assign(Object.assign({},MM.props),{defaultMarker:"square"});const EM=(t,e)=>{const n=Ie(t,[]),{coordinate:r}=e;return(...t)=>{const i=il(r)?$c:rl(r)?Qc:Zc;return MM(Object.assign({curve:i},n),e)(...t)}};EM.props=Object.assign(Object.assign({},MM.props),{defaultMarker:"smooth"});const SM=(t,e)=>(...n)=>MM(Object.assign({curve:tl},t),e)(...n);SM.props=Object.assign(Object.assign({},MM.props),{defaultMarker:"hvh"});const _M=(t,e)=>(...n)=>MM(Object.assign({curve:el},t),e)(...n);_M.props=Object.assign(Object.assign({},MM.props),{defaultMarker:"vh"});const AM=(t,e)=>(...n)=>MM(Object.assign({curve:nl},t),e)(...n);AM.props=Object.assign(Object.assign({},MM.props),{defaultMarker:"hv"});const TM=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>ab(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};TM.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const PM=(t,e)=>{const n=Ie(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Ie(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=pc();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),Cm(r.createElement("path",{})).call(Rm,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Rm,n).node()}};function CM(t,e,n,r){const i=pc();if(il(n)){const o=n.getCenter(),a=js(t,o),s=(js(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Im(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return rl(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}PM.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const NM=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Ie(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Ie(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=CM(f,h,i,n);return Cm(o.createElement("path",{})).call(Rm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Rm,r).node()}};NM.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const LM=(t,e)=>{const n=Ie(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=pc();if(h.moveTo(u[0],u[1]),il(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Im(h,u,f,Fs(u,f),js(u,f)/2)}return Cm(i.createElement("path",{})).call(Rm,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(Rm,n).node()}};function jM(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function RM(t={}){return[...jM(t),{name:"title",scale:"identity"}]}function IM(){return[{type:Ca,channel:"color"},{type:Ha,channel:["x","y"]}]}function DM(){return[{type:Ca,channel:"x"},{type:Ha,channel:["y"]}]}function BM(t={}){return jM(t)}function FM(){return[{type:Ia}]}function zM(t,e){return t.getBandWidth(t.invert(e))}function $M(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,h=!!(null==a?void 0:a.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?zM(a,r[e]):0,l=d?zM(s,i[e]):0,g=p&&o?(zM(c,o[e])/2+ +o[e])*n:0,[v,m]=t;return[v+u*n+g,m+f*l]}:t=>t}function WM(t){return parseFloat(t)/100}function GM(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions(),c=Array.from(t,t=>{const e=i[t],n=o[t];return[["string"==typeof e?WM(e)*a:+e,"string"==typeof n?WM(n)*s:+n]]});return[t,c]}function HM(t){return"function"==typeof t?t:e=>e[t]}function YM(t,e){return Array.from(t,HM(e))}function qM(t,e){const n=function(t){return Array.isArray(t)?{links:t}:t&&"object"==typeof t?{links:t.links||[],nodes:t.nodes}:{links:[]}}(t),{source:r=t=>t.source,target:i=t=>t.target,value:o=t=>t.value}=e,{links:a,nodes:s}=n;if(!a.length)return{links:[],nodes:s||[]};const c=YM(a,r),l=YM(a,i),u=YM(a,o);return{links:a.map((t,e)=>({target:l[e],source:c[e],value:u[e]})),nodes:s||Array.from(new Set([...c,...l]),t=>({key:t}))}}LM.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const VM=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,g]]=e,[v,m]=n.getSize();h="string"==typeof h?WM(h)*v:h,d="string"==typeof d?WM(d)*m:d;const y=p-Number(h)/2,b=g-Number(d)/2;return Cm(r.createElement("image",{})).call(Rm,s).style("x",y).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(Rm,t).style("width",h).style("height",d).node()}};function UM(t,e){const n=pc();if(il(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map(t=>js(t,r));return i.forEach((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?Im(n,s,e,r,a):n.lineTo(e[0],e[1])}),n.closePath(),n}return function(t,e){return e.forEach((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])),t.closePath(),t}(n,t)}VM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const XM=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,transform:l}=i,u=UM(e,n);return Cm(r.createElement("path",{})).call(Rm,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Rm,t).node()}};function KM(t,e){const[n,r,i,o]=t,a=pc();if(il(e)){const t=e.getCenter(),s=js(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Im(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Im(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}XM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ZM=(t,e)=>{const n=Ie(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Ie(o,["color"]),{color:c=a,transform:l}=e,u=KM(t,r);return Cm(i.createElement("path",{})).call(Rm,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Rm,n).node()}};function QM(t,e){const n=pc();if(il(e)){const r=e.getCenter(),[i,o]=r,a=Rs(Ns(t[0],r)),s=Rs(Ns(t[1],r)),c=js(r,t[2]),l=js(r,t[3]),u=js(r,t[8]),f=js(r,t[10]),h=js(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,h,a,s),n.arc(i,o,h,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}ZM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const JM=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=Ie(o,["color","fill","stroke"]),h=QM(e,n);return Cm(r.createElement("path",{})).call(Rm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Rm,t).node()}};function tO(t,e,n=4){const r=pc();if(!il(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=js(i,t[3]),c=js(i,t[8]),l=js(i,t[10]),u=Rs(Ns(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.arc(o,a,s,h,d),r.lineTo(Math.cos(d)*l+o,Math.sin(d)*l+a),r.arc(o,a,l,d,h,!0),r.lineTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/2;return r.moveTo(Math.cos(p)*(c+n/2)+o,Math.sin(p)*(c+n/2)+a),r.arc(Math.cos(p)*c+o,Math.sin(p)*c+a,n/2,p,2*Math.PI+p),r.closePath(),r}JM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=Ie(o,["color","fill","stroke"]),h=tO(e,n,4);return Cm(r.createElement("path",{})).call(Rm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Rm,t).node()}};eO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nO=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Ie(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Ie(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(a,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},ia(i,"arrow"))):null,p=function(t,e){if(!il(e))return Ac().x(t=>t[0]).y(t=>t[1])(t);const n=e.getCenter();return kc()({startAngle:0,endAngle:2*Math.PI,outerRadius:js(t[0],n),innerRadius:js(t[1],n)})}(t,o),g=function(t,e){if(!il(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return Cm(a.createElement("path",{})).call(Rm,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(Rm,i).node()}};function rO(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}nO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iO=(t,e)=>{const{offsetX:n=0,sourceOffsetX:r=n,targetOffsetX:i=n,offsetY:o=0,sourceOffsetY:a=o,targetOffsetY:s=o,connectLength1:c,endMarker:l=!0}=t,u=Ie(t,["offsetX","sourceOffsetX","targetOffsetX","offsetY","sourceOffsetY","targetOffsetY","connectLength1","endMarker"]),{coordinate:f}=e;return(t,e,n)=>{const{color:o,connectLength1:h}=n,d=Ie(n,["color","connectLength1"]),{color:p,transform:g}=e,v=function(t,e,n,r,i,o,a=0){const[[s,c],[l,u]]=e;if(rl(t)){const t=s+n,e=t+a,f=c+i,h=u+o;return[[t,f],[e,f],[e,h],[l+r,h]]}const f=c-n,h=f-a,d=s-i,p=l-o;return[[d,f],[d,h],[p,h],[p,u-r]]}(f,t,a,s,r,i,null!=c?c:h),m=ia(Object.assign(Object.assign({},u),n),"endMarker");return Cm(new uv).call(Rm,d).style("d",function(t){return Ac().x(t=>t[0]).y(t=>t[1])(t)}(v)).style("stroke",p||o).style("transform",g).style("markerEnd",l?new kx({className:"marker",style:Object.assign(Object.assign({},m),{symbol:rO})}):null).call(Rm,u).node()}};function oO(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=sa(n.x,l),s=sa(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function aO(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Fm(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=cO(p,a,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?sO(c,p,i):Fs(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function sO(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function cO(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function lO(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Fm(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:cO(p,a,s)},{innerRadius:v,outerRadius:m}=u,y=v+(m-v)*c+l,[b,x]=sO(d,p,y);return Object.assign({x:b,y:x},g)}function uO(t){return void 0===t?null:t}function fO(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:uO(o[0]),y:uO(o[1])}}function hO(t,e,n,r){const{bounds:i}=n;if(1===i.length)return fO(0,0,n);return(ol(r)?aO:ll(r)?lO:oO)(t,e,n,r)}function dO(t,e,n){const r=Fm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function pO(t,e,n){const r=Fm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function gO(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:c=a,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),h=pO(e,n,r),d=Math.sin(h)>0?1:-1,p=cO(h,i,o),g={textAlign:d>0||ol(r)?"start":"end",textBaseline:"middle",rotate:p},v=dO(e,n,r),m=v+(s?c:a),[[y,b],[x,w],[k,M]]=function(t,e,n,r,i){const[o,a]=sO(t,e,n),[s,c]=sO(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,v,m,s?l:0),O=s?+u*d:0,E=k+O,S={connector:s,connectorPoints:[[x-E,w-M],[k-E,M-M]]};return Object.assign(Object.assign({x0:y,y0:b,x:k+O,y:M},g),S)}function vO(t,e={}){const{labelHeight:n=14,height:r}=e,i=cr(t,t=>t.y),o=i.length,a=new Array(o);for(let t=0;t<o;t++){const e=i[t],{y:r}=e;a[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=a.length-1;t>0;t--){const e=a[t],n=a[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),a.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let c=0;for(const t of a){const{y:e,labels:r}=t;let o=e-n;for(const t of r){const e=i[c++],r=o+n-t;e.connectorPoints[0][1]-=r,e.y=o+n,o+=n}}}function mO(t,e){const n=cr(t,t=>t.y),{height:r,labelHeight:i=14}=e,o=Math.ceil(r/i);if(n.length<=o)return vO(n,e);const a=[];for(let t=0;t<n.length;t++)t<n.length-o?(n[t].opacity=0,n[t].connector=!1):a.push(n[t]);vO(a,e)}iO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yO=new WeakMap;var bO=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=wr(o,(t,e)=>Math.abs(t[1]-a[e][1]));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=Rs(Ns(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:hO,bottomLeft:hO,bottomRight:hO,inside:hO,left:hO,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?fO(0,0,n):(ol(r)?aO:ll(r)?gO:oO)(t,e,n,r)},right:hO,spider:function(t,e,n,r,i,o){if(!ll(r))return{};if(yO.has(e))return yO.get(e);const a=o.map(t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:o}=e,a=Ie(gO(0,t,e,n),[]),s=n.getCenter(),c=dO(t,e,n),l=pO(t,e,n),u=c+r+i,f=Math.sin(l)>0?1:-1,h=s[0]+(u+ +o)*f,{x:d}=a,p=h-d;return a.x+=p,a.connectorPoints[0][0]-=p,a}(t,n,r)),{width:s,height:c}=r.getOptions(),l=a.filter(t=>t.x<s/2),u=a.filter(t=>t.x>=s/2),f=Object.assign(Object.assign({},i),{height:c});return mO(l,f),mO(u,f),a.forEach((t,e)=>yO.set(o[e],t)),yO.get(e)},surround:function(t,e,n,r){if(!ll(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Ie(gO(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(ll(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find(t=>"polar"===t[0]);if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=Is([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,v]=sO(u,d,h);return s.x=g+(o+a)*p,s.y=v,s},top:hO,topLeft:hO,topRight:hO});function xO(t,e,n,r,i,o){const{position:a}=e,{render:s}=i,c=function(t,e){return void 0!==t?t:ll(e)?"inside":rl(e)?"right":"top"}(a,n),l=r[s?"htmlLabel":"inside"===c?"innerLabel":"label"],u=Object.assign({},l,e),f=bO[Ry(c)];if(!f)throw new Error(`Unknown position: ${c}`);return Object.assign(Object.assign({},l),f(c,t,u,n,i,o))}const wO=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o,a,s)=>{const{text:c,x:l,y:u,transform:f="",transformOrigin:h,className:d=""}=o,p=Ie(o,["text","x","y","transform","transformOrigin","className"]),g=xO(e,o,n,r,t,s),{rotate:v=0,transform:m=""}=g,y=Ie(g,["rotate","transform"]);return Cm(new mM).call(Rm,y).style("text",`${c}`).style("className",`${d} g2-label`).style("innerHTML",i?i(c,o.datum,o.index):void 0).style("labelTransform",`${m} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",h).style("coordCenter",n.getCenter()).call(Rm,p).node()}};wO.props={defaultMarker:"point"};const kO=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Ie(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Ie(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return Cm(a.createElement("path",{})).call(Rm,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(Rm,i).node()}};kO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const MO=(t,e)=>kO(Object.assign({colorAttribute:"fill"},t),e);MO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const OO=(t,e)=>kO(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);OO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const EO=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Ie(i,["color"]),{color:c=a}=r,[l,...u]=e,f=pc();return f.moveTo(...l),u.forEach(([t,e])=>{f.lineTo(t,e)}),f.closePath(),Cm(n.createElement("path",{})).call(Rm,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Rm,t).node()}};function SO(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function _O(t,e=(...t)=>`${t[0]}`,n=16){const r=SO(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}function AO(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}EO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},SO(3);const TO=_O((t,e,n)=>{const r=AO(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r},t=>`${t}`);function PO(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=AO(a,t,e).getContext("2d"),l=function(t,e){const n=AO(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map(t=>{const[e,n]=t.split(":");return[+e,n]}):t}(t).forEach(([t,e])=>{r.addColorStop(t,e)}),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);c.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),h=i-u,d=c-u,p=TO(u,1-a,o),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,h,d)}}(c,n,r,i,s,a);const u=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),h=f.data,d=h.length;for(let t=3;t<d;t+=4){const e=h[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));h[t-3]=r[n],h[t-2]=r[n+1],h[t-1]=r[n+2],h[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=AO(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const CO=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Ie(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,g]=l.getSize(),v=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),m=kr(t,t=>t[2]),y=xr(t,t=>t[2]),b=p&&g?PO(p,g,m,y,v,function(t,e){return Object.keys(t).reduce((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n},{})}({gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},t=>void 0===t),u):{canvas:null};return Cm(f.createElement("image",{})).call(Rm,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas.toDataURL()).style("transform",d).call(Rm,c).node()}};CO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const NO=(t,e)=>{const{render:n}=t,r=Ie(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};NO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};function LO(t,e,n){return t+(e-t)*n}function jO(t,e,n,r){return 0===e?[[t+.5*n/Math.PI/2,r/2],[t+.5*n/Math.PI,r],[t+n/4,r]]:1===e?[[t+.5*n/Math.PI/2*(Math.PI-2),r],[t+.5*n/Math.PI/2*(Math.PI-1),r/2],[t+n/4,0]]:2===e?[[t+.5*n/Math.PI/2,-r/2],[t+.5*n/Math.PI,-r],[t+n/4,-r]]:[[t+.5*n/Math.PI/2*(Math.PI-2),-r],[t+.5*n/Math.PI/2*(Math.PI-1),-r/2],[t+n/4,0]]}function RO(t,e,n,r,i,o,a){const s=4*Math.ceil(2*t/n*4),c=[];let l=r;for(;l<2*-Math.PI;)l+=2*Math.PI;for(;l>0;)l-=2*Math.PI;l=l/Math.PI/2*n;const u=o-t+l-2*t;c.push(["M",u,e]);let f=0;for(let t=0;t<s;++t){const r=jO(t*n/4,t%4,n,i);c.push(["C",r[0][0]+u,-r[0][1]+e,r[1][0]+u,-r[1][1]+e,r[2][0]+u,-r[2][1]+e]),t===s-1&&(f=r[2][0])}return c.push(["L",f+u,a+t]),c.push(["L",u,a+t]),c.push(["Z"]),c}const IO={pin:function(t,e,n){const r=4*n/3,i=Math.max(r,2*n),o=r/2,a=t,s=o+e-i/2,c=Math.asin(o/(.85*(i-o))),l=Math.sin(c)*o,u=Math.cos(c)*o,f=a-u,h=s+l,d=t,p=s+o/Math.sin(c);return`\n M ${f} ${h}\n A ${o} ${o} 0 1 1 ${f+2*u} ${h}\n Q ${d} ${p} ${t} ${e+i/2}\n Q ${d} ${p} ${f} ${h}\n Z \n `},rect:function(t,e,n){const r=.618*n;return`\n M ${t-r} ${e-n}\n L ${t+r} ${e-n}\n L ${t+r} ${e+n}\n L ${t-r} ${e+n}\n Z\n `},circle:function(t,e,n){return`\n M ${t} ${e-n} \n a ${n} ${n} 0 1 0 0 ${2*n}\n a ${n} ${n} 0 1 0 0 ${2*-n}\n Z\n `},diamond:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e}\n L ${t} ${e+n}\n L ${t-n} ${e}\n Z\n `},triangle:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e+n}\n L ${t-n} ${e+n}\n Z\n `}},DO=(t,e)=>{if(!e)return;const{coordinate:n}=e,{liquidOptions:r,styleOptions:i}=t,{liquidShape:o,percent:a}=r,{background:s,outline:c={},wave:l={}}=i,u=Ie(i,["background","outline","wave"]),{border:f=2,distance:h=0}=c,d=Ie(c,["border","distance"]),{length:p=192,count:g=3}=l;return(t,r,i)=>{const{document:c}=e.canvas,{color:l,fillOpacity:v}=i,m=Object.assign(Object.assign({fill:l},i),u),b=c.createElement("g",{}),[x,w]=n.getCenter(),k=n.getSize(),M=Math.min(...k)/2,O=y(o)?o:((t="circle")=>IO[t]||IO.circle)(o),E=O(x,w,M,...k),S=O(x,w,M+f/2,...k);if(Object.keys(s).length){const t=c.createElement("path",{style:Object.assign({d:E,fill:"#fff"},s)});b.appendChild(t)}if(a>0){const t=c.createElement("path",{style:{d:S}});b.appendChild(t),b.style.clipPath=t,function(t,e,n,r,i,o,a,s,c,l,u){const{fill:f,fillOpacity:h,opacity:d}=i;for(let i=0;i<r;i++){const p=r<=1?1:i/(r-1),g=RO(s,a+s*n,c,0,s/40,t,e),v=u.createElement("path",{style:{d:g,fill:f,opacity:LO(.2,.9,p)*Number(d||h)}});o.appendChild(v);try{if(!1===l)return;const t=[{transform:"translate(0, 0)"},{transform:`translate(${2*c}, 0)`}];v.animate(t,{duration:2*LO(2500,5e3,p),iterations:1/0})}catch(t){console.warn("off-screen group animate error!")}}}(x,w,1-a,g,m,b,t.getBBox().y,2*M,p,!0,c)}const _=c.createElement("path",{style:{d:E,fill:"transparent",lineWidth:f+2*h,stroke:"#fff"}}),A=c.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:E,stroke:l,strokeOpacity:v,lineWidth:f},m),d),{fill:"transparent"})});return b.appendChild(_),b.appendChild(A),b}};DO.props={};const BO=(t,e)=>Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))/2,FO=(t,e)=>{if(!e)return;const{coordinate:n}=e;if(!(null==n?void 0:n.getCenter))return;const r=n.getCenter();return(n,i,o)=>{const{document:a}=e.canvas,{color:s,index:c}=i,l=a.createElement("g",{}),u=BO(n[0],n[1]),f=2*BO(n[0],r),h=((t,e,n)=>{const r=Math.atan2(t[1]-n[1],t[0]-n[0]);let i=Math.atan2(e[1]-n[1],e[0]-n[0])-r;return i<0&&(i+=2*Math.PI),i})(n[3],n[0],r)>Math.PI,d=a.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:[["M",...n[0]],["A",u,u,0,1,0,...n[1]],["A",f+2*u,f+2*u,0,h?1:0,0,...n[2]],["A",u,u,0,1,0===c?0:1,...n[3]],["A",f,f,0,h?1:0,1,...n[0]],["Z"]]},o),ct(t,["shape","last","first"])),{fill:s||o.color})});return l.appendChild(d),l}},zO="main-layer",$O="label-layer",WO="element",GO="view",HO="plot",YO="component",qO="label",VO="area",UO="axis-breaks",XO="axis-breaks-group",KO=.03,ZO={fill:"#fff",stroke:"#aaa",lineDash:"4 3",lineWidth:.5,fillOpacity:1,strokeOpacity:1},QO=(t,e,n,r,i,o)=>{const a=[],s=[],c=r-1;for(let r=1;r<c;r++){const l=r/c*e,u=t+(r%2==0?n:-n);a.push(`${l},${u}`),s.push(`${l},${i?u-o:u+o}`)}return a.push(`${e},${t}`),s.push(`${e+o},${t}`),[a,s]},JO=(t,e)=>{const{context:n,selection:r,view:i}=e,o=r.select(`.${HO}`).node(),{document:a}=n.canvas,{scale:s}=i,c=new Map;return t=>{const{key:e,start:r,end:i,gap:l=KO,vertices:u=50,lineWidth:f=.5,verticeOffset:h=3}=t,d=Ie(t,["key","start","end","gap","vertices","lineWidth","verticeOffset"]),p=a.createElement("g",{id:`break-group-${e}`,className:XO}),g=ot(s,"x.sortedDomain",[]),v=s.y.getOptions(),{range:m,domain:y}=v,b=y.indexOf(r),x=y.indexOf(i),{width:w,height:k}=o.getBBox();if(-1===b||-1===x||!g.length)return p;const M=m[0]>m[1],O=m[b]*k,E=m[x]*k;let S="",_="";for(const[t,{y:e,isLower:n}]of[{y:E,isLower:!1},{y:O,isLower:!0}].entries()){const r=M?f:-f,[i,o]=QO(e,w-0,h,u,n,r);0===t?(S=`M 0,${e} L ${i.join(" L ")} `,_=`M ${0-f},${e+r} L ${o.join(" L ")} `):(S+=`L ${w-0},${e} L ${[...i].reverse().join(" L ")} L 0,${e} Z`,_+=`L ${w-0+f+2},${e-r} L ${[...o].reverse().join(" L ")} L ${0-f},${e-r} Z`)}const A=Object.assign(Object.assign({},ZO),d);try{const t=new uv({style:Object.assign(Object.assign({},A),{d:S})}),a=new uv({style:Object.assign(Object.assign({},A),{d:_,lineWidth:0,cursor:"pointer"})});a.addEventListener("click",t=>Be(void 0,void 0,void 0,function*(){t.stopPropagation(),2===t.detail&&(yield((t,e,r)=>Be(void 0,void 0,void 0,function*(){const{update:i,setState:o}=n.externals;o("options",n=>{const{marks:i}=n;if(!i||!i.length)return n;const o=i.map(t=>{const n=ot(t,"scale.y.breaks",[]),i=n.filter(t=>t.start!==e&&t.end!==r&&!t.collapsed);return n.forEach(t=>{t.start===e&&t.end===r&&(t.collapsed=!0)}),console.log("breaks group:",n,i),tt({},t,{scale:{y:{breaks:i}}})});return c.set(t,{start:e,end:r}),Object.assign(Object.assign({},n),{marks:o})}),yield i()}))(e,r,i))})),p.appendChild(t),p.appendChild(a),o.addEventListener("click",t=>Be(void 0,void 0,void 0,function*(){2===t.detail&&(yield Be(void 0,void 0,void 0,function*(){if(!c.size)return;const{update:t,setState:e}=n.externals;e("options",t=>{const{marks:e}=t,n=e.map(t=>{const e=ot(t,"scale.y.breaks",[]);return at(t,"scale.y.breaks",e.map(t=>Object.assign(Object.assign({},t),{collapsed:!1}))),t});return c.clear(),Object.assign(Object.assign({},t),{marks:n})}),yield t()}))})),o.appendChild(p)}catch(t){console.error("Failed to create break path:",t)}return p}};function tE(t,e){return t.getBandWidth(t.invert(e))}JO.props={};const eE={rect:Ym,hollow:qm,funnel:Um,pyramid:Km},nE=()=>(t,e,n,r)=>{const{x:i,y1:o,series:a,size:s}=n;let{y:c}=n;c=c.map(t=>void 0!==t?t:1);const l=e.x,u=e.series,[f]=r.getSize(),h=s?s.map(t=>+t/f):null,d=s?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,t=>{const e=tE(l,i[t]),n=e*(u?tE(u,null==a?void 0:a[t]):1),s=(+(null==a?void 0:a[t])||0)*e,f=+i[t]+s,[h,p]=d(f,n,t),g=+c[t],v=+o[t];return[[h,g],[p,g],[p,v],[h,v]].map(t=>r.map(t))});return[t,p]};nE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:eE,channels:[...RM({shapes:Object.keys(eE)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...FM(),{type:Bn},{type:Na}],postInference:[...DM()],interaction:{shareTooltip:!0}};const rE={rect:Ym,hollow:qm},iE=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t)));return[t,c]};iE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:rE,channels:[...RM({shapes:Object.keys(rE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...FM(),{type:Bn}],postInference:[...DM()],interaction:{shareTooltip:!0}};const oE={line:ty,smooth:ey,hv:ny,vh:ry,hvh:iy,trail:ay},aE=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=a?Array.from(rr(t,t=>a[t]).values()):[t],h=f.map(t=>t[0]).filter(t=>void 0!==t),d=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(o=null==u?void 0:u.getBandWidth)||void 0===o?void 0:o.call(u))||0)/2,g=Array.from(f,t=>t.map(t=>r.map([+s[t]+d,+c[t]+p])));return[h,g,f]},sE=(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===i.length)throw new Error("Missing encode for position channel.");il(r)&&i.push(i[0]);const o=Array.from(t,t=>{const e=i.map(e=>+e[t]),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o});return[t,o]},cE=()=>(t,e,n,r)=>(sl(r)?sE:aE)(t,e,n,r);cE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:oE,channels:[...RM({shapes:Object.keys(oE)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...FM(),{type:Xa},{type:Da}],postInference:[...DM(),{type:Ca,channel:"color"},{type:Ha,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const lE={hollow:$y,hollowDiamond:Fy,hollowHexagon:zy,hollowSquare:Wy,hollowTriangleDown:Hy,hollowTriangle:Gy,hollowBowtie:By,hollowCircle:Vy,point:eb,plus:tb,diamond:Ky,square:nb,triangle:ib,hexagon:Zy,cross:Xy,bowtie:Uy,hyphen:Qy,line:Jy,tick:rb,triangleDown:ob,circle:qy},uE=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=$M(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]},v=l?Array.from(e,t=>{const[e,n]=g(t),r=+l[t],o=r/h,a=r/d,s=[e-o,n-a],c=[e+o,n+a];return[i.map(p(s,t)),i.map(p(c,t))]}):Array.from(e,t=>[i.map(p(g(t),t))]);return[e,v]};uE.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:lE,channels:[...RM({shapes:Object.keys(lE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...FM(),{type:Na},{type:La}],postInference:[{type:Ra},...IM()]};const fE={text:yM,badge:xM,tag:wM},hE=t=>{const{cartesian:e=!1}=t;return e?GM:(e,n,r,i)=>{const{x:o,y:a}=r,s=$M(n,r,t),c=Array.from(e,t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]});return[e,c]}};hE.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:fE,channels:[...RM({shapes:Object.keys(fE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...FM(),{type:Ua},{type:qa}],postInference:[...IM()]};const dE={cell:Ym,hollow:qm},pE=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map(t=>r.map(t))});return[t,c]};pE.props={defaultShape:"cell",defaultLabelShape:"label",shape:dE,composite:!1,channels:[...RM({shapes:Object.keys(dE)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...FM(),{type:Na},{type:La},{type:Ya}],postInference:[...IM()]};const gE={area:OM,smooth:EM,hvh:SM,vh:_M,hv:AM},vE=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(rr(t,t=>l[t]).values()):[t],d=h.map(t=>t[0]).filter(t=>void 0!==t),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2,v=Array.from(h,t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n});return[d,v,h]};vE.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:gE,channels:[...RM({shapes:Object.keys(gE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...FM(),{type:Da},{type:Bn},{type:Ya}],postInference:[...DM()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const mE={link:TM,arc:LM,smooth:PM,vhv:NM},yE=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=$M(n,r,t),u=e.map(t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+c[t]],t))]);return[e,u]};yE.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:mE,channels:[...RM({shapes:Object.keys(mE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...FM(),{type:za},{type:$a}],postInference:[...IM()]};const bE={image:VM},xE=t=>{const{cartesian:e}=t;return e?GM:(e,n,r,i)=>{const{x:o,y:a}=r,s=$M(n,r,t),c=Array.from(e,t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]});return[e,c]}};xE.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:bE,channels:[...RM({shapes:Object.keys(bE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...FM(),{type:Ua},{type:qa}],postInference:[...IM()]};const wE={polygon:XM,ribbon:ZM},kE=()=>(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),o=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),a=t.map(t=>{const e=[];for(let n=0;n<i.length;n++){const a=i[n][t];if(void 0===a)break;const s=o[n][t];e.push(r.map([+a,+s]))}return e});return[t,a]};kE.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:wE,channels:[...RM({shapes:Object.keys(wE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...FM()],postInference:[...IM()]};const ME={box:JM,violin:eO},OE=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[g,v,m,y,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,y],[p-n/2,y],[p+n/2,y],[p+n/2,v],[p-n/2,v],[p-n/2,m],[p+n/2,m],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map(t=>r.map(t))});return[t,d]};OE.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:ME,channels:[...RM({shapes:Object.keys(ME)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...FM(),{type:Na}],postInference:[...DM()],interaction:{shareTooltip:!0}};const EE={vector:ab},SE=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[c,l]=r.getSize(),u=t.map(t=>{const e=+s[t]/180*Math.PI,n=+a[t],u=n/l,f=n/c*Math.cos(e),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-h/2]),r.map([+i[t]+f/2,+o[t]+h/2])]});return[t,u]};SE.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:EE,channels:[...RM({shapes:Object.keys(EE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...FM()],postInference:[...IM()]};const _E={line:nO},AE=t=>(e,n,r,i)=>{const{y:o}=r,a=$M(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[0,o[t]],[1,o[t]]].map(e=>i.map(a(e,t))));return[e,s]};AE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:_E,channels:[...BM({shapes:Object.keys(_E)}),{name:"y",required:!0}],preInference:[...FM(),{type:Ba}],postInference:[]};const TE={line:nO},PE=t=>(e,n,r,i)=>{const{x:o}=r,a=$M(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[o[t],1],[o[t],0]].map(e=>i.map(a(e,t))));return[e,s]};PE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:TE,channels:[...BM({shapes:Object.keys(TE)}),{name:"x",required:!0}],preInference:[...FM(),{type:Fa}],postInference:[]};const CE={connector:iO},NE=(...t)=>yE(...t);function LE(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function jE(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=LE("x",e,i,r.x),s=LE("y",n,i,r.y),c=Array.from(t,t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map(t=>o.map(t))});return[t,c]}}NE.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:CE,channels:[...BM({shapes:Object.keys(CE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...FM()],postInference:[]};const RE={range:Ym},IE=()=>jE();IE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:RE,channels:[...BM({shapes:Object.keys(RE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...FM()],postInference:[]};const DE={range:Ym},BE=()=>jE({extendY:!0});BE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:DE,channels:[...BM({shapes:Object.keys(DE)}),{name:"x",required:!0}],preInference:[...FM(),{type:Wa}],postInference:[]};const FE={range:Ym},zE=()=>jE({extendX:!0});function $E(t){return t.target.depth}function WE(t,e){return t.sourceLinks.length?t.depth:e-1}function GE(t){return function(){return t}}function HE(t,e){return qE(t.source,e.source)||t.index-e.index}function YE(t,e){return qE(t.target,e.target)||t.index-e.index}function qE(t,e){return t.y0-e.y0}function VE(t){return t.value}function UE(t){return t.index}function XE(t){return t.nodes}function KE(t){return t.links}function ZE(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function QE({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function JE(){let t,e,n,r,i=0,o=0,a=1,s=1,c=24,l=8,u=UE,f=WE,h=XE,d=KE,p=6;function g(g){const y={nodes:h(g),links:d(g)};return function({nodes:t,links:e}){t.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const n=new Map(t.map(t=>[u(t),t]));if(e.forEach((t,e)=>{t.index=e;let{source:r,target:i}=t;"object"!=typeof r&&(r=t.source=ZE(n,r)),"object"!=typeof i&&(i=t.target=ZE(n,i)),r.sourceLinks.push(t),i.targetLinks.push(t)}),null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}(y),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(Lr(e.sourceLinks,VE),Lr(e.targetLinks,VE)):e.fixedValue}(y),function({nodes:t}){const n=t.length;let r=new Set(t),i=new Set,o=0;for(;r.size;){if(r.forEach(t=>{t.depth=o;for(const{target:e}of t.sourceLinks)i.add(e)}),++o>n)throw new Error("circular link");r=i,i=new Set}if(e){const n=Math.max(xr(t,t=>t.depth)+1,0);let r;for(let i=0;i<t.length;i++)r=t[i],r.depth=e.call(null,r,n)}}(y),function({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){if(n.forEach(t=>{t.height=i;for(const{source:e}of t.targetLinks)r.add(e)}),++i>e)throw new Error("circular link");n=r,r=new Set}}(y),function(e){const r=function({nodes:t}){const e=Math.max(xr(t,t=>t.depth)+1,0),r=(a-i-c)/(e-1),o=new Array(e).fill(0).map(()=>[]);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(f.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+c,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(s-o)/(xr(r,t=>t.length)-1)),function(e){const n=kr(e,e=>(s-o-(e.length-1)*t)/Lr(e,VE));for(const r of e){let e=o;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(s-e+t)/(r.length+1);for(let t=0;t<r.length;++t){const n=r[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}k(r)}}(r);for(let t=0;t<p;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/p);m(r,e,n),v(r,e,n)}}(y),QE(y),y}function v(t,e,r){for(let i=1,o=t.length;i<o;++i){const o=t[i];for(const t of o){let n=0,r=0;for(const{source:e,value:i}of t.targetLinks){const o=i*(t.layer-e.layer);n+=M(e,t)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,w(t)}void 0===n&&o.sort(qE),o.length&&y(o,r)}}function m(t,e,r){for(let i=t.length-2;i>=0;--i){const o=t[i];for(const t of o){let n=0,r=0;for(const{target:e,value:i}of t.sourceLinks){const o=i*(e.layer-t.layer);n+=O(t,e)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,w(t)}void 0===n&&o.sort(qE),o.length&&y(o,r)}}function y(e,n){const r=e.length>>1,i=e[r];x(e,i.y0-t,r-1,n),b(e,i.y1+t,r+1,n),x(e,s,e.length-1,n),b(e,o,0,n)}function b(e,n,r,i){for(;r<e.length;++r){const o=e[r],a=(n-o.y0)*i;a>1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+t}}function x(e,n,r,i){for(;r>=0;--r){const o=e[r],a=(o.y1-n)*i;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-t}}function w({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(YE);for(const{target:{targetLinks:e}}of t)e.sort(HE)}}function k(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(YE),n.sort(HE)}function M(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:o}of e.sourceLinks){if(i===n)break;r+=o+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function O(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:o}of n.targetLinks){if(i===e)break;r+=o+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return g.update=function(t){return QE(t),t},g.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:GE(t),g):u},g.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:GE(t),g):f},g.nodeDepth=function(t){return arguments.length?(e=t,g):e},g.nodeSort=function(t){return arguments.length?(n=t,g):n},g.nodeWidth=function(t){return arguments.length?(c=+t,g):c},g.nodePadding=function(e){return arguments.length?(l=t=+e,g):l},g.nodes=function(t){return arguments.length?(h="function"==typeof t?t:GE(t),g):h},g.links=function(t){return arguments.length?(d="function"==typeof t?t:GE(t),g):d},g.linkSort=function(t){return arguments.length?(r=t,g):r},g.size=function(t){return arguments.length?(i=o=0,a=+t[0],s=+t[1],g):[a-i,s-o]},g.extent=function(t){return arguments.length?(i=+t[0][0],a=+t[1][0],o=+t[0][1],s=+t[1][1],g):[[i,o],[a,s]]},g.iterations=function(t){return arguments.length?(p=+t,g):p},g}zE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:FE,channels:[...BM({shapes:Object.keys(FE)}),{name:"y",required:!0}],preInference:[...FM(),{type:Ga}],postInference:[]};const tS={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},eS={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?kr(t.sourceLinks,$E)-1:0},justify:WE};const nS=t=>e=>{const{nodeId:n,nodeSort:r,nodeAlign:i,nodeWidth:o,nodePadding:a,nodeDepth:s,nodes:c,links:l,linkSort:u,iterations:f}=Object.assign({},tS,t),h=JE().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?eS[t]||WE:"function"===e?t:WE}(i)).iterations(f).extent([[0,0],[1,1]]);"function"==typeof n&&h.nodeId(n);const d=h(e),{nodes:p,links:g}=d,v=p.map(t=>{const{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),m=g.map(t=>{const{source:e,target:n}=t,r=e.x1,i=n.x0,o=t.width/2;return Object.assign(Object.assign({},t),{x:[r,r,i,i],y:[t.y0+o,t.y0-o,t.y1+o,t.y1-o]})});return{nodes:v,links:m}};function rS(t,e,n={},r=!1){if(la(t))return t;if(Array.isArray(t)&&r)return t;const i=ia(t,e);return tt(n,i)}function iS(t,e={}){return la(t)||Array.isArray(t)?t:oS(t)?tt(e,t):t}function oS(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}function aS(t,e){return"object"==typeof t?ia(t,e):t}nS.props={};const sS={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},cS={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},lS={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},uS={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},fS=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={},interaction:u,state:f={},viewStyle:h={}}=t,{links:d,nodes:p}=qM(e,n);if(!d||0===d.length)return[tt({},cS,{data:[],encode:{},scale:r,style:ia(i,"node"),viewStyle:h,labels:[],tooltip:!1,animate:!1,axis:!1,interaction:u,state:{}}),tt({},lS,{data:[],encode:{},labels:[],style:ia(i,"link"),tooltip:!1,animate:!1,interaction:u,state:{}})];const g=ia(n,"node"),v=ia(n,"link"),{key:m=t=>t.key,color:y=m}=g,{links:b,nodes:x}=nS(Object.assign(Object.assign(Object.assign({},sS),{nodeId:HM(m)}),o))({links:d,nodes:p}),w=ia(i,"label"),{text:k=m,spacing:M=5}=w,O=Ie(w,["text","spacing"]),E=HM(m),S=rS(l,"node",{title:E,items:[{field:"value"}]},!0),_=rS(l,"link",{title:"",items:[t=>({name:"source",value:E(t.source)}),t=>({name:"target",value:E(t.target)})]}),[A,T]=Object.entries(f).reduce((t,[e,n])=>{const r=aa(n,"node","link"),i=ia(n,"node");t[0][e]=Object.assign(Object.assign({},r),i);const o=ia(n,"link");return t[1][e]=Object.assign(Object.assign({},r),o),t},[{},{}]);return[tt({},cS,{data:x,encode:Object.assign(Object.assign({},g),{color:y}),scale:r,style:ia(i,"node"),viewStyle:h,labels:[Object.assign(Object.assign(Object.assign({},uS),{text:k,dx:t=>t.x[0]<.5?M:-M}),O),...a],tooltip:S,animate:aS(c,"node"),axis:!1,interaction:u,state:A}),tt({},lS,{data:b,encode:v,labels:s,style:Object.assign({fill:v.color?void 0:"#aaa",lineWidth:0},ia(i,"link")),tooltip:_,animate:aS(c,"link"),interaction:u,state:T})]};fS.props={};var hS=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return`${t.id}`.localeCompare(`${e.id}`)},name:function(t,e){return`${t.name}`.localeCompare(`${e.name}`)}});const dS={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function pS(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:o,source:a,target:s,sourceWeight:c,targetWeight:l,sortBy:u}=Object.assign(Object.assign({},dS),t);return function(t){const f=t.nodes.map(t=>Object.assign({},t)),h=t.edges.map(t=>Object.assign({},t));return function(t,e){e.forEach(t=>{t.source=a(t),t.target=s(t),t.sourceWeight=c(t),t.targetWeight=l(t)});const n=rr(e,t=>t.source),r=rr(e,t=>t.target);t.forEach(t=>{t.id=o(t);const e=n.has(t.id)?n.get(t.id):[],i=r.has(t.id)?r.get(t.id):[];t.frequency=e.length+i.length,t.value=Lr(e,t=>t.sourceWeight)+Lr(i,t=>t.targetWeight)})}(f,h),function(t){const e="function"==typeof u?u:hS[u];e&&t.sort(e)}(f),function(t,o){const a=t.length;if(!a)throw ta("Invalid nodes: it's empty!");if(!r){const n=1/a;return t.forEach((t,r)=>{t.x=(r+.5)*n,t.y=e}),{nodes:t,edges:o}}const s=i/(2*a),c=t.reduce((t,e)=>t+e.value,0);t.reduce((t,r)=>{r.weight=r.value/c,r.width=r.weight*(1-i),r.height=n;const o=s+t,a=o+r.width,l=e-n/2,u=l+n;return r.x=[o,a,a,o],r.y=[l,l,u,u],t+r.width+2*s},0)}(f,h),function(t,n){const i=new Map(t.map(t=>[t.id,t]));if(!r)return n.forEach(t=>{const e=a(t),n=s(t),r=i.get(e),o=i.get(n);r&&o&&(t.x=[r.x,o.x],t.y=[r.y,o.y])}),{nodes:t,edges:n};n.forEach(t=>{t.x=[0,0,0,0],t.y=[e,e,e,e]});const o=rr(n,t=>t.source),c=rr(n,t=>t.target);t.forEach(t=>{const{edges:e,width:n,x:r,y:i,value:a,id:s}=t,l=o.get(s)||[],u=c.get(s)||[];let f=0;l.map(t=>{const e=t.sourceWeight/a*n;t.x[0]=r[0]+f,t.x[1]=r[0]+f+e,f+=e}),u.forEach(t=>{const e=t.targetWeight/a*n;t.x[3]=r[0]+f,t.x[2]=r[0]+f+e,f+=e})})}(f,h),{nodes:f,edges:h}}}const gS=t=>e=>pS(t)(e);gS.props={};const vS={y:0,thickness:.05,marginRatio:.1,id:t=>t.key,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null},mS={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{opacity:1,fillOpacity:1,lineWidth:1}},yS={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{opacity:.5,lineWidth:1}},bS={position:"outside",fontSize:10},xS=(t,e)=>{const{data:n,encode:r={},scale:i,style:o={},layout:a={},nodeLabels:s=[],linkLabels:c=[],animate:l={},tooltip:u={}}=t,{nodes:f,links:h}=qM(n,r),d=ia(r,"node"),p=ia(r,"link"),{key:g=t=>t.key,color:v=g}=d,{linkEncodeColor:m=t=>t.source}=p,{nodeWidthRatio:y=vS.thickness,nodePaddingRatio:b=vS.marginRatio}=a,x=Ie(a,["nodeWidthRatio","nodePaddingRatio"]),{nodes:w,edges:k}=gS(Object.assign(Object.assign(Object.assign(Object.assign({},vS),{id:HM(g),thickness:y,marginRatio:b}),x),{weight:!0}))({nodes:f,edges:h}),M=ia(o,"label"),{text:O=g}=M,E=Ie(M,["text"]),S=rS(u,"node",{title:"",items:[t=>({name:t.key,value:t.value})]},!0),_=rS(u,"link",{title:"",items:[t=>({name:`${t.source} -> ${t.target}`,value:t.value})]}),{height:A,width:T}=e,P=Math.min(A,T);return[tt({},yS,{data:k,encode:Object.assign(Object.assign({},p),{color:m}),labels:c,style:Object.assign({fill:m?void 0:"#aaa"},ia(o,"link")),tooltip:_,animate:aS(l,"link")}),tt({},mS,{data:w,encode:Object.assign(Object.assign({},d),{color:v}),scale:i,style:ia(o,"node"),coordinate:{type:"polar",outerRadius:(P-20)/P,startAngle:2*-Math.PI,endAngle:0},labels:[Object.assign(Object.assign(Object.assign({},bS),{text:O}),E),...s],tooltip:S,animate:aS(l,"node"),axis:!1})]};xS.props={};const wS={path:MO,hollow:OO},kS=t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])];function MS(t,e){return t.parent===e.parent?1:2}function OS(t,e){return t+e.x}function ES(t,e){return Math.max(t,e.y)}function SS(){var t=MS,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter(function(e){var n=e.children;n?(e.x=function(t){return t.reduce(OS,0)/t.length}(n),e.y=function(t){return 1+t.reduce(ES,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)});var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function _S(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function AS(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=PS)):void 0===e&&(e=TS);for(var n,r,i,o,a,s=new LS(t),c=[s];n=c.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new LS(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(NS)}function TS(t){return t.children}function PS(t){return Array.isArray(t)?t[1]:null}function CS(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function NS(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function LS(t){this.data=t,this.depth=this.height=0,this.parent=null}function jS(t){return null==t?null:RS(t)}function RS(t){if("function"!=typeof t)throw new Error;return t}function IS(){return 0}function DS(t){return function(){return t}}kS.props={defaultShape:"path",defaultLabelShape:"label",shape:wS,composite:!1,channels:[...RM({shapes:Object.keys(wS)}),{name:"d",scale:"identity"}],preInference:[...FM()],postInference:[]},LS.prototype=AS.prototype={constructor:LS,count:function(){return this.eachAfter(_S)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return AS(this).eachBefore(CS)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};const BS=4294967296;function FS(t,e){var n,r;if(WS(e,t))return[e];for(n=0;n<t.length;++n)if(zS(e,t[n])&&WS(HS(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(zS(HS(t[n],t[r]),e)&&zS(HS(t[n],e),t[r])&&zS(HS(t[r],e),t[n])&&WS(YS(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function zS(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function $S(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function WS(t,e){for(var n=0;n<e.length;++n)if(!$S(t,e[n]))return!1;return!0}function GS(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return HS(t[0],t[1]);case 3:return YS(t[0],t[1],t[2])}}function HS(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,c=o-n,l=a-r,u=s-i,f=Math.sqrt(c*c+l*l);return{x:(n+o+c/f*u)/2,y:(r+a+l/f*u)/2,r:(f+i+s)/2}}function YS(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,c=e.r,l=n.x,u=n.y,f=n.r,h=r-a,d=r-l,p=i-s,g=i-u,v=c-o,m=f-o,y=r*r+i*i-o*o,b=y-a*a-s*s+c*c,x=y-l*l-u*u+f*f,w=d*p-h*g,k=(p*x-g*b)/(2*w)-r,M=(g*v-p*m)/w,O=(d*b-h*x)/(2*w)-i,E=(h*m-d*v)/w,S=M*M+E*E-1,_=2*(o+k*M+O*E),A=k*k+O*O-o*o,T=-(Math.abs(S)>1e-6?(_+Math.sqrt(_*_-4*S*A))/(2*S):A/_);return{x:r+k+M*T,y:i+O+E*T,r:T}}function qS(t,e,n){var r,i,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*c,n.y=t.y-r*c+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*c,n.y=e.y+r*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function VS(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function US(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function XS(t){this._=t,this.next=null,this.previous=null}function KS(t,e){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,c,l,u,f,h;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;qS(r,n,i=t[2]),n=new XS(n),r=new XS(r),i=new XS(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(c=3;c<o;++c){qS(n._,r._,i=t[c]),i=new XS(i),l=r.next,u=n.previous,f=r._.r,h=n._.r;do{if(f<=h){if(VS(l._,i._)){r=l,n.next=r,r.previous=n,--c;continue t}f+=l._.r,l=l.next}else{if(VS(u._,i._)){(n=u).next=r,r.previous=n,--c;continue t}h+=u._.r,u=u.previous}}while(l!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=US(n);(i=i.next)!==r;)(s=US(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=function(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i<o;)n=t[i],r&&$S(r,n)?++i:(r=GS(a=FS(a,n)),i=0);return r}(n,e),c=0;c<o;++c)(n=t[c]).x-=i.x,n.y-=i.y;return i.r}function ZS(t){return Math.sqrt(t.value)}function QS(){var t=null,e=1,n=1,r=IS;function i(i){const o=function(){let t=1;return()=>(t=(1664525*t+1013904223)%BS)/BS}();return i.x=e/2,i.y=n/2,t?i.eachBefore(JS(t)).eachAfter(t_(r,.5,o)).eachBefore(e_(1)):i.eachBefore(JS(ZS)).eachAfter(t_(IS,1,o)).eachAfter(t_(r,i.r/Math.min(e,n),o)).eachBefore(e_(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=jS(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:DS(+t),i):r},i}function JS(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function t_(t,e,n){return function(r){if(i=r.children){var i,o,a,s=i.length,c=t(r)*e||0;if(c)for(o=0;o<s;++o)i[o].r+=c;if(a=KS(i,n),c)for(o=0;o<s;++o)i[o].r-=c;r.r=a+c}}}function e_(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function n_(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function r_(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(r-e)/t.value;++s<c;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}var i_={depth:-1},o_={},a_={};function s_(t){return t.id}function c_(t){return t.parentId}function l_(){var t,e=s_,n=c_;function r(r){var i,o,a,s,c,l,u,f,h=Array.from(r),d=e,p=n,g=new Map;if(null!=t){const e=h.map((e,n)=>function(t){t=`${t}`;let e=t.length;f_(t,e-1)&&!f_(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r))),n=e.map(u_),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(u_(t)),h.push(a_));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=h.length;a<i;++a)o=h[a],l=h[a]=new LS(o),null!=(u=d(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?o_:l)),null!=(u=p(o,a,r))&&(u+="")&&(l.parent=u);for(a=0;a<i;++a)if(u=(l=h[a]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===o_)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===a_&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===a_;--t)l.data=null}if(s.parent=i_,s.eachBefore(function(t){t.depth=t.parent.depth+1,--i}).eachBefore(NS),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=jS(t),r):e},r.parentId=function(t){return arguments.length?(n=jS(t),r):n},r.path=function(e){return arguments.length?(t=jS(e),r):t},r}function u_(t){let e=t.length;if(e<2)return"";for(;--e>1&&!f_(t,e););return t.slice(0,e)}function f_(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function h_(t,e){return t.parent===e.parent?1:2}function d_(t){var e=t.children;return e?e[0]:t.t}function p_(t){var e=t.children;return e?e[e.length-1]:t.t}function g_(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function v_(t,e,n){return t.a.parent===e.parent?t.a:n}function m_(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function y_(){var t=h_,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new m_(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new m_(r[i],i)),n.parent=e;return(a.parent=new m_(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(s);else{var l=i,u=i,f=i;i.eachBefore(function(t){t.x<l.x&&(l=t),t.x>u.x&&(u=t),t.depth>f.depth&&(f=t)});var h=l===u?1:t(l,u)/2,d=h-l.x,p=e/(u.x+h+d),g=n/(f.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*g})}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,f=s.m,h=c.m;s=p_(s),o=d_(o),s&&o;)c=d_(c),(a=p_(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(g_(v_(s,e,r),e,i),l+=i,u+=i),f+=s.m,l+=o.m,h+=c.m,u+=a.m;s&&!p_(a)&&(a.t=s,a.m+=f-u),o&&!d_(c)&&(c.t=o,c.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function b_(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}m_.prototype=Object.create(LS.prototype);var x_=(1+Math.sqrt(5))/2;function w_(t,e,n,r,i,o){for(var a,s,c,l,u,f,h,d,p,g,v,m=[],y=e.children,b=0,x=0,w=y.length,k=e.value;b<w;){c=i-n,l=o-r;do{u=y[x++].value}while(!u&&x<w);for(f=h=u,v=u*u*(g=Math.max(l/c,c/l)/(k*t)),p=Math.max(h/v,v/f);x<w;++x){if(u+=s=y[x].value,s<f&&(f=s),s>h&&(h=s),v=u*u*g,(d=Math.max(h/v,v/f))>p){u-=s;break}p=d}m.push(a={value:u,dice:c<l,children:y.slice(b,x)}),a.dice?r_(a,n,r,i,k?r+=l*u/k:o):b_(a,n,r,k?n+=c*u/k:i,o),k-=u,b=x}return m}var k_=function t(e){function n(t,n,r,i,o){w_(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(x_);function M_(t,e,n,r,i){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var v=l[d]-f,m=r-v;if(a-i>c-o){var y=r?(i*m+a*v)/r:a;t(e,d,v,i,o,y,c),t(d,n,m,y,o,a,c)}else{var b=r?(o*m+c*v)/r:c;t(e,d,v,i,o,a,b),t(d,n,m,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function O_(t,e,n,r,i){(1&t.depth?b_:r_)(t,e,n,r,i)}var E_=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,f=-1,h=a.length,d=t.value;++f<h;){for(c=(s=a[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?r_(s,n,r,i,d?r+=(o-r)*s.value/d:o):b_(s,n,r,d?n+=(i-n)*s.value/d:i,o),d-=s.value}else t._squarify=a=w_(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(x_);function S_(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach(n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],S_(n,n.path)})}function __(t){const e=ot(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach(t=>{__(t)})}function A_(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:M_,treemapDice:r_,treemapSlice:b_,treemapSliceDice:O_,treemapSquarify:k_,treemapResquarify:E_},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),o=function(t,e){return Array.isArray(t)?"function"==typeof e?l_().path(e)(t):l_()(t):AS(t)}(t,e.path);x(t)?__(o):S_(o),r?o.sum(t=>e.ignoreParentValue&&t.children?0:HM(r)(t)).sort(e.sort):o.count(),function(){var t=k_,e=!1,n=1,r=1,i=[0],o=IS,a=IS,s=IS,c=IS,l=IS;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(n_),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<u&&(u=h=(u+h)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=h,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,u+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(h-=c(e)-n)<u&&(u=h=(u+h)/2),t(e,r,u,f,h))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=RS(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:DS(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:DS(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:DS(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:DS(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:DS(+t),u):l},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(o);const a=o.descendants().map(t=>Object.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]})),s=a.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,a]}const T_={fontSize:10,text:t=>j(t.path),position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0,isTreemapLabel:!0},P_={title:t=>{var e,n;return null===(n=null===(e=t.path)||void 0===e?void 0:e.join)||void 0===n?void 0:n.call(e,".")},items:[{field:"value"}]},C_={title:t=>j(t.path),items:[{field:"value"}]},N_=(t,e)=>{const{width:n,height:r,options:i}=e,{data:o,encode:a={},scale:s,style:c={},layout:l={},labels:u=[],tooltip:f={}}=t,h=Ie(t,["data","encode","scale","style","layout","labels","tooltip"]),d=ot(i,["interaction","treemapDrillDown"])||ot(i,["marks",0,"interaction","treemapDrillDown"]),p=tt({},((t,e)=>({tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}))(n,r),l,{layer:d?t=>1===t.depth:l.layer}),[g,v]=A_(o,p,a),m=ia(c,"label");return tt({},((t,e)=>({type:"rect",axis:!1,encode:{x:"x",y:"y",key:"id",color:t=>t.path[1]},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"},state:{active:{opacity:.6},inactive:{opacity:1}}}))(n,r),Object.assign(Object.assign({data:g,scale:s,style:c,labels:[Object.assign(Object.assign(Object.assign({},T_),m),d&&{cursor:"pointer"}),...u]},h),{encode:a,tooltip:iS(f,P_),axis:!1}),d?{interaction:Object.assign(Object.assign({},h.interaction),{treemapDrillDown:d?Object.assign(Object.assign({},d),{originData:v,layout:p}):void 0}),encode:Object.assign({color:t=>j(t.path)},a),tooltip:iS(f,C_)}:{})};N_.props={};const L_={text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r},j_={title:t=>t.data.name,items:[{field:"value"}]},R_=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:o={},scale:a={},style:s={},layout:c={},labels:l=[],tooltip:u={}}=t,f=Ie(t,["data","encode","scale","style","layout","labels","tooltip"]),h=((t,e,n)=>({type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:n.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:n.color?void 0:t=>0===t.height?"":"#000"}}))(n,r,o),d=((t,e,n)=>{const{value:r}=n,i=x(t)?l_().path(e.path)(t):AS(t);return r?i.sum(t=>HM(r)(t)).sort(e.sort):i.count(),QS().size(e.size).padding(e.padding)(i),i.descendants()})(i,tt({},((t,e)=>({size:[t,e],padding:0,sort:(t,e)=>e.value-t.value}))(n,r),c),tt({},h.encode,o)),p=ia(s,"label");return tt({},h,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},L_),p),...l]},f),{tooltip:iS(u,j_),axis:!1}))};function I_(t,e){return kr(t,t=>e[t])}function D_(t,e){return xr(t,t=>e[t])}function B_(t,e){const n=2.5*F_(t,e)-1.5*$_(t,e);return kr(t,t=>e[t]>=n?e[t]:NaN)}function F_(t,e){return Sr(t,.25,t=>e[t])}function z_(t,e){return Sr(t,.5,t=>e[t])}function $_(t,e){return Sr(t,.75,t=>e[t])}function W_(t,e){const n=2.5*$_(t,e)-1.5*F_(t,e);return xr(t,t=>e[t]<=n?e[t]:NaN)}function G_(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(rr(t,t=>a[+t]).values()),c=s.flatMap(t=>{const e=B_(t,o),n=W_(t,o);return t.filter(t=>o[t]<e||o[t]>n)});return[c,e]}}R_.props={};const H_=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:o,animate:a}=t,s=Ie(t,["data","encode","style","tooltip","transform","animate"]),{point:c=!0}=r,l=Ie(r,["point"]),{y:u}=n,f={y:u,y1:u,y2:u,y3:u,y4:u},h={y1:F_,y2:z_,y3:$_},d=rS(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),p=rS(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});if(!c)return Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:I_},h),{y4:D_})],encode:Object.assign(Object.assign({},n),f),style:l,tooltip:d},s);const g=ia(l,"box"),v=ia(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:B_},h),{y4:W_})],encode:Object.assign(Object.assign({},n),f),style:g,tooltip:d,animate:aS(a,"box")},s),{type:"point",data:e,transform:[{type:G_}],encode:n,style:Object.assign({},v),tooltip:p,animate:aS(a,"point")}]};H_.props={};const Y_=t=>{const{cartesian:e}=t;return e?GM:(e,n,r,i)=>{const{x:o,y:a}=r,s=$M(n,r,t),c=Array.from(e,t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]});return[e,c]}};function q_(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,c,l,u,f,h,d=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(v+y)/2))?v=a:y=a,i=d,!(d=d[f=u<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),c=+t._y.call(null,d.data),e===s&&n===c)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(v+y)/2))?v=a:y=a}while((f=u<<1|l)==(h=(c>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function V_(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function U_(t){return t[0]}function X_(t){return t[1]}function K_(t,e,n){var r=new Z_(null==e?U_:e,null==n?X_:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Z_(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Q_(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}Y_.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:NO},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...FM(),{type:Ua},{type:qa},{type:Va}]};var J_=K_.prototype=Z_.prototype;function tA(t){return function(){return t}}function eA(t){return 1e-6*(t()-.5)}function nA(t){return t.index}function rA(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}J_.copy=function(){var t,e,n=new Z_(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Q_(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Q_(e));return n},J_.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return q_(this.cover(e,n),e,n,t)},J_.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<c&&(c=r),r>u&&(u=r),i<l&&(l=i),i>f&&(f=i));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;n<o;++n)q_(this,a[n],s[n],t[n]);return this},J_.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,c=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,c*=2,s){case 0:i=n+c,o=r+c;break;case 1:n=i-c,o=r+c;break;case 2:i=n+c,r=o-c;break;case 3:n=i-c,r=o-c}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},J_.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},J_.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},J_.find=function(t,e,n){var r,i,o,a,s,c,l,u=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new V_(g,u,f,h,d)),null==n?n=1/0:(u=t-n,f=e-n,h=t+n,d=e+n,n*=n);c=p.pop();)if(!(!(g=c.node)||(i=c.x0)>h||(o=c.y0)>d||(a=c.x1)<u||(s=c.y1)<f))if(g.length){var v=(i+a)/2,m=(o+s)/2;p.push(new V_(g[3],v,m,a,s),new V_(g[2],i,m,v,s),new V_(g[1],v,o,a,m),new V_(g[0],i,o,v,m)),(l=(e>=m)<<1|t>=v)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=y*y+b*b;if(x<n){var w=Math.sqrt(n=x);u=t-w,f=e-w,h=t+w,d=e+w,r=g.data}}return r},J_.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,c,l,u,f,h,d=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+v)/2))?p=s:v=s,(u=a>=(c=(g+m)/2))?g=c:m=c,e=d,!(d=d[f=u<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},J_.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},J_.root=function(){return this._root},J_.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},J_.visit=function(t){var e,n,r,i,o,a,s=[],c=this._root;for(c&&s.push(new V_(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&c.length){var l=(r+o)/2,u=(i+a)/2;(n=c[3])&&s.push(new V_(n,l,u,o,a)),(n=c[2])&&s.push(new V_(n,r,u,l,a)),(n=c[1])&&s.push(new V_(n,l,i,o,u)),(n=c[0])&&s.push(new V_(n,r,i,l,u))}return this},J_.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new V_(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,c=e.x1,l=e.y1,u=(a+c)/2,f=(s+l)/2;(o=i[0])&&n.push(new V_(o,a,s,u,f)),(o=i[1])&&n.push(new V_(o,u,s,c,f)),(o=i[2])&&n.push(new V_(o,a,f,u,l)),(o=i[3])&&n.push(new V_(o,u,f,c,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},J_.x=function(t){return arguments.length?(this._x=t,this):this._x},J_.y=function(t){return arguments.length?(this._y=t,this):this._y};var iA={value:()=>{}};function oA(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new aA(r)}function aA(t){this._=t}function sA(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function cA(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=iA,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}aA.prototype=oA.prototype={constructor:aA,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=cA(i[n],t.name,e);else if(null==e)for(n in i)i[n]=cA(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=sA(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new aA(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var lA,uA,fA=0,hA=0,dA=0,pA=0,gA=0,vA=0,mA="object"==typeof performance&&performance.now?performance:Date,yA="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function bA(){return gA||(yA(xA),gA=mA.now()+vA)}function xA(){gA=0}function wA(){this._call=this._time=this._next=null}function kA(t,e,n){var r=new wA;return r.restart(t,e,n),r}function MA(){gA=(pA=mA.now())+vA,fA=hA=0;try{!function(){bA(),++fA;for(var t,e=lA;e;)(t=gA-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fA}()}finally{fA=0,function(){var t,e,n=lA,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:lA=e);uA=t,EA(r)}(),gA=0}}function OA(){var t=mA.now(),e=t-pA;e>1e3&&(vA-=e,pA=t)}function EA(t){fA||(hA&&(hA=clearTimeout(hA)),t-gA>24?(t<1/0&&(hA=setTimeout(MA,t-mA.now()-vA)),dA&&(dA=clearInterval(dA))):(dA||(pA=mA.now(),dA=setInterval(OA,1e3)),fA=1,yA(MA)))}wA.prototype=kA.prototype={constructor:wA,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?bA():+n)+(null==e?0:+e),this._next||uA===this||(uA?uA._next=this:lA=this,uA=this),this._call=t,this._time=n,EA()},stop:function(){this._call&&(this._call=null,this._time=1/0,EA())}};const SA=4294967296;function _A(t){return t.x}function AA(t){return t.y}var TA=Math.PI*(3-Math.sqrt(5));function PA(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,c=kA(f),l=oA("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%SA)/SA}();function f(){h(),l.call("tick",e),n<r&&(c.stop(),l.call("end",e))}function h(r){var c,l,u=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach(function(t){t(n)}),c=0;c<u;++c)null==(l=t[c]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*TA;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return c.restart(f),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,c,l=0,u=t.length;for(null==r?r=1/0:r*=r,l=0;l<u;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(c=s,r=a);return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}const CA={joint:!0},NA={type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},LA={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},jA={text:""};function RA(t,e,n){const{nodes:r,links:i}=t,{joint:o,nodeStrength:a,linkStrength:s}=e,{nodeKey:c=t=>t.id,linkKey:l=t=>t.id}=n,u=function(){var t,e,n,r,i,o=tA(-30),a=1,s=1/0,c=.81;function l(n){var i,o=t.length,a=K_(t,_A,AA).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function u(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,c=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,c+=n,r+=n*e.x,o+=n*e.y);t.x=r/c,t.y=o/c}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,u){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=u-o,p=f*f+h*h;if(d*d/c<p)return p<s&&(0===f&&(p+=(f=eA(n))*f),0===h&&(p+=(h=eA(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=eA(n))*f),0===h&&(p+=(h=eA(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,u()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:tA(+t),u(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l}(),f=function(t){var e,n,r,i,o,a,s=nA,c=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=tA(30),u=1;function f(r){for(var i=0,s=t.length;i<u;++i)for(var c,l,f,h,d,p,g,v=0;v<s;++v)l=(c=t[v]).source,h=(f=c.target).x+f.vx-l.x-l.vx||eA(a),d=f.y+f.vy-l.y-l.vy||eA(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[v])/p*r*e[v],d*=p,f.vx-=h*(g=o[v]),f.vy-=d*g,l.vx+=h*(g=1-g),l.vy+=d*g}function h(){if(r){var a,c,l=r.length,u=t.length,f=new Map(r.map((t,e)=>[s(t,e,r),t]));for(a=0,i=new Array(l);a<u;++a)(c=t[a]).index=a,"object"!=typeof c.source&&(c.source=rA(f,c.source)),"object"!=typeof c.target&&(c.target=rA(f,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)c=t[a],o[a]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);e=new Array(u),d(),n=new Array(u),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+c(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(u=+t,f):u},f.strength=function(t){return arguments.length?(c="function"==typeof t?t:tA(+t),d(),f):c},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:tA(+t),p(),f):l},f}(i).id(HM(l));"function"==typeof a&&u.strength(a),"function"==typeof s&&f.strength(s);const h=PA(r).force("link",f).force("charge",u);o?h.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,c=0;for(i=0;i<a;++i)s+=(o=n[i]).x,c+=o.y;for(s=(s/a-t)*r,c=(c/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=c}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}()):h.force("x",function(t){var e,n,r,i=tA(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=tA(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:tA(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:tA(+e),a(),o):t},o}()).force("y",function(t){var e,n,r,i=tA(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=tA(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:tA(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:tA(+e),a(),o):t},o}()),h.stop();const d=Math.ceil(Math.log(h.alphaMin())/Math.log(1-h.alphaDecay()));for(let t=0;t<d;t++)h.tick();return{nodesData:r,linksData:i}}const IA=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,{nodeKey:u=t=>t.id,linkKey:f=t=>t.id}=n,h=Ie(n,["nodeKey","linkKey"]),d=Object.assign({nodeKey:u,linkKey:f},h),p=ia(d,"node"),g=ia(d,"link"),{links:v,nodes:m}=qM(e,d),{nodesData:y,linksData:b}=RA({links:v,nodes:m},tt({},CA,o),d),x=rS(l,"link",{items:[t=>({name:"source",value:HM(f)(t.source)}),t=>({name:"target",value:HM(f)(t.target)})]}),w=rS(l,"node",{items:[t=>({name:"key",value:HM(u)(t)})]},!0);return[tt({},NA,{data:b,encode:g,labels:s,style:ia(i,"link"),tooltip:x,animate:aS(c,"link")}),tt({},LA,{data:y,encode:Object.assign({},p),scale:r,style:ia(i,"node"),tooltip:w,labels:[Object.assign(Object.assign({},jA),ia(i,"label")),...a],animate:aS(c,"link")})]};IA.props={};const DA=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[c,l]=s,u=AS(n,t=>t.children).sum(t=>t[r]).sort(a),f=t();f.size([1,1]),i&&f.nodeSize(i),o&&f.separation(o),f(u);const h=[];u.each(t=>{t[c]=t.x,t[l]=t.y,t.name=t.data.name,h.push(t)});const d=u.links();return d.forEach(t=>{t[c]=[t.source[c],t.target[c]],t[l]=[t.source[l],t.target[l]]}),{nodes:h,edges:d}},BA=t=>DA(SS)(t);BA.props={};const FA=t=>DA(y_)(t);FA.props={};const zA={sortBy:(t,e)=>e.value-t.value},$A={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},WA={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},GA={text:"",fontSize:10},HA=t=>{const{data:e,encode:n={},scale:r={},style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,u=null==n?void 0:n.value,{nodes:f,edges:h}=FA(Object.assign(Object.assign(Object.assign({},zA),o),{field:u}))(e),d=rS(l,"node",{title:"name",items:["value"]},!0),p=rS(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[tt({},WA,{data:h,encode:ia(n,"link"),scale:ia(r,"link"),labels:s,style:Object.assign({stroke:"#999"},ia(i,"link")),tooltip:p,animate:aS(c,"link")}),tt({},$A,{data:f,scale:ia(r,"node"),encode:ia(n,"node"),labels:[Object.assign(Object.assign({},GA),ia(i,"label")),...a],style:Object.assign({},ia(i,"node")),tooltip:d,animate:aS(c,"node")})]};HA.props={};const YA=(t,e)=>Be(void 0,void 0,void 0,function*(){const{width:n,height:r}=e,{data:i,encode:o={},scale:a,style:s={},layout:c={}}=t,l=Ie(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(i,o);return tt({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily},tooltip:{items:[t=>({name:t.text,value:t.value})]}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},c)]},encode:o,scale:a,style:s},l),{axis:!1}))});YA.props={};const qA={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},VA={style:{shape:(t,e)=>{const{shape:n,radius:r}=t,i=Ie(t,["shape","radius"]),o=ia(i,"pointer"),a=ia(i,"pin"),{shape:s}=o,l=Ie(o,["shape"]),{shape:u}=a,f=Ie(a,["shape"]),{coordinate:h,theme:d}=e;return(t,e)=>{const n=t.map(t=>h.invert(t)),[o,a,p]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find(t=>t[0]===e);return r}(h,"polar"),g=h.clone(),{color:v}=e,m=c({startAngle:o,endAngle:a,innerRadius:p,outerRadius:r});m.push(["cartesian"]),g.update({transformations:m});const y=n.map(t=>g.map(t)),[b,x]=Wm(y),[w,k]=h.getCenter(),M=Object.assign(Object.assign({x1:b,y1:x,x2:w,y2:k,stroke:v},l),i),O=Object.assign(Object.assign({cx:w,cy:k,stroke:v},f),i),E=Cm(new rv);return la(s)||("function"==typeof s?E.append(()=>s(y,e,g,d)):E.append("line").call(Rm,M).node()),la(u)||("function"==typeof u?E.append(()=>u(y,e,g,d)):E.append("circle").call(Rm,O).node()),E.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},UA={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},tooltip:!1};function XA(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=function(t){if(I(t)){const e=Math.max(0,Math.min(t,1));return{percent:e,target:e,total:1}}return t}(t),s=o||r,c=o?1:i,l=Object.assign({y:{domain:[0,c]}},e);return a.length?{targetData:[{x:n,y:s,color:"target"}],totalData:a.map((t,e)=>({x:n,y:e>=1?t-a[e-1]:t,color:e})),target:s,total:c,scale:l}:{targetData:[{x:n,y:s,color:"target"}],totalData:[{x:n,y:s,color:"target"},{x:n,y:c-s,color:"total"}],target:s,total:c,scale:l}}function KA(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const ZA=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:o=[]}=t,a=Ie(t,["data","scale","style","animate","transform"]),{targetData:s,totalData:c,target:l,total:u,scale:f}=XA(e,n),h=ia(r,"text"),{tooltip:d}=h,p=Ie(h,["tooltip"]),g=(v=r,m=["pointer","pin"],Object.fromEntries(Object.entries(v).filter(([t])=>m.find(e=>t.startsWith(e)))));var v,m;const y=ia(r,"arc"),b=y.shape;return[tt({},qA,Object.assign({type:"interval",transform:[{type:"stackY"}],data:c,scale:f,style:"round"===b?Object.assign(Object.assign({},y),{shape:FO}):y,animate:"object"==typeof i?ia(i,"arc"):i},a)),tt({},qA,VA,Object.assign({type:"point",data:s,scale:f,style:g,animate:"object"==typeof i?ia(i,"indicator"):i},a)),tt({},UA,{style:Object.assign({text:KA(p,{target:l,total:u})},p),tooltip:d,animate:"object"==typeof i?ia(i,"text"):i})]};ZA.props={};const QA={density:EO},JA=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),f=(+(null==o?void 0:o[e])||0)*n,h=+i[e]+f+u/2;return[...a.map((n,r)=>[h+ +s[r][e]/t.length,+a[r][e]]),...a.map((n,r)=>[h-+s[r][e]/t.length,+a[r][e]]).reverse()].map(t=>r.map(t))});return[t,u]};JA.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:QA,channels:[...RM({shapes:Object.keys(QA)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...FM(),{type:Bn},{type:Na}],postInference:[...DM()],interaction:{shareTooltip:!0}};const tT={heatmap:CO},eT=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n,c=Array.from(t,t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]});return[[0],[c]]};eT.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:tT,channels:[...RM({shapes:Object.keys(tT)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...FM(),{type:Na},{type:La}],postInference:[...IM()]};const nT={axis:{x:!1,y:!1},legend:!1,tooltip:!1,encode:{x:"type",y:"percent"},scale:{y:{domain:[0,1]}},style:{shape:DO},animate:{enter:{type:"fadeIn"}}},rT={type:"text",style:{x:"50%",y:"50%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},animate:{enter:{type:"fadeIn"}}},iT=t=>{const{data:e={},style:n={},animate:r}=t,i=Ie(t,["data","style","animate"]),o=Math.max(0,I(e)?e:null==e?void 0:e.percent),a=[{percent:o,type:"liquid"}],s=Object.assign(Object.assign({},ia(n,"text")),ia(n,"content")),c=ia(n,"outline"),l=ia(n,"wave"),u=ia(n,"background");return[tt({},nT,Object.assign({type:"interval",data:a,style:{liquidOptions:{percent:o,liquidShape:null==n?void 0:n.shape},styleOptions:Object.assign(Object.assign({},n),{outline:c,wave:l,background:u})},animate:r},i)),tt({},rT,{style:Object.assign({text:`${jm(100*o)} %`},s),animate:r})]};iT.props={};const oT=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];oT.props={};const aT=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];aT.props={};const sT=t=>new Ji(t);sT.props={};const cT=t=>new bo(t);cT.props={};const lT=t=>new Ki(t);lT.props={};const uT=t=>new po(t);uT.props={};const fT=t=>new xo(t);fT.props={};const hT=t=>new Go(t);hT.props={};const dT=t=>new So(t);dT.props={};const pT=t=>new ko(t);pT.props={};const gT=t=>new Oo(t);gT.props={};const vT=t=>new To(t);vT.props={};const mT=t=>new _o(t);mT.props={};const yT=t=>new Mo(t);yT.props={};const bT=t=>new qo(t);bT.props={};const xT=t=>new eo(t);function wT({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:o,padding2:a,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:h,category10:d,category20:p,sizeDefault:g=1,padding:v="auto",margin:m=16}){return{padding:v,margin:m,size:g,color:t,category10:d,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:h,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:o,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,focusMarkerSize:12,itemSpacing:[o,o,o/2],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}xT.props={};const kT=wT({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),MT=t=>tt({},kT,t);MT.props={};const OT=t=>tt({},MT(),{category10:"category10",category20:"category20"},t);OT.props={};const ET=wT({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),ST=t=>tt({},ET,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),_T=t=>Object.assign({},ST(),{category10:"category10",category20:"category20"},t);_T.props={};const AT=wT({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),TT=t=>tt({},AT,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function PT(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}TT.props={};var CT,NT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function LT(t){if(!(e=NT.exec(t)))throw new Error("invalid format: "+t);var e;return new jT({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function jT(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function RT(t,e){var n=PT(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}LT.prototype=jT.prototype,jT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var IT={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>RT(100*t,e),r:RT,s:function(t,e){var n=PT(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(CT=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+PT(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function DT(t){return t}var BT,FT,zT=Array.prototype.map,$T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function WT(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?DT:(e=zT.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?DT:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(zT.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=LT(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(g=!0,y="g"):IT[y]||(void 0===v&&(v=12),m=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===h?o:/[%p]/.test(y)?c:"",w=IT[y],k=/[defgprs%]/.test(y);function M(t){var i,o,c,h=b,M=x;if("c"===y)M=w(t)+M,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0===+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:l:"-"===f||"("===f?"":f)+h,M=("s"===y?$T[8+CT/3]:"")+M+(O&&"("===f?")":""),k)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<p?new Array(p-E+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=LT(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=PT(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=$T[8+r/3];return function(t){return n(i*t)+o}}}}function GT(t,e,n){return t.querySelector(e)?Cm(t).select(e):Cm(t).append(n)}function HT(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function YT(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const o={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","flex-start","center"],right:["column","flex-start","center"],center:["column","center","center"]};return t in o&&([n,r,i]=o[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}BT=WT({thousands:",",grouping:[3],currency:["$",""]}),FT=BT.format;class qT extends gM{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class VT extends qT{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function UT(t,e){var n;return null===(n=t.filter(t=>t.getOptions().name===e))||void 0===n?void 0:n[0]}function XT(t){return"vertical"===t||t===-Math.PI/2}function KT(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,h=o||u||c,d=a||f||l,p=s?"horizontal":"vertical",[g,v]=s?[d,h]:[h,d];return{orientation:p,width:g,height:v,size:h,length:d}}function ZT(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Ie(t,["style"]),i={};return Object.entries(r).forEach(([t,n])=>{e.includes(t)?i[`show${G(t)}`]=n:i[t]=n}),Object.assign(Object.assign({},i),n)}function QT(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function JT(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function tP(t,e,n,r,i,o,a,s){var c;void 0===n&&void 0===o||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),o&&{tickMethod:o}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=Zn(e,t=>+t),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(il(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],h=new bo({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!cl(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new bo({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new bo({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return il(s)||rl(s)?u.map((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:ol(s)&&"center"===a||rl(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||rl(s)&&g(a)?1-l:l,label:f(h(jm(e),n,r)),id:String(n)}}):u.map((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(d(t.map(e)+o));return{value:g(a)?1-s:s,label:f(h(jm(e),n,r)),id:String(n)}})}function eP(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function nP(t,e,n){return!function(t){return il(t)&&rl(t)}(e)&&!sl(e)&&(void 0===t?!!n.getTicks:t)}function rP(t,e,n,r,i,o){const a=function(t,e,n,r,i){const o=n.axis,a=["top","right","bottom","left"].includes(i)?n[`axis${Jo(i)}`]:n.axisLinear,s=t.getOptions().name,c=n[`axis${G(s)}`]||{};return Object.assign({},o,a,c)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:XT(o)?10:0,tick:"center"!==r&&void 0}):a}const iP=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,c="string"==typeof n?FT(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:a});return t(l)(i)}},oP=iP(t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:o,actualPosition:a,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:h,tickMethod:d,tickLength:p,transform:g,indexBBox:v}=t,m=Ie(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","tickLength","transform","indexBBox"]);return({scales:i,value:y,coordinate:b,theme:x})=>{const{bbox:w}=y,[k]=i,{domain:M,xScale:O}=k.getOptions(),E=rP(k,0,x,e,s,o),S=Object.assign(Object.assign(Object.assign({},E),l),m),_=function(t,e,n="xy"){const[r,i,o]=JT(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,b,t.plane),A=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=n;if("bottom"===t)return{startPos:[o,a],endPos:[o+s,a]};if("left"===t)return{startPos:[o+s,a+c],endPos:[o+s,a]};if("right"===t)return{startPos:[o,a+c],endPos:[o,a]};if("top"===t)return{startPos:[o,a+c],endPos:[o+s,a+c]};if("center"===t){if("vertical"===e)return{startPos:[o,a],endPos:[o,a+c]};if("horizontal"===e)return{startPos:[o,a],endPos:[o+s,a]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=ul(r),[f,h]=fl(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=l*d,m=u*d,[y,b]=[t+o-p,n+a-g],[x,w]=[Math.cos(e),Math.sin(e)],k=[y+m*x,b+m*w],M=[y+v*x,b+v*w],O=()=>{const{domain:t}=i.getOptions();return t.length},E=il(r)&&i?O():3;return{startPos:k,endPos:M,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[y,b],gridControlAngles:new Array(E).fill(0).map((t,e,n)=>(h-f)/E*e)}}}return{}}(s,o,w,b,O),T=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(b),P=tP(k,M,f,r,h,d,s,b),C=v?P.map((t,e)=>{const n=v.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):P,N=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},S),{type:"linear",data:C,crossSize:c,titleText:HT(u),labelOverlap:eP(g,S),grid:nP(S.grid,b,k),gridLength:_,line:!0,indexBBox:v}),void 0!==p?{tickLength:p}:null),S.line?null:{lineOpacity:0}),A),T),n),L=N.labelOverlap.find(t=>"hide"===t.type);return L&&(N.crossSize=!1),new Mk({className:"axis",style:ZT(N)})}}),aP=iP(t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:o,tickFilter:a,tickCount:s,tickMethod:c,tickLength:l,important:u={},style:f={},indexBBox:h,title:d,grid:p=!1}=t,g=Ie(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","tickLength","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:f}=e,{domain:v}=t.getOptions(),m=tP(t,v,s,o,a,c,r,n),y=h?m.map((t,e)=>{const n=h.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):m,[b,x]=ul(n),w=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,h]=fl(i),[d,p]=JT(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,f,b,x,n),{axis:k,axisArc:M={}}=i,O=ZT(tt({},k,M,w,Object.assign(Object.assign(Object.assign({type:"arc",data:y,titleText:HT(d),grid:p},void 0!==l?{tickLength:l}:null),g),u)));return new Mk({style:ct(O,["transform"])})}});oP.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},aP.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const sP=t=>(...e)=>{const n=oP(Object.assign({},{crossPadding:50},t))(...e);return QT(n,t),n};sP.props=Object.assign(Object.assign({},oP.props),{defaultPosition:"bottom"});const cP=t=>(...e)=>{const n=oP(Object.assign({},{crossPadding:10},t))(...e);return QT(n,t),n};function lP(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=fl(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===a,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>(c-s)/i.count*e)})}cP.props=Object.assign(Object.assign({},oP.props),{defaultPosition:"left"});const uP=t=>{const{important:e={}}=t,n=Ie(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return oP(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},lP(t,i,o,a)),e)}))(r)}};function fP(t,e){const n=UT(t,"shape"),r=UT(t,"color"),i=n?n.clone():null,o=[];for(const[t,n]of e){const e=t.type,a=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map((e,r)=>{var o;return i?i.map(e||"point"):(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.shape)||n.defaultShape||"point"});"string"==typeof e&&o.push([e,a])}if(0===o.length)return["point",["point"]];if(1===o.length)return o[0];if(!n)return o[0];const{range:a}=n.getOptions();return o.map(([t,e])=>{let n=0;for(let t=0;t<o.length;t++){const r=a[t%a.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}function hP(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=fP(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,a;const s=(null===(a=null===(i=null===(n=r[`mark.${o}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===a?void 0:a.props.defaultMarker)||j(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:o,stroke:a,color:s}=e,c=Ie(e,["d","fill","lineWidth","path","stroke","color"]);const l=jy.get(t)||jy.get("point");return(...t)=>new uv({style:Object.assign(Object.assign({},c),{d:l(...t),stroke:l.style.includes("stroke")?s||a:"",fill:l.style.includes("fill")?s||r:"",lineWidth:l.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${a[t]}`;return UT(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function dP(t){const e=UT(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function pP(t,e){const{scales:n,markState:r}=e,[i,o]=fP(n,r),{itemMarker:a,itemMarkerLineWidth:s}=t;if(void 0!==s)return s;const c=["line","hyphen","dash","smooth","hv","hvh","vh","vhv"];if("string"==typeof a&&c.includes(a))return 4;if("function"==typeof a)return(t,e)=>{const n=a(t.id,e);if("string"==typeof n&&c.includes(n))return 4};const l=(Array.isArray(o)?o:[o]).some(t=>c.includes(t));return l?4:void 0}function gP(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,o=function(t,e){const n=UT(t,"size");return n instanceof po?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:hP(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:dP(r),itemMarkerLineWidth:pP(t,e)},s="string"==typeof n?FT(n):n,c=UT(r,"color"),l=function(t){return t.find(t=>t.getOptions().domain.length>0).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},a),{data:l.map(t=>({id:t,label:s(t),color:u(t)}))})}uP.props=Object.assign(Object.assign({},oP.props),{defaultPosition:"center"});const vP=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Ie(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:a}=r,{width:l,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=KT(t,e,n);return{width:i,height:o}}(r,t,vP),d=YT(o,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:HT(s)}),gP(t,e)),{legendCategory:g={}}=i,v=ZT(Object.assign({},g,function(t){return Object.assign(Object.assign({},t),{data:(null==t?void 0:t.data.filter(t=>""!==t.id))||[]})}(p),u)),m=new VT({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:v})});return m.appendChild(new Qk({className:"legend-category",style:v})),m}};function mP(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function yP(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],pa(e)];return[n,r]}function bP(t,e,n,r,i,o){const{length:a}=t,s=n||r,c=i.color?o.legendContinuous.ribbonFill||"black":o.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[_h(e).toString()]})),r}(s,c),[u,f]=yP(l),[h,d]=yP([e,n,r].filter(t=>void 0!==t).find(t=>!(t instanceof eo)));return Object.assign(Object.assign({},t),{domain:[h,d],data:l.getTicks().map(t=>({value:t})),color:new Array(Math.floor(a)).fill(0).map((t,e)=>{const n=(f-u)/(a-1)*e+u,i=l.map(n)||c,o=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${o})`)})})}function xP(t,e,n,r,i,o){const a=UT(t,"color"),s=function(t,e,n){const{size:r}=e,i=KT(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof Oo){const{range:t}=a.getOptions(),[e,n]=yP(a);return a instanceof _o||a instanceof To?mP(s,a,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,a,t)}return bP(s,a,UT(t,"size"),UT(t,"opacity"),e,o)}vP.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const wP=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Ie(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:a,scale:l})=>{const{bbox:u}=i,{x:h,y:d,width:p,height:g}=u,v=YT(o,n),{legendContinuous:m={}}=a,y=ZT(Object.assign({},m,Object.assign(Object.assign({titleText:HT(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>FT(e)(t.label):e},xP(r,l,i,t,wP,a)),c),f)),b=new qT({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},v),{subOptions:y})});return b.appendChild(new uM({className:"legend-continuous",style:y})),b}};wP.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const kP=t=>(...e)=>wP(Object.assign({},{block:!0},t))(...e);kP.props=Object.assign(Object.assign({},wP.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const MP=t=>e=>{const{scales:n}=e,r=UT(n,"size");return wP(Object.assign({},{type:"size",data:r.getTicks().map((t,e)=>({value:t,label:String(t)}))},t))(e)};MP.props=Object.assign(Object.assign({},wP.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const OP=t=>MP(Object.assign({},{block:!0},t));function EP(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}OP.props=Object.assign(Object.assign({},wP.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const SP=(_P={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Ie(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=ia(l,"title"),f=ia(l,"subtitle"),h=GT(e,".title","text").attr("className","title").call(Rm,Object.assign(Object.assign(Object.assign({},EP(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();GT(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},EP(0,h.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))})}},class extends ev{constructor(t){super(t),this.descriptor=_P}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(tt({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var _P;const AP=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new SP({style:tt({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function TP(t){return!!t.getBandWidth}function PP(t,e,n){if(!TP(t))return t.invert(e);const{adjustedRange:r}=t;if(r.includes(e))return t.invert(e);const{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map(t=>t+a),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(qn(s,e)+o,0,i.length-1);return i[c]}function CP(t,e,n){if(!e)return t.getOptions().domain;if(!TP(t)){const r=cr(e);if(!n)return r;const[i]=r,{range:o}=t.getOptions(),[a,s]=o,c=a>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],o=r.indexOf(i);if(n){const t=o+Math.round(r.length*n);return r.slice(o,t)}const a=e[e.length-1],s=r.indexOf(a);return r.slice(o,s+1)}function NP(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[PP(a,n,e),PP(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[CP(a,[l[0],u[0]]),CP(s,[l[1],u[1]])]}function LP(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}AP.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const jP=(t,e)=>{var n,r;const[i,o]=t,a=(null===(r=null===(n=e.getOptions)||void 0===n?void 0:n.call(e))||void 0===r?void 0:r.domain)||[],s=a.indexOf(i),c=a.indexOf(o);if(-1===s||-1===c)return[e.map(i),e.map(o)];const l=a.length;return l<=1?[0,1]:[s/(l-1),c/(l-1)]};const RP=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Ie(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[c],value:l,theme:u,coordinate:f}=r,{bbox:h}=l,{width:d,height:p}=h,{slider:g={}}=u,v=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),m="string"==typeof n?FT(n):n,y="horizontal"===e,b=rl(f)&&y,{trackSize:x=g.trackSize}=i,[w,k]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(h,o,x);return new kw({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:k,trackLength:y?d:p,orientation:e,formatter:t=>(m||v)(PP(c,b?1-t:t,!0)),sparklineData:IP(t,r)},i),a))})}};function IP(t,e){const{markState:n}=e;return x(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter(([t])=>"line"===t.type||"area"===t.type).filter(([t])=>t.slider).map(([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}});if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t),{});return Object.values(r)}(n,["y","series"])}RP.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const DP=t=>RP(Object.assign(Object.assign({},t),{orientation:"horizontal"}));DP.props=Object.assign(Object.assign({},RP.props),{defaultPosition:"bottom"});const BP=t=>RP(Object.assign(Object.assign({},t),{orientation:"vertical"}));BP.props=Object.assign(Object.assign({},RP.props),{defaultPosition:"left"});const FP=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Ie(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:o})=>{const{bbox:a}=n,{x:s,y:c,width:l,height:u}=a,{scrollbar:f={}}=o,{ratio:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,g=p/h,[v,m]=d,y=m>v?0:1;return new Mw({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:y}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};FP.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const zP=t=>FP(Object.assign(Object.assign({},t),{orientation:"horizontal"}));zP.props=Object.assign(Object.assign({},FP.props),{defaultPosition:"bottom"});const $P=t=>FP(Object.assign(Object.assign({},t),{orientation:"vertical"}));$P.props=Object.assign(Object.assign({},FP.props),{defaultPosition:"left"});const WP=t=>()=>new rv;WP.props={};const GP=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=rl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(h,Object.assign(Object.assign({},i),t))}},HP=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=rl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},YP=(t,e)=>{const n=1e-4,{coordinate:r}=e;return bv({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:lf.NUMBER}),(e,i,o)=>{const[a]=e;return il(r)?(e=>{const{__data__:i,style:a}=e,{fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a,{points:u,y:f,y1:h}=i,d=Fm(r,u,[f,h]),{innerRadius:p,outerRadius:g}=d,v=[{scaleInYRadius:p+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:p+n,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{scaleInYRadius:g,fillOpacity:s,strokeOpacity:c,opacity:l}];return e.animate(v,Object.assign(Object.assign({},o),t))})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=rl(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return e.animate(f,Object.assign(Object.assign({},o),t))})(a)}},qP=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=rl(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},VP=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};VP.props={};const UP=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:o,strokeOpacity:a,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};UP.props={};const XP={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},KP={[pu.CIRCLE]:["cx","cy","r"],[pu.ELLIPSE]:["cx","cy","rx","ry"],[pu.RECT]:["x","y","width","height"],[pu.IMAGE]:["x","y","width","height"],[pu.LINE]:["x1","y1","x2","y2"],[pu.POLYLINE]:["points"],[pu.POLYGON]:["points"]};function ZP(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=XP[i])}return r}const QP=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function JP(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function tC(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function eC(t,e){const[n,r,i,o]=JP(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),c=[],l=o/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,o=r+u*l;c.push(tC([t,o,e,l]))}f-=t,u+=1}return c}function nC(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function rC(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function iC(t){const e=od(t);if(e&&!function(t){return!rC(t,"m")||!rC(t,"M")}(e))return e}function oC(t){const{nodeName:e}=t;if("path"===e){const e=ot(t,"attributes");return e.markerEnd||e.markerStart}return!1}function aC(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=iC(e),s=iC(n),{opacity:c=1,strokeOpacity:l=1,fillOpacity:u=1}=e.style,{opacity:f=1,strokeOpacity:h=1,fillOpacity:d=1}=n.style,p=i===o&&"path"!==i,g=void 0===a||void 0===s,v=oC(e)||oC(n);if(p||g||v)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;nC(e,t);let o=QP;if(t.nodeName===pu.GROUP){const[n,i,o,a]=JP(t),[s,c,l,u]=JP(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(KP[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},ZP(t,o,!0)),Object.assign({transform:null!=i?i:"none"},ZP(e,o,!0))];return e.animate(a,n)}(e,n,r);const m=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new uv({style:Object.assign(Object.assign({},ZP(t,QP)),{d:e})});return nC(r,t),r}(t,a),y=Object.assign(Object.assign({},ZP(e,QP)),{opacity:c,strokeOpacity:l,fillOpacity:u}),b=Object.assign(Object.assign({},ZP(n,QP)),{opacity:f,strokeOpacity:h,fillOpacity:d}),x=[y,b];if(a!==s){x[0].d=a,x[1].d=s;const t=m.animate(x,r);return t.onfinish=()=>{ea(m,n),m.style.d=s,m.style.transform="none"},m.style.transform="none",t}return rt(y,b)?null:m.animate(x,r)}const sC=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:eC}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return aC(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map((e,r)=>aC(e,new uv({style:Object.assign({d:i[r]},ZP(t,QP))}),e,n))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map((t,r)=>aC(t,t,new uv({style:{d:i[r],fill:e.style.fill}}),n));return[...u,l]}(e,t,o,i)}return null};sC.props={};const cC=(t,e)=>{const n=1e-4;bv({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:lf.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!il(r))return GP(t,e)(i,o,a);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:h=1,strokeOpacity:d=1,opacity:p=1}=l,{points:g,y:v,y1:m}=c,y=kc().cornerRadius(u).padAngle(f*Math.PI/180),b=Fm(r,g,[v,m]),{startAngle:x,endAngle:w}=b,k=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:h,strokeOpacity:d,opacity:p}],M=s.animate(k,Object.assign(Object.assign({},a),t));return M.onframe=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:w}))},M}};cC.props={};const lC=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},uC=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(1)`.trimStart(),transformOrigin:l},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},fC=t=>(e,n,r)=>{var i,o;const[a]=e,s=(null===(o=(i=a).getTotalLength)||void 0===o?void 0:o.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(c,Object.assign(Object.assign({},r),t))};fC.props={};const hC=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new uv({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return GP(t,e)([f],r,i)};hC.props={};const dC=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new uv({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return YP(t,e)([f],r,i)};
21
21
  /*!
22
22
  * @antv/g-plugin-canvas-path-generator
23
23
  * @description A G plugin of path generator with Canvas2D API
@@ -26,7 +26,7 @@ var jv=function(t){function e(t,n,r,i){var o;return yl(this,e),(o=_l(this,e,[t])
26
26
  * @author AntVis
27
27
  * @docs https://g.antv.antgroup.com/
28
28
  */
29
- function fC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc(r,o,a,0,2*Math.PI,!1)}function hC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,o,a,s,0,0,2*Math.PI,!1);else{var c=a>s?a:s,l=a>s?1:a/s,u=a>s?s/a:1;t.save(),t.scale(l,u),t.arc(r,o,c,0,2*Math.PI)}}function dC(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=0,d=0,p=0,g=0,v=0;c&&Vg(c)&&u&&(n=a-i,r=s-o,v=Math.atan2(r,n),h=Math.cos(v)*(u||0),d=Math.sin(v)*(u||0)),l&&Vg(l)&&f&&(n=i-a,r=o-s,v=Math.atan2(r,n),p=Math.cos(v)*(f||0),g=Math.sin(v)*(f||0)),t.moveTo(i+h,o+d),t.lineTo(a+p,s+g)}function pC(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.d,l=c.absolutePath,u=c.segments,f=0,h=0,d=0,p=0,g=0;if(i&&Vg(i)&&a){var v=Pl(i.parentNode.getStartTangent(),2),m=v[0],y=v[1];n=m[0]-y[0],r=m[1]-y[1],g=Math.atan2(r,n),f=Math.cos(g)*(a||0),h=Math.sin(g)*(a||0)}if(o&&Vg(o)&&s){var b=Pl(o.parentNode.getEndTangent(),2),x=b[0],w=b[1];n=x[0]-w[0],r=x[1]-w[1],g=Math.atan2(r,n),d=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var k=0;k<l.length;k++){var M=l[k],O=M[0],E=l[k+1],S=0===k&&(0!==f||0!==h),_=(k===l.length-1||E&&("M"===E[0]||"Z"===E[0]))&&0!==d&&0!==p,A=Pl(S?[f,h]:[0,0],2),T=A[0],P=A[1],C=Pl(_?[d,p]:[0,0],2),N=C[0],L=C[1];switch(O){case"M":t.moveTo(M[1]+T,M[2]+P);break;case"L":t.lineTo(M[1]+N,M[2]+L);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+N,M[4]+L);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+N,M[6]+L);break;case"A":var j=u[k].arcParams,R=j.cx,I=j.cy,D=j.rx,B=j.ry,F=j.startAngle,z=j.endAngle,$=j.xRotation,W=j.sweepFlag;if(t.ellipse)t.ellipse(R,I,D,B,$,F,z,!!(1-W));else{var G=D>B?D:B,H=D>B?1:D/B,Y=D>B?B/D:1;t.translate(R,I),t.rotate($),t.scale(H,Y),t.arc(0,0,G,F,z,!!(1-W)),t.scale(1/H,1/Y),t.rotate(-$),t.translate(-R,-I)}_&&t.lineTo(M[6]+d,M[7]+p);break;case"Z":t.closePath()}}}function gC(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Vg(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&Vg(o)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),f+(g||m));for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h,d)}function vC(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Vg(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&Vg(o)&&s&&(n=c[l-2][0]-c[l-1][0],r=c[l-2][1]-c[l-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h+v,d+m)}function mC(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.radius,s=e.width,c=e.height,l=s,u=c,f=a&&a.some(function(t){return 0!==t});if(f){var h=s>0?1:-1,d=c>0?1:-1,p=h+d===0,g=a.map(function(t){return R(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))}),v=Pl(g,4),m=v[0],y=v[1],b=v[2],x=v[3];t.moveTo(h*m+r,o),t.lineTo(l-h*y+r,o),0!==y&&t.arc(l-h*y+r,d*y+o,y,-d*Math.PI/2,h>0?0:Math.PI,p),t.lineTo(l+r,u-d*b+o),0!==b&&t.arc(l-h*b+r,u-d*b+o,b,h>0?0:Math.PI,d>0?Math.PI/2:1.5*Math.PI,p),t.lineTo(h*x+r,u+o),0!==x&&t.arc(h*x+r,u-d*x+o,x,d>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,p),t.lineTo(r,d*m+o),0!==m&&t.arc(h*m+r,d*m+o,m,h>0?Math.PI:0,d>0?1.5*Math.PI:Math.PI/2,p)}else t.rect(r,o,l,u)}uC.props={};var yC=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="canvas-path-generator",t}return Tl(e,t),xl(e,[{key:"init",value:function(){var t,e=(gl(gl(gl(gl(gl(gl(gl(gl(gl(gl(t={},pu.CIRCLE,fC),pu.ELLIPSE,hC),pu.RECT,mC),pu.LINE,dC),pu.POLYLINE,vC),pu.POLYGON,gC),pu.PATH,pC),pu.TEXT,void 0),pu.GROUP,void 0),pu.IMAGE,void 0),gl(gl(gl(t,pu.HTML,void 0),pu.MESH,void 0),pu.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(vu),bC=te(),xC=te(),wC=te(),kC=mt(),MC=function(){function t(){var e=this;yl(this,t),this.isHit=function(t,n,r,i){var o=e.context.pointInPathPickerFactory[t.nodeName];if(o){var a=Ot(kC,r),s=de(xC,oe(wC,n[0],n[1],0),a);if(o(t,new Au(s[0],s[1]),i,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var r=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),i=e.context.pathGeneratorFactory[t.nodeName];return i&&(r.beginPath(),i(r,t.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return xl(t,[{key:"apply",value:function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,function(){var t=lu(su().mark(function t(e){return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(s,e));case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()),o.hooks.pickSync.tap(t.tag,function(t){return i.pick(s,t)})}},{key:"pick",value:function(t,e){var n,r=e.topmost,i=e.position,o=i.x,a=i.y,s=oe(bC,o,a,0),c=[],l=uu(t.elementsFromBBox(s[0],s[1],s[0],s[1]));try{for(l.s();!(n=l.n()).done;){var u=n.value,f=u.getWorldTransform();if(this.isHit(u,s,f,!1)){var h=rp(u);if(h){var d=h.parsedStyle.clipPath;if(this.isHit(d,s,d.getWorldTransform(),!0)){if(r)return e.picked=[u],e;c.push(u)}}else{if(r)return e.picked=[u],e;c.push(u)}}}}catch(t){l.e(t)}finally{l.f()}return e.picked=c,e}}])}();
29
+ function pC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc(r,o,a,0,2*Math.PI,!1)}function gC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,o,a,s,0,0,2*Math.PI,!1);else{var c=a>s?a:s,l=a>s?1:a/s,u=a>s?s/a:1;t.save(),t.scale(l,u),t.arc(r,o,c,0,2*Math.PI)}}function vC(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=0,d=0,p=0,g=0,v=0;c&&Vg(c)&&u&&(n=a-i,r=s-o,v=Math.atan2(r,n),h=Math.cos(v)*(u||0),d=Math.sin(v)*(u||0)),l&&Vg(l)&&f&&(n=i-a,r=o-s,v=Math.atan2(r,n),p=Math.cos(v)*(f||0),g=Math.sin(v)*(f||0)),t.moveTo(i+h,o+d),t.lineTo(a+p,s+g)}function mC(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.d,l=c.absolutePath,u=c.segments,f=0,h=0,d=0,p=0,g=0;if(i&&Vg(i)&&a){var v=Pl(i.parentNode.getStartTangent(),2),m=v[0],y=v[1];n=m[0]-y[0],r=m[1]-y[1],g=Math.atan2(r,n),f=Math.cos(g)*(a||0),h=Math.sin(g)*(a||0)}if(o&&Vg(o)&&s){var b=Pl(o.parentNode.getEndTangent(),2),x=b[0],w=b[1];n=x[0]-w[0],r=x[1]-w[1],g=Math.atan2(r,n),d=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var k=0;k<l.length;k++){var M=l[k],O=M[0],E=l[k+1],S=0===k&&(0!==f||0!==h),_=(k===l.length-1||E&&("M"===E[0]||"Z"===E[0]))&&0!==d&&0!==p,A=Pl(S?[f,h]:[0,0],2),T=A[0],P=A[1],C=Pl(_?[d,p]:[0,0],2),N=C[0],L=C[1];switch(O){case"M":t.moveTo(M[1]+T,M[2]+P);break;case"L":t.lineTo(M[1]+N,M[2]+L);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+N,M[4]+L);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+N,M[6]+L);break;case"A":var j=u[k].arcParams,R=j.cx,I=j.cy,D=j.rx,B=j.ry,F=j.startAngle,z=j.endAngle,$=j.xRotation,W=j.sweepFlag;if(t.ellipse)t.ellipse(R,I,D,B,$,F,z,!!(1-W));else{var G=D>B?D:B,H=D>B?1:D/B,Y=D>B?B/D:1;t.translate(R,I),t.rotate($),t.scale(H,Y),t.arc(0,0,G,F,z,!!(1-W)),t.scale(1/H,1/Y),t.rotate(-$),t.translate(-R,-I)}_&&t.lineTo(M[6]+d,M[7]+p);break;case"Z":t.closePath()}}}function yC(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Vg(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&Vg(o)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),f+(g||m));for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h,d)}function bC(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Vg(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&Vg(o)&&s&&(n=c[l-2][0]-c[l-1][0],r=c[l-2][1]-c[l-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h+v,d+m)}function xC(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.radius,s=e.width,c=e.height,l=s,u=c,f=a&&a.some(function(t){return 0!==t});if(f){var h=s>0?1:-1,d=c>0?1:-1,p=h+d===0,g=a.map(function(t){return R(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))}),v=Pl(g,4),m=v[0],y=v[1],b=v[2],x=v[3];t.moveTo(h*m+r,o),t.lineTo(l-h*y+r,o),0!==y&&t.arc(l-h*y+r,d*y+o,y,-d*Math.PI/2,h>0?0:Math.PI,p),t.lineTo(l+r,u-d*b+o),0!==b&&t.arc(l-h*b+r,u-d*b+o,b,h>0?0:Math.PI,d>0?Math.PI/2:1.5*Math.PI,p),t.lineTo(h*x+r,u+o),0!==x&&t.arc(h*x+r,u-d*x+o,x,d>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,p),t.lineTo(r,d*m+o),0!==m&&t.arc(h*m+r,d*m+o,m,h>0?Math.PI:0,d>0?1.5*Math.PI:Math.PI/2,p)}else t.rect(r,o,l,u)}dC.props={};var wC=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="canvas-path-generator",t}return Tl(e,t),xl(e,[{key:"init",value:function(){var t,e=(gl(gl(gl(gl(gl(gl(gl(gl(gl(gl(t={},pu.CIRCLE,pC),pu.ELLIPSE,gC),pu.RECT,xC),pu.LINE,vC),pu.POLYLINE,bC),pu.POLYGON,yC),pu.PATH,mC),pu.TEXT,void 0),pu.GROUP,void 0),pu.IMAGE,void 0),gl(gl(gl(t,pu.HTML,void 0),pu.MESH,void 0),pu.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(vu),kC=te(),MC=te(),OC=te(),EC=mt(),SC=function(){function t(){var e=this;yl(this,t),this.isHit=function(t,n,r,i){var o=e.context.pointInPathPickerFactory[t.nodeName];if(o){var a=Ot(EC,r),s=de(MC,oe(OC,n[0],n[1],0),a);if(o(t,new Au(s[0],s[1]),i,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var r=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),i=e.context.pathGeneratorFactory[t.nodeName];return i&&(r.beginPath(),i(r,t.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return xl(t,[{key:"apply",value:function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,function(){var t=lu(su().mark(function t(e){return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(s,e));case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()),o.hooks.pickSync.tap(t.tag,function(t){return i.pick(s,t)})}},{key:"pick",value:function(t,e){var n,r=e.topmost,i=e.position,o=i.x,a=i.y,s=oe(kC,o,a,0),c=[],l=uu(t.elementsFromBBox(s[0],s[1],s[0],s[1]));try{for(l.s();!(n=l.n()).done;){var u=n.value,f=u.getWorldTransform();if(this.isHit(u,s,f,!1)){var h=rp(u);if(h){var d=h.parsedStyle.clipPath;if(this.isHit(d,s,d.getWorldTransform(),!0)){if(r)return e.picked=[u],e;c.push(u)}}else{if(r)return e.picked=[u],e;c.push(u)}}}}catch(t){l.e(t)}finally{l.f()}return e.picked=c,e}}])}();
30
30
  /*!
31
31
  * @antv/g-plugin-canvas-picker
32
32
  * @description A G plugin for picking in canvas
@@ -34,7 +34,7 @@ function fC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc
34
34
  * @date 7/30/2025, 1:37:32 PM
35
35
  * @author AntVis
36
36
  * @docs https://g.antv.antgroup.com/
37
- */function OC(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.r,l=r.fill,u=r.stroke,f=r.lineWidth,h=void 0===f?1:f,d=r.increasedLineWidthForHitTesting,p=void 0===d?0:d,g=r.pointerEvents,v=void 0===g?"auto":g,m=(h+p)/2,y=Rl(o,s,e.x,e.y),b=Pl(cp(v,l,u),2),x=b[0],w=b[1];return x&&w||n?y<=c+m:x?y<=c:!!w&&(y>=c-m&&y<=c+m)}function EC(t,e,n,r){return t/(n*n)+e/(r*r)}function SC(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,h=r.lineWidth,d=void 0===h?1:h,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=e.x,b=e.y,x=Pl(cp(m,u,f),2),w=x[0],k=x[1],M=(d+g)/2,O=(y-o)*(y-o),E=(b-s)*(b-s);return w&&k||n?EC(O,E,c+M,l+M)<=1:w?EC(O,E,c,l)<=1:!!k&&(EC(O,E,c-M,l-M)>=1&&EC(O,E,c+M,l+M)<=1)}function _C(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function AC(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Rl(l.x,l.y,a,s)<=o/2}function TC(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&Gl(t,e,n,r,o,a)<=i/2}function PC(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(TC(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(TC(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}MC.tag="CanvasPicker";function CC(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function NC(t,e,n){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function LC(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(NC(a,s,[e,n]))return!0;CC(a[1]-n)>0!=CC(s[1]-n)>0&&CC(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function jC(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=LC(t[i],e,n))break}return r}function RC(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=void 0===c?1:c,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,h=r.pointerEvents;return!(!Pl(cp(void 0===h?"auto":h,r.fill,r.stroke),2)[1]&&!n||!l)&&TC(i,o,a,s,l+f,e.x,e.y)}function IC(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=void 0===s?1:s,l=a.increasedLineWidthForHitTesting,u=void 0===l?0:l,f=a.stroke,h=a.fill,d=a.d,p=a.pointerEvents,g=void 0===p?"auto":p,v=d.segments,m=d.hasArc,y=d.polylines,b=d.polygons,x=Pl(cp(g,(null==b?void 0:b.length)&&h,f),2),w=x[0],k=x[1],M=Vh(t),O=!1;return w||n?O=m?r(t,e):jC(b,e.x,e.y)||jC(y,e.x,e.y):((k||n)&&(O=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||_C(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=TC(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Ql(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Vl(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=un(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var v=Vl(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],o=v<=e/2)return!0}}}return o}(v,c+u,e.x,e.y,M)),O)}function DC(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=void 0===a?1:a,c=r.increasedLineWidthForHitTesting,l=void 0===c?0:c,u=r.points,f=r.pointerEvents,h=Pl(cp(void 0===f?"auto":f,o,i),2),d=h[0],p=!1;return(h[1]||n)&&(p=PC(u.points,s+l,e.x,e.y,!0)),p||!d&&!n||(p=LC(u.points,e.x,e.y)),p}function BC(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=void 0===i?1:i,a=r.increasedLineWidthForHitTesting,s=void 0===a?0:a,c=r.points,l=r.pointerEvents;return!(!Pl(cp(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!o)&&PC(c.points,o+s,e.x,e.y,!1)}function FC(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,u=void 0===l?1:l,f=o.increasedLineWidthForHitTesting,h=void 0===f?0:f,d=o.x,p=void 0===d?0:d,g=o.y,v=void 0===g?0:g,m=o.width,y=o.height,b=o.pointerEvents,x=Pl(cp(void 0===b?"auto":b,s,c),2),w=x[0],k=x[1],M=a&&a.some(function(t){return 0!==t}),O=u+h;if(M){var E=!1;return(k||n)&&(E=function(t,e,n,r,i,o,a,s){var c=Pl(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return TC(t+l,e,t+n-u,e,o,a,s)||TC(t+n,e+u,t+n,e+r-f,o,a,s)||TC(t+n-f,e+r,t+h,e+r,o,a,s)||TC(t,e+r-h,t,e+l,o,a,s)||AC(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||AC(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||AC(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||AC(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(p,v,m,y,a.map(function(t){return R(t,0,Math.min(Math.abs(m)/2,Math.abs(y)/2))}),O,e.x,e.y)),E||!w&&!n||(E=r(t,e)),E}var S=O/2;return w&&k||n?_C(p-S,v-S,m+S,y+S,e.x,e.y):w?_C(p,v,m,y,e.x,e.y):!!k&&function(t,e,n,r,i,o,a){var s=i/2;return _C(t-s,e-s,n,i,o,a)||_C(t+n-s,e-s,i,r,o,a)||_C(t+s,e+r-s,n,i,o,a)||_C(t-s,e+s,i,r,o,a)}(p,v,m,y,O,e.x,e.y)}function zC(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=void 0===s?"auto":s,l=a.x,u=void 0===l?0:l,f=a.y,h=void 0===f?0:f,d=a.width,p=a.height;if("non-transparent-pixel"===c){var g=i.config.offscreenCanvas,v=o.offscreenCanvasCreator.getOrCreateCanvas(g),m=o.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return v.width=d,v.height=p,i.defaultStyleRendererFactory[pu.IMAGE].render(m,ml(ml({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),m.getImageData(e.x-u,e.y-h,1,1).data.every(function(t){return 0!==t})}return!0}function $C(t,e,n,r){var i=t.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var WC=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="canvas-picker",t}return Tl(e,t),xl(e,[{key:"init",value:function(){var t,e=(gl(gl(gl(gl(gl(gl(gl(gl(gl(gl(t={},pu.CIRCLE,OC),pu.ELLIPSE,SC),pu.RECT,FC),pu.LINE,RC),pu.POLYLINE,BC),pu.POLYGON,DC),pu.PATH,IC),pu.TEXT,$C),pu.GROUP,null),pu.IMAGE,zC),gl(gl(t,pu.HTML,null),pu.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new MC)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(vu);function GC(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var HC=0;function YC(t){return"__private_"+HC+++"_"+t}
37
+ */function _C(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.r,l=r.fill,u=r.stroke,f=r.lineWidth,h=void 0===f?1:f,d=r.increasedLineWidthForHitTesting,p=void 0===d?0:d,g=r.pointerEvents,v=void 0===g?"auto":g,m=(h+p)/2,y=Rl(o,s,e.x,e.y),b=Pl(cp(v,l,u),2),x=b[0],w=b[1];return x&&w||n?y<=c+m:x?y<=c:!!w&&(y>=c-m&&y<=c+m)}function AC(t,e,n,r){return t/(n*n)+e/(r*r)}function TC(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,h=r.lineWidth,d=void 0===h?1:h,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=e.x,b=e.y,x=Pl(cp(m,u,f),2),w=x[0],k=x[1],M=(d+g)/2,O=(y-o)*(y-o),E=(b-s)*(b-s);return w&&k||n?AC(O,E,c+M,l+M)<=1:w?AC(O,E,c,l)<=1:!!k&&(AC(O,E,c-M,l-M)>=1&&AC(O,E,c+M,l+M)<=1)}function PC(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function CC(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Rl(l.x,l.y,a,s)<=o/2}function NC(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&Gl(t,e,n,r,o,a)<=i/2}function LC(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(NC(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(NC(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}SC.tag="CanvasPicker";function jC(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function RC(t,e,n){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function IC(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(RC(a,s,[e,n]))return!0;jC(a[1]-n)>0!=jC(s[1]-n)>0&&jC(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function DC(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=IC(t[i],e,n))break}return r}function BC(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=void 0===c?1:c,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,h=r.pointerEvents;return!(!Pl(cp(void 0===h?"auto":h,r.fill,r.stroke),2)[1]&&!n||!l)&&NC(i,o,a,s,l+f,e.x,e.y)}function FC(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=void 0===s?1:s,l=a.increasedLineWidthForHitTesting,u=void 0===l?0:l,f=a.stroke,h=a.fill,d=a.d,p=a.pointerEvents,g=void 0===p?"auto":p,v=d.segments,m=d.hasArc,y=d.polylines,b=d.polygons,x=Pl(cp(g,(null==b?void 0:b.length)&&h,f),2),w=x[0],k=x[1],M=Vh(t),O=!1;return w||n?O=m?r(t,e):DC(b,e.x,e.y)||DC(y,e.x,e.y):((k||n)&&(O=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||PC(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=NC(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Ql(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Vl(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=un(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var v=Vl(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],o=v<=e/2)return!0}}}return o}(v,c+u,e.x,e.y,M)),O)}function zC(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=void 0===a?1:a,c=r.increasedLineWidthForHitTesting,l=void 0===c?0:c,u=r.points,f=r.pointerEvents,h=Pl(cp(void 0===f?"auto":f,o,i),2),d=h[0],p=!1;return(h[1]||n)&&(p=LC(u.points,s+l,e.x,e.y,!0)),p||!d&&!n||(p=IC(u.points,e.x,e.y)),p}function $C(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=void 0===i?1:i,a=r.increasedLineWidthForHitTesting,s=void 0===a?0:a,c=r.points,l=r.pointerEvents;return!(!Pl(cp(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!o)&&LC(c.points,o+s,e.x,e.y,!1)}function WC(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,u=void 0===l?1:l,f=o.increasedLineWidthForHitTesting,h=void 0===f?0:f,d=o.x,p=void 0===d?0:d,g=o.y,v=void 0===g?0:g,m=o.width,y=o.height,b=o.pointerEvents,x=Pl(cp(void 0===b?"auto":b,s,c),2),w=x[0],k=x[1],M=a&&a.some(function(t){return 0!==t}),O=u+h;if(M){var E=!1;return(k||n)&&(E=function(t,e,n,r,i,o,a,s){var c=Pl(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return NC(t+l,e,t+n-u,e,o,a,s)||NC(t+n,e+u,t+n,e+r-f,o,a,s)||NC(t+n-f,e+r,t+h,e+r,o,a,s)||NC(t,e+r-h,t,e+l,o,a,s)||CC(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||CC(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||CC(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||CC(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(p,v,m,y,a.map(function(t){return R(t,0,Math.min(Math.abs(m)/2,Math.abs(y)/2))}),O,e.x,e.y)),E||!w&&!n||(E=r(t,e)),E}var S=O/2;return w&&k||n?PC(p-S,v-S,m+S,y+S,e.x,e.y):w?PC(p,v,m,y,e.x,e.y):!!k&&function(t,e,n,r,i,o,a){var s=i/2;return PC(t-s,e-s,n,i,o,a)||PC(t+n-s,e-s,i,r,o,a)||PC(t+s,e+r-s,n,i,o,a)||PC(t-s,e+s,i,r,o,a)}(p,v,m,y,O,e.x,e.y)}function GC(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=void 0===s?"auto":s,l=a.x,u=void 0===l?0:l,f=a.y,h=void 0===f?0:f,d=a.width,p=a.height;if("non-transparent-pixel"===c){var g=i.config.offscreenCanvas,v=o.offscreenCanvasCreator.getOrCreateCanvas(g),m=o.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return v.width=d,v.height=p,i.defaultStyleRendererFactory[pu.IMAGE].render(m,ml(ml({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),m.getImageData(e.x-u,e.y-h,1,1).data.every(function(t){return 0!==t})}return!0}function HC(t,e,n,r){var i=t.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var YC=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="canvas-picker",t}return Tl(e,t),xl(e,[{key:"init",value:function(){var t,e=(gl(gl(gl(gl(gl(gl(gl(gl(gl(gl(t={},pu.CIRCLE,_C),pu.ELLIPSE,TC),pu.RECT,WC),pu.LINE,BC),pu.POLYLINE,$C),pu.POLYGON,zC),pu.PATH,FC),pu.TEXT,HC),pu.GROUP,null),pu.IMAGE,GC),gl(gl(t,pu.HTML,null),pu.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new SC)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(vu);function qC(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var VC=0;function UC(t){return"__private_"+VC+++"_"+t}
38
38
  /*!
39
39
  * @antv/g-plugin-image-loader
40
40
  * @description A G plugin for loading image
@@ -42,7 +42,7 @@ function fC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc
42
42
  * @date 7/30/2025, 1:35:52 PM
43
43
  * @author AntVis
44
44
  * @docs https://g.antv.antgroup.com/
45
- */var qC=function(){return xl(function t(){yl(this,t),this.cacheStore=new Map},[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=ml(ml({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(n){e.release(n,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),VC=[],UC=[],XC=function(){function t(){yl(this,t)}return xl(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;VC.length<=0&&UC.length<=0||(UC.forEach(function(t){return t()}),UC=VC.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame(function(){t.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,c=e.naturalHeight||e.height,l=n-o,u=r-o,f=Math.ceil(s/l),h=Math.ceil(c/u),d={tileSize:[n,r],gridSize:[h,f],tiles:Array(h).fill(null).map(function(){return Array(f).fill(null)})},p=function(t){for(var o=function(o){VC.push(function(){var f=o*l,h=t*u,p=[Math.min(n,s-f),Math.min(r,c-h)],g=p[0],v=p[1],m=a.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,f,h,g,v,0,0,g,v),d.tiles[t][o]={x:f,y:h,tileX:o,tileY:t,data:m},i()})},h=0;h<f;h++)o(h)},g=0;g<h;g++)p(g);return t.stop(),t.executeTask(),d}}])}();XC.TASK_NUM_PER_FRAME=10;var KC=new qC;KC.onRefAdded=function(t){var e=this;t.addEventListener(cg.DESTROY,function(){e.releaseRef(t)},{once:!0})};var ZC=function(){return xl(function t(e,n){yl(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n},[{key:"getImageSync",value:function(t,e,n){var r=L(t)?t:t.src;if(KC.has(r)){var i=KC.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then(function(t){null==n||n(t)}).catch(function(t){console.error(t)}),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=L(t)?t:t.src;if(!L(t)&&!KC.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:QC(t)};KC.put(r,i,e)}if(KC.has(r)){var o=KC.get(r,e);return o.img.complete?Promise.resolve(o):new Promise(function(t,e){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=QC(o.img),t(o)}),o.img.addEventListener("error",function(t){e(t)})})}return new Promise(function(t,i){var o=n.context.config.createImage();if(o){var a={img:o,size:[0,0],tileSize:QC(o)};KC.put(r,a,e),o.onload=function(){a.size=[o.naturalWidth||o.width,o.naturalHeight||o.height],a.tileSize=QC(a.img),t(a)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=r}})}},{key:"createDownSampledImage",value:(e=lu(su().mark(function t(e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g,v;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(i=this.context.config.enableLargeImageOptimization,a=(o="boolean"==typeof i?{}:i).maxDownSampledImageSize,s=void 0===a?2048:a,c=o.downSamplingRateThreshold,l=void 0===c?.5:c,u=this.runtime.globalThis.createImageBitmap,f=Pl(r.size,2),h=f[0],d=f[1],p=r.img,g=Math.min((s+s)/(h+d),Math.max(.01,Math.min(l,.5))),v=ml(ml({},r),{},{downSamplingRate:g}),KC.update(r.img.src,v,n),!u){t.next=7;break}return t.prev=3,t.next=4,u(r.img,{resizeWidth:h*g,resizeHeight:d*g});case 4:p=t.sent,t.next=6;break;case 5:t.prev=5,t.catch(3),g=1;case 6:t.next=8;break;case 7:g=1;case 8:return v=ml(ml({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:g}),KC.update(r.img.src,v,n),t.abrupt("return",v);case 9:case"end":return t.stop()}},t,this,[[3,5]])})),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=lu(su().mark(function t(e,n,r,i){var o,a,s,c,l;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,i);case 1:return o=t.sent,a=i.ownerDocument.defaultView,s=a.requestAnimationFrame,c=a.cancelAnimationFrame,XC.api={requestAnimationFrame:s,cancelAnimationFrame:c,createCanvas:function(){return rg.createCanvas()}},l=ml(ml({},o),XC.sliceImage(o.img,o.tileSize[0],o.tileSize[0],r)),KC.update(o.img.src,l,i),t.abrupt("return",l);case 2:case"end":return t.stop()}},t,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){KC.release(L(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){KC.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,o,a){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var c,l=e.image,u=e.repetition,f=e.transform,h=!1;if(L(l)){var d=this.getImageSync(l,t,a);c=null==d?void 0:d.img}else r?(c=r,h=!0):c=l;var p,g=c&&n.createPattern(c,u);g&&(p=f?Ip(md(f),new Qg({})):kt(mt()),h&&At(p,p,[1/i,1/i,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+o[0],f:p[13]+o[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.min,a=t.width,s=t.height,c=t.angle,l=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===eh.LinearGradient){var d=function(t,e,n,r){var i=Iu(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}}(o,a,s,c),p=d.x1,g=d.y1,v=d.x2,m=d.y2;h=e.createLinearGradient(p,g,v,m)}else if(r===eh.RadialGradient){var y=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===Hf.kPercentage&&(a=r.value/100*e),i.unit===Hf.kPercentage&&(s=i.value/100*n);var c=Math.max(gn([0,0],[a,s]),gn([0,n],[a,s]),gn([e,n],[a,s]),gn([e,0],[a,s]));return o&&(o instanceof oh?c=o.value:o instanceof rh&&("closest-side"===o.value?c=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?c=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(c=Math.min(gn([0,0],[a,s]),gn([0,n],[a,s]),gn([e,n],[a,s]),gn([e,0],[a,s]))))),{x:a+t[0],y:s+t[1],r:c}}(o,a,s,l,u,f),b=y.x,x=y.y,w=y.r;h=e.createRadialGradient(b,x,0,b,x,w)}return h&&(i.forEach(function(t){var e,n=t.offset,r=t.color;n.unit===Hf.kPercentage&&(null===(e=h)||void 0===e||e.addColorStop(n.value/100,r.toString()))}),this.gradientCache[n]=h),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,r=t.width,i=t.height,o=t.steps,a=t.angle,s=t.cx,c=t.cy,l=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(o.map(function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)}).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return L(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function QC(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach(function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(r=t)}),[r,r]}ZC.isSupportTile=!!rg.createCanvas();var JC=function(){function t(){yl(this,t)}return xl(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},s=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===pu.IMAGE){var s=o.src,c=o.keepAspectRatio;i.getImageSync(s,e,function(t){var r=t.img,i=r.width,o=r.height;c&&a(e,i,o),e.renderable.dirty=!0,n.dirtify()})}},c=function(t){var e=t.target,r=t.attrName,o=t.prevValue,s=t.newValue;e.nodeName===pu.IMAGE&&"src"===r&&(o!==s&&i.releaseImage(o,e),L(s)&&i.getOrCreateImage(s,e).then(function(t){var r=t.img,i=r.width,o=r.height;e.attributes.keepAspectRatio&&a(e,i,o),e.renderable.dirty=!0,n.dirtify()}).catch(function(){}))};n.hooks.init.tap(t.tag,function(){o.addEventListener(cg.MOUNTED,s),o.addEventListener(cg.ATTR_MODIFIED,c)}),n.hooks.destroy.tap(t.tag,function(){o.removeEventListener(cg.MOUNTED,s),o.removeEventListener(cg.ATTR_MODIFIED,c)})}}])}();JC.tag="LoadImage";var tN=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="image-loader",t}return Tl(e,t),xl(e,[{key:"init",value:function(t){this.context.imagePool=new ZC(this.context,t),this.addRenderingPlugin(new JC)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(vu),eN=YC("renderState"),nN=function(){function t(e){yl(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,eN,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=mt(),this.dprMatrix=mt(),this.tmpMat4=mt(),this.vec3a=te(),this.vec3b=te(),this.vec3c=te(),this.vec3d=te(),this.canvasRendererPluginOptions=e}return xl(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,o=i.config,a=i.camera,s=i.renderingService,c=i.renderingContext,l=i.rBushRoot,u=i.pathGeneratorFactory,f=o.renderer.getConfig().enableRenderingOptimization;o.renderer.getConfig().enableDirtyCheck=!1,o.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=l,this.pathGeneratorFactory=u;var h=e.contextService,d=c.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;null!=e&&e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},g=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,function(){d.addEventListener(cg.UNMOUNTED,p),d.addEventListener(cg.CULLED,g);var t=h.getDPR(),e=o.width,n=o.height,i=h.getContext();r.clearRect(i,0,0,e*t,n*t,o.background)}),s.hooks.destroy.tap(t.tag,function(){d.removeEventListener(cg.UNMOUNTED,p),d.removeEventListener(cg.CULLED,g),r.renderQueue=[],r.removedRBushNodeAABBs=[],GC(r,eN)[eN]={restoreStack:[],prevObject:null,currentContext:null}});var v=function(t,e){for(var i=[t];i.length>0;){var o,a=i.pop();a.isVisible()&&!a.isCulled()&&(f?r.renderDisplayObjectOptimized(a,e,r.context,GC(r,eN)[eN],n):r.renderDisplayObject(a,e,r.context,GC(r,eN)[eN],n));for(var s=(null===(o=a.sortable)||void 0===o||null===(o=o.sorted)||void 0===o?void 0:o.length)>0?a.sortable.sorted:a.childNodes,c=s.length-1;c>=0;c--)i.push(s[c])}};s.hooks.endFrame.tap(t.tag,function(){if(function(){var t,e=h.getContext(),n=h.getDPR(),i=o.width,a=o.height,c=r.canvasRendererPluginOptions,l=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,f=s.getStats(),p=f.total,g=f.rendered,v=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=d.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>l&&v>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n,o.background))}(),0!==c.root.childNodes.length){f=o.renderer.getConfig().enableRenderingOptimization,GC(r,eN)[eN]={restoreStack:[],prevObject:null,currentContext:GC(r,eN)[eN].currentContext},GC(r,eN)[eN].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=h.getContext(),e=h.getDPR();if(Nt(r.dprMatrix,[e,e,1]),St(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)f?(t.save(),v(c.root,t),t.restore()):v(c.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(Ml(r.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Ou;return o.setMinMax([e,n,0],[r,i,0]),o}))));if(r.removedRBushNodeAABBs=[],Ou.isEmpty(i))return void(r.renderQueue=[]);var l=r.convertAABB2Rect(i),u=l.x,p=l.y,g=l.width,m=l.height,y=de(r.vec3a,[u,p,0],r.vpMatrix),b=de(r.vec3b,[u+g,p,0],r.vpMatrix),x=de(r.vec3c,[u,p+m,0],r.vpMatrix),w=de(r.vec3d,[u+g,p+m,0],r.vpMatrix),k=Math.min(y[0],b[0],w[0],x[0]),M=Math.min(y[1],b[1],w[1],x[1]),O=Math.max(y[0],b[0],w[0],x[0]),E=Math.max(y[1],b[1],w[1],x[1]),S=Math.floor(k),_=Math.floor(M),A=Math.ceil(O-k),T=Math.ceil(E-M);t.save(),r.clearRect(t,S,_,A,T,o.background),t.beginPath(),t.rect(S,_,A,T),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),o.renderer.getConfig().enableDirtyRectangleRenderingDebug&&d.dispatchEvent(new Jp(Sv.DIRTY_RECTANGLE,{dirtyRect:{x:S,y:_,width:A,height:T}})),r.searchDirtyObjects(i).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,GC(r,eN)[eN],n)}),t.restore(),r.renderQueue.forEach(function(t){r.saveDirtyAABB(t)}),r.renderQueue=[]}GC(r,eN)[eN].restoreStack.forEach(function(){t.restore()}),GC(r,eN)[eN].restoreStack=[]}else r.clearFullScreenLastFrame=!0}),s.hooks.render.tap(t.tag,function(t){r.clearFullScreen||r.renderQueue.push(t)})}},{key:"clearRect",value:function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var o=t.nodeName,a=!1,s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){(!r.prevObject||!Kt(l.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,l),r.prevObject=null);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),a=!0,e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!Kt(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var f=!r.prevObject;if(!f){var h=r.prevObject.nodeName;f=o===pu.TEXT?h!==pu.TEXT:o===pu.IMAGE?h!==pu.IMAGE:h===pu.TEXT||h===pu.IMAGE}s.applyStyleToContext(e,t,f,r),r.prevObject=t}c&&(e.beginPath(),c(e,t.parsedStyle),o!==pu.LINE&&o!==pu.PATH&&o!==pu.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,GC(this,eN)[eN],this,i),a&&e.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var o=t.nodeName,a=r.restoreStack[r.restoreStack.length-1];!a||t.compareDocumentPosition(a)&eg.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),o!==pu.LINE&&o!==pu.PATH&&o!==pu.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.dirty(!1)}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),b(s)||(t.lineDashOffset=s),b(o)||(t.globalAlpha*=o),b(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),b(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new Ou;return t.forEach(function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)}),e}},{key:"searchDirtyObjects",value:function(t){var e=Pl(t.getMin(),2),n=e[0],r=e[1],i=Pl(t.getMax(),2),o=i[0],a=i[1];return this.rBush.search({minX:n,minY:r,maxX:o,maxY:a}).map(function(t){return t.displayObject})}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Ou);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(bt(this.tmpMat4,e.getLocalTransform()),St(this.tmpMat4,n,this.tmpMat4),St(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(bt(this.tmpMat4,e.getWorldTransform()),St(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new Ou,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.add(e)}),t}}])}();
45
+ */var XC=function(){return xl(function t(){yl(this,t),this.cacheStore=new Map},[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=ml(ml({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(n){e.release(n,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),KC=[],ZC=[],QC=function(){function t(){yl(this,t)}return xl(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;KC.length<=0&&ZC.length<=0||(ZC.forEach(function(t){return t()}),ZC=KC.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame(function(){t.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,c=e.naturalHeight||e.height,l=n-o,u=r-o,f=Math.ceil(s/l),h=Math.ceil(c/u),d={tileSize:[n,r],gridSize:[h,f],tiles:Array(h).fill(null).map(function(){return Array(f).fill(null)})},p=function(t){for(var o=function(o){KC.push(function(){var f=o*l,h=t*u,p=[Math.min(n,s-f),Math.min(r,c-h)],g=p[0],v=p[1],m=a.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,f,h,g,v,0,0,g,v),d.tiles[t][o]={x:f,y:h,tileX:o,tileY:t,data:m},i()})},h=0;h<f;h++)o(h)},g=0;g<h;g++)p(g);return t.stop(),t.executeTask(),d}}])}();QC.TASK_NUM_PER_FRAME=10;var JC=new XC;JC.onRefAdded=function(t){var e=this;t.addEventListener(cg.DESTROY,function(){e.releaseRef(t)},{once:!0})};var tN=function(){return xl(function t(e,n){yl(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n},[{key:"getImageSync",value:function(t,e,n){var r=L(t)?t:t.src;if(JC.has(r)){var i=JC.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then(function(t){null==n||n(t)}).catch(function(t){console.error(t)}),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=L(t)?t:t.src;if(!L(t)&&!JC.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:eN(t)};JC.put(r,i,e)}if(JC.has(r)){var o=JC.get(r,e);return o.img.complete?Promise.resolve(o):new Promise(function(t,e){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=eN(o.img),t(o)}),o.img.addEventListener("error",function(t){e(t)})})}return new Promise(function(t,i){var o=n.context.config.createImage();if(o){var a={img:o,size:[0,0],tileSize:eN(o)};JC.put(r,a,e),o.onload=function(){a.size=[o.naturalWidth||o.width,o.naturalHeight||o.height],a.tileSize=eN(a.img),t(a)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=r}})}},{key:"createDownSampledImage",value:(e=lu(su().mark(function t(e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g,v;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(i=this.context.config.enableLargeImageOptimization,a=(o="boolean"==typeof i?{}:i).maxDownSampledImageSize,s=void 0===a?2048:a,c=o.downSamplingRateThreshold,l=void 0===c?.5:c,u=this.runtime.globalThis.createImageBitmap,f=Pl(r.size,2),h=f[0],d=f[1],p=r.img,g=Math.min((s+s)/(h+d),Math.max(.01,Math.min(l,.5))),v=ml(ml({},r),{},{downSamplingRate:g}),JC.update(r.img.src,v,n),!u){t.next=7;break}return t.prev=3,t.next=4,u(r.img,{resizeWidth:h*g,resizeHeight:d*g});case 4:p=t.sent,t.next=6;break;case 5:t.prev=5,t.catch(3),g=1;case 6:t.next=8;break;case 7:g=1;case 8:return v=ml(ml({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:g}),JC.update(r.img.src,v,n),t.abrupt("return",v);case 9:case"end":return t.stop()}},t,this,[[3,5]])})),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=lu(su().mark(function t(e,n,r,i){var o,a,s,c,l;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,i);case 1:return o=t.sent,a=i.ownerDocument.defaultView,s=a.requestAnimationFrame,c=a.cancelAnimationFrame,QC.api={requestAnimationFrame:s,cancelAnimationFrame:c,createCanvas:function(){return rg.createCanvas()}},l=ml(ml({},o),QC.sliceImage(o.img,o.tileSize[0],o.tileSize[0],r)),JC.update(o.img.src,l,i),t.abrupt("return",l);case 2:case"end":return t.stop()}},t,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){JC.release(L(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){JC.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,o,a){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var c,l=e.image,u=e.repetition,f=e.transform,h=!1;if(L(l)){var d=this.getImageSync(l,t,a);c=null==d?void 0:d.img}else r?(c=r,h=!0):c=l;var p,g=c&&n.createPattern(c,u);g&&(p=f?Ip(md(f),new Qg({})):kt(mt()),h&&At(p,p,[1/i,1/i,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+o[0],f:p[13]+o[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.min,a=t.width,s=t.height,c=t.angle,l=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===eh.LinearGradient){var d=function(t,e,n,r){var i=Iu(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}}(o,a,s,c),p=d.x1,g=d.y1,v=d.x2,m=d.y2;h=e.createLinearGradient(p,g,v,m)}else if(r===eh.RadialGradient){var y=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===Hf.kPercentage&&(a=r.value/100*e),i.unit===Hf.kPercentage&&(s=i.value/100*n);var c=Math.max(gn([0,0],[a,s]),gn([0,n],[a,s]),gn([e,n],[a,s]),gn([e,0],[a,s]));return o&&(o instanceof oh?c=o.value:o instanceof rh&&("closest-side"===o.value?c=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?c=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(c=Math.min(gn([0,0],[a,s]),gn([0,n],[a,s]),gn([e,n],[a,s]),gn([e,0],[a,s]))))),{x:a+t[0],y:s+t[1],r:c}}(o,a,s,l,u,f),b=y.x,x=y.y,w=y.r;h=e.createRadialGradient(b,x,0,b,x,w)}return h&&(i.forEach(function(t){var e,n=t.offset,r=t.color;n.unit===Hf.kPercentage&&(null===(e=h)||void 0===e||e.addColorStop(n.value/100,r.toString()))}),this.gradientCache[n]=h),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,r=t.width,i=t.height,o=t.steps,a=t.angle,s=t.cx,c=t.cy,l=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(o.map(function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)}).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return L(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function eN(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach(function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(r=t)}),[r,r]}tN.isSupportTile=!!rg.createCanvas();var nN=function(){function t(){yl(this,t)}return xl(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},s=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===pu.IMAGE){var s=o.src,c=o.keepAspectRatio;i.getImageSync(s,e,function(t){var r=t.img,i=r.width,o=r.height;c&&a(e,i,o),e.renderable.dirty=!0,n.dirtify()})}},c=function(t){var e=t.target,r=t.attrName,o=t.prevValue,s=t.newValue;e.nodeName===pu.IMAGE&&"src"===r&&(o!==s&&i.releaseImage(o,e),L(s)&&i.getOrCreateImage(s,e).then(function(t){var r=t.img,i=r.width,o=r.height;e.attributes.keepAspectRatio&&a(e,i,o),e.renderable.dirty=!0,n.dirtify()}).catch(function(){}))};n.hooks.init.tap(t.tag,function(){o.addEventListener(cg.MOUNTED,s),o.addEventListener(cg.ATTR_MODIFIED,c)}),n.hooks.destroy.tap(t.tag,function(){o.removeEventListener(cg.MOUNTED,s),o.removeEventListener(cg.ATTR_MODIFIED,c)})}}])}();nN.tag="LoadImage";var rN=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="image-loader",t}return Tl(e,t),xl(e,[{key:"init",value:function(t){this.context.imagePool=new tN(this.context,t),this.addRenderingPlugin(new nN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(vu),iN=UC("renderState"),oN=function(){function t(e){yl(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,iN,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=mt(),this.dprMatrix=mt(),this.tmpMat4=mt(),this.vec3a=te(),this.vec3b=te(),this.vec3c=te(),this.vec3d=te(),this.canvasRendererPluginOptions=e}return xl(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,o=i.config,a=i.camera,s=i.renderingService,c=i.renderingContext,l=i.rBushRoot,u=i.pathGeneratorFactory,f=o.renderer.getConfig().enableRenderingOptimization;o.renderer.getConfig().enableDirtyCheck=!1,o.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=l,this.pathGeneratorFactory=u;var h=e.contextService,d=c.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;null!=e&&e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},g=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,function(){d.addEventListener(cg.UNMOUNTED,p),d.addEventListener(cg.CULLED,g);var t=h.getDPR(),e=o.width,n=o.height,i=h.getContext();r.clearRect(i,0,0,e*t,n*t,o.background)}),s.hooks.destroy.tap(t.tag,function(){d.removeEventListener(cg.UNMOUNTED,p),d.removeEventListener(cg.CULLED,g),r.renderQueue=[],r.removedRBushNodeAABBs=[],qC(r,iN)[iN]={restoreStack:[],prevObject:null,currentContext:null}});var v=function(t,e){for(var i=[t];i.length>0;){var o,a=i.pop();a.isVisible()&&!a.isCulled()&&(f?r.renderDisplayObjectOptimized(a,e,r.context,qC(r,iN)[iN],n):r.renderDisplayObject(a,e,r.context,qC(r,iN)[iN],n));for(var s=(null===(o=a.sortable)||void 0===o||null===(o=o.sorted)||void 0===o?void 0:o.length)>0?a.sortable.sorted:a.childNodes,c=s.length-1;c>=0;c--)i.push(s[c])}};s.hooks.endFrame.tap(t.tag,function(){if(function(){var t,e=h.getContext(),n=h.getDPR(),i=o.width,a=o.height,c=r.canvasRendererPluginOptions,l=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,f=s.getStats(),p=f.total,g=f.rendered,v=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=d.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>l&&v>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n,o.background))}(),0!==c.root.childNodes.length){f=o.renderer.getConfig().enableRenderingOptimization,qC(r,iN)[iN]={restoreStack:[],prevObject:null,currentContext:qC(r,iN)[iN].currentContext},qC(r,iN)[iN].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=h.getContext(),e=h.getDPR();if(Nt(r.dprMatrix,[e,e,1]),St(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)f?(t.save(),v(c.root,t),t.restore()):v(c.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(Ml(r.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Ou;return o.setMinMax([e,n,0],[r,i,0]),o}))));if(r.removedRBushNodeAABBs=[],Ou.isEmpty(i))return void(r.renderQueue=[]);var l=r.convertAABB2Rect(i),u=l.x,p=l.y,g=l.width,m=l.height,y=de(r.vec3a,[u,p,0],r.vpMatrix),b=de(r.vec3b,[u+g,p,0],r.vpMatrix),x=de(r.vec3c,[u,p+m,0],r.vpMatrix),w=de(r.vec3d,[u+g,p+m,0],r.vpMatrix),k=Math.min(y[0],b[0],w[0],x[0]),M=Math.min(y[1],b[1],w[1],x[1]),O=Math.max(y[0],b[0],w[0],x[0]),E=Math.max(y[1],b[1],w[1],x[1]),S=Math.floor(k),_=Math.floor(M),A=Math.ceil(O-k),T=Math.ceil(E-M);t.save(),r.clearRect(t,S,_,A,T,o.background),t.beginPath(),t.rect(S,_,A,T),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),o.renderer.getConfig().enableDirtyRectangleRenderingDebug&&d.dispatchEvent(new Jp(Sv.DIRTY_RECTANGLE,{dirtyRect:{x:S,y:_,width:A,height:T}})),r.searchDirtyObjects(i).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,qC(r,iN)[iN],n)}),t.restore(),r.renderQueue.forEach(function(t){r.saveDirtyAABB(t)}),r.renderQueue=[]}qC(r,iN)[iN].restoreStack.forEach(function(){t.restore()}),qC(r,iN)[iN].restoreStack=[]}else r.clearFullScreenLastFrame=!0}),s.hooks.render.tap(t.tag,function(t){r.clearFullScreen||r.renderQueue.push(t)})}},{key:"clearRect",value:function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var o=t.nodeName,a=!1,s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){(!r.prevObject||!Kt(l.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,l),r.prevObject=null);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),a=!0,e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!Kt(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var f=!r.prevObject;if(!f){var h=r.prevObject.nodeName;f=o===pu.TEXT?h!==pu.TEXT:o===pu.IMAGE?h!==pu.IMAGE:h===pu.TEXT||h===pu.IMAGE}s.applyStyleToContext(e,t,f,r),r.prevObject=t}c&&(e.beginPath(),c(e,t.parsedStyle),o!==pu.LINE&&o!==pu.PATH&&o!==pu.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,qC(this,iN)[iN],this,i),a&&e.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var o=t.nodeName,a=r.restoreStack[r.restoreStack.length-1];!a||t.compareDocumentPosition(a)&eg.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),o!==pu.LINE&&o!==pu.PATH&&o!==pu.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.dirty(!1)}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),b(s)||(t.lineDashOffset=s),b(o)||(t.globalAlpha*=o),b(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),b(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new Ou;return t.forEach(function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)}),e}},{key:"searchDirtyObjects",value:function(t){var e=Pl(t.getMin(),2),n=e[0],r=e[1],i=Pl(t.getMax(),2),o=i[0],a=i[1];return this.rBush.search({minX:n,minY:r,maxX:o,maxY:a}).map(function(t){return t.displayObject})}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Ou);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(bt(this.tmpMat4,e.getLocalTransform()),St(this.tmpMat4,n,this.tmpMat4),St(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(bt(this.tmpMat4,e.getWorldTransform()),St(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new Ou,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.add(e)}),t}}])}();
46
46
  /*!
47
47
  * @antv/g-plugin-canvas-renderer
48
48
  * @description A G plugin of renderer implementation with Canvas2D API
@@ -50,7 +50,7 @@ function fC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc
50
50
  * @date 7/30/2025, 1:36:40 PM
51
51
  * @author AntVis
52
52
  * @docs https://g.antv.antgroup.com/
53
- */function rN(t,e,n,r,i,o,a){var s,c;if("rect"===t.image.nodeName){var l=t.image.parsedStyle,u=l.width,f=l.height;c=r.contextService.getDPR();var h=r.config.offscreenCanvas;(s=o.offscreenCanvasCreator.getOrCreateCanvas(h)).width=u*c,s.height=f*c;var d=o.offscreenCanvasCreator.getOrCreateContext(h),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach(function(t){i.renderDisplayObject(t,d,r,p,o)}),p.restoreStack.forEach(function(){d.restore()})}return a.getOrCreatePatternSync(e,t,n,s,c,e.getGeometryBounds().min,function(){e.dirty(),r.renderingService.dirtify()})}function iN(t,e,n,r){var i;if(t.type===eh.LinearGradient||t.type===eh.RadialGradient){var o=e.getGeometryBounds(),a=o&&2*o.halfExtents[0]||1,s=o&&2*o.halfExtents[1]||1,c=o&&o.min||[0,0];i=r.getOrCreateGradient(ml(ml({type:t.type},t.value),{},{min:c,width:a,height:s}),n)}return i}nN.tag="CanvasRenderer";var oN=["shadowBlur","shadowOffsetX","shadowOffsetY"],aN=["lineCap","lineJoin","miterLimit"],sN={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},cN={};function lN(t,e,n,r){var i=r.has(e)?r.get(e):sN[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var uN=function(){return xl(function t(e){yl(this,t),this.imagePool=e},[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,o){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?cN:r.prevObject.parsedStyle,o=e.parsedStyle;(n||o.opacity!==i.opacity)&&lN(t,"globalAlpha",b(o.opacity)?sN.globalAlpha:o.opacity,r.currentContext),(n||o.blend!==i.blend)&&lN(t,"globalCompositeOperation",b(o.blend)?sN.globalCompositeOperation:o.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?cN:r.prevObject.parsedStyle,o=e.parsedStyle,a=o.lineWidth,s=void 0===a?sN.lineWidth:a,c=o.fill&&!o.fill.isNone;if(o.stroke&&!o.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)lN(t,"strokeStyle",b(o.stroke)||Array.isArray(o.stroke)||o.stroke.isNone?sN.strokeStyle:e.attributes.stroke,r.currentContext);(n||o.lineWidth!==i.lineWidth)&&lN(t,"lineWidth",b(o.lineWidth)?sN.lineWidth:o.lineWidth,r.currentContext),(n||o.lineDash!==i.lineDash)&&lN(t,"lineDash",o.lineDash||sN.lineDash,r.currentContext),(n||o.lineDashOffset!==i.lineDashOffset)&&lN(t,"lineDashOffset",b(o.lineDashOffset)?sN.lineDashOffset:o.lineDashOffset,r.currentContext);for(var l=0;l<aN.length;l++){var u=aN[l];(n||o[u]!==i[u])&&lN(t,u,b(o[u])?sN[u]:o[u],r.currentContext)}}c&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&lN(t,"fillStyle",b(o.fill)||Array.isArray(o.fill)||o.fill.isNone?sN.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===pu.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){lN(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var o=0;o<oN.length;o++){var a=oN[o];lN(t,a,i[a]||sN[a],r.currentContext)}}i.filter&&i.filter.length&&lN(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){lN(t,"shadowColor",sN.shadowColor,r.currentContext);for(var o=0;o<oN.length;o++){var a=oN[o];lN(t,a,sN[a],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!b(s)&&s.indexOf("drop-shadow")>-1&&lN(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||sN.filter,r.currentContext)}else lN(t,"filter",sN.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle,s=a.fill,c=a.fillRule,l=null;if(Array.isArray(s)&&s.length>0)s.forEach(function(r){var i=lN(t,"fillStyle",iN(r,e,t,o.imagePool),n.currentContext);l=null!=l?l:i,c?t.fill(c):t.fill()});else{if(Eh(s)){var u=rN(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,l=!0)}c?t.fill(c):t.fill()}null!==l&&lN(t,"fillStyle",l,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle.stroke,s=null;if(Array.isArray(a)&&a.length>0)a.forEach(function(r){var i=lN(t,"strokeStyle",iN(r,e,t,o.imagePool),n.currentContext);s=null!=s?s:i,t.stroke()});else{if(Eh(a)){var c=rN(a,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(c){var l=lN(t,"strokeStyle",c,n.currentContext);s=null!=s?s:l}}t.stroke()}null!==s&&lN(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var o,a=e.nodeName,s=e.parsedStyle,c=s.opacity,l=void 0===c?sN.globalAlpha:c,u=s.fillOpacity,f=void 0===u?sN.fillOpacity:u,h=s.strokeOpacity,d=void 0===h?sN.strokeOpacity:h,p=s.lineWidth,g=void 0===p?sN.lineWidth:p,v=s.fill&&!s.fill.isNone,m=s.stroke&&!s.stroke.isNone&&g>0;if(v||m){var y=!b(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,w=0===(null===(o=s.fill)||void 0===o?void 0:o.alpha),k=!(!s.filter||!s.filter.length),M=y&&m&&(a===pu.PATH||a===pu.LINE||a===pu.POLYLINE||w||x),O=null;if(v)M||this.applyShadowAndFilterStyleToContext(t,e,y,n),O=lN(t,"globalAlpha",l*f,n.currentContext),this.fillToContext(t,e,n,r,i),M||this.clearShadowAndFilterStyleForContext(t,y,k,n);if(m){var E=!1,S=lN(t,"globalAlpha",l*d,n.currentContext);if(O=v?O:S,M&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),E=!0,x)){var _=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=_,this.clearShadowAndFilterStyleForContext(t,y,k,n,!0)}this.strokeToContext(t,e,n,r,i),E&&this.clearShadowAndFilterStyleForContext(t,y,k,n)}null!==O&&lN(t,"globalAlpha",O,n.currentContext)}}}])}(),fN=function(t){function e(){return yl(this,e),_l(this,e,arguments)}return Tl(e,t),xl(e,[{key:"render",value:function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=void 0===c?1:c,u=e.fillOpacity,f=void 0===u?1:u,h=e.stroke,d=e.strokeOpacity,p=void 0===d?1:d,g=e.lineWidth,v=void 0===g?1:g,m=e.lineCap,y=e.lineJoin,x=e.shadowType,w=e.shadowColor,k=e.shadowBlur,M=e.filter,O=e.miterLimit,E=a&&!a.isNone,S=h&&!h.isNone&&v>0,_=0===(null==a?void 0:a.alpha),A=!(!M||!M.length),T=!b(w)&&k>0,P=n.nodeName,C="inner"===x,N=S&&T&&(P===pu.PATH||P===pu.LINE||P===pu.POLYLINE||_||C);E&&(t.globalAlpha=l*f,N||hN(n,t,T),dN(t,n,a,s,r,i,o,this.imagePool),N||this.clearShadowAndFilter(t,A,T)),S&&(t.globalAlpha=l*p,t.lineWidth=v,b(O)||(t.miterLimit=O),b(m)||(t.lineCap=m),b(y)||(t.lineJoin=y),N&&(C&&(t.globalCompositeOperation="source-atop"),hN(n,t,!0),C&&(pN(t,n,h,r,i,o,this.imagePool),t.globalCompositeOperation=sN.globalCompositeOperation,this.clearShadowAndFilter(t,A,!0))),pN(t,n,h,r,i,o,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!b(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(uN);function hN(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}function dN(t,e,n,r,i,o,a,s){var c=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach(function(n){t.fillStyle=iN(n,e,t,s),c||(r?t.fill(r):t.fill())}):(Eh(n)&&(t.fillStyle=rN(n,e,t,i,o,a,s)),c||(r?t.fill(r):t.fill()))}function pN(t,e,n,r,i,o,a){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach(function(n){t.strokeStyle=iN(n,e,t,a),s||t.stroke()}):(Eh(n)&&(t.strokeStyle=rN(n,e,t,r,i,o,a)),s||t.stroke())}var gN=function(t){function e(){return yl(this,e),_l(this,e,arguments)}return Tl(e,t),xl(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,o=r.imageCache;o.downSampled?t.drawImage(o.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then(function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())}).catch(function(t){console.error(t)})}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,o=r.imageCache,a=r.imageRect,s=r.drawRect,c=o.size,l=t.getTransform(),u=l.a,f=l.b,h=l.c,d=l.d,p=l.e,g=l.f;if(t.resetTransform(),null!=o&&o.gridSize){for(var v=[c[0]/a[2],c[1]/a[3]],m=[o.tileSize[0]/v[0],o.tileSize[1]/v[1]],y=[Math.floor((s[0]-a[0])/m[0]),Math.ceil((s[0]+s[2]-a[0])/m[0])],b=y[0],x=y[1],w=[Math.floor((s[1]-a[1])/m[1]),Math.ceil((s[1]+s[3]-a[1])/m[1])],k=w[1],M=w[0];M<=k;M++)for(var O=b;O<=x;O++){var E=o.tiles[M][O];if(E){var S=[Math.floor(a[0]+E.tileX*m[0]),Math.floor(a[1]+E.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];t.drawImage(E.data,S[0],S[1],S[2],S[3])}}t.setTransform(u,f,h,d,p,g)}else this.imagePool.createImageTiles(i,[],function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())},n).catch(function(t){console.error(t)})}},{key:"render",value:function(t,n,r){var i=n.x,o=void 0===i?0:i,a=n.y,s=void 0===a?0:a,c=n.width,l=n.height,u=n.src,f=n.shadowColor,h=n.shadowBlur,d=this.imagePool.getImageSync(u,r),p=null==d?void 0:d.img,g=c,v=l;if(p){g||(g=p.width),v||(v=p.height),hN(r,t,!b(f)&&h>0);try{var m=r.ownerDocument.defaultView.getContextService().getDomElement(),y=m.width,x=m.height,w=t.getTransform(),k=w.a,M=w.b,O=function(t,e){var n=de(te(),[t[0],t[1],0],e),r=de(te(),[t[0]+t[2],t[1],0],e),i=de(te(),[t[0],t[1]+t[3],0],e),o=de(te(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0])-Math.min(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])-Math.min(n[1],r[1],i[1],o[1])]}([o,s,g,v],xt(k,w.c,0,0,M,w.d,0,0,0,0,1,0,w.e,w.f,0,1)),E=function(t,e){var n=Pl(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Pl(e,4),c=s[0],l=s[1],u=s[2],f=s[3],h=Math.max(r,c),d=Math.max(i,l),p=Math.min(r+o,c+u),g=Math.min(i+a,l+f);return p<=h||g<=d?null:[h,d,p-h,g-d]}([0,0,y,x],O);if(!E)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:p,drawRect:[o,s,g,v]});if(O[2]/d.size[0]<(d.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:d,drawRect:[o,s,g,v]});if(!ZC.isSupportTile)return void e.renderFull(t,n,r,{image:p,drawRect:[o,s,g,v]});this.renderTile(t,n,r,{src:u,imageCache:d,imageRect:O,drawRect:E})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}(fN),vN=function(t){function e(){return yl(this,e),_l(this,e,arguments)}return Tl(e,t),xl(e,[{key:"render",value:function(t,e,n,r,i,o){n.getBounds();var a=e.lineWidth,s=void 0===a?1:a,c=e.textAlign,l=void 0===c?"start":c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.lineJoin,d=void 0===h?"miter":h,p=e.miterLimit,g=void 0===p?10:p,v=e.letterSpacing,m=void 0===v?0:v,y=e.stroke,x=e.fill,w=e.fillRule,k=e.fillOpacity,M=void 0===k?1:k,O=e.strokeOpacity,E=void 0===O?1:O,S=e.opacity,_=void 0===S?1:S,A=e.metrics,T=e.x,P=void 0===T?0:T,C=e.y,N=void 0===C?0:C,L=e.dx,j=e.dy,R=e.shadowColor,I=e.shadowBlur,D=A.font,B=A.lines,F=A.height,z=A.lineHeight,$=A.lineMetrics;t.font=D,t.lineWidth=s,t.textAlign="middle"===l?"center":l;var W=f;"alphabetic"===W&&(W="bottom"),t.lineJoin=d,b(g)||(t.miterLimit=g);var G=N;"middle"===f?G+=-F/2-z/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?G+=-F:"top"!==f&&"hanging"!==f||(G+=-z);var H=P+(L||0);G+=j||0,1===B.length&&("bottom"===W?(W="middle",G-=.5*F):"top"===W&&(W="middle",G+=.5*F)),t.textBaseline=W,hN(n,t,!b(R)&&I>0);for(var Y=0;Y<B.length;Y++){var q=s/2+H;G+=z,b(y)||y.isNone||!s||this.drawLetterSpacing(t,n,B[Y],$[Y],l,q,G,m,x,w,M,y,E,_,!0,r,i,o),b(x)||this.drawLetterSpacing(t,n,B[Y],$[Y],l,q,G,m,x,w,M,y,E,_,!1,r,i,o)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,v,m){if(0!==s){var y=t.textAlign;t.textAlign="left";var b=o;"center"===i||"middle"===i?b=o-r.width/2:"right"!==i&&"end"!==i||(b=o-r.width);for(var x=Array.from(n),w=t.measureText(n).width,k=0,M=0;M<x.length;++M){var O=x[M];p?this.strokeText(t,e,O,b,a,f,h,g,v,m):this.fillText(t,e,O,b,a,c,l,u,d,g,v,m),b+=w-(k=t.measureText(n.substring(M+1)).width)+s,w=k}t.textAlign=y}else p?this.strokeText(t,e,n,o,a,f,h,g,v,m):this.fillText(t,e,n,o,a,c,l,u,d,g,v,m)}},{key:"fillText",value:function(t,e,n,r,i,o,a,s,c,l,u,f){var h;dN(t,e,o,a,l,u,f,this.imagePool,!0);var d=!b(s)&&1!==s;d&&(h=t.globalAlpha,t.globalAlpha=s*c),t.fillText(n,r,i),d&&(t.globalAlpha=h)}},{key:"strokeText",value:function(t,e,n,r,i,o,a,s,c,l){var u;pN(t,e,o,s,c,l,this.imagePool,!0);var f=!b(a)&&1!==a;f&&(u=t.globalAlpha,t.globalAlpha=a),t.strokeText(n,r,i),f&&(t.globalAlpha=u)}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,r,i)}}])}(fN),mN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yl(this,e),(t=_l(this,e)).name="canvas-renderer",t.options=n,t}return Tl(e,t),xl(e,[{key:"init",value:function(){var t,e=ml({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new fN(n),i=(gl(gl(gl(gl(gl(gl(gl(gl(gl(gl(t={},pu.CIRCLE,r),pu.ELLIPSE,r),pu.RECT,r),pu.IMAGE,new gN(n)),pu.TEXT,new vN(n)),pu.LINE,r),pu.POLYLINE,r),pu.POLYGON,r),pu.PATH,r),pu.GROUP,void 0),gl(gl(gl(t,pu.HTML,void 0),pu.MESH,void 0),pu.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new nN(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(vu),yN=function(){function t(){yl(this,t)}return xl(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0),n.globalThis.removeEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)})}}])}();yN.tag="DOMInteraction";var bN=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="dom-interaction",t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.addRenderingPlugin(new yN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(vu),xN=function(){function t(){yl(this,t),this.displayObjectHTMLElementMap=new WeakMap}return xl(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===pu.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach(function(t){r.updateAttribute(t,e)}),l(e,n),c.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===pu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===pu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;(e.nodeName===pu.FRAGMENT?e.childNodes:[e]).forEach(function(t){if(t.nodeName===pu.HTML){var e=r.getOrCreateEl(t);l(t,e)}})},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,function(){s.addEventListener(Sv.RESIZE,p),s.addEventListener(cg.MOUNTED,u),s.addEventListener(cg.UNMOUNTED,f),s.addEventListener(cg.ATTR_MODIFIED,h),s.addEventListener(cg.BOUNDS_CHANGED,d)}),a.hooks.endFrame.tap(t.tag,function(){r.$camera&&o.renderReasons.has(ig.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),a.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Sv.RESIZE,p),s.removeEventListener(cg.MOUNTED,u),s.removeEventListener(cg.UNMOUNTED,f),s.removeEventListener(cg.ATTR_MODIFIED,h),s.removeEventListener(cg.BOUNDS_CHANGED,d)})}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#".concat(s));if(!c){var l=(n||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");c=u,u.id=s,u.style.position="absolute",u.style.left="".concat(o.offsetLeft||0,"px"),u.style.top="".concat(o.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",l.appendChild(u),a.appendChild(l)}return c}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;L(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var o=e.parsedStyle.width;n.style.width=I(o)?"".concat(o,"px"):o.toString();break;case"height":var a=e.parsedStyle.height;n.style.height=I(a)?"".concat(a,"px"):a.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,u=void 0===l?"auto":l;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var h=e.parsedStyle.fill,d="";Sh(h)?d=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)&&(d=e.getAttribute("fill")),n.style.background=d;break;case"stroke":var p=e.parsedStyle.stroke,g="";Sh(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var v=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(v||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:b(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();
53
+ */function aN(t,e,n,r,i,o,a){var s,c;if("rect"===t.image.nodeName){var l=t.image.parsedStyle,u=l.width,f=l.height;c=r.contextService.getDPR();var h=r.config.offscreenCanvas;(s=o.offscreenCanvasCreator.getOrCreateCanvas(h)).width=u*c,s.height=f*c;var d=o.offscreenCanvasCreator.getOrCreateContext(h),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach(function(t){i.renderDisplayObject(t,d,r,p,o)}),p.restoreStack.forEach(function(){d.restore()})}return a.getOrCreatePatternSync(e,t,n,s,c,e.getGeometryBounds().min,function(){e.dirty(),r.renderingService.dirtify()})}function sN(t,e,n,r){var i;if(t.type===eh.LinearGradient||t.type===eh.RadialGradient){var o=e.getGeometryBounds(),a=o&&2*o.halfExtents[0]||1,s=o&&2*o.halfExtents[1]||1,c=o&&o.min||[0,0];i=r.getOrCreateGradient(ml(ml({type:t.type},t.value),{},{min:c,width:a,height:s}),n)}return i}oN.tag="CanvasRenderer";var cN=["shadowBlur","shadowOffsetX","shadowOffsetY"],lN=["lineCap","lineJoin","miterLimit"],uN={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},fN={};function hN(t,e,n,r){var i=r.has(e)?r.get(e):uN[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var dN=function(){return xl(function t(e){yl(this,t),this.imagePool=e},[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,o){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?fN:r.prevObject.parsedStyle,o=e.parsedStyle;(n||o.opacity!==i.opacity)&&hN(t,"globalAlpha",b(o.opacity)?uN.globalAlpha:o.opacity,r.currentContext),(n||o.blend!==i.blend)&&hN(t,"globalCompositeOperation",b(o.blend)?uN.globalCompositeOperation:o.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?fN:r.prevObject.parsedStyle,o=e.parsedStyle,a=o.lineWidth,s=void 0===a?uN.lineWidth:a,c=o.fill&&!o.fill.isNone;if(o.stroke&&!o.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)hN(t,"strokeStyle",b(o.stroke)||Array.isArray(o.stroke)||o.stroke.isNone?uN.strokeStyle:e.attributes.stroke,r.currentContext);(n||o.lineWidth!==i.lineWidth)&&hN(t,"lineWidth",b(o.lineWidth)?uN.lineWidth:o.lineWidth,r.currentContext),(n||o.lineDash!==i.lineDash)&&hN(t,"lineDash",o.lineDash||uN.lineDash,r.currentContext),(n||o.lineDashOffset!==i.lineDashOffset)&&hN(t,"lineDashOffset",b(o.lineDashOffset)?uN.lineDashOffset:o.lineDashOffset,r.currentContext);for(var l=0;l<lN.length;l++){var u=lN[l];(n||o[u]!==i[u])&&hN(t,u,b(o[u])?uN[u]:o[u],r.currentContext)}}c&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&hN(t,"fillStyle",b(o.fill)||Array.isArray(o.fill)||o.fill.isNone?uN.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===pu.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){hN(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var o=0;o<cN.length;o++){var a=cN[o];hN(t,a,i[a]||uN[a],r.currentContext)}}i.filter&&i.filter.length&&hN(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){hN(t,"shadowColor",uN.shadowColor,r.currentContext);for(var o=0;o<cN.length;o++){var a=cN[o];hN(t,a,uN[a],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!b(s)&&s.indexOf("drop-shadow")>-1&&hN(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||uN.filter,r.currentContext)}else hN(t,"filter",uN.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle,s=a.fill,c=a.fillRule,l=null;if(Array.isArray(s)&&s.length>0)s.forEach(function(r){var i=hN(t,"fillStyle",sN(r,e,t,o.imagePool),n.currentContext);l=null!=l?l:i,c?t.fill(c):t.fill()});else{if(Eh(s)){var u=aN(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,l=!0)}c?t.fill(c):t.fill()}null!==l&&hN(t,"fillStyle",l,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle.stroke,s=null;if(Array.isArray(a)&&a.length>0)a.forEach(function(r){var i=hN(t,"strokeStyle",sN(r,e,t,o.imagePool),n.currentContext);s=null!=s?s:i,t.stroke()});else{if(Eh(a)){var c=aN(a,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(c){var l=hN(t,"strokeStyle",c,n.currentContext);s=null!=s?s:l}}t.stroke()}null!==s&&hN(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var o,a=e.nodeName,s=e.parsedStyle,c=s.opacity,l=void 0===c?uN.globalAlpha:c,u=s.fillOpacity,f=void 0===u?uN.fillOpacity:u,h=s.strokeOpacity,d=void 0===h?uN.strokeOpacity:h,p=s.lineWidth,g=void 0===p?uN.lineWidth:p,v=s.fill&&!s.fill.isNone,m=s.stroke&&!s.stroke.isNone&&g>0;if(v||m){var y=!b(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,w=0===(null===(o=s.fill)||void 0===o?void 0:o.alpha),k=!(!s.filter||!s.filter.length),M=y&&m&&(a===pu.PATH||a===pu.LINE||a===pu.POLYLINE||w||x),O=null;if(v)M||this.applyShadowAndFilterStyleToContext(t,e,y,n),O=hN(t,"globalAlpha",l*f,n.currentContext),this.fillToContext(t,e,n,r,i),M||this.clearShadowAndFilterStyleForContext(t,y,k,n);if(m){var E=!1,S=hN(t,"globalAlpha",l*d,n.currentContext);if(O=v?O:S,M&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),E=!0,x)){var _=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=_,this.clearShadowAndFilterStyleForContext(t,y,k,n,!0)}this.strokeToContext(t,e,n,r,i),E&&this.clearShadowAndFilterStyleForContext(t,y,k,n)}null!==O&&hN(t,"globalAlpha",O,n.currentContext)}}}])}(),pN=function(t){function e(){return yl(this,e),_l(this,e,arguments)}return Tl(e,t),xl(e,[{key:"render",value:function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=void 0===c?1:c,u=e.fillOpacity,f=void 0===u?1:u,h=e.stroke,d=e.strokeOpacity,p=void 0===d?1:d,g=e.lineWidth,v=void 0===g?1:g,m=e.lineCap,y=e.lineJoin,x=e.shadowType,w=e.shadowColor,k=e.shadowBlur,M=e.filter,O=e.miterLimit,E=a&&!a.isNone,S=h&&!h.isNone&&v>0,_=0===(null==a?void 0:a.alpha),A=!(!M||!M.length),T=!b(w)&&k>0,P=n.nodeName,C="inner"===x,N=S&&T&&(P===pu.PATH||P===pu.LINE||P===pu.POLYLINE||_||C);E&&(t.globalAlpha=l*f,N||gN(n,t,T),vN(t,n,a,s,r,i,o,this.imagePool),N||this.clearShadowAndFilter(t,A,T)),S&&(t.globalAlpha=l*p,t.lineWidth=v,b(O)||(t.miterLimit=O),b(m)||(t.lineCap=m),b(y)||(t.lineJoin=y),N&&(C&&(t.globalCompositeOperation="source-atop"),gN(n,t,!0),C&&(mN(t,n,h,r,i,o,this.imagePool),t.globalCompositeOperation=uN.globalCompositeOperation,this.clearShadowAndFilter(t,A,!0))),mN(t,n,h,r,i,o,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!b(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(dN);function gN(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}function vN(t,e,n,r,i,o,a,s){var c=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach(function(n){t.fillStyle=sN(n,e,t,s),c||(r?t.fill(r):t.fill())}):(Eh(n)&&(t.fillStyle=aN(n,e,t,i,o,a,s)),c||(r?t.fill(r):t.fill()))}function mN(t,e,n,r,i,o,a){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach(function(n){t.strokeStyle=sN(n,e,t,a),s||t.stroke()}):(Eh(n)&&(t.strokeStyle=aN(n,e,t,r,i,o,a)),s||t.stroke())}var yN=function(t){function e(){return yl(this,e),_l(this,e,arguments)}return Tl(e,t),xl(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,o=r.imageCache;o.downSampled?t.drawImage(o.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then(function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())}).catch(function(t){console.error(t)})}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,o=r.imageCache,a=r.imageRect,s=r.drawRect,c=o.size,l=t.getTransform(),u=l.a,f=l.b,h=l.c,d=l.d,p=l.e,g=l.f;if(t.resetTransform(),null!=o&&o.gridSize){for(var v=[c[0]/a[2],c[1]/a[3]],m=[o.tileSize[0]/v[0],o.tileSize[1]/v[1]],y=[Math.floor((s[0]-a[0])/m[0]),Math.ceil((s[0]+s[2]-a[0])/m[0])],b=y[0],x=y[1],w=[Math.floor((s[1]-a[1])/m[1]),Math.ceil((s[1]+s[3]-a[1])/m[1])],k=w[1],M=w[0];M<=k;M++)for(var O=b;O<=x;O++){var E=o.tiles[M][O];if(E){var S=[Math.floor(a[0]+E.tileX*m[0]),Math.floor(a[1]+E.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];t.drawImage(E.data,S[0],S[1],S[2],S[3])}}t.setTransform(u,f,h,d,p,g)}else this.imagePool.createImageTiles(i,[],function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())},n).catch(function(t){console.error(t)})}},{key:"render",value:function(t,n,r){var i=n.x,o=void 0===i?0:i,a=n.y,s=void 0===a?0:a,c=n.width,l=n.height,u=n.src,f=n.shadowColor,h=n.shadowBlur,d=this.imagePool.getImageSync(u,r),p=null==d?void 0:d.img,g=c,v=l;if(p){g||(g=p.width),v||(v=p.height),gN(r,t,!b(f)&&h>0);try{var m=r.ownerDocument.defaultView.getContextService().getDomElement(),y=m.width,x=m.height,w=t.getTransform(),k=w.a,M=w.b,O=function(t,e){var n=de(te(),[t[0],t[1],0],e),r=de(te(),[t[0]+t[2],t[1],0],e),i=de(te(),[t[0],t[1]+t[3],0],e),o=de(te(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0])-Math.min(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])-Math.min(n[1],r[1],i[1],o[1])]}([o,s,g,v],xt(k,w.c,0,0,M,w.d,0,0,0,0,1,0,w.e,w.f,0,1)),E=function(t,e){var n=Pl(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Pl(e,4),c=s[0],l=s[1],u=s[2],f=s[3],h=Math.max(r,c),d=Math.max(i,l),p=Math.min(r+o,c+u),g=Math.min(i+a,l+f);return p<=h||g<=d?null:[h,d,p-h,g-d]}([0,0,y,x],O);if(!E)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:p,drawRect:[o,s,g,v]});if(O[2]/d.size[0]<(d.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:d,drawRect:[o,s,g,v]});if(!tN.isSupportTile)return void e.renderFull(t,n,r,{image:p,drawRect:[o,s,g,v]});this.renderTile(t,n,r,{src:u,imageCache:d,imageRect:O,drawRect:E})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}(pN),bN=function(t){function e(){return yl(this,e),_l(this,e,arguments)}return Tl(e,t),xl(e,[{key:"render",value:function(t,e,n,r,i,o){n.getBounds();var a=e.lineWidth,s=void 0===a?1:a,c=e.textAlign,l=void 0===c?"start":c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.lineJoin,d=void 0===h?"miter":h,p=e.miterLimit,g=void 0===p?10:p,v=e.letterSpacing,m=void 0===v?0:v,y=e.stroke,x=e.fill,w=e.fillRule,k=e.fillOpacity,M=void 0===k?1:k,O=e.strokeOpacity,E=void 0===O?1:O,S=e.opacity,_=void 0===S?1:S,A=e.metrics,T=e.x,P=void 0===T?0:T,C=e.y,N=void 0===C?0:C,L=e.dx,j=e.dy,R=e.shadowColor,I=e.shadowBlur,D=A.font,B=A.lines,F=A.height,z=A.lineHeight,$=A.lineMetrics;t.font=D,t.lineWidth=s,t.textAlign="middle"===l?"center":l;var W=f;"alphabetic"===W&&(W="bottom"),t.lineJoin=d,b(g)||(t.miterLimit=g);var G=N;"middle"===f?G+=-F/2-z/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?G+=-F:"top"!==f&&"hanging"!==f||(G+=-z);var H=P+(L||0);G+=j||0,1===B.length&&("bottom"===W?(W="middle",G-=.5*F):"top"===W&&(W="middle",G+=.5*F)),t.textBaseline=W,gN(n,t,!b(R)&&I>0);for(var Y=0;Y<B.length;Y++){var q=s/2+H;G+=z,b(y)||y.isNone||!s||this.drawLetterSpacing(t,n,B[Y],$[Y],l,q,G,m,x,w,M,y,E,_,!0,r,i,o),b(x)||this.drawLetterSpacing(t,n,B[Y],$[Y],l,q,G,m,x,w,M,y,E,_,!1,r,i,o)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,v,m){if(0!==s){var y=t.textAlign;t.textAlign="left";var b=o;"center"===i||"middle"===i?b=o-r.width/2:"right"!==i&&"end"!==i||(b=o-r.width);for(var x=Array.from(n),w=t.measureText(n).width,k=0,M=0;M<x.length;++M){var O=x[M];p?this.strokeText(t,e,O,b,a,f,h,g,v,m):this.fillText(t,e,O,b,a,c,l,u,d,g,v,m),b+=w-(k=t.measureText(n.substring(M+1)).width)+s,w=k}t.textAlign=y}else p?this.strokeText(t,e,n,o,a,f,h,g,v,m):this.fillText(t,e,n,o,a,c,l,u,d,g,v,m)}},{key:"fillText",value:function(t,e,n,r,i,o,a,s,c,l,u,f){var h;vN(t,e,o,a,l,u,f,this.imagePool,!0);var d=!b(s)&&1!==s;d&&(h=t.globalAlpha,t.globalAlpha=s*c),t.fillText(n,r,i),d&&(t.globalAlpha=h)}},{key:"strokeText",value:function(t,e,n,r,i,o,a,s,c,l){var u;mN(t,e,o,s,c,l,this.imagePool,!0);var f=!b(a)&&1!==a;f&&(u=t.globalAlpha,t.globalAlpha=a),t.strokeText(n,r,i),f&&(t.globalAlpha=u)}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,r,i)}}])}(pN),xN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yl(this,e),(t=_l(this,e)).name="canvas-renderer",t.options=n,t}return Tl(e,t),xl(e,[{key:"init",value:function(){var t,e=ml({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new pN(n),i=(gl(gl(gl(gl(gl(gl(gl(gl(gl(gl(t={},pu.CIRCLE,r),pu.ELLIPSE,r),pu.RECT,r),pu.IMAGE,new yN(n)),pu.TEXT,new bN(n)),pu.LINE,r),pu.POLYLINE,r),pu.POLYGON,r),pu.PATH,r),pu.GROUP,void 0),gl(gl(gl(t,pu.HTML,void 0),pu.MESH,void 0),pu.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new oN(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(vu),wN=function(){function t(){yl(this,t)}return xl(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0),n.globalThis.removeEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)})}}])}();wN.tag="DOMInteraction";var kN=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="dom-interaction",t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.addRenderingPlugin(new wN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(vu),MN=function(){function t(){yl(this,t),this.displayObjectHTMLElementMap=new WeakMap}return xl(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===pu.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach(function(t){r.updateAttribute(t,e)}),l(e,n),c.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===pu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===pu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;(e.nodeName===pu.FRAGMENT?e.childNodes:[e]).forEach(function(t){if(t.nodeName===pu.HTML){var e=r.getOrCreateEl(t);l(t,e)}})},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,function(){s.addEventListener(Sv.RESIZE,p),s.addEventListener(cg.MOUNTED,u),s.addEventListener(cg.UNMOUNTED,f),s.addEventListener(cg.ATTR_MODIFIED,h),s.addEventListener(cg.BOUNDS_CHANGED,d)}),a.hooks.endFrame.tap(t.tag,function(){r.$camera&&o.renderReasons.has(ig.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),a.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Sv.RESIZE,p),s.removeEventListener(cg.MOUNTED,u),s.removeEventListener(cg.UNMOUNTED,f),s.removeEventListener(cg.ATTR_MODIFIED,h),s.removeEventListener(cg.BOUNDS_CHANGED,d)})}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#".concat(s));if(!c){var l=(n||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");c=u,u.id=s,u.style.position="absolute",u.style.left="".concat(o.offsetLeft||0,"px"),u.style.top="".concat(o.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",l.appendChild(u),a.appendChild(l)}return c}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;L(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var o=e.parsedStyle.width;n.style.width=I(o)?"".concat(o,"px"):o.toString();break;case"height":var a=e.parsedStyle.height;n.style.height=I(a)?"".concat(a,"px"):a.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,u=void 0===l?"auto":l;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var h=e.parsedStyle.fill,d="";Sh(h)?d=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)&&(d=e.getAttribute("fill")),n.style.background=d;break;case"stroke":var p=e.parsedStyle.stroke,g="";Sh(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var v=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(v||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:b(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();
54
54
  /*!
55
55
  * @antv/g-plugin-html-renderer
56
56
  * @description A G plugin for rendering HTML
@@ -58,7 +58,7 @@ function fC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc
58
58
  * @date 7/30/2025, 1:35:48 PM
59
59
  * @author AntVis
60
60
  * @docs https://g.antv.antgroup.com/
61
- */xN.tag="HTMLRendering";var wN=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="html-renderer",t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.addRenderingPlugin(new xN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(vu),kN=function(){return xl(function t(e){yl(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config},[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=L(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var n=this.canvasConfig.devicePixelRatio;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){tp&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(ig.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=lu(su().mark(function t(){var e,n,r,i=arguments;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e=i.length>0&&void 0!==i[0]?i[0]:{}).type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 1:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),MN=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="canvas-context-register",t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.context.ContextService=kN}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(vu),ON=function(t){function e(t){var n;return yl(this,e),(n=_l(this,e,[t])).registerPlugin(new MN),n.registerPlugin(new tN),n.registerPlugin(new yC),n.registerPlugin(new mN),n.registerPlugin(new bN),n.registerPlugin(new WC),n.registerPlugin(new wN),n}return Tl(e,t),xl(e)}(mu),EN=function(){function t(e){yl(this,t),this.dragndropPluginOptions=e}return xl(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(){var t=lu(su().mark(function t(o){var h,d,p,g,v,m;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=2;break}if(h=o.timeStamp-c,d=gn([o.clientX,o.clientY],l),!(h<=n.dragndropPluginOptions.dragstartTimeThreshold||d<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=1;break}return t.abrupt("return");case 1:o.type="dragstart",a.dispatchEvent(o),s=!0;case 2:if(o.type="drag",o.dx=o.clientX-f[0],o.dy=o.clientY-f[1],a.dispatchEvent(o),f=[o.clientX,o.clientY],r){t.next=4;break}return p="pointer"===n.dragndropPluginOptions.overlap?[o.canvasX,o.canvasY]:e.getBounds().center,t.next=3,i.elementsFromPoint(p[0],p[1]);case 3:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(o.type="dragleave",o.target=u,u.dispatchEvent(o)),m&&(o.type="dragenter",o.target=m,m.dispatchEvent(o)),(u=m)&&(o.type="dragover",o.target=u,u.dispatchEvent(o)));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();o.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,function(){o.addEventListener("pointerdown",a)}),r.hooks.destroy.tap(t.tag,function(){o.removeEventListener("pointerdown",a)})}}])}();
61
+ */MN.tag="HTMLRendering";var ON=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="html-renderer",t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.addRenderingPlugin(new MN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(vu),EN=function(){return xl(function t(e){yl(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config},[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=L(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var n=this.canvasConfig.devicePixelRatio;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){tp&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(ig.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=lu(su().mark(function t(){var e,n,r,i=arguments;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e=i.length>0&&void 0!==i[0]?i[0]:{}).type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 1:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),SN=function(t){function e(){var t;yl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=_l(this,e,[].concat(r))).name="canvas-context-register",t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.context.ContextService=EN}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(vu),_N=function(t){function e(t){var n;return yl(this,e),(n=_l(this,e,[t])).registerPlugin(new SN),n.registerPlugin(new rN),n.registerPlugin(new wC),n.registerPlugin(new xN),n.registerPlugin(new kN),n.registerPlugin(new YC),n.registerPlugin(new ON),n}return Tl(e,t),xl(e)}(mu),AN=function(){function t(e){yl(this,t),this.dragndropPluginOptions=e}return xl(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(){var t=lu(su().mark(function t(o){var h,d,p,g,v,m;return su().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=2;break}if(h=o.timeStamp-c,d=gn([o.clientX,o.clientY],l),!(h<=n.dragndropPluginOptions.dragstartTimeThreshold||d<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=1;break}return t.abrupt("return");case 1:o.type="dragstart",a.dispatchEvent(o),s=!0;case 2:if(o.type="drag",o.dx=o.clientX-f[0],o.dy=o.clientY-f[1],a.dispatchEvent(o),f=[o.clientX,o.clientY],r){t.next=4;break}return p="pointer"===n.dragndropPluginOptions.overlap?[o.canvasX,o.canvasY]:e.getBounds().center,t.next=3,i.elementsFromPoint(p[0],p[1]);case 3:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(o.type="dragleave",o.target=u,u.dispatchEvent(o)),m&&(o.type="dragenter",o.target=m,m.dispatchEvent(o)),(u=m)&&(o.type="dragover",o.target=u,u.dispatchEvent(o)));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();o.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,function(){o.addEventListener("pointerdown",a)}),r.hooks.destroy.tap(t.tag,function(){o.removeEventListener("pointerdown",a)})}}])}();
62
62
  /*!
63
63
  * @antv/g-canvas
64
64
  * @description A renderer implemented by Canvas 2D API
@@ -66,4 +66,4 @@ function fC(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc
66
66
  * @date 7/30/2025, 1:38:18 PM
67
67
  * @author AntVis
68
68
  * @docs https://g.antv.antgroup.com/
69
- */EN.tag="Dragndrop";var SN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yl(this,e),(t=_l(this,e)).name="dragndrop",t.options=n,t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.addRenderingPlugin(new EN(ml({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(vu),_N=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),AN=_N;const TN={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},PN={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class CN extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var NN;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(NN||(NN={}));const LN=new Set([32,9,10,13]),jN=new Set([43,45,42,47,37,33,38,124,61,60,62]),RN=new Map([["true",NN.BOOLEAN],["false",NN.BOOLEAN],["null",NN.NULL]]),IN=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),DN=new Map([[46,NN.DOT],[91,NN.BRACKET_LEFT],[93,NN.BRACKET_RIGHT],[40,NN.PAREN_LEFT],[41,NN.PAREN_RIGHT],[44,NN.COMMA],[63,NN.QUESTION],[58,NN.COLON],[36,NN.DOLLAR]]),BN=new Map;for(const[t,e]of DN.entries())BN.set(t,{type:e,value:String.fromCharCode(t)});function FN(t){return t>=48&&t<=57}function zN(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function $N(t){return zN(t)||FN(t)}function WN(t){return jN.has(t)}var GN;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(GN||(GN={}));const HN=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),YN={type:GN.Literal,value:null},qN={type:GN.Literal,value:!0},VN={type:GN.Literal,value:!1},UN=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],o=t=>{const e=r();return null!==e&&e.type===t},a=t=>t.type===NN.OPERATOR?HN.get(t.value)||-1:t.type===NN.DOT||t.type===NN.BRACKET_LEFT?9:t.type===NN.QUESTION?1:-1,s=t=>{let n,a;if(i().type===NN.DOT){if(!o(NN.IDENTIFIER)){const t=r();throw new CN("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:GN.Identifier,name:t.value},a=!1}else{if(n=l(0),!o(NN.BRACKET_RIGHT)){const t=r();throw new CN("Expected closing bracket",e,t?t.value:"<end of input>")}i(),a=!0}return{type:GN.MemberExpression,object:t,property:n,computed:a}},c=()=>{const t=r();if(!t)throw new CN("Unexpected end of input",e,"<end of input>");if(t.type===NN.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=c();return{type:GN.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case NN.NUMBER:return i(),{type:GN.Literal,value:Number(t.value)};case NN.STRING:return i(),{type:GN.Literal,value:t.value};case NN.BOOLEAN:return i(),"true"===t.value?qN:VN;case NN.NULL:return i(),YN;case NN.IDENTIFIER:return i(),{type:GN.Identifier,name:t.value};case NN.FUNCTION:return(()=>{const t=i(),n=[];if(!o(NN.PAREN_LEFT)){const t=r();throw new CN("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(o(NN.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new CN("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!o(NN.COMMA)){const t=r();throw new CN("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=l(0);n.push(t)}return{type:GN.CallExpression,callee:{type:GN.Identifier,name:t.value},arguments:n}})();case NN.PAREN_LEFT:{i();const t=l(0);if(!o(NN.PAREN_RIGHT)){const t=r();throw new CN("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new CN(`Unexpected token: ${t.type}`,e,t.value)}},l=(u=0)=>{let f=c();for(;e<n;){const n=t[e],c=a(n);if(c<=u)break;if(n.type!==NN.QUESTION)if(n.type!==NN.OPERATOR){if(n.type!==NN.DOT&&n.type!==NN.BRACKET_LEFT)break;f=s(f)}else{i();const t=l(c);f={type:GN.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=l(0);if(!o(NN.COLON)){const t=r();throw new CN("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=l(0);f={type:GN.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=l();return{type:GN.Program,body:u}},XN=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case GN.Literal:return(t=>t.value)(t);case GN.Identifier:return(t=>{if(!(t.name in r.context))throw new CN(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case GN.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new CN("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case GN.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new CN(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map(t=>i(t)))})(t);case GN.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new CN(`Unknown operator: ${t.operator}`)}})(t);case GN.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new CN(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new CN(`Unknown operator: ${t.operator}`)}throw new CN(`Postfix operators are not supported: ${t.operator}`)})(t);case GN.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new CN(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const KN=["style","encode","labels","children"],ZN=EO(t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,o=0;function a(t){const r=o+1;o++;let i="",a=!1;for(;o<n;){const n=e.charCodeAt(o);if(n===t)return a||(i=e.substring(r,o)),o++,{type:NN.STRING,value:i};92===n?(a||(i=e.substring(r,o),a=!0),o++,i+=e[o]):a&&(i+=e[o]),o++}throw new CN(`Unterminated string starting with ${String.fromCharCode(t)}`,o,e.substring(Math.max(0,o-10),o))}function s(){const t=o;for(45===e.charCodeAt(o)&&o++;o<n&&FN(e.charCodeAt(o));)o++;if(o<n&&46===e.charCodeAt(o))for(o++;o<n&&FN(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:NN.NUMBER,value:r}}function c(){o++;const t=o;if(o<n&&zN(e.charCodeAt(o)))for(o++;o<n&&$N(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:NN.FUNCTION,value:r}}function l(){const t=o++;for(;o<n&&$N(e.charCodeAt(o));)o++;const r=e.slice(t,o),i=RN.get(r);return i?{type:i,value:r}:{type:NN.IDENTIFIER,value:r}}function u(){if(o+2<n){const t=e.substring(o,o+3);if(IN.has(t))return o+=3,{type:NN.OPERATOR,value:t}}if(o+1<n){const t=e.substring(o,o+2);if(IN.has(t))return o+=2,{type:NN.OPERATOR,value:t}}const t=e[o];if(IN.has(t))return o++,{type:NN.OPERATOR,value:t};throw new CN(`Unknown operator at position ${o}: ${e.substring(o,o+1)}`,o,e.substring(Math.max(0,o-10),o))}for(;o<n;){const t=e.charCodeAt(o);if(f=t,LN.has(f)){o++;continue}const h=BN.get(t);if(h)r[i++]=h,o++;else if(34!==t&&39!==t)if(FN(t)||45===t&&o+1<n&&FN(e.charCodeAt(o+1)))r[i++]=s();else if(64!==t)if(zN(t))r[i++]=l();else{if(!WN(t))throw new CN(`Unexpected character: ${e[o]}`,o,e.substring(Math.max(0,o-10),o));r[i++]=u()}else r[i++]=c();else r[i++]=a(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=UN(e),r=((t={},e={})=>({context:t,functions:e}))({},PN);return(t={})=>XN(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},(t,e)=>String.fromCharCode(97+e)),r=Object.fromEntries(t.map((t,e)=>[n[e],t]));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}},t=>t,128);function QN(t,e=!0){if(Array.isArray(t))return t.map((n,r)=>QN(t[r],e));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=it);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach(function(r){n[r]=e(t[r],r)}),n}(t,(t,n)=>e&&KN.includes(n)?QN(t,"children"===n):e?t:QN(t,!1));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return ZN(e.slice(1,-1))}return t}const JN=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var tL={}.toString,eL=function(t,e){return tL.call(t)==="[object "+e+"]"},nL=function(t){return Array.isArray?Array.isArray(t):eL(t,"Array")},rL=function(t){return"object"==typeof t&&null!==t},iL=function(t){if(!rL(t)||!eL(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function oL(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&iL(o)?(iL(t[i])||(t[i]={}),n<r?oL(t[i],o,n+1,r):t[i]=e[i]):nL(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var aL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)oL(t,e[r]);return t},sL=function(t){return t};function cL(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(t,e){return function(n){return e(t(n))}},t):sL}function lL(t){return t instanceof Float32Array||t instanceof Array}var uL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},fL=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function hL(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var dL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},pL=function(t,e,n,r,i){var o,a,s=dL(t,2),c=s[0],l=s[1],u=gt();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o};function gL(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function vL(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}const mL=Math.sqrt(50),yL=Math.sqrt(10),bL=Math.sqrt(2);function xL(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=mL?10:o>=yL?5:o>=bL?2:1)*10**i:-(10**-i)/(o>=mL?10:o>=yL?5:o>=bL?2:1)}const wL=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=xL(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=xL(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=xL(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r};function kL(t){return Array.isArray(t)}var ML=function(t){return"object"==typeof t&&null!==t},OL={}.toString,EL=function(t,e){return OL.call(t)==="[object "+e+"]"},SL=function(t){if(!ML(t)||!EL(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var _L=function(t){return void 0===t};function AL(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function TL(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(AL(e,i)){var o=e[i];null!==o&&SL(o)?(SL(t[i])||(t[i]={}),n<r?TL(t[i],o,n+1,r):t[i]=e[i]):kL(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var PL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)TL(t,e[r]);return t},CL=function(t){return t};function NL(t){return!_L(t)&&!function(t){return null===t}(t)&&!Number.isNaN(t)}function LL(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function jL(t){const e=Ii.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*LL(a,o,e+1/3),255*LL(a,o,e),255*LL(a,o,e-1/3),i]}(r):null}const RL=(t,e)=>n=>t*(1-n)+e*n,IL=(t,e)=>"number"==typeof t&&"number"==typeof e?RL(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=jL(t),r=jL(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,DL=(t,e)=>{const n=RL(t,e);return t=>Math.round(n(t))};function BL({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function FL(t){return"object"==typeof t?t.valueOf():t}class zL extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=FL,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(BL({map:this.map,initKey:this.initKey},t))}has(t){return super.has(BL({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class $L{constructor(t){this.options=PL({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=PL({},this.options,t),this.rescale(t)}rescale(t){}}const WL=Symbol("defaultUnknown");function GL(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function HL(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==WL)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function YL(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class qL extends $L{getDefaultOptions(){return{domain:[],range:[],unknown:WL}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&GL(this.domainIndexMap,this.getDomain(),this.domainKey),HL({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&GL(this.rangeIndexMap,this.getRange(),this.rangeKey),HL({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=YL(e),this.rangeKey=YL(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new qL(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function VL(t){return Math.round(1e12*t)/1e12}function UL(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,v=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(l),m=v.reduce((t,e)=>t+e),y=g/m,b=new zL(e.map((t,e)=>{const n=v[e]*y;return[t,a?Math.floor(n):n]})),x=new zL(e.map((t,e)=>{const n=v[e]*y+p;return[t,a?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(h-(w-w/c*i))*s;let M=a?Math.round(k):k;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=VL(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class XL extends qL{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:WL,flex:[]}}constructor(t){super(t)}clone(){return new XL(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return UL(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*l);return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const KL=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=xL(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i},ZL=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=vL(r,i),c=n(o,a)):(s=vL(i,r),c=n(a,o)),gL(c,s)},QL=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=vL(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=function(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}(t,e,1,r)-1,a=i[n];return gL(o[n],a)(e)}},JL=(t,e,n,r)=>(Math.min(t.length,e.length)>2?QL:ZL)(t,e,r?DL:n);class tj extends $L{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:RL,tickCount:5}}map(t){return NL(t)?this.output(t):this.options.unknown}invert(t){return NL(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return wL}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):CL}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=JL(n.map(t),r,o,i);this.output=gL(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=JL(i,r.map(t),RL);this.input=gL(e,n,o)}}class ej extends tj{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:IL,tickMethod:KL,tickCount:5}}chooseTransforms(){return[CL,CL]}clone(){return new ej(this.options)}}class nj extends XL{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:WL,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new nj(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}var rj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ij=function(t,e,n,r,i){var o=new ej({range:[e,e+r]}),a=new ej({range:[n,n+i]});return{transform:function(t){var e=rj(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=rj(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},oj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},aj=function(t,e,n,r,i){return(0,oj(t,1)[0])(e,n,r,i)},sj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},cj=function(t,e,n,r,i){return sj(t,1)[0]},lj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},uj=function(t,e,n,r,i){var o=lj(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ej({range:[c,l]}),f=new ej({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=lj(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*d)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=lj(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=hL(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},fj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},hj=function(t,e,n,r,i){return{transform:function(t){var e=fj(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=fj(t,2),n=e[0];return[e[1],n]}}},dj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},pj=function(t,e,n,r,i){var o,a,s=dj(t,2),c=s[0],l=s[1],u=gt();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},gj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},vj=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},mj=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pj.apply(void 0,vj([[-1,-1]],gj(e),!1))},yj=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pj.apply(void 0,vj([[-1,1]],gj(e),!1))},bj=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pj.apply(void 0,vj([[1,-1]],gj(e),!1))},xj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},wj=function(t,e,n,r,i){var o=xj(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(gt(),o)},kj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Mj=function(t,e,n,r,i){var o=kj(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new ej({range:[c,c+.99*l]}),h=new ej({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=kj(t,2),n=e[0],r=e[1],i=h.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=kj(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),d=hL(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},Oj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Ej=function(t,e,n,r,i){var o=Oj(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ej({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new nj({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},Sj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function _j(t){return 1/Math.tan(t)}var Aj=function(t,e,n,r,i){var o=_j(Sj(t,1)[0]);return{transform:function(t){var e=Sj(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=Sj(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},Tj=function(t,e,n,r,i){var o=_j(Sj(t,1)[0]);return{transform:function(t){var e=Sj(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=Sj(t,2),n=e[0];return[n,e[1]-n*o]}}},Pj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function Cj(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function Nj(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function Lj(t,e,n){return n?new ej({range:[0,1],domain:[0,e]}).map(t):t}var jj=function(t,e,n,r,i){var o=Pj(t,3),a=o[0],s=o[1],c=o[2],l=Lj(a,r,void 0!==c&&c);return{transform:function(t){var e=Pj(t,2),n=e[0],r=e[1];return[Cj(n,l,s,0,1),r]},untransform:function(t){var e=Pj(t,2),n=e[0],r=e[1];return[Nj(n,l,s,0,1),r]}}},Rj=function(t,e,n,r,i){var o=Pj(t,3),a=o[0],s=o[1],c=o[2],l=Lj(a,i,void 0!==c&&c);return{transform:function(t){var e=Pj(t,2);return[e[0],Cj(e[1],l,s,0,1)]},untransform:function(t){var e=Pj(t,2);return[e[0],Nj(e[1],l,s,0,1)]}}},Ij=function(t,e,n,r,i){var o=Pj(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=Lj(a,r,f),d=Lj(s,i,f);return{transform:function(t){var e=Pj(t,2),n=e[0],r=e[1];return[Cj(n,h,c,0,1),Cj(r,d,l,0,1)]},untransform:function(t){var e=Pj(t,2),n=e[0],r=e[1];return[Nj(n,h,c,0,1),Nj(r,d,l,0,1)]}}},Dj=function(t,e,n,r,i){var o=Pj(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new ej({range:[0,r]}),d=new ej({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=Pj(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=Cj(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=Pj(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=Nj(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},Bj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Fj=function(t,e,n,r,i,o,a){var s=new ej({range:[e,e+i]}),c=new ej({range:[n,n+o]}),l=new ej({range:[r,r+a]});return{transform:function(t){var e=Bj(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=Bj(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},zj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},$j=function(t,e,n,r,i,o,a){var s=zj(t,3),c=s[0],l=s[1],u=s[2];return Ct(mt(),[c,l,u])},Wj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Gj=function(t,e,n,r,i,o,a){return{transform:function(t){var e=Wj(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=Wj(t,3),n=e[0];return[e[1],n,e[2]]}}},Hj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Yj=function(t,e,n,r,i,o,a){var s=Hj(t,3),c=s[0],l=s[1],u=s[2];return Nt(mt(),[c,l,u])},qj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Vj=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},Uj=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Xj=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:ij,translate:pL,custom:aj,matrix:cj,polar:uj,transpose:hj,scale:pj,"shear.x":Aj,"shear.y":Tj,reflect:mj,"reflect.x":yj,"reflect.y":bj,rotate:wj,helix:Mj,parallel:Ej,fisheye:Ij,"fisheye.x":jj,"fisheye.y":Rj,"fisheye.circular":Dj},this.update(t)}return t.prototype.update=function(t){this.options=aL({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:Vj(Vj([],qj(n),!1),[Vj([],qj(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?Vj([],qj(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,fL([],uL(o),!1))}return n}}(t):t)};try{for(var c=Uj(r),l=c.next();!l.done;l=c.next()){var u=qj(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=d(Vj([],qj(h),!1),g,v,m,y);if(lL(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||sL,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return cL.apply(void 0,Vj([],qj(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=gt();return e&&t.reverse(),t.forEach(function(t){return vt(n,n,t)}),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,h=-u*o+s*c,d=l*o-a*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(n,function(t){var e=new pt(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}(n)),function(t){var e=[t[0],t[1],1];return pe(e,e,n),[e[0],e[1]]}},t}(),Kj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Zj=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},Qj=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jj=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:Fj,translate3D:$j,scale3D:Yj,transpose3D:Gj},this.update(t)}return t.prototype.update=function(t){this.options=aL({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:Zj(Zj([],Kj(n),!1),[Zj([],Kj(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?Zj([],Kj(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,fL([],uL(o),!1))}return n}}(t):t)};try{for(var c=Qj(r),l=c.next();!l.done;l=c.next()){var u=Kj(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,w=d(Zj([],Kj(h),!1),g,v,m,y,b,x);if(lL(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||sL,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return cL.apply(void 0,Zj([],Kj(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=mt();return e&&t.reverse(),t.forEach(function(t){return Zt(n,n,t)}),e&&Ot(n,yt(n)),function(t){var e=[t[0],t[1],t[2],1];return we(e,e,n),[e[0],e[1],e[2]]}},t}();function tR(t){return(e,...n)=>tt({},t(e,...n),e)}function eR(t){return(e,...n)=>tt({},e,t(e,...n))}function nR(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Ie(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const rR=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map(t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=Ie(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:nR(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})})};rR.props={};const iR=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map(()=>1),padding:i=0,data:o}=t,[a,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce((t,e)=>t+e),f=t[s]-i*(e.length-1),h=r.map(t=>f*(t/u)),d=[];let p=t[a]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=Ie(r,["data"]),g=nR(u,o);d.push(Object.assign({[a]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};iR.props={};const oR=()=>t=>{const{children:e}=t,n=Ie(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Ie(n,["data","scale","axis","legend","encode","transform"]),u=e.map(t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=Ie(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:nR(e,r),scale:tt({},i,n),encode:tt({},s,f),transform:[...c,...h],axis:!(!l||!o)&&tt({},o,l),legend:!(!u||!a)&&tt({},a,u)},d)});return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};oR.props={};const aR=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:w,theme:k,component:M,interaction:O,x:E,y:S,z:_,key:A,frame:T,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=Ie(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:S,z:_,key:A,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:k,coordinate:w,component:M,interaction:O,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${A}-0`,data:x}),t&&{title:j})]})]};aR.props={};class sR{constructor(t){this.$value=t}static of(t){return new sR(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const cR=tR(t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=rr(n,e=>e[t]),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),c=s.map(t=>a.has(t)?a.get(t).length:1);return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}}),lR=eR(t=>{const{data:e,scale:n,legend:r}=t,i=[t];let o,a,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(o=l),void 0!==u&&(a=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof o?o:"",[l,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===o)return[void 0];const i="function"==typeof o?o:t=>t[o],a=e.map(i);return a.some(t=>"number"==typeof t)?[Zn(a)]:[Array.from(new Set(a)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:tt({},a,{domain:l,type:u})}},void 0===r&&{legend:{color:tt({title:c},s)}})}),uR=tR(()=>({animate:{enterType:"fadeIn"}})),fR=eR(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),hR=eR(()=>({type:"cell"})),dR=eR(t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map(t=>t[r]))):[],a=i?Array.from(new Set(e.map(t=>t[i]))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map(t=>({[r]:t})):a.length?a.map(t=>({[i]:t})):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}}),pR=eR((t,e=gR,n=mR,r=yR,i={})=>{const{data:o,encode:a,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=o,{x:p,y:g}=a,{color:v}=c,{domain:m}=v;return{children:(t,o,a)=>{const{x:c,y:v}=o,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:k}=c.getOptions(),{domain:M}=v.getOptions(),O=ha(t),E=t.map(e),S=t.map(({x:t,y:e})=>[c.invert(t),v.invert(e)]),_=S.map(([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)}),A=_.map(t=>d.filter(t)),T=f?xr(A,t=>t.length):void 0,P=S.map(([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length})),C=P.map(t=>Array.isArray(s)?s:[s(t)].flat(1));return O.flatMap(t=>{const[e,o,a,s]=E[t],c=P[t],f=A[t];return C[t].map(v=>{var k,M,{scale:O,key:E,facet:S=!0,axis:_={},legend:A={}}=v,P=Ie(v,["scale","key","facet","axis","legend"]);const C=(null===(k=null==O?void 0:O.y)||void 0===k?void 0:k.guide)||_.y,N=(null===(M=null==O?void 0:O.x)||void 0===M?void 0:M.guide)||_.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:m}},I={x:bR(N,n)(c,j),y:bR(C,r)(c,j)};return Object.assign(Object.assign({key:`${E}-${t}`,data:j,margin:0,x:e+y+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:tt(L,O,R),axis:tt({},_,I),legend:!1},P),i)})})}}});function gR(t){const{points:e}=t;return Bs(e)}function vR(t,e){return e.length?tt({title:!1,tick:null,label:null},t):tt({title:!1,tick:null,label:null,grid:null},t)}function mR(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return vR(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return tt({title:s,grid:c},t)}}function yR(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return vR(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return tt({title:o,grid:a},t)}}function bR(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const xR=()=>t=>[sR.of(t).call(hR).call(lR).call(uR).call(cR).call(fR).call(dR).call(pR).value()];xR.props={};const wR=tR(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),kR=eR(t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(t,a,s)=>{const{x:c,y:l}=a,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),v=ha(t),m=t.map(({points:t})=>Bs(t)),y=t.map(({x:t,y:e})=>[c.invert(t),l.invert(e)]),b=y.map(([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length})),x=b.map(t=>Array.isArray(n)?n:[n(t)].flat(1));return v.flatMap(t=>{const[n,a,s,c]=m[t],[l,p]=y[t],g=b[t];return x[t].map(v=>{var m,y;const{scale:b,key:x,encode:w,axis:k,interaction:M}=v,O=Ie(v,["scale","key","encode","axis","interaction"]),E=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:OR(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:ER(E)(g,e)};return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+h,y:a+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:tt({x:{facet:!1},y:{facet:!1}},b),axis:tt({x:{tickCount:5},y:{tickCount:5}},k,S),legend:!1,encode:tt({},w,{x:l,y:p}),interaction:tt({},M,{legendFilter:!1})},O)})})}}}),MR=eR(t=>{const{encode:e}=t,n=Ie(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Ie(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[o].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[o].flat(1).length&&{y:{paddingInner:0}})})});function OR(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return vR(t,n)}}function ER(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return vR(t,n)}}const SR=()=>t=>[sR.of(t).call(hR).call(lR).call(kR).call(MR).call(uR).call(fR).call(wR).value()],_R=tR(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),AR=tR(t=>({coordinate:{type:"polar"}})),TR=t=>{const{encode:e}=t,n=Ie(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function PR(t){return t=>null}function CR(t){const{points:e}=t,[n,r,i,o]=e,a=js(n,o),s=Ns(n,o),c=Ds(s,Ns(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Is(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const NR=()=>t=>[sR.of(t).call(hR).call(TR).call(lR).call(AR).call(dR).call(pR,CR,PR,PR,{frame:!1}).call(uR).call(fR).call(_R).value()];function LR(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const jR=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map(t=>Object.assign(Object.assign({},t),{key:s})).map(t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=tt({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=LR(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};jR.props={};const RR=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:c,tooltip:l}=t,u=Ie(t,["type","data","scale","encode","style","animate","key","state","tooltip"]);return[Object.assign(Object.assign({type:"geoView"},u),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:o,animate:a,state:c,tooltip:l}]})]};RR.props={};var IR=1e-6,DR=Math.PI,BR=DR/2,FR=DR/4,zR=2*DR,$R=180/DR,WR=DR/180,GR=Math.abs,HR=Math.atan,YR=Math.atan2,qR=Math.cos,VR=Math.ceil,UR=Math.exp,XR=Math.log,KR=Math.pow,ZR=Math.sin,QR=Math.sign||function(t){return t>0?1:t<0?-1:0},JR=Math.sqrt,tI=Math.tan;function eI(t){return t>1?0:t<-1?DR:Math.acos(t)}function nI(t){return t>1?BR:t<-1?-BR:Math.asin(t)}function rI(){}function iI(t,e){t&&aI.hasOwnProperty(t.type)&&aI[t.type](t,e)}var oI={Feature:function(t,e){iI(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)iI(n[r].geometry,e)}},aI={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){sI(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)sI(n[r],e,0)},Polygon:function(t,e){cI(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)cI(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)iI(n[r],e)}};function sI(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function cI(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)sI(t[n],e,1);e.polygonEnd()}function lI(t,e){t&&oI.hasOwnProperty(t.type)?oI[t.type](t,e):iI(t,e)}function uI(t){return[YR(t[1],t[0]),nI(t[2])]}function fI(t){var e=t[0],n=t[1],r=qR(n);return[r*qR(e),r*ZR(e),ZR(n)]}function hI(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function dI(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function pI(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function gI(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function vI(t){var e=JR(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function mI(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function yI(t,e){return GR(t)>DR&&(t-=Math.round(t/zR)*zR),[t,e]}function bI(t,e,n){return(t%=zR)?e||n?mI(wI(t),kI(e,n)):wI(t):e||n?kI(e,n):yI}function xI(t){return function(e,n){return GR(e+=t)>DR&&(e-=Math.round(e/zR)*zR),[e,n]}}function wI(t){var e=xI(t);return e.invert=xI(-t),e}function kI(t,e){var n=qR(t),r=ZR(t),i=qR(e),o=ZR(e);function a(t,e){var a=qR(e),s=qR(t)*a,c=ZR(t)*a,l=ZR(e),u=l*n+s*r;return[YR(c*i-u*o,s*n-l*r),nI(u*i+c*o)]}return a.invert=function(t,e){var a=qR(e),s=qR(t)*a,c=ZR(t)*a,l=ZR(e),u=l*i-c*o;return[YR(c*i+l*o,s*n+u*r),nI(u*n-s*r)]},a}function MI(t,e){(e=fI(e))[0]-=t,vI(e);var n=eI(-e[1]);return((-e[2]<0?-n:n)+zR-IR)%zR}function OI(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:rI,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function EI(t,e){return GR(t[0]-e[0])<IR&&GR(t[1]-e[1])<IR}function SI(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function _I(t,e,n,r,i){var o,a,s=[],c=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(EI(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new SI(r,t,null,!0)),c.push(n.o=new SI(r,null,n,!1)),s.push(n=new SI(a,t,null,!1)),c.push(n.o=new SI(a,null,n,!0))}}),s.length){for(c.sort(e),AI(s),AI(c),o=0,a=c.length;o<a;++o)c[o].e=n=!n;for(var l,u,f=s[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(o=0,a=l.length;o<a;++o)i.point((u=l[o])[0],u[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,o=l.length-1;o>=0;--o)i.point((u=l[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function AI(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function TI(t){return GR(t[0])<=DR?t[0]:QR(t[0])*((GR(t[0])+DR)%zR-DR)}function PI(t,e,n,r){return function(i){var o,a,s,c=e(i),l=OI(),u=e(l),f=!1,h={point:d,lineStart:g,lineEnd:v,polygonStart:function(){h.point=m,h.lineStart=y,h.lineEnd=b,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=v,a=Cr(a);var t=function(t,e){var n=TI(e),r=e[1],i=ZR(r),o=[ZR(n),-qR(n),0],a=0,s=0,c=new Qn;1===i?r=BR+IR:-1===i&&(r=-BR-IR);for(var l=0,u=t.length;l<u;++l)if(h=(f=t[l]).length)for(var f,h,d=f[h-1],p=TI(d),g=d[1]/2+FR,v=ZR(g),m=qR(g),y=0;y<h;++y,p=x,v=k,m=M,d=b){var b=f[y],x=TI(b),w=b[1]/2+FR,k=ZR(w),M=qR(w),O=x-p,E=O>=0?1:-1,S=E*O,_=S>DR,A=v*k;if(c.add(YR(A*E*ZR(S),m*M+A*qR(S))),a+=_?O+E*zR:O,_^p>=n^x>=n){var T=dI(fI(d),fI(b));vI(T);var P=dI(o,T);vI(P);var C=(_^O>=0?-1:1)*nI(P[2]);(r>C||r===C&&(T[0]||T[1]))&&(s+=_^O>=0?1:-1)}}return(a<-IR||a<IR&&c<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),_I(a,NI,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){c.point(t,e)}function g(){h.point=p,c.lineStart()}function v(){h.point=d,c.lineEnd()}function m(t,e){s.push([t,e]),u.point(t,e)}function y(){u.lineStart(),s=[]}function b(){m(s[0][0],s[0][1]),u.lineEnd();var t,e,n,r,c=u.clean(),h=l.result(),d=h.length;if(s.pop(),o.push(s),s=null,d)if(1&c){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(CI))}return h}}function CI(t){return t.length>1}function NI(t,e){return((t=t.x)[0]<0?t[1]-BR-IR:BR-t[1])-((e=e.x)[0]<0?e[1]-BR-IR:BR-e[1])}yI.invert=yI;var LI=PI(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?DR:-DR,c=GR(o-n);GR(c-DR)<IR?(t.point(n,r=(r+a)/2>0?BR:-BR),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&c>=DR&&(GR(n-i)<IR&&(n-=i*IR),GR(o-s)<IR&&(o-=s*IR),r=function(t,e,n,r){var i,o,a=ZR(t-n);return GR(a)>IR?HR((ZR(e)*(o=qR(r))*ZR(n)-ZR(r)*(i=qR(e))*ZR(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*BR,r.point(-DR,i),r.point(0,i),r.point(DR,i),r.point(DR,0),r.point(DR,-i),r.point(0,-i),r.point(-DR,-i),r.point(-DR,0),r.point(-DR,i);else if(GR(t[0]-e[0])>IR){var o=t[0]<e[0]?DR:-DR;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-DR,-BR]);function jI(t){var e=qR(t),n=2*WR,r=e>0,i=GR(e)>IR;function o(t,n){return qR(t)*qR(n)>e}function a(t,n,r){var i=[1,0,0],o=dI(fI(t),fI(n)),a=hI(o,o),s=o[0],c=a-s*s;if(!c)return!r&&t;var l=e*a/c,u=-e*s/c,f=dI(i,o),h=gI(i,l);pI(h,gI(o,u));var d=f,p=hI(h,d),g=hI(d,d),v=p*p-g*(hI(h,h)-1);if(!(v<0)){var m=JR(v),y=gI(d,(-p-m)/g);if(pI(y,h),y=uI(y),!r)return y;var b,x=t[0],w=n[0],k=t[1],M=n[1];w<x&&(b=x,x=w,w=b);var O=w-x,E=GR(O-DR)<IR;if(!E&&M<k&&(b=k,k=M,M=b),E||O<IR?E?k+M>0^y[1]<(GR(y[0]-x)<IR?k:M):k<=y[1]&&y[1]<=M:O>DR^(x<=y[0]&&y[0]<=w)){var S=gI(d,(-p+m)/g);return pI(S,h),[y,uI(S)]}}}function s(e,n){var i=r?t:DR-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return PI(o,function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(f,h){var d,p=[f,h],g=o(f,h),v=r?g?0:s(f,h):g?s(f+(f<0?DR:-DR),h):0;if(!e&&(l=c=g)&&t.lineStart(),g!==c&&(!(d=a(e,p))||EI(e,d)||EI(p,d))&&(p[2]=1),g!==c)u=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var m;v&n||!(m=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||e&&EI(e,p)||t.point(p[0],p[1]),e=p,c=g,n=v},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}},function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var a=qR(e),s=ZR(e),c=r*n;null==i?(i=e+r*zR,o=e-c/2):(i=MI(a,i),o=MI(a,o),(r>0?i<o:i>o)&&(i+=r*zR));for(var l,u=i;r>0?u>o:u<o;u-=c)l=uI([a,-s*qR(u),-s*ZR(u)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)},r?[0,-t]:[-DR,t-DR])}var RI=1e9,II=-RI;function DI(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var u=0,f=0;if(null==i||(u=a(i,s))!==(f=a(o,s))||c(i,o)<0^s>0)do{l.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return GR(r[0]-t)<IR?i>0?0:3:GR(r[0]-n)<IR?i>0?2:1:GR(r[1]-e)<IR?i>0?1:0:i>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,l,u,f,h,d,p,g,v,m,y,b=a,x=OI(),w={point:k,lineStart:function(){w.point=M,l&&l.push(u=[]);m=!0,v=!1,p=g=NaN},lineEnd:function(){c&&(M(f,h),d&&v&&x.rejoin(),c.push(x.result()));w.point=k,v&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,s=l[n],c=1,u=s.length,f=s[0],h=f[0],d=f[1];c<u;++c)o=h,a=d,h=(f=s[c])[0],d=f[1],a<=r?d>r&&(h-o)*(r-a)>(d-a)*(t-o)&&++e:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--e;return e}(),n=y&&e,i=(c=Cr(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&_I(c,s,e,o,a),a.polygonEnd());b=a,c=l=u=null}};function k(t,e){i(t,e)&&b.point(t,e)}function M(o,a){var s=i(o,a);if(l&&u.push([o,a]),m)f=o,h=a,d=s,m=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&v)b.point(o,a);else{var c=[p=Math.max(II,Math.min(RI,p)),g=Math.max(II,Math.min(RI,g))],x=[o=Math.max(II,Math.min(RI,o)),a=Math.max(II,Math.min(RI,a))];!function(t,e,n,r,i,o){var a,s=t[0],c=t[1],l=0,u=1,f=e[0]-s,h=e[1]-c;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<u&&(u=a)}else if(f>0){if(a>u)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>u)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<u&&(u=a)}if(a=r-c,h||!(a>0)){if(a/=h,h<0){if(a<l)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>l&&(l=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>l&&(l=a)}else if(h>0){if(a<l)return;a<u&&(u=a)}return l>0&&(t[0]=s+l*f,t[1]=c+l*h),u<1&&(e[0]=s+u*f,e[1]=c+u*h),!0}}}}}(c,x,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),y=!1):(v||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),y=!1)}p=o,g=a,v=s}return w}}function BI(t,e,n){var r=Nr(t,e-IR,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function FI(t,e,n){var r=Nr(t,e-IR,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function zI(){return function(){var t,e,n,r,i,o,a,s,c,l,u,f,h=10,d=h,p=90,g=360,v=2.5;function m(){return{type:"MultiLineString",coordinates:y()}}function y(){return Nr(VR(r/p)*p,n,p).map(u).concat(Nr(VR(s/g)*g,a,g).map(f)).concat(Nr(VR(e/h)*h,t,h).filter(function(t){return GR(t%p)>IR}).map(c)).concat(Nr(VR(o/d)*d,i,d).filter(function(t){return GR(t%g)>IR}).map(l))}return m.lines=function(){return y().map(function(t){return{type:"LineString",coordinates:t}})},m.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),m.precision(v)):[[r,s],[n,a]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),m.precision(v)):[[e,o],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],m):[p,g]},m.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],m):[h,d]},m.precision=function(h){return arguments.length?(v=+h,c=BI(o,i,90),l=FI(e,t,v),u=BI(s,a,90),f=FI(r,n,v),m):v},m.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}var $I,WI,GI,HI,YI=t=>t,qI=new Qn,VI=new Qn,UI={point:rI,lineStart:rI,lineEnd:rI,polygonStart:function(){UI.lineStart=XI,UI.lineEnd=QI},polygonEnd:function(){UI.lineStart=UI.lineEnd=UI.point=rI,qI.add(GR(VI)),VI=new Qn},result:function(){var t=qI/2;return qI=new Qn,t}};function XI(){UI.point=KI}function KI(t,e){UI.point=ZI,$I=GI=t,WI=HI=e}function ZI(t,e){VI.add(HI*t-GI*e),GI=t,HI=e}function QI(){ZI($I,WI)}var JI=UI,tD=1/0,eD=tD,nD=-tD,rD=nD,iD={point:function(t,e){t<tD&&(tD=t);t>nD&&(nD=t);e<eD&&(eD=e);e>rD&&(rD=e)},lineStart:rI,lineEnd:rI,polygonStart:rI,polygonEnd:rI,result:function(){var t=[[tD,eD],[nD,rD]];return nD=rD=-(eD=tD=1/0),t}};var oD,aD,sD,cD,lD=iD,uD=0,fD=0,hD=0,dD=0,pD=0,gD=0,vD=0,mD=0,yD=0,bD={point:xD,lineStart:wD,lineEnd:OD,polygonStart:function(){bD.lineStart=ED,bD.lineEnd=SD},polygonEnd:function(){bD.point=xD,bD.lineStart=wD,bD.lineEnd=OD},result:function(){var t=yD?[vD/yD,mD/yD]:gD?[dD/gD,pD/gD]:hD?[uD/hD,fD/hD]:[NaN,NaN];return uD=fD=hD=dD=pD=gD=vD=mD=yD=0,t}};function xD(t,e){uD+=t,fD+=e,++hD}function wD(){bD.point=kD}function kD(t,e){bD.point=MD,xD(sD=t,cD=e)}function MD(t,e){var n=t-sD,r=e-cD,i=JR(n*n+r*r);dD+=i*(sD+t)/2,pD+=i*(cD+e)/2,gD+=i,xD(sD=t,cD=e)}function OD(){bD.point=xD}function ED(){bD.point=_D}function SD(){AD(oD,aD)}function _D(t,e){bD.point=AD,xD(oD=sD=t,aD=cD=e)}function AD(t,e){var n=t-sD,r=e-cD,i=JR(n*n+r*r);dD+=i*(sD+t)/2,pD+=i*(cD+e)/2,gD+=i,vD+=(i=cD*t-sD*e)*(sD+t),mD+=i*(cD+e),yD+=3*i,xD(sD=t,cD=e)}var TD=bD;function PD(t){this._context=t}PD.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,zR)}},result:rI};var CD,ND,LD,jD,RD,ID=new Qn,DD={point:rI,lineStart:function(){DD.point=BD},lineEnd:function(){CD&&FD(ND,LD),DD.point=rI},polygonStart:function(){CD=!0},polygonEnd:function(){CD=null},result:function(){var t=+ID;return ID=new Qn,t}};function BD(t,e){DD.point=FD,ND=jD=t,LD=RD=e}function FD(t,e){jD-=t,RD-=e,ID.add(JR(jD*jD+RD*RD)),jD=t,RD=e}var zD=DD;let $D,WD,GD,HD;class YD{constructor(t){this._append=null==t?qD:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return qD;if(e!==$D){const t=10**e;$D=e,WD=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return WD}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==GD||this._append!==WD){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,GD=t,WD=this._append,HD=this._,this._=e}this._+=HD}}result(){const t=this._;return this._="",t.length?t:null}}function qD(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function VD(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),lI(t,n(r))),r.result()}return a.area=function(t){return lI(t,n(JI)),JI.result()},a.measure=function(t){return lI(t,n(zD)),zD.result()},a.bounds=function(t){return lI(t,n(lD)),lD.result()},a.centroid=function(t){return lI(t,n(TD)),TD.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,YI):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new YD(i)):new PD(e=t),"function"!=typeof o&&r.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new YD(i)),a},a.projection(t).digits(i).context(e)}function UD(t){return function(e){var n=new XD;for(var r in t)n[r]=t[r];return n.stream=e,n}}function XD(){}function KD(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),lI(n,t.stream(lD)),e(lD.result()),null!=r&&t.clipExtent(r),t}function ZD(t,e,n){return KD(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])},n)}function QD(t,e,n){return ZD(t,[[0,0],e],n)}function JD(t,e,n){return KD(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])},n)}function tB(t,e,n){return KD(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])},n)}XD.prototype={constructor:XD,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var eB=qR(30*WR);function nB(t,e){return+e?function(t,e){function n(r,i,o,a,s,c,l,u,f,h,d,p,g,v){var m=l-r,y=u-i,b=m*m+y*y;if(b>4*e&&g--){var x=a+h,w=s+d,k=c+p,M=JR(x*x+w*w+k*k),O=nI(k/=M),E=GR(GR(k)-1)<IR||GR(o-f)<IR?(o+f)/2:YR(w,x),S=t(E,O),_=S[0],A=S[1],T=_-r,P=A-i,C=y*T-m*P;(C*C/b>e||GR((m*T+y*P)/b-.5)>.3||a*h+s*d+c*p<eB)&&(n(r,i,o,a,s,c,_,A,E,x/=M,w/=M,k,g,v),v.point(_,A),n(_,A,E,x,w,k,l,u,f,h,d,p,g,v))}}return function(e){var r,i,o,a,s,c,l,u,f,h,d,p,g={point:v,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=m}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){u=NaN,g.point=y,e.lineStart()}function y(r,i){var o=fI([r,i]),a=t(r,i);n(u,f,l,h,d,p,u=a[0],f=a[1],l=r,h=o[0],d=o[1],p=o[2],16,e),e.point(u,f)}function b(){g.point=v,e.lineEnd()}function x(){m(),g.point=w,g.lineEnd=k}function w(t,e){y(r=t,e),i=u,o=f,a=h,s=d,c=p,g.point=y}function k(){n(u,f,l,h,d,p,i,o,r,a,s,c,16,e),g.lineEnd=b,b()}return g}}(t,e):function(t){return UD({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var rB=UD({point:function(t,e){this.stream.point(t*WR,e*WR)}});function iB(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=qR(o),s=ZR(o),c=a*t,l=s*t,u=a/t,f=s/t,h=(s*n-a*e)/t,d=(s*e+a*n)/t;function p(t,o){return[c*(t*=r)-l*(o*=i)+e,n-l*t-c*o]}return p.invert=function(t,e){return[r*(u*t-f*e+h),i*(d-f*t-u*e)]},p}function oB(t){return aB(function(){return t})()}function aB(t){var e,n,r,i,o,a,s,c,l,u,f=150,h=480,d=250,p=0,g=0,v=0,m=0,y=0,b=0,x=1,w=1,k=null,M=LI,O=null,E=YI,S=.5;function _(t){return c(t[0]*WR,t[1]*WR)}function A(t){return(t=c.invert(t[0],t[1]))&&[t[0]*$R,t[1]*$R]}function T(){var t=iB(f,0,0,x,w,b).apply(null,e(p,g)),r=iB(f,h-t[0],d-t[1],x,w,b);return n=bI(v,m,y),s=mI(e,r),c=mI(n,s),a=nB(s,S),P()}function P(){return l=u=null,_}return _.stream=function(t){return l&&u===t?l:l=rB(function(t){return UD({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(a(E(u=t)))))},_.preclip=function(t){return arguments.length?(M=t,k=void 0,P()):M},_.postclip=function(t){return arguments.length?(E=t,O=r=i=o=null,P()):E},_.clipAngle=function(t){return arguments.length?(M=+t?jI(k=t*WR):(k=null,LI),P()):k*$R},_.clipExtent=function(t){return arguments.length?(E=null==t?(O=r=i=o=null,YI):DI(O=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==O?null:[[O,r],[i,o]]},_.scale=function(t){return arguments.length?(f=+t,T()):f},_.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],T()):[h,d]},_.center=function(t){return arguments.length?(p=t[0]%360*WR,g=t[1]%360*WR,T()):[p*$R,g*$R]},_.rotate=function(t){return arguments.length?(v=t[0]%360*WR,m=t[1]%360*WR,y=t.length>2?t[2]%360*WR:0,T()):[v*$R,m*$R,y*$R]},_.angle=function(t){return arguments.length?(b=t%360*WR,T()):b*$R},_.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},_.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},_.precision=function(t){return arguments.length?(a=nB(s,S=t*t),P()):JR(S)},_.fitExtent=function(t,e){return ZD(_,t,e)},_.fitSize=function(t,e){return QD(_,t,e)},_.fitWidth=function(t,e){return JD(_,t,e)},_.fitHeight=function(t,e){return tB(_,t,e)},function(){return e=t.apply(this,arguments),_.invert=e.invert&&A,T()}}function sB(t){var e=0,n=DR/3,r=aB(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*WR,n=t[1]*WR):[e*$R,n*$R]},i}function cB(t,e){var n=ZR(t),r=(n+ZR(e))/2;if(GR(r)<IR)return function(t){var e=qR(t);function n(t,n){return[t*e,ZR(n)/e]}return n.invert=function(t,n){return[t/e,nI(n*e)]},n}(t);var i=1+n*(2*r-n),o=JR(i)/r;function a(t,e){var n=JR(i-2*r*ZR(e))/r;return[n*ZR(t*=r),o-n*qR(t)]}return a.invert=function(t,e){var n=o-e,a=YR(t,GR(n))*QR(n);return n*r<0&&(a-=DR*QR(t)*QR(n)),[a/r,nI((i-(t*t+n*n)*r*r)/(2*r))]},a}function lB(){return sB(cB).scale(155.424).center([0,33.6442])}function uB(){return lB().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function fB(t){return function(e,n){var r=qR(e),i=qR(n),o=t(r*i);return o===1/0?[2,0]:[o*i*ZR(e),o*ZR(n)]}}function hB(t){return function(e,n){var r=JR(e*e+n*n),i=t(r),o=ZR(i),a=qR(i);return[YR(e*o,r*a),nI(r&&n*o/r)]}}var dB=fB(function(t){return JR(2/(1+t))});dB.invert=hB(function(t){return 2*nI(t/2)});var pB=fB(function(t){return(t=eI(t))&&t/ZR(t)});function gB(t,e){return[t,XR(tI((BR+e)/2))]}function vB(t){var e,n,r,i=oB(t),o=i.center,a=i.scale,s=i.translate,c=i.clipExtent,l=null;function u(){var o=DR*a(),s=i(function(t){function e(e){return(e=t(e[0]*WR,e[1]*WR))[0]*=$R,e[1]*=$R,e}return t=bI(t[0]*WR,t[1]*WR,t.length>2?t[2]*WR:0),e.invert=function(e){return(e=t.invert(e[0]*WR,e[1]*WR))[0]*=$R,e[1]*=$R,e},e}(i.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===gB?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),u()):a()},i.translate=function(t){return arguments.length?(s(t),u()):s()},i.center=function(t){return arguments.length?(o(t),u()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),u()):null==l?null:[[l,e],[n,r]]},u()}function mB(t){return tI((BR+t)/2)}function yB(t,e){var n=qR(t),r=t===e?ZR(t):XR(n/qR(e))/XR(mB(e)/mB(t)),i=n*KR(mB(t),r)/r;if(!r)return gB;function o(t,e){i>0?e<-BR+IR&&(e=-BR+IR):e>BR-IR&&(e=BR-IR);var n=i/KR(mB(e),r);return[n*ZR(r*t),i-n*qR(r*t)]}return o.invert=function(t,e){var n=i-e,o=QR(r)*JR(t*t+n*n),a=YR(t,GR(n))*QR(n);return n*r<0&&(a-=DR*QR(t)*QR(n)),[a/r,2*HR(KR(i/o,1/r))-BR]},o}function bB(t,e){return[t,e]}function xB(t,e){var n=qR(t),r=t===e?ZR(t):(n-qR(e))/(e-t),i=n/r+t;if(GR(r)<IR)return bB;function o(t,e){var n=i-e,o=r*t;return[n*ZR(o),i-n*qR(o)]}return o.invert=function(t,e){var n=i-e,o=YR(t,GR(n))*QR(n);return n*r<0&&(o-=DR*QR(t)*QR(n)),[o/r,i-QR(r)*JR(t*t+n*n)]},o}pB.invert=hB(function(t){return t}),gB.invert=function(t,e){return[t,2*HR(UR(e))-BR]},bB.invert=bB;var wB=1.340264,kB=-.081106,MB=893e-6,OB=.003796,EB=JR(3)/2;function SB(t,e){var n=nI(EB*ZR(e)),r=n*n,i=r*r*r;return[t*qR(n)/(EB*(wB+3*kB*r+i*(7*MB+9*OB*r))),n*(wB+kB*r+i*(MB+OB*r))]}function _B(t,e){var n=qR(e),r=qR(t)*n;return[n*ZR(t)/r,ZR(e)/r]}function AB(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function TB(t,e){return[qR(e)*ZR(t),ZR(e)]}function PB(t,e){var n=qR(e),r=1+qR(t)*n;return[n*ZR(t)/r,ZR(e)/r]}function CB(t,e){return[XR(tI((BR+e)/2)),-t]}SB.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(wB+kB*i+o*(MB+OB*i))-e)/(wB+3*kB*i+o*(7*MB+9*OB*i)))*r)*i*i,!(GR(n)<1e-12));++a);return[EB*t*(wB+3*kB*i+o*(7*MB+9*OB*i))/qR(r),nI(ZR(r)/EB)]},_B.invert=hB(HR),AB.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(GR(n)>IR&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},TB.invert=hB(nI),PB.invert=hB(function(t){return 2*HR(t)}),CB.invert=function(t,e){return[-e,2*HR(UR(t))-BR]};var NB=Object.freeze({__proto__:null,geoAlbersUsa:function(){var t,e,n,r,i,o,a=uB(),s=lB().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=lB().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),s.stream(n),c.stream(n)])},u.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),c.precision(t),f()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),c.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(l),r=s.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+IR,u+.12*e+IR],[o-.214*e-IR,u+.234*e-IR]]).stream(l),i=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+IR,u+.166*e+IR],[o-.115*e-IR,u+.234*e-IR]]).stream(l),f()},u.fitExtent=function(t,e){return ZD(u,t,e)},u.fitSize=function(t,e){return QD(u,t,e)},u.fitWidth=function(t,e){return JD(u,t,e)},u.fitHeight=function(t,e){return tB(u,t,e)},u.scale(1070)},geoAlbers:uB,geoAzimuthalEqualArea:function(){return oB(dB).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:dB,geoAzimuthalEquidistant:function(){return oB(pB).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:pB,geoConicConformal:function(){return sB(yB).scale(109.5).parallels([30,30])},geoConicConformalRaw:yB,geoConicEqualArea:lB,geoConicEqualAreaRaw:cB,geoConicEquidistant:function(){return sB(xB).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:xB,geoEqualEarth:function(){return oB(SB).scale(177.158)},geoEqualEarthRaw:SB,geoEquirectangular:function(){return oB(bB).scale(152.63)},geoEquirectangularRaw:bB,geoGnomonic:function(){return oB(_B).scale(144.049).clipAngle(60)},geoGnomonicRaw:_B,geoIdentity:function(){var t,e,n,r,i,o,a,s=1,c=0,l=0,u=1,f=1,h=0,d=null,p=1,g=1,v=UD({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),m=YI;function y(){return p=s*u,g=s*f,o=a=null,b}function b(n){var r=n[0]*p,i=n[1]*g;if(h){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+c,i+l]}return b.invert=function(n){var r=n[0]-c,i=n[1]-l;if(h){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/g]},b.stream=function(t){return o&&a===t?o:o=v(m(a=t))},b.postclip=function(t){return arguments.length?(m=t,d=n=r=i=null,y()):m},b.clipExtent=function(t){return arguments.length?(m=null==t?(d=n=r=i=null,YI):DI(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),y()):null==d?null:[[d,n],[r,i]]},b.scale=function(t){return arguments.length?(s=+t,y()):s},b.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],y()):[c,l]},b.angle=function(n){return arguments.length?(e=ZR(h=n%360*WR),t=qR(h),y()):h*$R},b.reflectX=function(t){return arguments.length?(u=t?-1:1,y()):u<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,y()):f<0},b.fitExtent=function(t,e){return ZD(b,t,e)},b.fitSize=function(t,e){return QD(b,t,e)},b.fitWidth=function(t,e){return JD(b,t,e)},b.fitHeight=function(t,e){return tB(b,t,e)},b},geoProjection:oB,geoProjectionMutator:aB,geoMercator:function(){return vB(gB).scale(961/zR)},geoMercatorRaw:gB,geoNaturalEarth1:function(){return oB(AB).scale(175.295)},geoNaturalEarth1Raw:AB,geoOrthographic:function(){return oB(TB).scale(249.5).clipAngle(90.000001)},geoOrthographicRaw:TB,geoStereographic:function(){return oB(PB).scale(250).clipAngle(142)},geoStereographicRaw:PB,geoTransverseMercator:function(){var t=vB(CB),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:CB});function LB(t,e,n,r){const i=()=>{const t=e.filter(RB),n=t.find(t=>t.sphere);return n?{type:"Sphere"}:(r=t.filter(t=>!t.sphere).flatMap(t=>t.data.value),{type:"FeatureCollection",features:r.flatMap(t=>function(t){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];return n?"geometry"===n?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===n?{type:"FeatureCollection",features:[t]}:"featureCollection"===n?t:void 0:null}(t).features)});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;return"fitExtent"===a?function(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}(t,o,n):"fitWidth"===a?function(t,e,n){const{width:r,height:i}=n,[[o,a],[s,c]]=VD(t.fitWidth(r,e)).bounds(e),l=Math.ceil(c-a),u=Math.min(Math.ceil(s-o),l),f=t.scale()*(u-1)/u,[h,d]=t.translate(),p=d+(i-l)/2;t.scale(f).translate([h,p]).precision(.2)}(t,o,n):void 0}function jB(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return"graticule10"===n?Object.assign(Object.assign({},t),{data:{value:[zI()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function RB(t){return"geoPath"===t.type}const IB=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=Ie(n,["type"]),o=function(t){if("function"==typeof t)return t;const e=`geo${G(t)}`,n=NB[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}(r),a=e.map(e=>Object.assign(Object.assign({},e),{data:nR(e.data,t.data)})).map(jB);let s;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const c=o();LB(c,a,{x:t,y:e,width:n,height:r},i),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(c,i),s=VD(c);const l=new bo({domain:[t,t+n]}),u=new bo({domain:[e,e+r]});return{transform:t=>(t=>{const e=c(t);if(!e)return[null,null];const[n,r]=e;return[l.map(n),u.map(r)]})(t),untransform:t=>(t=>{if(!t)return null;const[e,n]=t,r=[l.invert(e),u.invert(n)];return c.invert(r)})(t)}}]]}},children:a.flatMap(t=>RB(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:nS(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>s(t)||[]})})}(t):t)})]};function DB(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=YG(o,t=>"element"===t.className);const c=function(t){return YG(t,t=>"component"===t.className)}(o),l=function(t){return YG(t,t=>"label"===t.className)}(o),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:Xo(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${a}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${a}:${t}`,d))}}function BB(){return(t,e,n)=>{const{container:r,view:i}=t,o=DB(TN.CLICK,i,n,t=>1===t.detail),a=DB(TN.DBLCLICK,i,n,t=>2===t.detail),s=DB(TN.POINTER_TAP,i,n),c=DB(TN.POINTER_DOWN,i,n),l=DB(TN.POINTER_UP,i,n),u=DB(TN.POINTER_OVER,i,n),f=DB(TN.POINTER_OUT,i,n),h=DB(TN.POINTER_MOVE,i,n),d=DB(TN.POINTER_ENTER,i,n),p=DB(TN.POINTER_LEAVE,i,n),g=DB(TN.POINTER_UPOUTSIDE,i,n),v=DB(TN.DRAG_START,i,n),m=DB(TN.DRAG,i,n),y=DB(TN.DRAG_END,i,n),b=DB(TN.DRAG_ENTER,i,n),x=DB(TN.DRAG_LEAVE,i,n),w=DB(TN.DRAG_OVER,i,n),k=DB(TN.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function FB(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":cP,"component.axisLinear":rP,"component.axisArc":iP,"component.legendContinuousBlock":xP,"component.legendContinuousBlockSize":kP,"component.legendContinuousSize":wP,"interaction.event":BB,"composition.mark":aR,"composition.view":oR,"shape.label.label":bO,"shape.break":ZO}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||ta(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Ie(t,["type"]);n||ta("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function zB(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||ta("Cannot find library document")}function $B(t,e){const{coordinate:n={},coordinates:r}=t,i=Ie(t,["coordinate","coordinates"]);if(r)return t;const{type:o,transform:a=[]}=n,s=Ie(n,["type","transform"]);if(!o)return Object.assign(Object.assign({},i),{coordinates:a});const[,c]=FB("coordinate",e),{transform:l=!1}=c(o).props||{};if(l)throw new Error(`Unknown coordinate: ${o}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:o},s),...a]})}function WB(t,e){return t.filter(t=>t.type===e)}function GB(t){return WB(t,"polar").length>0}function HB(t){return WB(t,"transpose").length%2==1}function YB(t){return WB(t,"theta").length>0}function qB(t){return WB(t,"radial").length>0}function VB(t){return WB(t,"radar").length>0}function UB(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}IB.props={},BB.props={reapplyWhenUpdate:!0};var XB=UB("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),KB=UB("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),ZB=UB("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),QB=UB("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),JB=UB("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),tF=UB("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),eF=UB("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),nF=UB("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),rF=UB("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),iF=UB("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),oF=UB("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function aF(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sF(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function cF(){}var lF=.7,uF=1/lF,fF="\\s*([+-]?\\d+)\\s*",hF="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dF="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pF=/^#([0-9a-f]{3,8})$/,gF=new RegExp(`^rgb\\(${fF},${fF},${fF}\\)$`),vF=new RegExp(`^rgb\\(${dF},${dF},${dF}\\)$`),mF=new RegExp(`^rgba\\(${fF},${fF},${fF},${hF}\\)$`),yF=new RegExp(`^rgba\\(${dF},${dF},${dF},${hF}\\)$`),bF=new RegExp(`^hsl\\(${hF},${dF},${dF}\\)$`),xF=new RegExp(`^hsla\\(${hF},${dF},${dF},${hF}\\)$`),wF={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function kF(){return this.rgb().formatHex()}function MF(){return this.rgb().formatRgb()}function OF(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=pF.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?EF(e):3===n?new TF(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?SF(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?SF(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=gF.exec(t))?new TF(e[1],e[2],e[3],1):(e=vF.exec(t))?new TF(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=mF.exec(t))?SF(e[1],e[2],e[3],e[4]):(e=yF.exec(t))?SF(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bF.exec(t))?RF(e[1],e[2]/100,e[3]/100,1):(e=xF.exec(t))?RF(e[1],e[2]/100,e[3]/100,e[4]):wF.hasOwnProperty(t)?EF(wF[t]):"transparent"===t?new TF(NaN,NaN,NaN,0):null}function EF(t){return new TF(t>>16&255,t>>8&255,255&t,1)}function SF(t,e,n,r){return r<=0&&(t=e=n=NaN),new TF(t,e,n,r)}function _F(t){return t instanceof cF||(t=OF(t)),t?new TF((t=t.rgb()).r,t.g,t.b,t.opacity):new TF}function AF(t,e,n,r){return 1===arguments.length?_F(t):new TF(t,e,n,null==r?1:r)}function TF(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function PF(){return`#${jF(this.r)}${jF(this.g)}${jF(this.b)}`}function CF(){const t=NF(this.opacity);return`${1===t?"rgb(":"rgba("}${LF(this.r)}, ${LF(this.g)}, ${LF(this.b)}${1===t?")":`, ${t})`}`}function NF(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function LF(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function jF(t){return((t=LF(t))<16?"0":"")+t.toString(16)}function RF(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new DF(t,e,n,r)}function IF(t){if(t instanceof DF)return new DF(t.h,t.s,t.l,t.opacity);if(t instanceof cF||(t=OF(t)),!t)return new DF;if(t instanceof DF)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new DF(a,s,c,t.opacity)}function DF(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function BF(t){return(t=(t||0)%360)<0?t+360:t}function FF(t){return Math.max(0,Math.min(1,t||0))}function zF(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}aF(cF,OF,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:kF,formatHex:kF,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return IF(this).formatHsl()},formatRgb:MF,toString:MF}),aF(TF,AF,sF(cF,{brighter(t){return t=null==t?uF:Math.pow(uF,t),new TF(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?lF:Math.pow(lF,t),new TF(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new TF(LF(this.r),LF(this.g),LF(this.b),NF(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PF,formatHex:PF,formatHex8:function(){return`#${jF(this.r)}${jF(this.g)}${jF(this.b)}${jF(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:CF,toString:CF})),aF(DF,function(t,e,n,r){return 1===arguments.length?IF(t):new DF(t,e,n,null==r?1:r)},sF(cF,{brighter(t){return t=null==t?uF:Math.pow(uF,t),new DF(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?lF:Math.pow(lF,t),new DF(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new TF(zF(t>=240?t-240:t+120,i,r),zF(t,i,r),zF(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new DF(BF(this.h),FF(this.s),FF(this.l),NF(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=NF(this.opacity);return`${1===t?"hsl(":"hsla("}${BF(this.h)}, ${100*FF(this.s)}%, ${100*FF(this.l)}%${1===t?")":`, ${t})`}`}}));const $F=Math.PI/180,WF=180/Math.PI;var GF=-.14861,HF=1.78277,YF=-.29227,qF=-.90649,VF=1.97294,UF=VF*qF,XF=VF*HF,KF=HF*YF-qF*GF;function ZF(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof QF)return new QF(t.h,t.s,t.l,t.opacity);t instanceof TF||(t=_F(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(KF*r+UF*e-XF*n)/(KF+UF-XF),o=r-i,a=(VF*(n-i)-YF*o)/qF,s=Math.sqrt(a*a+o*o)/(VF*i*(1-i)),c=s?Math.atan2(a,o)*WF-120:NaN;return new QF(c<0?c+360:c,s,i,t.opacity)}(t):new QF(t,e,n,null==r?1:r)}function QF(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}aF(QF,ZF,sF(cF,{brighter(t){return t=null==t?uF:Math.pow(uF,t),new QF(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?lF:Math.pow(lF,t),new QF(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*$F,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new TF(255*(e+n*(GF*r+HF*i)),255*(e+n*(YF*r+qF*i)),255*(e+n*(VF*r)),this.opacity)}}));var JF=t=>()=>t;function tz(t,e){return function(n){return t+n*e}}function ez(t){return 1===(t=+t)?nz:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):JF(isNaN(e)?n:e)}}function nz(t,e){var n=e-t;return n?tz(t,n):JF(isNaN(t)?e:t)}!function t(e){var n=ez(e);function r(t,e){var r=n((t=AF(t)).r,(e=AF(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=nz(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var rz,iz=(rz=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=AF(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=rz(i),o=rz(o),a=rz(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function oz(t){return function e(n){function r(e,r){var i=t((e=ZF(e)).h,(r=ZF(r)).h),o=nz(e.s,r.s),a=nz(e.l,r.l),s=nz(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}oz(function(t,e){var n=e-t;return n?tz(t,n>180||n<-180?n-360*Math.round(n/360):n):JF(isNaN(t)?e:t)});var az=oz(nz),sz=t=>iz(t[t.length-1]),cz=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(UB),lz=sz(cz),uz=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(UB),fz=sz(uz),hz=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(UB),dz=sz(hz),pz=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(UB),gz=sz(pz),vz=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(UB),mz=sz(vz),yz=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(UB),bz=sz(yz),xz=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(UB),wz=sz(xz),kz=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(UB),Mz=sz(kz),Oz=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(UB),Ez=sz(Oz),Sz=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(UB),_z=sz(Sz),Az=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(UB),Tz=sz(Az),Pz=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(UB),Cz=sz(Pz),Nz=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(UB),Lz=sz(Nz),jz=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(UB),Rz=sz(jz),Iz=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(UB),Dz=sz(Iz),Bz=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(UB),Fz=sz(Bz),zz=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(UB),$z=sz(zz),Wz=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(UB),Gz=sz(Wz),Hz=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(UB),Yz=sz(Hz),qz=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(UB),Vz=sz(qz),Uz=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(UB),Xz=sz(Uz),Kz=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(UB),Zz=sz(Kz),Qz=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(UB),Jz=sz(Qz),t$=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(UB),e$=sz(t$),n$=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(UB),r$=sz(n$),i$=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(UB),o$=sz(i$),a$=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(UB),s$=sz(a$);var c$=az(ZF(300,.5,0),ZF(-240,.5,1)),l$=az(ZF(-100,.75,.35),ZF(80,1.5,.8)),u$=az(ZF(260,.75,.35),ZF(80,1.5,.8)),f$=ZF();var h$=AF(),d$=Math.PI/3,p$=2*Math.PI/3;function g$(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var v$=g$(UB("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),m$=g$(UB("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),y$=g$(UB("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),b$=g$(UB("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),x$=Object.freeze({__proto__:null,schemeCategory10:XB,schemeAccent:KB,schemeDark2:ZB,schemeObservable10:QB,schemePaired:JB,schemePastel1:tF,schemePastel2:eF,schemeSet1:nF,schemeSet2:rF,schemeSet3:iF,schemeTableau10:oF,interpolateBrBG:lz,schemeBrBG:cz,interpolatePRGn:fz,schemePRGn:uz,interpolatePiYG:dz,schemePiYG:hz,interpolatePuOr:gz,schemePuOr:pz,interpolateRdBu:mz,schemeRdBu:vz,interpolateRdGy:bz,schemeRdGy:yz,interpolateRdYlBu:wz,schemeRdYlBu:xz,interpolateRdYlGn:Mz,schemeRdYlGn:kz,interpolateSpectral:Ez,schemeSpectral:Oz,interpolateBuGn:_z,schemeBuGn:Sz,interpolateBuPu:Tz,schemeBuPu:Az,interpolateGnBu:Cz,schemeGnBu:Pz,interpolateOrRd:Lz,schemeOrRd:Nz,interpolatePuBuGn:Rz,schemePuBuGn:jz,interpolatePuBu:Dz,schemePuBu:Iz,interpolatePuRd:Fz,schemePuRd:Bz,interpolateRdPu:$z,schemeRdPu:zz,interpolateYlGnBu:Gz,schemeYlGnBu:Wz,interpolateYlGn:Yz,schemeYlGn:Hz,interpolateYlOrBr:Vz,schemeYlOrBr:qz,interpolateYlOrRd:Xz,schemeYlOrRd:Uz,interpolateBlues:Zz,schemeBlues:Kz,interpolateGreens:Jz,schemeGreens:Qz,interpolateGreys:e$,schemeGreys:t$,interpolatePurples:r$,schemePurples:n$,interpolateReds:o$,schemeReds:i$,interpolateOranges:s$,schemeOranges:a$,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:c$,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return f$.h=360*t-100,f$.s=1.5-1.5*e,f$.l=.8-.9*e,f$+""},interpolateWarm:l$,interpolateCool:u$,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,h$.r=255*(e=Math.sin(t))*e,h$.g=255*(e=Math.sin(t+d$))*e,h$.b=255*(e=Math.sin(t+p$))*e,h$+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:v$,interpolateMagma:m$,interpolateInferno:y$,interpolatePlasma:b$});function w$(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return D$(t,ca)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return N$(t,s);if(void 0!==i)return R$([i])?N$(t,s):I$(e)?"time":L$(t,o,a);return R$(e)?N$(t,s):I$(e)?"time":L$(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return j$(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)na(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return j$(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)na(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(A$({type:t}))return function(t,e,n){const r=t.map(Number),i=new bo({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map(t=>new Date(i.map(t))):t.map(t=>i.map(t))}(e,r,t);return T$({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=zi,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?YB(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=G(e),i=x$[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:P$(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function k$(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map(t=>o.map(t))}}return n}function M$(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter(t=>t.startsWith(e)).map(t=>+(t.replace(e,"")||0)),o=xr(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function O$(t,e){const[n]=FB("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Zo,Zo];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter(([t])=>"function"==typeof t),a=t.filter(([t])=>"function"!=typeof t),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(a.map(([t,e])=>[e,t])),l=new Map(o.map(([t,e])=>[e,t]));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function E$(t){const e=t.flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale));_$(e,"x"),_$(e,"y")}function S$(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter(t=>i.includes(t)):[]}function _$(t,e){const n=t.filter(({name:t,facet:n=!0})=>n&&t===e),r=n.flatMap(t=>t.domain),i=n.every(A$)?Zn(r):n.every(T$)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function A$(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function T$(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function P$(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=C$(n,r,i,o,a),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[da(e),pa(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return C$(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function C$(t,e,n,r,i){const[o]=FB("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=G(t),i=x$[`scheme${r}`],o=x$[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map((t,r)=>o(n(r/e.length)))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function N$(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function L$(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function j$(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function R$(t){return D$(t,t=>{const e=typeof t;return"string"===e||"boolean"===e})}function I$(t){return D$(t,t=>t instanceof Date)}function D$(t,e){for(const n of t)if(n.some(e))return!0;return!1}const B$={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},F$={threshold:"threshold",quantize:"quantize",quantile:"quantile"},z$={ordinal:"ordinal",band:"band",point:"point"},$$={constant:"constant"};function W$(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=FB("component",n),a=t.filter(({guide:t})=>null!==t),s=[],c=function(t,e,n){const[,r]=FB("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?HB(n)?`${e}Y`:`${e}X`:"y"===t?HB(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter(t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t));return[...Y$(n),...V$(n,e)]}(a,r);return l.forEach(([t,e])=>{const{props:n}=o(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=tt({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[o,g]=K$(t,i,l,n,e,a,r);if(!o&&!g)continue;const v="left"===o||"right"===o,y=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=h,padding:M=y,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:k,position:o,plane:c,orientation:g,padding:M,order:w,crossPadding:O,size:x,type:t,scales:e}))}}),s}function G$(t,e,n,r,i){const[o]=FB("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Ie(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function H$(t,e){const n=["left","right","bottom","top"],r=ir(t,({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent"));return r.flatMap(([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=Lr(n);if(r>e)return t.forEach(t=>t.group=Symbol("independent")),t;const i=(e-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=i)})}const n=xr(t,t=>t.size),r=xr(t,t=>t.order),i=xr(t,t=>t.crossPadding);return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}})}function Y$(t,e){const n=["shape","size","color","opacity"],r=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e)),i=r.filter(({type:t})=>"constant"===t),o=ir(r.filter(({type:t})=>"constant"!==t),t=>t.field?t.field:Symbol("independent")).map(([t,e])=>[t,[...e,...i]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),a=new Map(o);if(0===a.size)return[];const s=t=>t.sort(([t],[e])=>t.localeCompare(e)),c=Array.from(a).map(([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...va(t,n));return e}(t).sort((t,e)=>e.length-t.length),n=e.map(t=>({combination:t,option:t.map(t=>[t.name,q$(t)])}));for(const{option:t,combination:e}of n)if(!t.every(t=>"constant"===t[1])&&t.every(t=>"discrete"===t[1]||"constant"===t[1]))return["legendCategory",e];for(const[t,e]of JN)for(const{option:r,combination:i}of n)if(e.some(t=>rt(s(t),s(r))))return[t,i];return null}).filter(na);return c}function q$(t){const{type:e}=t;return"string"!=typeof e?null:e in B$?"continuous":e in z$?"discrete":e in F$?"distribution":e in $$?"constant":null}function V$(t,e){return t.map(t=>{const{name:n}=t;if(function(t){return WB(t,"helix").length>0}(e)||YB(e))return null;if(HB(e)&&(GB(e)||qB(e)))return null;if(n.startsWith("x"))return GB(e)?["axisArc",[t]]:qB(e)?["axisLinear",[t]]:[HB(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return GB(e)?["axisLinear",[t]]:qB(e)?["axisArc",[t]]:[HB(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(VB(e))return["axisRadar",[t]];if(!GB(e))return["axisY",[t]]}return null}).filter(na)}function U$(t){const e=WB(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=WB(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function X$(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter(t=>t.name.startsWith("position")),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(null===e)return[null,null];const[n,a]=U$(i);return["center",(a-n)/(VB(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return WB(t,"parallel").length>0}(i))return HB(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=U$(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:GB(i)||qB(i)?["center",null]:"axisX"===t&&function(t){return WB(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return WB(t,"reflectY").length>0}(i)?["top",null]:e}function K$(t,e,n,r,i,o,a){const[s]=U$(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?X$(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&GB(a)&&"center"===r.position?["center","vertical"]:c}function Z$(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?nW:s.startsWith("group")?Q$:s.startsWith("legendContinuous")?rW:"legendCategory"===s?iW:s.startsWith("slider")?eW:"title"===s?tW:s.startsWith("scrollbar")?J$:()=>{})(t,e,n,r,i,o)}function Q$(t,e,n,r,i,o){const{children:a}=t,s=xr(a,t=>t.crossPadding);a.forEach(t=>t.crossPadding=s),a.forEach(t=>Z$(t,e,n,r,i,o));const c=xr(a,t=>t.size);t.size=c,a.forEach(t=>t.size=c)}function J$(t,e,n,r,i,o){const{trackSize:a=6}=tt({},i.scrollbar,t);t.size=a}function tW(t,e,n,r,i,o){const a=tt({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Ie(a,["title","subtitle","spacing"]);if(s){const e=uW(s,ia(u,"title"));t.size=e.height}if(c){const e=uW(c,ia(u,"subtitle"));t.size+=l+e.height}}function eW(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return tt({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function nW(t,e,n,r,i,o){var a,s;t.transform=t.transform||[{type:"hide"}];const c="left"===r||"right"===r,l=cW(t,r,i),{tickLength:u=0,labelSpacing:f=0,titleSpacing:h=0,labelAutoRotate:d}=l,p=Ie(l,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),g=oW(t,o),v=aW(p,g);let m=u;if("function"==typeof t.tickLength){const e=((null===(a=g.getTicks)||void 0===a?void 0:a.call(g))||g.getOptions().domain).map((e,n,r)=>t.tickLength(e,n,r));m=Math.max(...e,0)}const y=m+f;if(v&&v.length){const r=xr(v,t=>t.width),i=xr(v,t=>t.height);if(c)t.size=r+y;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=Lr(e,t=>t.width);if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=lW(t,i),c=s.map(t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t)),l=s.map((t,e)=>e),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const o=c[t+1];if(o){const[n]=h(o,e[t+1]);if(i>n)return!0}}return!1}(g,v,e,n,o)||a||!1===d||null===d?(t.labelTransform=null!==(s=t.labelTransform)&&void 0!==s?s:"rotate(0)",t.size=i+y):(t.labelTransform="rotate(90)",t.size=r+y)}}else t.size=m;const b=sW(p);b&&(t.size+=c?h+b.width:h+b.height)}function rW(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return tt({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Ie(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=ia(l,"ribbon"),{size:h}=f,d=ia(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=aW(l,oW(t,o));if(v){const e=u?"width":"height",n=xr(v,t=>t[e]);t.size+=n+s}const m=sW(l);m&&(u?t.size=Math.max(t.size,m.width):t.size+=c+m.height)}function iW(t,e,n,r,i,o){const a=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,o]=Array.isArray(n)?[n,void 0]:[void 0,n];return tt({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{focus:s,itemSpacing:c,focusMarkerSize:l,itemMarkerSize:u,titleSpacing:f,rowPadding:h,colPadding:d,maxCols:p=1/0,maxRows:g=1/0}=a,v=Ie(a,["focus","itemSpacing","focusMarkerSize","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:m,length:y}=t,b=t=>Math.min(t,g),x=t=>Math.min(t,p),w="left"===r||"right"===r,k=void 0===y?e+(w?0:n[0]+n[1]):y,M=sW(v),O=aW(v,oW(t,o),"itemLabel"),E=Math.max(O[0].height,u)+h,S=(t,e=0)=>u+t+c[0]+e+(s?l+c[2]:0);w?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=M?M.height:0,c=k-s;for(const{width:t}of O){const s=S(t,d);e=Math.max(e,s),n+E>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=E):(n+=E,i++)}r<=1&&(o=i,a=n),t.size=e*x(r),t.length=a+s,tt(t,{cols:x(r),gridRow:o})})():"number"==typeof m?(()=>{const e=Math.ceil(O.length/m),n=xr(O,t=>S(t.width))*m;t.size=E*b(e)-h,t.length=Math.min(n,k)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of O){const i=S(t,d);n+i>k?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*b(e)-h,t.length=r})(),M&&(w?t.size=Math.max(t.size,M.width):t.size+=f+M.height)}function oW(t,e){const[n]=FB("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==i&&(a.tickCount=i),void 0!==o&&(a.tickMethod=o),n(a)}function aW(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Ie(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=lW(t,n),i=r.map(t=>"number"==typeof t?jm(t):t),o=e?"string"==typeof e?DT(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=ia(a,n),l=s.map((t,e)=>Object.fromEntries(Object.entries(c).map(([n,r])=>[n,"function"==typeof r?r(t,e):r]))),u=s.map((t,e)=>uW(t,l[e])),f=l.some(t=>t.transform);if(!f){const e=s.map((t,e)=>e);t.indexBBox=new Map(e.map(t=>[t,[s[t],u[t]]]))}return u}function sW(t){const{title:e}=t,n=Ie(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=ia(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return uW(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function cW(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${Jo(e)}`]:s}=n;return tt({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function lW(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function uW(t,e){const n=function(t){return t instanceof Qg?t:new mv({style:{text:`${t}`}})}(t),r=Ie(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function fW(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:v=h,margin:m=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:y=m,marginBottom:b=m,marginTop:x=m,marginRight:w=m,padding:k=n.padding,paddingBottom:M=k,paddingLeft:O=k,paddingRight:E=k,paddingTop:S=k}=function(t,e,n,r){const{coordinates:i}=e;if(!GB(i)&&!qB(i))return e;const o=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===o.length)return e;const a=o.map(t=>cW(t,"axisArc"===t.type?"arc":"linear",n)),s=xr(a,t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0}),c=o.flatMap((t,e)=>aW(a[e],oW(t,r))).filter(na),l=xr(c,t=>t.height)+s,u=o.flatMap((t,e)=>sW(a[e])).filter(t=>null!==t),f=0===u.length?0:xr(u,t=>t.height),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),_=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},A=t=>"auto"===t?20:null!=t?t:20,T=A(S),P=A(M),C=hW(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-y-w,[R,I]=_(j,O,E,N,L),D=j-R-I,B=hW(t,D,[R+y,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,$=s-b-x,[W,G]=_($,M,S,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:$-W-G,paddingLeft:R,paddingRight:I,paddingTop:G,paddingBottom:W,marginLeft:y,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function hW(t,e,n,r,i,o,a){const s=rr(t,t=>t.position),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${Jo(Ry(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=xr(t.children,t=>t.size)):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(Z$(r,e,n,t,o,a),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=kr(i,t=>t.order),v=i.filter(t=>t.type.startsWith("axis")&&t.order==g);if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=H$(i,p?e+n[0]+n[1]:e);t.forEach(f);const o=t.reduce((t,{size:e,crossPadding:n=12})=>t+e+n,0);d[r]=o}}return d}function dW({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const v=n+a,m=i+s,y=r+l,b=o+c,x=t-a-l,w=[v+d,m+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,m,"vertical",!0,Fn,a,x],right:[t-y,m,y,u,"horizontal",!1,Fn],bottom:[v,e-b,f,b,"vertical",!1,Fn,a,x],left:[0,m,v,u,"horizontal",!0,Fn],"top-left":[v,0,f,m,"vertical",!0,Fn],"top-right":[v,0,f,m,"vertical",!0,Fn],"bottom-left":[v,e-b,f,b,"vertical",!1,Fn],"bottom-right":[v,e-b,f,b,"vertical",!1,Fn],center:w,inner:w,outer:w}}function pW(t,e,n,r){const[i,o]=ga(t,t=>!("string"!=typeof t.type||!t.type.startsWith("axis")));!function(t,e,n,r){"center"===r?function(t){return sl(t)&&il(t)}(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):il(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):sl(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=ul(e),l=o/2,u=c*l,f=a-u,h=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+h,width:2*u,height:2*u}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=ul(e),c=a/2*s/Math.sqrt(2),l=r+o/2,u=i+a/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(o,e,n)}function gW(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort((t,e)=>null==l?void 0:l(t.order,e.order));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+m:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:o}=r,{size:a}=r;r.bbox={[h]:c?n-a-i:n+i,[p]:k(o,g,u),[v]:a,[y]:w(o,b,f)},n+=(a+i)*(c?-1:1)}const M=t.filter(t=>"group"===t.type);for(const t of M){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,o=n.reduce((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t},"flex-start"),a=n.map((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)}),s=r-Lr(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[v]:e[v],[h]:e[h],[p]:r,[y]:a[t]-c},tt(i,{layout:{justifyContent:o}}),r+=a[t]}}}const vW=Symbol("CALLBACK_ITEM");function mW(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Ie(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function yW(t,e,n){return Be(this,void 0,void 0,function*(){const{library:t}=n,{data:r}=e,[i]=FB("data",t),o=function(t){if(I(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=Ie(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Ie(o,["transform"]),...a].map(t=>i(t,n)),c=yield function(t){return t.reduce((t,e)=>n=>Be(this,void 0,void 0,function*(){const r=yield t(n);return e(r)}),Zo)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?ha(c):[],Object.assign(Object.assign({},e),{data:l})]})}function bW(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function xW(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=fa(r,t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return na(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some(t=>void 0!==t[e])}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}});return[t,Object.assign(Object.assign({},e),{encode:o})]}function wW(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=fa(r,(t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function kW(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=FB("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:PW(n)})}(o),s=fa(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:s})]}function MW(t,e,n){const{tooltip:r={}}=e;return la(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:ca(r)&&rS(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function OW(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(la(o))return[t,e];const a=e=>{if(!e)return e;if("string"==typeof e)return t.map(t=>({name:e,value:r[t][e]}));if(ca(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?DT(c):c,u=o&&i[o],f=u&&i[o].field,h=s||f||o,d=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;d[e]={name:h,color:a,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);ca(t)?n[o]=Object.assign(Object.assign({},t),{[vW]:!0}):n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Ie(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(c)?c.map(a):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function EW(t,e,n){const{encode:r}=e,i=Ie(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter(([,t])=>{const{value:e}=t;return Array.isArray(e[0])}).flatMap(([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,o=Ie(n,["value"]);for(let n=0;n<i.length;n++){const o=i[n];if(Array.isArray(o))for(let i=0;i<o.length;i++){const a=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];a[1][n]=o[i],r[i]=a}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},o)])}),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function SW(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return tt(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map(t=>{const e=s(a,t);return[t,Object.assign({guide:s(r,t),slider:s(o,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function _W(t,e,n){const{animate:r}=e;return r||void 0===r||tt(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function AW(t,e,n){var r,i;return tt(e,{scale:{series:Object.assign({key:`DEFAULT_${e.type}_SERIES_KEY`},null!==(i=null===(r=null==e?void 0:e.scale)||void 0===r?void 0:r.series)&&void 0!==i?i:{})}}),[t,e]}function TW(t,e,n){return Be(this,void 0,void 0,function*(){const[r,i]=yield function(t,e,n){return Be(this,void 0,void 0,function*(){const{library:r}=n,[i]=FB("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[mW,yW,bW,xW,wW,kW,EW,_W,SW,MW,AW,...o.map(i),...s.map(i),...a.map(i),OW];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]})}(t,e,n),{encode:o,scale:a,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=ar(Object.entries(o).filter(([,t])=>na(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find(t=>t.name===n);return(null==r?void 0:r.independent)?t:n}),f=l.filter(t=>{const{name:e,required:n}=t;if(u.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:s}=t;return u.filter(([t])=>t.startsWith(e)).map(([t,e],c)=>{const l=e.some(t=>t.visual),u=e.some(t=>t.constant),f=a[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Ie(f,["independent","key","type"]),v="constant"===p,m=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:m},g),{quantitative:o,ordinal:s})}})});return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]})}function PW(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function CW(t,e,n){return Be(this,void 0,void 0,function*(){var r;const{library:i}=n,[o]=FB("composition",i),[a]=FB("interaction",i),s=new Set(Object.keys(i).map(t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(na)),c=new Set(Object.keys(i).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(na)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return o({type:e,static:h(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,o]=e?DW(e,t,i):yield jW(t,n);g.set(r,t),p.push(r);const a=o.flatMap(d).map(t=>$B(t,i));if(m.push(...a),a.every(f)){const t=yield Promise.all(a.map(t=>RW(t,n)));E$(t);for(let e=0;e<a.length;e++){const n=a[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield QW(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(TN.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(nG($O)).data(p,t=>t.key).join(t=>t.append("g").attr("className",$O).attr("id",t=>t.key).call(NW).each(function(t,e,r){BW(t,Cm(r),k,n),b.set(t,r)}),t=>t.call(NW).each(function(t,e,r){BW(t,Cm(r),k,n),w.set(t,r)}),t=>t.each(function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()}).remove());const M=(t,e,r)=>Array.from(t.entries()).map(([i,o])=>{const a=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=FB("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=ZW(e),s=a.map(i).filter(o).map(t=>t[0]);return(e,r,i)=>Be(this,void 0,void 0,function*(){const o=[],[a,c]=yield jW(e,n);BW(a,t,o,n);for(const i of s.filter(t=>t!==r))LW(i,t,e,a,n);for(const e of c)CW(e,t,n);return i(),{options:e,view:a}})}(Cm(o),s,n);return{view:i,container:o,options:s,setState:(t,e=t=>t)=>a.set(t,e),update:(n,r)=>Be(this,void 0,void 0,function*(){const i=Qo(Array.from(a.values()))(s);return yield c(i,n,()=>{x(r)&&e(t,r,a)})})}}),O=(t=w,e,r)=>{var i;const o=M(t,O,r);for(const t of o){const{options:r,container:s}=t,c=s.nameInteraction;let l=ZW(r);e&&(l=l.filter(t=>e.includes(t[0])));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=IW(t.view,r,s,a)(t,o,n.emitter);c.set(r,{destroy:e})}}}},E=M(b,O);for(const t of E){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of ZW(e)){const[e,o]=i;if(o){const i=IW(t.view,e,o,a)(t,E,n.emitter);r.set(e,{destroy:i})}}}O();const{width:S,height:_}=t,A=[];for(const t of y){const r=new Promise(r=>Be(this,void 0,void 0,function*(){for(const r of t){const t=Object.assign({width:S,height:_},r);yield CW(t,e,n)}r()}));A.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach(t=>null==t?void 0:t.cancel()),n.animations=k,n.emitter.emit(TN.AFTER_PAINT);const T=k.filter(na).map(VW).map(t=>t.finished);return Promise.all([...T,...A])})}function NW(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function LW(t,e,n,r,i){var o;const{library:a}=i,[s]=FB("interaction",a),c=e.node().nameInteraction,l=ZW(n).find(([e])=>e===t),u=c.get(t);if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=IW(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function jW(t,e){return Be(this,void 0,void 0,function*(){const{library:n}=e,r=yield function(t,e){return Be(this,void 0,void 0,function*(){const{library:n}=e,[r,i]=FB("mark",n),o=new Set(Object.keys(n).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(na)),{marks:a}=t,s=[],c=[],l=[...a],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:m=d}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(o)-l-u-p-g,height:e-y(a)-y(s)-f-h-v-m}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield QW(t,e),{type:a=ta("G2Mark type is required."),key:u}=n;if(o.has(a))c.push(n);else{const{props:t={}}=i(a),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),o=Array.isArray(i)?i:[i];l.unshift(...o.map((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`})))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})})}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Ie(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),s=i.map(t=>t.interaction||{}),c=i.map(t=>t.viewStyle||{}),l=[...a,e].reduceRight((t,e)=>tt(t,e),{}),u=[n,...s].reduce((t,e)=>tt(t,e),{}),f=[...c,r].reduce((t,e)=>tt(t,e),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const o=$B(i,n);return DW(yield RW(o,e),o,n)})}function RW(t,e){return Be(this,void 0,void 0,function*(){const{library:n}=e,[r]=FB("theme",n),[,i]=FB("mark",n),{theme:o,marks:a,coordinates:s=[]}=t,c=r(KW(o)),l=new Map;for(const t of a){const{type:n}=t,{props:r={}}=i(n),o=yield TW(t,r,e);if(o){const[t,e]=o;l.set(t,e)}}const u=rr(Array.from(l.values()).flatMap(t=>t.channels),({scaleKey:t})=>t);for(const t of u.values()){const e=t.reduce((t,{scale:e})=>tt(t,e),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map(t=>t.field).filter(na))),a=tt({guide:{title:0===o.length?void 0:o},field:o[0]},e),{name:l}=t[0],u=t.flatMap(({values:t})=>t.map(t=>t.value)),f=Object.assign(Object.assign({},w$(l,u,a,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach(t=>t.scale=f)}return l})}function IW(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(tt(o,Object.assign({type:e},n)))}function DW(t,e,n){var r;const[i]=FB("mark",n),[o]=FB("theme",n),[a]=FB("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=o(KW(l)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),a=new Map(o.map(t=>[t.name,t]));for(const t of r){const e=S$(t);for(const r of e){const e=a.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=tt({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:ct(t,i)});o.push(e)}}}return o}(p,e),v=function(t){return t.map(t=>{const e=tt(t,t.style);return delete e.style,e})}(W$(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find(t=>"color"===t.name))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=fW(v,e,d,n),y=function(t,e,n){const[r]=FB("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find(t=>"cartesian"===t.type||"cartesian3D"===t.type)?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-c,height:i-l-s,transformations:f.flatMap(r)});return d?new Jj(p):new Xj(p)}(m,e,n),b=c?tt({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=rr(t,t=>`${t.plane||"xy"}-${t.position}`),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,w={xy:dW({width:b,height:y,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:dW({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:dW({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=ga(n,t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i))));a.length&&pW(a,e,o,i),s.length&&gW(n,0,o)}}(H$(v),y,m),function(t){const e=t.find(({type:t})=>"axisX"===t),n=t.find(({type:t})=>"axisY"===t),r=t.find(({type:t})=>"axisZ"===t);e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap(t=>{const{channels:e}=t;return e.map(({scale:t})=>[t.uid,O$(t,n)])}));!function(t,e){const n=Array.from(t.values()).flatMap(t=>t.channels),r=ar(n,t=>t.map(t=>e.get(t.scale.uid)),t=>t.name).filter(([,t])=>t.some(t=>"function"==typeof t.getOptions().groupTransform)&&t.every(t=>t.getTicks)).map(t=>t[1]);r.forEach(t=>{const e=t.map(t=>t.getOptions().groupTransform)[0];e(t)})}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:o}=t,a=null!==(r=x.get(o))&&void 0!==r?r:O$(t,n);i.push(a),"y"===e&&a.update(Object.assign(Object.assign({},a.getOptions()),{xScale:w.x})),M$(w,{[e]:a})}t.scaleInstances=i}const k=[],M=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:o,key:a,data:c}=e;M.set(a,c);const{index:l,channels:u,tooltip:f}=n,h=Object.fromEntries(u.map(({name:t,scale:e})=>[t,e])),d=fa(h,({uid:t})=>x.get(t));M$(w,d);const p=k$(u,d),g=i(e),[v,b,O]=FW(g(l,d,p,y)),E=r||v.length,S=o?o(b,E,m):[],_=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},A=t=>f.items.map(e=>e[t]),T=v.map((t,e)=>{const n=Object.assign({points:b[e],transform:S[e],index:t,markKey:a,viewKey:s,data:c[t]},f&&{title:_(t),items:A(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],O&&(n[`series${G(r)}`]=O[e].map(t=>i[t]));return O&&(n.seriesIndex=O[e]),O&&f&&(n.seriesItems=O[e].map(t=>A(t)),n.seriesTitle=O[e].map(t=>_(t))),n});n.data=T,n.index=v;const P=null==t?void 0:t(T,d,m);k.push(...P||[])}return[{layout:m,theme:d,coordinate:y,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:M,options:e,labelTransform:Qo(h.map(a))},k]}function BW(t,e,n,r){return Be(this,void 0,void 0,function*(){const{library:i}=r,{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:m}=s,y=Ie(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map((t,e)=>e),w=b.map(t=>oa(Object.assign({},a.view,f),t)),k=["a","margin","padding","inset"].map(t=>ia(y,t)),M=t=>t.style("x",t=>A[t].x).style("y",t=>A[t].y).style("width",t=>A[t].width).style("height",t=>A[t].height).each(function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Cm(n),w[t])});let O=0,E=0,S=v,_=m;const A=x.map(t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return O+=n,E+=r,S-=n+o,_-=r+i,{x:O,y:E,width:S,height:_}});e.selectAll(nG(YO)).data(x.filter(t=>na(w[t])),t=>b[t]).join(t=>t.append("rect").attr("className",YO).style("zIndex",-2).call(M),t=>t.call(M),t=>t.remove());const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:v=300,delay:m=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of ir(o,t=>`${t.type}-${t.position}`))t.forEach((t,e)=>t.index=e);const C=e.selectAll(nG(GO)).data(o,t=>`${t.type}-${t.position}-${t.index}`).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",GO).append(t=>G$(tt({animate:P,scale:d},t),l,a,i,c)),t=>t.transition(function(t,e,n){const{preserve:r=!1}=t;if(r)return;const o=G$(tt({animate:P,scale:d},t),l,a,i,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})).transitions();n.push(...C.flat().filter(na));const N=e.selectAll(nG(WO)).data([s],()=>u).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",WO).call(JW).call(eG,Array.from(c.keys())).call(rG,h),t=>t.call(eG,Array.from(c.keys())).call(JW).call(rG,h)).transitions();n.push(...N.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=GW(o,a,t,r),d=qW(o,a,t,i),p=UW(o,a,t,i),g=XW(o,a,t,i),v=$W(e,f,l,"element"),m=f.selectAll(nG(zO)).selectFacetAll(v).data(s,t=>t.key,t=>t.groupKey).join(t=>t.append(h).attr("className",zO).attr("markType",u).transition(function(t,e,n){return d(t,[n])}),t=>t.call(t=>{const e=t.parent(),n=ra(t=>{const[e,n]=t.getBounds().min;return[e,n]});t.transition(function(t,r,i){WW(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return(null==a?void 0:a.length)||(i.nodeName===o.nodeName&&"g"!==o.nodeName?ea(i,o):(i.parentNode.replaceChild(o,i),o.className=zO,o.markType=u,o.__data__=i.__data__)),a}).each(function(t,e,n){n.__removed__&&(n.__removed__=!1)}).attr("markType",u).attr("className",zO)}),t=>t.each(function(t,e,n){n.__removed__=!0}).transition(function(t,e,n){return g(t,[n])}).remove(),t=>t.append(h).attr("className",zO).attr("markType",u).transition(function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Nm(r,null,n.parentNode).transition(i).remove(),i}),t=>t.transition(function(t,e,n){const r=new Nm([],n.__toData__,n.parentNode).append(h).attr("className",zO).attr("markType",u).nodes();return p(t,[n],r)}).remove()).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[o]=FB("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(nG(FO)).node(),l=new Map,u=new Map,f=Array.from(a.entries()).flatMap(([n,o])=>{const{labels:a=[],key:s}=n,c=function(t,e,n,r,i){const[o]=FB("shape",r),{data:a,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map(t=>t.points),f=fa(s,t=>t.value),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:zB(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,m=Ie(t,["formatter","transform","style","render","selector","element"]),y=fa(Object.assign(Object.assign({},m),c),t=>zW(t,r,e,a,{channel:f,element:v})),{shape:b=l,text:x}=y,w=Ie(y,["shape","text"]),k="string"==typeof i?DT(i):i,M=Object.assign(Object.assign({},w),{text:k(x,r,e,a),datum:r}),O=Object.assign({type:`label.${b}`,render:d},w);return o(O,p)(n,M,HW(h,"label",b,"label"),u)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(nG(zO)).nodes().filter(t=>!t.__removed__);return a.flatMap((t,e)=>{const n=Ie(t,["transform"]);return f.flatMap(r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach(t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])}),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n}));return l?l(u):u}(n,e,r);return i.forEach(e=>{l.set(e,t=>c(Object.assign(Object.assign({},t),{element:r}))),u.set(e,t)}),i})})}),h=Cm(c).selectAll(nG(HO)).data(f,t=>t.key).join(t=>t.append(t=>l.get(t)(t)).attr("className",HO),t=>t.each(function(t,e,n){ea(n,l.get(t)(t))}),t=>t.remove()).nodes(),d=rr(h,t=>u.get(t.__data__)),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;Qo(n.map(o))(e,v)}s&&s(h,v)}(t,e,0,i,r),function(t,e,n,r,i){const o=t.scale,a=ot(o,"y.options.breaks",[]),{document:s}=i.canvas;if([qO,VO].forEach(t=>{s.getElementsByClassName(t).forEach(t=>{t.remove()})}),!a.length)return;const c=e.select(nG(WO)).node(),[l]=FB("shape",r),u=new Map;a.forEach((r,o)=>{u.set(r,l({type:"break"},{view:t,selection:e,transitions:n,context:i,update:BW}))}),Cm(c).selectAll(nG(qO)).data(a,t=>t.key).join(t=>t.append((t,e)=>u.get(t)(t,e)).attr("className",qO),t=>t.each(function(t,e,n){ea(n,u.get(t)(t,e))}),t=>t.remove()).nodes()}(t,e,n,i,r)})}function FW([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const o=t[n],a=e[n];a.every(([t,e])=>na(t)&&na(e))&&(r.push(o),i.push(a))}return[r,i]}function zW(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:ca(e)&&void 0!==e[t]?e[t]:t}function $W(t,e,n,r){const i=t.node().parentElement;return i&&"function"==typeof i.findAll?i.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r)):[]}function WW(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-c})`),e.append(t)}function GW(t,e,n,r){const{library:i}=r,[o]=FB("shape",i),{data:a,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=fa(s,t=>t.value),h=l.map(t=>t.points),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:zB(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Ie(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:l}),b=s?s.map(t=>a[t]):a[l],x=s||l,w=fa(v,t=>zW(t,b,x,a,{channel:f}));return(u[r]?u[r](w,m):o(Object.assign(Object.assign({},w),{type:tG(t,r)}),m))(i,y,HW(d,g,r,c),h)}}function HW(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function YW(t,e,n,r,i){var o,a;const[,s]=FB("shape",i),[c]=FB("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${G(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(tG(e,l)).props,{[t]:g={}}=f,v=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},m={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},v);if(!l.type)return null;const u=c(l,m)(n,r,tt(g,{delay:o,duration:a,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function qW(t,e,n,r){return YW("enter",t,e,n,r)}function VW(t){return t.finished.then(()=>{t.cancel()}),t}function UW(t,e,n,r){return YW("update",t,e,n,r)}function XW(t,e,n,r){return YW("exit",t,e,n,r)}function KW(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Ie(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function ZW(t){const{interaction:e={}}=t;return Object.entries(tt({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function QW(t,e){return Be(this,void 0,void 0,function*(){const{data:n}=t,r=Ie(t,["data"]);if(null==n)return t;const[,{data:i}]=yield yW(0,{data:n},e);return Object.assign({data:i},r)})}function JW(t){t.style("transform",t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function tG(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function eG(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(nG(BO)).data(e,t=>t.key).join(t=>t.append("g").attr("className",BO).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.remove());t.select(nG(FO)).node()||t.append("g").attr("className",FO).style("zIndex",0)}function nG(...t){return t.map(t=>`.${t}`).join("")}function rG(t,e){t.node()&&t.style("clipPath",t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new gv({style:{x:r+i,y:n+o,width:a,height:s}})})}function iG(t){const{style:e,scale:n,type:r}=t,i={},o=ot(e,"columnWidthRatio");return o&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-o})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}const oG=t=>{if(!t||"string"!=typeof t)return t;const e=t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t);if(isNaN(e)||e<0||e>1)throw new Error(`Invalid gap value: ${t}. It should be between 0 and 1.`);return e};function aG(t){const{axis:e}=t,n=ot(e,"y.breaks");return n&&at(t,"scale.y.breaks",n.map(t=>Object.assign(Object.assign({key:`break-${t.start}-${t.end}`},t),{gap:oG(t.gap)}))),t}function sG(t){const e=function(t){return function(...t){return e=>t.reduce((t,e)=>e(t),e)}(iG,aG)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map(t=>sG(t))),e}function cG(t){const e=tt({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o<e.length;o++){const a=tt({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function lG(t,e){const n=new ON;return n.registerPlugin(new SN),new Nv({width:t,height:e,container:document.createElement("div"),renderer:n})}function uG(t,e={},n=()=>{},r=t=>{throw t}){const i=QN(t),{width:o=640,height:a=480,depth:s=0}=i,c=cG(sG(i)),{canvas:l=lG(o,a),emitter:u=new AN,library:f}=e;e.canvas=l,e.emitter=u;const{width:h,height:d}=l.getConfig();h===o&&d===a||l.resize(o,a),u.emit(TN.BEFORE_RENDER);const p=Cm(l.document.documentElement);return l.ready.then(()=>CW(Object.assign(Object.assign({},c),{width:o,height:a,depth:s}),p,e)).then(()=>{if(s){const[t,e]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(t,e,-s/2)}l.requestAnimationFrame(()=>{l.requestAnimationFrame(()=>{u.emit(TN.AFTER_RENDER),null==n||n()})})}).catch(t=>{null==r||r(t)}),"string"==typeof(g=l.getConfig().container)?document.getElementById(g):g;var g}function fG(t,e={},n=!1,r=!0){const{canvas:i,emitter:o}=e;i&&(!function(t){const e=t.getRoot().querySelectorAll(`.${$O}`);null==e||e.forEach(t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach(t=>{null==t||t.destroy()})})}(i),n?i.destroy():i.destroyChildren()),r&&o.off()}function hG(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(hG(t,e))return!0}return!1}const dG={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function pG(t,e){let n;return hG(t,t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)}),null!=n?n:dG[e]}function gG(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>gG(t,e,n,r))}function vG(t){gG(t,"visibility","hidden",!0)}function mG(t){gG(t,"visibility","visible",!0)}function yG(t){return Cm(t).selectAll(`.${zO}`).nodes().filter(t=>!t.__removed__)}function bG(t,e){return xG(t,e).flatMap(({container:t})=>yG(t))}function xG(t,e){return e.filter(e=>e!==t&&e.options.parentKey===t.options.key)}function wG(t){return Cm(t).select(`.${WO}`).node()}function kG(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new Ou;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function MG(t,e){const{offsetX:n,offsetY:r}=e,i=kG(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function OG(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function EG(t){return t=>t.__data__.color}function SG(t){return t=>t.__data__.x}function _G(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap(t=>Array.from(t.markState.keys()).map(e=>[LG(t.key,e.key),e.data])));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(LG(i,r))[e]}}const AG={selected:3,unselected:3,active:2,inactive:2,default:1},TG={selection:["selected","unselected"],highlight:["active","inactive"]},PG=(t,e,n)=>{hG(t,t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)})};function CG(t,e){return e.forEach(e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t}),(t=(t,e)=>t,e=PG)=>NG(void 0,t,e)}function NG(t,e=(t,e)=>t,n=PG){const r="__states__",i="__ordinal__",o=t=>AG[t]||AG.default,a=t=>{var e;return null===(e=Object.entries(TG).find(([e,n])=>n.includes(t)))||void 0===e?void 0:e[0]},s=a=>{var s;const{[r]:c=[],[i]:l={}}=a,u=[...c].sort((t,e)=>o(e)-o(t)),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:a.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const h=Object.assign({},l);for(const[t,e]of f.entries())h[t]=e;if(0!==Object.keys(h).length){for(const[t,r]of Object.entries(h)){const i=pG(a,t),o=e(r,a);n(a,t,o),t in l||(l[t]=i)}a[i]=l}},c=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{c(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{c(t);const n=t[r],i=new Set(e.map(t=>a(t)).filter(t=>void 0!==t)),o=n.filter(t=>!i.has(a(t)));t[r]=[...o,...e],s(t)},removeState:(t,...e)=>{c(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(c(t),-1!==t[r].indexOf(e))}}function LG(t,e){return`${t},${e}`}function jG(t,e){const n=(Array.isArray(t)?t:[t]).flatMap(t=>t.marks.map(e=>[LG(t.key,e.key),e.state])),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=LG(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t},{})}return r}function RG(t,e){const n=new Map(t.map((t,e)=>[t,e])),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function IG(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Ie(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const o=t=>t.__data__.points,a=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=cr(t,(t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r});for(let t=1;t<r.length;t++){const s=pc(),c=r[t-1],l=r[t],[u,f,h,d]=a(o(c),o(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=fa(i,t=>n(t,c)),{fill:g=c.getAttribute("fill")}=p,v=Ie(p,["fill"]),m=new uv({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(m),c.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function DG(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(il(n)){const{points:i}=t.__data__,[o,a]=rl(n)?Bm(i):i,s=n.getCenter(),c=Ns(o,s),l=Ns(a,s),u=Rs(c)+Ds(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return rl(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function BG(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Ie(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},l=(t,n)=>{const{padding:o}=n,[a,s]=((t,e)=>{const{x:n}=r;if(!_P(n))return[0,1];const{__data__:i}=t,{x:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),[l,u]=((t,e)=>{const{y:n}=r;if(!_P(n))return[0,1];const{__data__:i}=t,{y:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),f=[[a,l],[s,l],[s,u],[a,u]].map(t=>i.map(t)),{__data__:h}=t,{y:d,y1:p}=h;return Gm(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=Ie(e,["transform","transformOrigin","stroke"]),a=Object.assign({transform:n,transformOrigin:r,stroke:i},o),s=t.cloneNode(!0);for(const[t,e]of Object.entries(a))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=fa(a,e=>o(e,t)),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Ie(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(_P)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function FG(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function zG(t){FG(t,t.cursor)}function $G(t,e,n){return t.find(t=>Object.entries(e).every(([e,r])=>n(t)[e]===r))}function WG(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function GG(t,e=!1){const n=m(t,t=>!!t).map((t,e)=>[0===e?"M":"L",...t]);return e&&n.push(["Z"]),n}function HG(t){return t.querySelectorAll(".element")}function YG(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const qG=["interval","point","density"];function VG({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=qG}){var o,a;let s=t(e);const c=t=>i.includes(t.markType);if(s.find(c)){s=s.filter(c);const t=r.x,i=r.series,l=null!==(a=null===(o=null==t?void 0:t.getBandWidth)||void 0===o?void 0:o.call(t))&&void 0!==a?a:0,u=i?t=>{var e,n;const r=Math.round(1/(null!==(e=i.valueBandWidth)&&void 0!==e?e:1));return t.__data__.x+(null!==(n=t.__data__.series)&&void 0!==n?n:0)*l+l/(2*r)}:t=>t.__data__.x+l/2;return s.sort((t,e)=>u(t)-u(e)),t=>{const r=MG(e,t);if(!r)return;const[i]=n.invert(r),o=(0,$n(u).center)(s,i);return s[o]}}return t=>{const{target:e}=t;return YG(e,t=>!!t.classList&&t.classList.includes("element"))}}function UG(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:o=!1}=t,a=Ie(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,c)=>{const{container:l,view:u,options:f}=t,{scale:h,coordinate:d}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,background:a=!1,delay:s=60,scale:c,coordinate:l,emitter:u,state:f={},region:h=!1,regionEleFilter:d=t=>qG.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],m=h?v.filter(d):v,y=new Set(m),b=h?i:r,x=rr(m,b),w=VG({elementsof:e,root:t,coordinate:l,scale:c}),k=RG(m,n),[M,O]=IG(Object.assign({elements:m,valueof:k,link:o,coordinate:l},ia(f.active,"link"))),[E,S,_]=BG(Object.assign({document:t.ownerDocument,scale:c,coordinate:l,background:a,valueof:k},ia(f.active,"background"))),A=tt(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return DG(m[n],e,l)}})}),T=CG(A,m),{updateState:P,removeState:C,hasState:N}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(h&&(r=w(t)),!y.has(r))return;L&&clearTimeout(L);const i=b(r),o=x.get(i),a=new Set(o);for(const t of m)a.has(t)?N(t,"active")||P(t,"active"):(P(t,"inactive"),O(t)),t!==r&&S(t);E(r),M(o),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:o.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout(()=>{I(),L=null},s)},I=(t=!0)=>{for(const t of m)C(t,"active","inactive"),S(t),O(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;h&&(e=w(t)),e?a&&!_(e)||(a||y.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=$G(m,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of m)S(t),O(t)}}(wG(l),Object.assign({elements:yG,datum:_G(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:d,scale:h,state:jG(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:o,delay:e,emitter:c},a))}}function XG(t){return UG(Object.assign(Object.assign({},t),{createGroup:SG}))}function KG(t){return UG(Object.assign(Object.assign({},t),{createGroup:EG}))}function ZG(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,single:a=!1,multipleSelectHotkey:s,coordinate:c,background:l=!1,scale:u,emitter:f,state:h={},region:d=!1,regionEleFilter:p=t=>qG.includes(t.markType)}){var g;const v=e(t),m=new Set(v),y=VG({elementsof:e,root:t,coordinate:c,scale:u}),b=rr(v,r),x=rr(v,i),w=RG(v,n),[k,M]=IG(Object.assign({link:o,elements:v,valueof:w,coordinate:c},ia(h.selected,"link"))),[O,E]=BG(Object.assign({document:t.ownerDocument,background:l,coordinate:c,scale:u,valueof:w},ia(h.selected,"background"))),S=tt(h,{selected:Object.assign({},(null===(g=h.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=h.selected.offset(...t),[,n]=t;return DG(v[n],e,c)}})}),_=CG(S,v),{updateState:A,removeState:T,hasState:P}=_(w);let C=!a,N=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),M(t),E(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:a=r,groupMap:s=b})=>{const c=v.filter(o);if(P(e,"selected"))L();else{const r=a(e),o=s.get(r),l=new Set(o);for(const t of c)l.has(t)?A(t,"selected"):(A(t,"unselected"),M(t)),t!==e&&E(t);if(k(o),O(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...o.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:s=r,groupMap:c=b})=>{const l=s(e),u=c.get(l),h=new Set(u),d=v.filter(a);if(P(e,"selected")){const t=v.some(t=>!h.has(t)&&P(t,"selected"));if(!t)return L();for(const t of u)A(t,"unselected"),M(t),E(t)}else{const t=u.some(t=>P(t,"selected"));for(const t of d)h.has(t)?A(t,"selected"):P(t,"selected")||A(t,"unselected");!t&&o&&k(u),O(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter(t=>P(t,"selected")).map(n)}}))},I=t=>{if(m.has(t))return t;for(const e of m){let n=null;if(hG(e,r=>{r===t&&(n=e)}),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,o=C?R:j;let a=e;const s=(t=>{if(m.has(t))return!0;for(const e of m)if(hG(e,e=>e===t))return!0;return!1})(e);return!d||s?s?o({event:t,element:I(a),nativeEvent:n,groupBy:r}):L():(a=y(t),m.has(a)?o({event:t,element:a,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!N&&(N=t.code,C=!0)},z=t=>{t.code===N&&(N=null,C=!1)};t.addEventListener("click",D),s&&(C=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const $=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=C?r.data:r.data.slice(0,1);for(const t of i){const e=$G(v,t,n);D({target:e,nativeEvent:!1})}},W=()=>{L(!1)};return f.on("element:select",$),f.on("element:unselect",W),()=>{for(const t of v)M(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",$),f.off("element:unselect",W)}}function QG(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,o=Ie(t,["createGroup","createRegionGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{coordinate:f,scale:h}=l;return ZG(wG(c),Object.assign({elements:yG,datum:_G(l),groupKey:e?e(l):void 0,regionGroupKey:n?n(l):t=>t.__data__.x,coordinate:f,scale:h,state:jG(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},o))}}function JG(t){return QG(Object.assign(Object.assign({},t),{createGroup:SG}))}function tH(t){return QG(Object.assign(Object.assign({},t),{createGroup:EG}))}function eH(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,o=Ie(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:a,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=a,d=function(t,e,n){const[r]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const{encode:e}=t;return Object.fromEntries(n.map(t=>{const n=e[t];return[t,n?n.value:void 0]}))});return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,m=p.map((t,e)=>e),y=cr(m.map(t=>g[t])),b=wG(s),x=s.getElementsByClassName(zO),w=rr(s.getElementsByClassName(HO),t=>t.__data__.key.split("-")[0]),k=new cv({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ia(o,"rule"))}),M=new mv({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ia(o,"label"))});k.append(M),b.appendChild(k);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[Vn(y,i)]},E=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let S;const _=lt(t=>{const e=MG(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=O(n,r,t);E(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[$n(t=>g[+t]).center(e,o)],s=[0,i.map(1)],c=[0,i.map(p[a]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)},e,{leading:n,trailing:r});return(t=>{Be(this,void 0,void 0,function*(){const{x:e}=f,n=O(h,e,t);E(t,n),l("chartIndex",t=>{const e=tt({},t),r=e.marks.find(t=>"line"===t.type),i=xr(or(m,t=>xr(t,t=>+p[t])/kr(t,t=>+p[t]),t=>v[t]).values());tt(r,{scale:{y:{domain:[1/i,i]}}});const o=function(t){const{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);o.groupBy="color",o.basis=(t,e)=>e[t[$n(t=>g[+t]).center(t,n)]];for(const t of e.marks)t.animate=!1;return e});const r=yield c("chartIndex");S=r.view})})([0,0]),b.addEventListener("pointerenter",_),b.addEventListener("pointermove",_),b.addEventListener("pointerleave",_),()=>{k.remove(),b.removeEventListener("pointerenter",_),b.removeEventListener("pointermove",_),b.removeEventListener("pointerleave",_)}}}function nH({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=wG(s),l=lt(t=>{const e=MG(c,t);if(!e)return a("fisheye"),void o();a("fisheye",t=>{const n=tt({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n}),o()},t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function rH(t,e){var n;if(e)return"string"==typeof e?document.querySelector(e):e;const r=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;return r.getContextService().getDomElement().parentElement}function iH(t,e,n,r,i,o,a,s={},c=[10,10]){const l=new hM({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:tt({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function oH({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=rH(t,u),p=rH(t),g=a?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:y=iH(d,n,r,s,c,v,m,l,h)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:m},void 0!==i&&{content:i(o,{items:b,title:x})})),g.tooltipElement=y}function aH({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=rH(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),gH(t),vH(t),mH(t)}function sH({root:t,single:e}){const n=rH(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),gH(t),vH(t),mH(t)}function cH(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function lH(t){const{__data__:e}=t;if(Uo(t))return function(t){var e,n,r,i,o,a,s;const{__data__:c}=t,{title:l,items:u=[]}=c;if(u.some(t=>vW in t)){const e=u.filter(na).map(e=>{var{color:n=uH(t)}=e,r=Ie(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(cH);return Object.assign(Object.assign({},l&&{title:l}),{items:e})}const f=null!==(n=null===(e=null==c?void 0:c.normalized)||void 0===e?void 0:e.x)&&void 0!==n?n:0,h=null===(r=t.parentNode)||void 0===r?void 0:r.__data__,d=null!==(i=null==h?void 0:h.encode)&&void 0!==i?i:{},{x:p={},y:g={},color:v={}}=d,{value:m=[]}=p,{value:y=[]}=g,{value:b=[]}=v,x=Math.min(Math.round(m.length*f),m.length-1);return{title:`${m[x]}, ${y[x]}`,items:[{name:null!==(o=v.field)&&void 0!==o?o:"value",value:b[x],color:(null===(a=t.style)||void 0===a?void 0:a.fill)||(null===(s=t.getAttribute)||void 0===s?void 0:s.call(t,"color"))||"#000"}]}}(t);const{title:n,items:r=[]}=e,i=r.filter(na).map(e=>{var{color:n=uH(t)}=e,r=Ie(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(cH);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}function uH(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function fH(t,e=t=>t){const n=new Map(t.map(t=>[e(t),t]));return Array.from(n.values())}function hH(t,e,n,r=t.map(t=>t.__data__),i={}){const o=t=>t instanceof Date?+t:t,a=fH(r.map(t=>t.title),o).filter(na),s=r.flatMap((r,o)=>{const a=r.element||t[o],{items:s=[],title:c}=r,l=s.filter(na),u=void 0!==n?n:s.length<=1;return l.map(t=>{var{color:n=uH(a)||i.color,name:o}=t,s=Ie(t,["color","name"]);const l=Ko(e,r),f=u&&!(vW in s)?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c,channel:o})})}).map(cH);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:fH(s,t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`)})}function dH(t,e,n,r){var{plotWidth:i,plotHeight:o,mainWidth:a,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Ie(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map(e=>js(e,t)),r=Mr(n,t=>t);return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+a/2,e=l+d+s/2;return[t,e,js([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Jg({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,a]=u?[c+v[0],c+v[0],l,l+o]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const o=new cv({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(o),o})(e,n,r,a);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=a,t.ruleX=s}}function pH(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=Ie(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map(t=>t[1]),v=e.map(t=>t[0]),m=Ar(g),y=Ar(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=Rs(Ns([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,m+c,m+c]:[y+s,y+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new cv({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function gH(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function vH(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function mH(t){t.markers&&(t.markers.forEach(t=>t.remove()),t.markers=[])}function yH(t,e){return Array.from(t.values()).some(t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]})}function bH(t,e){return void 0===t?e:t}function xH(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function wH({root:t,event:e,elements:n=[],coordinate:r,scale:i,shared:o}){var a,s;const c=n.every(t=>"interval"===t.markType)&&!il(r),l=i.x,u=function(t){const{x:e}=t;if(!e||!e.valueBandWidth)return!0;const{valueBandWidth:n}=e;return!!I(n)||1===new Set(n.values()).size}(i),f=i.series,h=null!==(s=null===(a=null==l?void 0:l.getBandWidth)||void 0===a?void 0:a.call(l))&&void 0!==s?s:0,d=f&&f.valueBandWidth?t=>{const e=Math.round(1/f.valueBandWidth);return t.__data__.x+t.__data__.series*h+h/(2*e)}:t=>t.__data__.x+h/2;c&&n.sort((t,e)=>d(t)-d(e));const p=t=>{const{target:e=j(n)}=t;return YG(e,e=>!!e.classList&&(Uo(e)&&at(e,"__data__.normalized",function(t,e){const{innerWidth:n,innerHeight:r,marginLeft:i,paddingLeft:o,insetLeft:a,marginTop:s,paddingTop:c,insetTop:l}=t.getOptions();return{x:(e.x-i-o-a)/n,y:(e.y-s-c-l)/r}}(r,{x:t.offsetX,y:t.offsetY})),e.classList.includes("element")))},g=c?e=>{const i=MG(t,e);if(!i)return;const[a]=r.invert(i),s=$n(d).center,c=u?s(n,a):function(t,e){const{adjustedRange:n,valueBandWidth:r,valueStep:i}=t,o=Array.from(r.values()),a=Array.from(i.values()),s=n.map((t,e)=>{const n=(a[e]-o[e])/2;return[t-n,t+o[e]+n]}),c=s.findIndex(([t,n])=>t<=e&&e<=n);return-1!==c?c:e>.5?n.length-1:0}(l,a),f=n[c];if(!o){const t=n.find(t=>t!==f&&d(t)===d(f));if(t)return p(e)||t}return f}:p;return g(e)}function kH({root:t,event:e,elements:n,coordinate:r,scale:i,startX:o,startY:a}){const s=rl(r),c=[],l=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?c.push(t):(r||i)&&l.push(t)}const u=l.length&&l.every(t=>"interval"===t.markType)&&!il(r),f=t=>t.__data__.x,h=!!i.x.getBandWidth&&l.length>0;c.sort((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)});const d=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return cr([n[e],r[e]])};u?n.sort((t,e)=>f(t)-f(e)):l.sort((t,e)=>{const[n,r]=d(t),[i,o]=d(e),a=(n+r)/2,c=(i+o)/2;return s?c-a:a-c});const p=new Map(c.map(t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map((t,e)=>e),i=cr(r,t=>n[+t]);return[t,[i,n]]})),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,m=t=>{const[e]=r.invert(t);return e-v},y=(t,e,n,r)=>{const{_x:i}=t,o=void 0!==i?g.map(i):m(e),a=r.filter(na),[s,c]=cr([a[0],a[a.length-1]]);if(!h&&(o<s||o>c)&&!(s===c))return null;const l=$n(t=>r[+t]).center;return n[l(n,o)]},b=u?(t,e)=>{const n=e[(0,$n(f).center)(e,m(t))];return rr(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter(t=>{const[e,r]=d(t);return n>=e&&n<=r});if(!h||r.length>0)return r;const i=$n(t=>{const[e,n]=d(t);return(e+n)/2}).center;return[e[i(e,n)]].filter(na)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,n])=>{const r=n[e];return[W(t.replace("series","")),r]}))},w=MG(t,e);if(!w)return;const k=[w[0]-o,w[1]-a];if(!k)return;const M=b(k,l),O=[],E=[];for(const t of c){const[n,i]=p.get(t),o=y(e,k,n,i);if(null!==o){O.push(t);const e=x(t,o),{x:n,y:i}=e,a=r.map([(n||0)+v,i||0]);E.push([Object.assign(Object.assign({},e),{element:t}),a])}}const S=Array.from(new Set(E.map(t=>t[0].x))),_=S[Mr(S,t=>Math.abs(t-m(k)))],A=E.filter(t=>t[0].x===_),T=[...A.map(t=>t[0]),...M.map(t=>t.__data__)];return{selectedElements:[...O,...M],selectedData:T,filteredSeriesData:A,abstractX:m}}function MH(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:M,theme:O,offset:E,disableNative:S=!1,marker:_=!0,preserve:A=!1,style:T={},css:P={}}=e,C=Ie(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const N=n(t),L=tt(T,C),j=il(a),R=rl(a),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:$}=a.getOptions(),W=lt(e=>{var n;const d=MG(t,e);if(!d)return;const p=kG(t),g=p.min[0],S=p.min[1],{selectedElements:A,selectedData:T,filteredSeriesData:C,abstractX:W}=kH({root:t,event:e,elements:N,coordinate:a,scale:o,startX:v,startY:m}),H=hH(A,o,f,T,O);if(r&&H.items.sort((t,e)=>r(t)-r(e)),i&&(H.items=H.items.filter(i)),0===A.length||xH(H))return void G(e);if(y&&oH({root:t,data:H,x:d[0]+g,y:d[1]+S,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:M,css:P,offset:E}),s||c||l){const e=ia(L,"crosshairs"),n=Object.assign(Object.assign({},e),ia(L,"crosshairsX")),r=Object.assign(Object.assign({},e),ia(L,"crosshairsY")),i=C.map(t=>t[1]);c&&dH(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:m,transposed:R,polar:j})),l&&pH(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:m,transposed:R,polar:j}))}if(_){const e=ia(L,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach(t=>t.remove());const{type:i=""}=n,o=e.filter(t=>{const[{x:e,y:n}]=t;return na(e)&&na(n)}).map(t=>{const[{color:e,element:o},a]=t,s=e||o.style.fill||o.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Jg({className:"g2-tooltip-marker",style:Object.assign({cx:a[0],cy:a[1],fill:c,r:4,stroke:l,lineWidth:2,pointerEvents:"none"},n)})});for(const e of o)t.appendChild(e);t.markers=o}(t,{data:C,style:e,theme:O})}const Y=null===(n=C[0])||void 0===n?void 0:n[0].x,q=null!=Y?Y:W(focus);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},H),{data:{x:AP(o.x,q,!0)}})}))},d,{leading:p,trailing:g}),G=e=>{aH({root:t,single:b,emitter:h,event:e})},H=()=>{sH({root:t,single:b})},Y=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Ie(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=o.x.map(u),[h,d]=a.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];W(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},q=()=>{aH({root:t,single:b,emitter:h,nativeEvent:!1})},V=()=>{Z(),H()},U=e=>{MG(t,e)||G(e)},X=()=>{K()},K=()=>{S||(t.addEventListener("pointerdown",W),t.addEventListener("pointerenter",W),t.addEventListener("pointermove",W),t.addEventListener("pointerleave",U),t.addEventListener("pointerup",G))},Z=()=>{S||(t.removeEventListener("pointerdown",W),t.removeEventListener("pointerenter",W),t.removeEventListener("pointermove",W),t.removeEventListener("pointerleave",U),t.removeEventListener("pointerup",G))};return K(),h.on("tooltip:show",Y),h.on("tooltip:hide",q),h.on("tooltip:disable",V),h.on("tooltip:enable",X),()=>{Z(),h.off("tooltip:show",Y),h.off("tooltip:hide",q),h.off("tooltip:disable",V),h.off("tooltip:enable",X),A?aH({root:t,single:b,emitter:h,nativeEvent:!1}):H()}}function OH(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:o,name:a,item:s=()=>({}),facet:c=!1}=t,l=Ie(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,a,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,m=yH(p,"seriesTooltip"),y=yH(p,"crosshairs"),b=wG(f),x=bH(o,m),w=bH(n,y);if(x&&function(t){return Array.from(t.values()).some(t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip})}(p)&&!c)return MH(b,Object.assign(Object.assign({},l),{theme:v,elements:yG,scale:d,coordinate:g,crosshairs:w,crosshairsX:bH(bH(r,n),!1),crosshairsY:bH(i,w),item:s,emitter:u}));if(x&&c){const e=a.filter(e=>e!==t&&e.options.parentKey===t.options.key),o=bG(t,a),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),MH(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>o,scale:c,coordinate:g,crosshairs:bH(n,y),crosshairsX:bH(bH(r,n),!1),crosshairsY:bH(i,w),item:s,startX:h,startY:d,emitter:u}))}return function(t,{elements:e,coordinate:n,scale:r,render:i,groupName:o,sort:a,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:w,shared:k=!1,body:M=!0,disableNative:O=!1,preserve:E=!1,css:S={}}){const _=e(t),A=rr(_,h),T=lt(e=>{const l=wH({root:t,event:e,elements:_,coordinate:n,scale:r,shared:k});if(!l)return void aH({root:t,single:d,emitter:c,event:e});const u=h(l),f=A.get(u);if(!f)return;const v=1!==f.length||k?hH(f,r,o,void 0,x):lH(f[0]);if(a&&v.items.sort((t,e)=>a(t)-a(e)),s&&(v.items=v.items.filter(s)),xH(v))return void aH({root:t,single:d,emitter:c,event:e});const{offsetX:O,offsetY:E}=e;M&&oH({root:t,data:v,x:O,y:E,render:i,event:e,single:d,position:p,enterable:g,mount:y,bounding:b,css:S,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Xo(l,m)})}))},l,{leading:u,trailing:f}),P=e=>{aH({root:t,single:d,emitter:c,event:e})},C=()=>{O||(t.addEventListener("pointerdown",T),t.addEventListener("pointermove",T),t.addEventListener("pointerleave",P),t.addEventListener("pointerup",P))},N=()=>{O||(t.removeEventListener("pointerdown",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerleave",P),t.removeEventListener("pointerup",P))},L=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:o}=i,a=$G(_,o,v);if(!a)return;const s=a.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();T({target:a,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},j=({nativeEvent:e}={})=>{e||aH({root:t,single:d,emitter:c,nativeEvent:!1})},R=()=>{N(),sH({root:t,single:d})},I=()=>{C()};return c.on("tooltip:show",L),c.on("tooltip:hide",j),c.on("tooltip:enable",I),c.on("tooltip:disable",R),C(),()=>{N(),c.off("tooltip:show",L),c.off("tooltip:hide",j),c.off("tooltip:enable",I),c.off("tooltip:disable",R),E?aH({root:t,single:d,emitter:c,nativeEvent:!1}):sH({root:t,single:d})}}(b,Object.assign(Object.assign({},l),{datum:_G(h),elements:yG,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}UG.props={reapplyWhenUpdate:!0},XG.props={reapplyWhenUpdate:!0},KG.props={reapplyWhenUpdate:!0},QG.props={reapplyWhenUpdate:!0},JG.props={reapplyWhenUpdate:!0},tH.props={reapplyWhenUpdate:!0},eH.props={reapplyWhenUpdate:!0},OH.props={reapplyWhenUpdate:!0};const EH="legend-category";function SH(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function _H(t){return t.getElementsByClassName("legend-category-item-label")[0]}function AH(t){return t.getElementsByClassName("legend-category-item-focus-group")[0]}function TH(t){return t.getElementsByClassName("items-item")}function PH(t){return t.getElementsByClassName(EH)}function CH(t){return t.getElementsByClassName("legend-continuous")}function NH(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function LH(t,e){return Be(this,arguments,void 0,function*(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){const{view:c,update:l,setState:u}=t;u(e,t=>{const{marks:e}=t,l=e.map(t=>{if("legends"===t.type)return t;const{transform:e=[],data:l=[]}=t,u=e.findIndex(({type:t})=>t.startsWith("group")||t.startsWith("bin")),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(o.map(t=>[t,{domain:c.scale[t].getOptions().domain}]));return tt({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map(t=>[t,{preserve:!0}]))}))});return Object.assign(Object.assign({},t),{marks:l})}),yield l()})}function jH(t,e){for(const n of t)LH(n,Object.assign(Object.assign({},e),{facet:!0}))}function RH(){return(t,e,n)=>{const{container:r}=t,i=e.filter(e=>e!==t),o=i.length>0,a=t=>NH(t).scales.map(t=>t.name),s=[...PH(r),...CH(r)],c=s.flatMap(a),l=lt(o?jH:LH,50,{trailing:!0}),u=s.map(e=>{const{name:s,domain:u}=NH(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===EH?function(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,h=new Map,{unselected:d={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,p={unselected:ia(d,"marker")},g={unselected:ia(d,"label")},{setState:v,removeState:m}=NG(p,void 0),{setState:y,removeState:b}=NG(g,void 0),x=Array.from(e(t));let w=x.map(i);const k=()=>{for(const t of x){const e=i(t),o=n(t),a=r(t);w.includes(e)?(m(o,"unselected"),b(a,"unselected")):(v(o,"unselected"),y(a,"unselected"))}};for(const e of x){const n=()=>{FG(t,"pointer")},r=()=>{zG(t)},c=t=>Be(this,void 0,void 0,function*(){const n=i(e),r=w.indexOf(n);-1===r?w.push(n):w.splice(r,1),yield o(w),k();const{nativeEvent:c=!0}=t;c&&(w.length===x.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:w}})))});e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r);const d=AH(e);if(d){const t=t=>Be(this,void 0,void 0,function*(){t.stopPropagation();const n=i(e),r=w.indexOf(n),{nativeEvent:c=!0}=t;if(-1!==r&&1===w.length){if(!c)return;w=x.map(i),yield o(w),k(),a.emit("legend:reset",{nativeEvent:c})}else{if(w=[n],yield o(w),k(),!c)return;a.emit("legend:focus",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,value:n}}))}});d.addEventListener("click",t),h.set(e,t)}}const M=t=>Be(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,value:i}=n;r===s&&(w=[i],yield o(w),k())}),O=t=>Be(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(w=i,yield o(w),k())}),E=t=>Be(this,void 0,void 0,function*(){const{nativeEvent:e}=t;e||(w=x.map(i),yield o(w),k())});return a.on("legend:filter",O),a.on("legend:focus",M),a.on("legend:reset",E),()=>{for(const t of x){t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t));const e=AH(t);e&&e.removeEventListener("click",h.get(t)),a.on("legend:focus",M),a.off("legend:filter",O),a.off("legend:reset",E)}}}(r,{legends:TH,marker:SH,label:_H,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})});return()=>{u.forEach(t=>t())}}}function IH(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=PH(r),s=yG(r),c=t=>NH(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=jG(o,["active","inactive"]),f=RG(s,_G(i)),h=[];for(const t of a){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=TH(t),o=l(r),a=rr(s,t=>o.invert(t.__data__[r])),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=NG(u,f),m={inactive:ia(p,"marker")},y={inactive:ia(p,"label")},{setState:b,removeState:x}=NG(m),{setState:w,removeState:k}=NG(y),M=t=>{for(const e of i){const n=SH(e),r=_H(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},O=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},E=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),E.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},_=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find(t=>e(t)===s);c&&O({nativeEvent:!1},c)},A=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",_),n.on("legend:unhighlight",A);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",_),n.off("legend:unhighlight",A);for(const[t,e]of E)t.removeEventListener(e)};h.push(T)}return()=>h.forEach(t=>t())}}function DH(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function BH(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function FH(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const zH=Zm(t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Ie(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=ia(aa(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Ie(d,["render"]),v=ia(u,"handleE"),{render:m=h}=v,y=Ie(v,["render"]),b=ia(aa(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=Ie(b,["render"]),k=ia(u,"handleW"),{render:M=h}=k,O=Ie(k,["render"]),E=ia(u,"handleNW"),{render:S=h}=E,_=Ie(E,["render"]),A=ia(u,"handleNE"),{render:T=h}=A,P=Ie(A,["render"]),C=ia(u,"handleSE"),{render:N=h}=C,L=Ie(C,["render"]),j=ia(u,"handleSW"),{render:R=h}=j,I=Ie(j,["render"]),D=t=>()=>{const e=Zm(e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t));return new e({})},B=Cm(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(FH,Object.assign(Object.assign({width:i,height:o},aa(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(FH,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(FH,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(FH,w),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(FH,O),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(FH,_),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(FH,P),B.maybeAppend("handle-se",D(N)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(FH,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(FH,I)});function $H(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:o=()=>{},brushupdated:a=()=>{},extent:s=BH(t),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Ie(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[w,k,M,O]=s;FG(t,"crosshair"),t.style.draggable=!0;const E=(t,e,n)=>{if(o(n),y&&y.remove(),b&&b.remove(),g=[t,e],l)return S();_()},S=()=>{b=new uv({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),y=new zH({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},_=()=>{y=new zH({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(y)},A=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${M},${k}L${M},${O}L${w},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=OG(t,e);if(!y||!L(n))return E(r,i,e),void(x=!0);L(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=OG(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],w,M),o=e(r,g[1],v[1],k,O),a=[g[0]+i,g[1]+o],s=[v[0]+i,v[1]+o];T(a,s)})(r);const[i,o]=[r[0]-m[0],r[1]-m[1]],{id:a}=n;if(N[a]){const[t,e,n,r]=N[a].vector;return T([g[0]+i*t,g[1]+o*e],[v[0]+i*n,v[1]+o*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void a(t,n,t+r,n+i,e)}v=OG(t,e);const[n,r,o,s]=T(g,v);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;y&&!L(e)&&A()},z=e=>{const{target:n}=e;y&&L(n)&&!x?R(n)?FG(t,"move"):j(n)&&FG(t,N[n.id].cursor):FG(t,"crosshair")},$=()=>{FG(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",$),{mask:y,move(t,e,n,r,i=!0){y||E(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&A(t)},destroy(){y&&A(!1),FG(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",$)}}}function WH(t,e,n){return e.filter(e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find(t=>t.brushKey===n)})}function GH(t,e,n){return WH(t,e,n).map(t=>t.options)}function HH(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:o,brushRegion:a,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=t=>t,bboxOf:d=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=Ie(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=RG(m,o),w=ia(v,"mask"),{setState:k,removeState:M}=NG(p,x),O=new Map,{width:E,height:S,x:_=0,y:A=0}=d(t),T=s||[0,0,E,S],P=()=>{for(const t of[...m,...b])M(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of m){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;DH([c,l,u,f],[t,e,n,r])?(k(i,"active"),o.add(h(i))):k(i,"inactive")}for(const t of b)o.has(h(t))?k(t,"active"):k(t,"inactive")},N=()=>{for(const t of m)M(t,"inactive");for(const t of O.values())t.remove();O.clear()},L=(e,n,r,i)=>{const o=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e},a=new gv({style:{x:e+_,y:n+A,width:r-e,height:i-n}});t.appendChild(a);for(const t of m){const e=O.get(t)||o(t);e.style.clipPath=a,k(t,"inactive"),k(e,"active")}},j=$H(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=PP(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=PP(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushupdated:(t,e,n,r,i)=>{const o=PP(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const{x:r,y:i}=e,[o,a]=t,s=CP(o,r),c=CP(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function YH(t){var{facet:e,brushKey:n}=t,r=Ie(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=wG(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return HH(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>bG(t,i),datum:_G(xG(t,i).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:jG(xG(t,i).map(t=>t.options),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=HH(l,Object.assign(Object.assign({elements:yG,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return WH(t,e,n).map(t=>wG(t.container))}(t,i,n),datum:_G([s,...WH(t,i,n).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:jG([c,...GH(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function qH(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function VH(t){return YH(Object.assign(Object.assign({},t),{brushRegion:qH,selectedHandles:["handle-e","handle-w"]}))}function UH(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function XH(t){return YH(Object.assign(Object.assign({},t),{brushRegion:UH,selectedHandles:["handle-n","handle-s"]}))}const KH="axis-hot-area";function ZH(t){return t.getElementsByClassName("axis")}function QH(t){return t.getElementsByClassName("axis-line")[0]}function JH(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function tY(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Ie(e,["cross","offsetX","offsetY"]);const a=JH(t),s=QH(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:UH,hotZone:new gv({className:KH,style:Object.assign({width:n?d/2:d,transform:`translate(${(n?l:c-d/2).toFixed(2)}, ${u})`,height:h-u},o)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function eY(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Ie(e,["offsetY","offsetX","cross"]);const a=JH(t),s=QH(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:qH,hotZone:new gv({className:KH,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},o)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function nY(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=wG(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=o;return function(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=Ie(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=RG(p,a),{setState:m,removeState:y}=NG(u,v),b=new Map,x=ia(d,"mask"),w=t=>Array.from(b.values()).every(([e,n,r,i])=>t.some(([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)),k=g.map(t=>t.attributes.scale),M=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,E=()=>{O.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();O.set(t,M(n))}};E();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}O.set(t,A(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},_=t=>{for(const t of p)y(t,"active","inactive");E(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},A=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return M(TP(n,i))},T=g.some(o)&&g.some(t=>!o(t)),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?eY:tY,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=$H(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?_(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach(t=>t.remove(!1))},N=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=k[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach(t=>t.destroy()),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:yG,axes:ZH,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:_G(o),state:jG(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function rY(t){var{hideX:e=!0,hideY:n=!0}=t,r=Ie(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=wG(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=ia(Ie(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=$H(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){t===r&&e===i||(o.nativeEvent=!0,n(u(t,e,r,i),o),m.remove())}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return PP(t,e,n,r,i,o)},filter:(t,r)=>Be(this,void 0,void 0,function*(){if(d)return;d=!0;const[i,a]=t;u("brushFilter",t=>{const{marks:r}=t,o=r.map(t=>tt({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:a,nice:!1}}}));return Object.assign(Object.assign({},c),{marks:o,clip:!0})}),o.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,a]}}));const s=yield l();p=s.view,d=!1,h=!0}),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,a=r.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,a]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:o,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function iY(t){return rY(Object.assign(Object.assign({hideX:!0},t),{brushRegion:qH}))}function oY(t){return rY(Object.assign(Object.assign({hideY:!0},t),{brushRegion:UH}))}function aY(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map(t=>{var a,s;return tt({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(a=t[n])||void 0===a?void 0:a[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function sY(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return TP(e,[AP(e,o(r),!0),AP(e,o(i),!1)])}function cY(t){return[t[0],t[t.length-1]]}function lY({initDomain:t={},className:e="slider",prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1,getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(l,u,f)=>{const{container:h,view:d,update:p,setState:g}=l,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let m=!1;const{scale:y,coordinate:b,layout:x}=d,{x:w,y:k}=y,M=rl(b),O=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return M?[n,e]:[e,n]},E=new Map,S=new Set,_={x:t.x||w.getOptions().domain,y:t.y||k.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=O(e),h=`${n}${G(l)}:filter`,d="x"===l,{ratio:v}=w.getOptions(),{ratio:b}=k.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=cY(_.x),r=cY(_.y)]=e;return d?[TP(w,n,v),TP(k,r,b)]:[TP(k,r,b),TP(w,n,v)]}const{value:n}=t.detail;return[sY(n,y[l],M&&"horizontal"===e),_[u]]},A=lt(e=>Be(this,void 0,void 0,function*(){const{initValue:r=!1}=e;if(m&&!r)return;m=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(_[l]=a,_[u]=s,o){const t=d?a:s,n=d?s:a;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[cY(t),cY(n)]}}))}g(t,t=>Object.assign({},aY(t,{[l]:{domain:a,nice:!1}},n,i,l,u))),yield p(),m=!1}),o,{leading:a,trailing:s}),T=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new Jp("valuechange",{data:i,nativeEvent:!1}));const c=d?CP(a,w):CP(s,k);r(t,c)};f.on(h,T),t.addEventListener("valuechange",A),E.set(t,A),S.add([h,T]);const P=c(t);P&&t.dispatchEvent(new Jp("valuechange",{detail:{value:P},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of E)t.removeEventListener("valuechange",e);for(const[t,e]of S)f.off(t,e)}}}const uY="g2-scrollbar";function fY(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(uY).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return lY(Object.assign({initDomain:l,className:uY,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0]||1!==e[1])return e}},t))(e,n,r)}}function hY(t,e,n){return`<${t} style="${Object.entries(n).map(([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`).join(";")}">${e}</${t}>`}const dY={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function pY(t){return"text"===t.nodeName&&!!t.isOverflowing()}function gY(t){var{offsetX:e=8,offsetY:n=8}=t,r=Ie(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=ia(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!pY(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,h=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new ov({className:"poptip",style:{innerHTML:hY("div",d,Object.assign(Object.assign({},dY),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;pY(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach(t=>t.remove())}}}gY.props={reapplyWhenUpdate:!0};const vY={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function mY(t={}){const{originData:e=[],layout:n}=t,r=Ie(t,["originData","layout"]),i=tt({},vY,r),o=ia(i,"breadCrumb"),a=ia(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return Cm(t).select(`.${WO}`).node()}(s),u=c.marks[0],{state:f}=u,h=new rv;l.appendChild(h);const d=(t,c)=>Be(this,void 0,void 0,function*(){if(h.removeChildren(),c){let e="",n=o.y,r=0;const i=[],s=l.getBBox().width,c=t.map((a,c)=>{e=`${e}${a}/`,i.push(a);const l=new mv({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:a,x:r,path:[...i],depth:c},o),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new mv({style:Object.assign(Object.assign({x:r,text:" / "},o),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.getBBox().height+o.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===ht(t)-1&&u.remove(),l});c.forEach((t,e)=>{if(e===ht(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",()=>{t.attr(a)}),t.addEventListener("mouseleave",()=>{t.attr(n)}),t.addEventListener("click",()=>{d(ot(t,["style","path"]),ot(t,["style","depth"]))})})}!function(t,e){[...PH(t),...CH(t)].forEach(t=>{e(t,t=>t)})}(s,i),i("treemapDrillDown",r=>{const{marks:i}=r,o=t.join("/"),a=i.map(t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter(t=>{const e=ot(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))}).map(t=>({value:0===t.height?ot(t,["value"]):void 0,name:ot(t,["id"])})),{paddingLeft:i,paddingBottom:a,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:a/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=S_(t,l,{value:"value"})[0]}else r=e.filter(t=>1===t.depth);const i=[];return r.forEach(({path:t})=>{i.push(j(t))}),tt({},t,{data:r,scale:{color:{domain:i}}})});return Object.assign(Object.assign({},r),{marks:a})}),yield r(void 0,["legendFilter"])}),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:o}=n||{};if("rect"!==r&&i!==pu.TEXT)return;const a=i===pu.TEXT&&!0===ot(o,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>ot(t,["__data__","key"]))(n),s=A(e,t=>t.id===a);ot(s,"height")&&d(ot(s,"path"),ot(s,"depth"))};l.addEventListener("click",p);const g=M(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{HG(l).forEach(t=>{const n=ot(t,["style","cursor"]),r=A(e,e=>e.id===ot(t,["__data__","key"]));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=function(t,e){if(null===t||!_(t))return{};var n={};return k(e,function(e){st.call(t,e)&&(n[e]=t[e])}),n}(t.attributes,g);t.addEventListener("mouseenter",()=>{t.attr(f.active)}),t.addEventListener("mouseleave",()=>{t.attr(tt(e,f.inactive))})}})};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const yY={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},bY="movePoint",xY=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},wY=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},kY=(t,e,n)=>{t.forEach((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)})},MY=(t,e,n,r)=>{const i=new uv({style:n}),o=new mv({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},OY=(t,e)=>{if(!ot(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},EY=(t,e,n)=>{const r=WG(t,e),i=WG(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function SY(t={}){const{selection:e=[],precision:n=2}=t,r=Ie(t,["selection","precision"]),i=Object.assign(Object.assign({},yY),r||{}),o=ia(i,"path"),a=ia(i,"label"),s=ia(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=wG(u);let g,v=HG(p),m=e;const{transform:y=[],type:b}=d,x=!!A(y,({type:t})=>"transpose"===t),w="polar"===b,k="theta"===b,M=!!A(v,({markType:t})=>"area"===t);M&&(v=v.filter(({markType:t})=>"area"===t));const O=new rv({style:{zIndex:2}});p.appendChild(O);const E=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],E(),T(e)},_=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=ot(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:_,y1:P}=d;if(x&&"interval"!==r)return;const{scale:C,coordinate:N}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=C,I=N.getCenter();let D;O.removeChildren();const B=(t,e,n,r)=>Be(this,void 0,void 0,function*(){return l("elementPointMove",o=>{var a;const s=((null===(a=null==g?void 0:g.options)||void 0===a?void 0:a.marks)||h).map(o=>{if(!r.includes(o.type))return o;const{data:a,encode:s}=o,c=Object.keys(s).reduce((r,i)=>{const o=s[i];return"x"===i&&(r[o]=t),"y"===i&&(r[o]=e),"color"===i&&(r[o]=n),r},{}),l=((t,e,n)=>e.map(e=>{const r=["x","color"].reduce((r,i)=>{const o=n[i];return o?e[o]===t[o]&&r:r},!0);return r?Object.assign(Object.assign({},e),t):e}))(c,a,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),tt({},o,{data:l,animate:!1})});return Object.assign(Object.assign({},o),{marks:s})}),yield c("elementPointMove")});if(["line","area"].includes(r))v.forEach((e,r)=>{const i=R.invert(_[r]);if(!i)return;const c=new Jg({name:bY,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=ot(t,["__data__","seriesItems",e,"0","value"]),r=ot(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=A(a,({type:t})=>"normalizeY"===t),c=ot(o,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",f=>{const h=N.output([_[r],0]),d=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,E()),kY(O.childNodes,m,s);const[p,x]=MY(O,c,o,a),k=t=>{const i=e[1]+t.clientY-D[1];if(M)if(w){const o=e[0]+t.clientX-D[0],[a,s]=EY(I,h,[o,i]),[,u]=N.output([1,j.output(0)]),[,f]=N.invert([a,u-(v[r+d][1]-s)]),g=(r+1)%d,m=GG([v[(r-1+d)%d],[a,s],y[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",m),c.attr("cx",a),c.attr("cy",s)}else{const[,t]=N.output([1,j.output(0)]),[,o]=N.invert([e[0],t-(v[r+d][1]-i)]),a=GG([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",l(j.invert(o)).toFixed(n)),p.attr("d",a),c.attr("cy",i)}else{const[,t]=N.invert([e[0],i]),o=GG([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",o),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const S=()=>Be(this,void 0,void 0,function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",S),q(x.attr("text")))return;const e=Number(x.attr("text")),n=OY(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)});u.addEventListener("mouseup",S)}),O.appendChild(c)}),kY(O.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=ot(t,["__data__","y"]),n=ot(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=A(o,({type:t})=>"normalizeY"===t),c=ot(i,["y","field"]),l=r[a.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new Jg({name:bY,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",s=>{u.attr("cursor","move");const l=OY(L,b),[f,h]=MY(O,c,o,a),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[o]=N.output([j.output(0),j.output(0)]),[,a]=N.invert([o+(r-v[2][0]),e[1]]),s=GG([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],o=e[0]+t.clientX-D[0],[a,s]=EY(I,[o,r],e),[l,u]=EY(I,[o,r],v[1]),d=N.invert([a,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=WG(t,e[1]),o=WG(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]),r}(I,[[a,s],[l,u],v[2],v[3]],p>.5?1:0);h.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),c.attr("cx",a),c.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,o]=N.output([1,j.output(0)]),[,a]=N.invert([e[0],o-(v[2][1]-r)]),s=GG([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Be(this,void 0,void 0,function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),q(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(S,e,l,[r]),h.remove(),f.remove(),T(t)});u.addEventListener("mouseup",p)}),O.appendChild(c)}};v.forEach((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",xY),t.addEventListener("mouseleave",wY)});const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===bY||v.includes(e))||(m=[],E(),O.removeChildren())};return i.on("element-point:select",_),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{O.remove(),i.off("element-point:select",_),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach(t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",xY),t.removeEventListener("mouseleave",wY)})}}}var _Y={},AY={};function TY(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function PY(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var r in t)r in e||n.push(e[r]=r)}),n}function CY(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function NY(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+CY(-t,6):t>9999?"+"+CY(t,6):CY(t,4)}(t.getUTCFullYear())+"-"+CY(t.getUTCMonth()+1,2)+"-"+CY(t.getUTCDate(),2)+(i?"T"+CY(e,2)+":"+CY(n,2)+":"+CY(r,2)+"."+CY(i,3)+"Z":r?"T"+CY(e,2)+":"+CY(n,2)+":"+CY(r,2)+"Z":n||e?"T"+CY(e,2)+":"+CY(n,2)+"Z":"")}function LY(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return AY;if(l)return l=!1,_Y;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=u())!==AY;){for(var f=[];r!==_Y&&r!==AY;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map(function(e){return n.map(function(t){return a(e[t])}).join(t)})}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?NY(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=TY(t);return function(r,i){return e(n(r),i,t)}}(t,e):TY(t)});return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=PY(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=PY(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function jY(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;RY&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const RY=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),IY=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Be(void 0,void 0,void 0,function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return LY(r).parse(e,i?jY:Zo)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)})};IY.props={};const DY=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap(t=>e.map(e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))):t;var i}};function BY(t){return null!=t&&!Number.isNaN(t)}DY.props={};const FY=t=>{const{callback:e=BY}=t;return t=>t.filter(e)};FY.props={};const zY=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};zY.props={};const $Y=t=>{const{fields:e}=t;return t=>t.map(t=>function(t,e=[]){return e.reduce((e,n)=>(n in t&&(e[n]=t[n]),e),{})}(t,e))};$Y.props={};const WY=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map(e=>Object.entries(e).reduce((e,[n,r])=>(e[t[n]||n]=r,e),{}))};WY.props={};const GY=t=>{const{fields:e=[]}=t,n=(r=!0,e.map(t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]}));var r;return t=>[...t].sort((t,e)=>n.reduce((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r]),0))};GY.props={};const HY=t=>{const{value:e}=t;return()=>e};HY.props={};const YY=t=>{const{callback:e=Zo}=t;return t=>e(t)};YY.props={};const qY=t=>{const{callback:e=Zo}=t;return t=>Array.isArray(t)?t.map(e):t};qY.props={};const VY=Math.PI/180,UY=2048;function XY(t){return t.text}function KY(){return"serif"}function ZY(){return"normal"}function QY(t){return t.value}function JY(){return 90*~~(2*Math.random())}function tq(){return 1}function eq(){}function nq(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,UY/o);let a=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font;let t=i.measureText(e.text+"m").width*o,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*VY),r=Math.cos(e.rotate*VY),i=t*r,o=t*n,a=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(o+a),Math.abs(o-a))}else t=t+31>>5<<5;if(l>c&&(c=l),a+t>=2048&&(a=0,s+=c,c=0),s+l>=UY)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*VY),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=a,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const u=i.getImageData(0,0,2048/o,UY/o).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let o=e.y1-e.y0;for(let t=0;t<o*i;t++)f[t]=0;if(a=e.xoff,null==a)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<o;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(a+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,o--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function rq(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,o=t.x-(i<<4),a=127&o,s=32-a,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(o>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>a:0))&e[u+n])return!0;u+=n}return!1}function iq(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function oq(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function aq(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function sq(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function cq(){return document.createElement("canvas")}function lq(t){return"function"==typeof t?t:function(){return t}}const uq={archimedean:aq,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function fq(){let t=[256,256],e=XY,n=KY,r=QY,i=ZY,o=JY,a=tq,s=aq,c=Math.random,l=eq,u=[],f=null,h=1/0,d=cq;const p=ZY,g={};function v(e,n,r){const i=n.x,o=n.y,a=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,h,d,p=-u;for(;(f=l(p+=u))&&(h=~~f[0],d=~~f[1],!(Math.min(Math.abs(h),Math.abs(d))>=a));)if(n.x=i+h,n.y=o+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!rq(n,e,t[0]))&&(!r||oq(n,r))){const r=n.sprite,i=n.width>>5,o=t[0]>>5,a=n.x-(i<<4),s=127&a,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*o+(a>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=o}return delete n.sprite,!0}return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=UY/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:sq((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map(function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=o.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=a.call(this,t,s,c),t}).sort(function(t,e){return e.size-t.size});let M=-1,O=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function E(){const e=Date.now();for(;Date.now()-e<h&&++M<x;){const e=k[M];e.x=s*(c()+.5)>>1,e.y=m*(c()+.5)>>1,nq(y,e,k,M),e.hasText&&v(b,e,O)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),O?g.hasImage||iq(O,e):O=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=O,M>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:w,bounds:O}))}return f&&clearInterval(f),f=setInterval(E,0),E(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const o=r>>5,a=sq((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=o*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;a[n]|=s}g.board=a,g.hasImage=!0},g.timeInterval=function(t){h=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=lq(t)},g.font=function(t){n=lq(t)},g.fontWeight=function(t){i=lq(t)},g.rotate=function(t){o=lq(t)},g.canvas=function(t){d=lq(t)},g.spiral=function(t){s=uq[t]||t},g.fontSize=function(t){r=lq(t)},g.padding=function(t){a=lq(t)},g.random=function(t){c=lq(t)},g.on=function(t){l=lq(t)},g}const hq={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function dq(t){return new Promise((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}})}const pq=(t,e)=>n=>Be(void 0,void 0,void 0,function*(){const r=Object.assign({},hq,t,{canvas:e.createCanvas}),i=fq();var o,a;yield(o=i,a=r,{set(t,e,n){if(void 0===a[t])return this;const r=e?e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this},setAsync(t,e,n){return Be(this,void 0,void 0,function*(){if(void 0===a[t])return this;const r=e?yield e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this})}}).set("fontSize",t=>{const e=n.map(t=>t.value);return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[kr(e),xr(e)])}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",dq,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map(t=>{var{x:e,y:n,font:r}=t,i=Ie(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})}),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:m,y:d?l:y})),p});function gq(t){return"string"==typeof t?e=>e[t]:t}pq.props={};const vq=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=gq(s),l=gq(a),u=or(e,([t])=>t,t=>c(t));return t=>t.map(t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce((t,n,r)=>(t[i[r]]=e?e[n]:o,t),{}))})};vq.props={};const mq=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};mq.props={};var yq={exports:{}},bq={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(bq),function(t){var e=Math.log(2),n=t.exports,r=bq.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<o;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,a),p=d[a],g=d[a-1]-d[a-2],v=0;t.forEach(function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,m=d[-a-1+l]||0,y=p/(p-h-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*y*g)}});var m=v,y=0,b=0;return f.forEach(function(t){y+=t.y,m+=y,t.y=m,b+=m}),b>0&&f.forEach(function(t){t.y/=b}),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach(function(t){e+=t.x*t.y}),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/e,Math.pow(2,n)}}}(yq);var xq=yq.exports;const wq=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(rr(t,t=>n.map(e=>t[e]).join("-")).values());return r.map(t=>{const n=xq.create(t.map(t=>t[e]),{min:i,max:o,size:a,width:s}),r=n.map(t=>t.x),u=n.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})})}};function kq(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function Mq(t,e){return kq(t).map(()=>kq(e))}function Oq(t,e){let n=0;for(let r=0;r<t.length;++r)n+=t[r]*e[r];return n}function Eq(t){return Math.sqrt(Oq(t,t))}function Sq(t,e,n){for(let r=0;r<e.length;++r)t[r]=e[r]*n}function _q(t,e,n,r,i){for(let o=0;o<t.length;++o)t[o]=e*n[o]+r*i[o]}function Aq(t,e,n,r,i,o,a){const s=n.fx,c=Oq(n.fxprime,e);let l=s,u=s,f=c,h=0;function d(u,h,d){for(let p=0;p<16;++p)if(i=(u+h)/2,_q(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=Oq(r.fxprime,e),l>s+o*i*c||l>=d)h=i;else{if(Math.abs(f)<=-a*c)return i;f*(h-u)>=0&&(h=u),u=i,d=l}return 0}i=i||1,o=o||1e-6,a=a||.1;for(let p=0;p<10;++p){if(_q(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=Oq(r.fxprime,e),l>s+o*i*c||p&&l>=u)return d(h,i,u);if(Math.abs(f)<=-a*c)return i;if(f>=0)return d(i,h,l);u=l,h=i,i*=2}return i}function Tq(t,e,n){let r={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const o=e.slice();let a,s=1;const c=(n=n||{}).maxIterations||20*e.length;r.fx=t(r.x,r.fxprime);const l=r.fxprime.slice();Sq(l,r.fxprime,-1);for(let e=0;e<c;++e){if(s=Aq(t,l,r,i,s),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),s){_q(o,1,i.fxprime,-1,r.fxprime);const t=Oq(r.fxprime,r.fxprime);_q(l,Math.max(0,Oq(o,i.fxprime)/t),l,-1,i.fxprime),a=r,r=i,i=a}else Sq(l,r.fxprime,-1);if(Eq(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),r}wq.props={};const Pq=1e-10;function Cq(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let r=n+1;r<t.length;++r){const i=Rq(t[n],t[r]);for(let t=0;t<i.length;++t){const o=i[t];o.parentIndex=[n,r],e.push(o)}}return e}(t),r=n.filter(function(e){return function(t,e){for(let n=0;n<e.length;++n)if(Lq(t,e[n])>e[n].radius+Pq)return!1;return!0}(e,t)});let i,o=0,a=0;const s=[];if(r.length>1){const e=function(t){const e={x:0,y:0};for(let n=0;n<t.length;++n)e.x+=t[n].x,e.y+=t[n].y;return e.x/=t.length,e.y/=t.length,e}(r);for(i=0;i<r.length;++i){const t=r[i];t.angle=Math.atan2(t.x-e.x,t.y-e.y)}r.sort(function(t,e){return e.angle-t.angle});let n=r[r.length-1];for(i=0;i<r.length;++i){const e=r[i];a+=(n.x+e.x)*(e.y-n.y);const c={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let l=null;for(let r=0;r<e.parentIndex.length;++r)if(n.parentIndex.indexOf(e.parentIndex[r])>-1){const i=t[e.parentIndex[r]],o=Math.atan2(e.x-i.x,e.y-i.y),a=Math.atan2(n.x-i.x,n.y-i.y);let s=a-o;s<0&&(s+=2*Math.PI);const u=a-s/2;let f=Lq(c,{x:i.x+i.radius*Math.sin(u),y:i.y+i.radius*Math.cos(u)});f>2*i.radius&&(f=2*i.radius),(null===l||l.width>f)&&(l={circle:i,width:f,p1:e,p2:n})}null!==l&&(s.push(l),o+=Nq(l.circle.radius,l.width),n=e)}}else{let e=t[0];for(i=1;i<t.length;++i)t[i].radius<e.radius&&(e=t[i]);let n=!1;for(i=0;i<t.length;++i)if(Lq(t[i],e)>Math.abs(e.radius-t[i].radius)){n=!0;break}n?o=a=0:(o=e.radius*e.radius*Math.PI,s.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-Pq,y:e.y+e.radius},width:2*e.radius}))}return a/=2,e&&(e.area=o+a,e.arcArea=o,e.polygonArea=a,e.arcs=s,e.innerPoints=r,e.intersectionPoints=n),o+a}function Nq(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function Lq(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function jq(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const r=e-(n*n-t*t+e*e)/(2*n);return Nq(t,t-(n*n-e*e+t*t)/(2*n))+Nq(e,r)}function Rq(t,e){const n=Lq(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];const o=(r*r-i*i+n*n)/(2*n),a=Math.sqrt(r*r-o*o),s=t.x+o*(e.x-t.x)/n,c=t.y+o*(e.y-t.y)/n,l=-(e.y-t.y)*(a/n),u=-(e.x-t.x)*(a/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function Iq(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const n=e.initialLayout||Fq,r=e.lossFunction||zq;t=function(t){t=t.slice();const e=[],n={};let r,i,o,a;for(r=0;r<t.length;++r){const i=t[r];1==i.sets.length?e.push(i.sets[0]):2==i.sets.length&&(o=i.sets[0],a=i.sets[1],n[[o,a]]=!0,n[[a,o]]=!0)}for(e.sort((t,e)=>t>e?1:-1),r=0;r<e.length;++r)for(o=e[r],i=r+1;i<e.length;++i)a=e[i],[o,a]in n||t.push({sets:[o,a],size:0});return t}(t);const i=n(t,e),o=[],a=[];let s;for(s in i)i.hasOwnProperty(s)&&(o.push(i[s].x),o.push(i[s].y),a.push(s));const c=function(t,e,n){const r=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,a=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,l=void 0!==n.chi?n.chi:2,u=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5;let h;const d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e),p[0].id=0;for(let n=0;n<d;++n){const r=e.slice();r[n]=r[n]?r[n]*i:o,p[n+1]=r,p[n+1].fx=t(r),p[n+1].id=n+1}function g(t){for(let e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}const v=(t,e)=>t.fx-e.fx,m=e.slice(),y=e.slice(),b=e.slice(),x=e.slice();for(let e=0;e<r;++e){if(p.sort(v),n.history){const t=p.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:t})}h=0;for(let t=0;t<d;++t)h=Math.max(h,Math.abs(p[0][t]-p[1][t]));if(Math.abs(p[0].fx-p[d].fx)<a&&h<s)break;for(let t=0;t<d;++t){m[t]=0;for(let e=0;e<d;++e)m[t]+=p[e][t];m[t]/=d}const e=p[d];if(_q(y,1+c,m,-c,e),y.fx=t(y),y.fx<p[0].fx)_q(x,1+l,m,-l,e),x.fx=t(x),x.fx<y.fx?g(x):g(y);else if(y.fx>=p[d-1].fx){let n=!1;if(y.fx>e.fx?(_q(b,1+u,m,-u,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(_q(b,1-u*c,m,u*c,e),b.fx=t(b),b.fx<y.fx?g(b):n=!0),n){if(f>=1)break;for(let e=1;e<p.length;++e)_q(p[e],1-f,p[0],f,p[e]),p[e].fx=t(p[e])}}else g(y)}return p.sort(v),{fx:p[0].fx,x:p[0]}}(function(e){const n={};for(let t=0;t<a.length;++t){const r=a[t];n[r]={x:e[2*t],y:e[2*t+1],radius:i[r].radius}}return r(n,t)},o,e),l=c.x;for(let t=0;t<a.length;++t)s=a[t],i[s].x=l[2*t],i[s].y=l[2*t+1];return i}const Dq=1e-10;function Bq(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+Dq?Math.abs(t-e):function(t,e,n,r){const i=(r=r||{}).maxIterations||100,o=r.tolerance||1e-10,a=t(e),s=t(n);let c=n-e;if(a*s>0)throw"Initial bisect points must have opposite signs";if(0===a)return e;if(0===s)return n;for(let n=0;n<i;++n){c/=2;const n=e+c,r=t(n);if(r*a>=0&&(e=n),Math.abs(c)<o||0===r)return n}return e+c}(function(r){return jq(t,e,r)-n},0,t+e)}function Fq(t,e){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:zq,r={},i={};let o;for(let e=0;e<t.length;++e){const n=t[e];1==n.sets.length&&(o=n.sets[0],r[o]={x:1e10,y:1e10,rowid:Object.keys(r).length,size:n.size,radius:Math.sqrt(n.size/Math.PI)},i[o]=[])}t=t.filter(function(t){return 2==t.sets.length});for(let e=0;e<t.length;++e){const n=t[e];let o=n.hasOwnProperty("weight")?n.weight:1;const a=n.sets[0],s=n.sets[1];n.size+Dq>=Math.min(r[a].size,r[s].size)&&(o=0),i[a].push({set:s,size:n.size,weight:o}),i[s].push({set:a,size:n.size,weight:o})}const a=[];for(o in i)if(i.hasOwnProperty(o)){let t=0;for(let e=0;e<i[o].length;++e)t+=i[o][e].size*i[o][e].weight;a.push({set:o,size:t})}function s(t,e){return e.size-t.size}a.sort(s);const c={};function l(t){return t.set in c}function u(t,e){r[e].x=t.x,r[e].y=t.y,c[e]=!0}u({x:0,y:0},a[0].set);for(let e=1;e<a.length;++e){const c=a[e].set,f=i[c].filter(l);if(o=r[c],f.sort(s),0===f.length)throw"ERROR: missing pairwise overlap information";const h=[];for(let t=0;t<f.length;++t){const e=r[f[t].set],n=Bq(o.radius,e.radius,f[t].size);h.push({x:e.x+n,y:e.y}),h.push({x:e.x-n,y:e.y}),h.push({y:e.y+n,x:e.x}),h.push({y:e.y-n,x:e.x});for(let i=t+1;i<f.length;++i){const t=r[f[i].set],a=Bq(o.radius,t.radius,f[i].size),s=Rq({x:e.x,y:e.y,radius:n},{x:t.x,y:t.y,radius:a});for(let t=0;t<s.length;++t)h.push(s[t])}}let d=1e50,p=h[0];for(let e=0;e<h.length;++e){r[c].x=h[e].x,r[c].y=h[e].y;const i=n(r,t);i<d&&(d=i,p=h[e])}u(p,c)}return r}(t,e);const r=e.lossFunction||zq;if(t.length>=8){const i=function(t,e){e=e||{};const n=e.restarts||10,r=[],i={};let o;for(o=0;o<t.length;++o){const e=t[o];1==e.sets.length&&(i[e.sets[0]]=r.length,r.push(e))}const a=function(t,e,n){const r=Mq(e.length,e.length),i=Mq(e.length,e.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){const o=n[t.sets[0]],a=n[t.sets[1]],s=Bq(Math.sqrt(e[o].size/Math.PI),Math.sqrt(e[a].size/Math.PI),t.size);r[o][a]=r[a][o]=s;let c=0;t.size+1e-10>=Math.min(e[o].size,e[a].size)?c=1:t.size<=1e-10&&(c=-1),i[o][a]=i[a][o]=c}),{distances:r,constraints:i}}(t,r,i);let s=a.distances;const c=a.constraints,l=Eq(s.map(Eq))/s.length;s=s.map(function(t){return t.map(function(t){return t/l})});const u=function(t,e){return function(t,e,n,r){let i,o=0;for(i=0;i<e.length;++i)e[i]=0;for(i=0;i<n.length;++i){const a=t[2*i],s=t[2*i+1];for(let c=i+1;c<n.length;++c){const l=t[2*c],u=t[2*c+1],f=n[i][c],h=r[i][c],d=(l-a)*(l-a)+(u-s)*(u-s),p=Math.sqrt(d),g=d-f*f;h>0&&p<=f||h<0&&p>=f||(o+=2*g*g,e[2*i]+=4*g*(a-l),e[2*i+1]+=4*g*(s-u),e[2*c]+=4*g*(l-a),e[2*c+1]+=4*g*(u-s))}}return o}(t,e,s,c)};let f,h;for(o=0;o<n;++o){h=Tq(u,kq(2*s.length).map(Math.random),e),(!f||h.fx<f.fx)&&(f=h)}const d=f.x,p={};for(o=0;o<r.length;++o){const t=r[o];p[t.sets[0]]={x:d[2*o]*l,y:d[2*o+1]*l,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(o=0;o<e.history.length;++o)Sq(e.history[o].x,l);return p}(t,e);r(i,t)+1e-8<r(n,t)&&(n=i)}return n}function zq(t,e){let n=0;function r(e){return e.map(function(e){return t[e]})}for(let i=0;i<e.length;++i){const o=e[i];let a;if(1==o.sets.length)continue;if(2==o.sets.length){const e=t[o.sets[0]],n=t[o.sets[1]];a=jq(e.radius,n.radius,Lq(e,n))}else a=Cq(r(o.sets));n+=(o.hasOwnProperty("weight")?o.weight:1)*(a-o.size)*(a-o.size)}return n}function $q(t,e,n,r){const i=[],o=[];for(const e in t)t.hasOwnProperty(e)&&(o.push(e),i.push(t[e]));e-=2*r,n-=2*r;const a=function(t){const e=function(e){const n=Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),r=Math.min.apply(null,t.map(function(t){return t[e]-t.radius}));return{max:n,min:r}};return{xRange:e("x"),yRange:e("y")}}(i),s=a.xRange,c=a.yRange;if(s.max==s.min||c.max==c.min)return console.log("not scaling solution: zero size detected"),t;const l=e/(s.max-s.min),u=n/(c.max-c.min),f=Math.min(u,l),h=(e-(s.max-s.min)*f)/2,d=(n-(c.max-c.min)*f)/2,p={};for(let t=0;t<i.length;++t){const e=i[t];p[o[t]]={radius:f*e.radius,x:r+h+(e.x-s.min)*f,y:r+d+(e.y-c.min)*f}}return p}const Wq=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:i=0}=t,[o,a]=r;return t=>{const r=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[o]:t.sets.join("&")}));r.sort((t,e)=>t.sets.length-e.sets.length);const s=Iq(r);let c;return r.map(t=>{const n=t[e];return Object.assign(Object.assign({},t),{[a]:({width:t,height:e})=>{c=c||$q(s,t,e,i);const r=n.map(t=>c[t]);let o=function(t){const e={};Cq(t,e);const n=e.arcs;if(0===n.length)return"M 0 0";if(1==n.length){const t=n[0].circle;return function(t,e,n){const r=[],i=t-n,o=e;return r.push("M",i,o),r.push("A",n,n,0,1,0,i+2*n,o),r.push("A",n,n,0,1,0,i,o),r.join(" ")}(t.x,t.y,t.radius)}{const t=["\nM",n[0].p2.x,n[0].p2.y];for(let e=0;e<n.length;++e){const r=n[e],i=r.circle.radius,o=r.width>i;t.push("\nA",i,i,0,o?1:0,1,r.p1.x,r.p1.y)}return t.join(" ")}}(r);return/[zZ]$/.test(o)||(o+=" Z"),o}})})}};Wq.props={};const Gq=()=>t=>(console.log("G2 data section:",t),t);Gq.props={};const Hq=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map(t=>t[e]),o=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const o=n*e+(1-e)*i;r.push(o),n=o}return r}(i,n);return t.map((t,e)=>Object.assign(Object.assign({},t),{[r]:o[e]}))}};Hq.props={};function Yq(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function qq(t,e,n=.01){const[r,i]=t,[o,a]=e;return r>=o[0]-n&&r<=a[0]+n&&i>=o[1]-n&&i<=a[1]+n}function Vq(t,e,n=.01){const[r,i]=t;return!(qq(r,e,n)&&qq(i,e,n))}const Uq=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach(t=>{mG(t);const e=t.getLocalBounds(),r=n.some(t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}(Yq(e),Yq(t.getLocalBounds())));r?vG(t):n.push(t)}),t}};function Xq([t,e],[n,r]){return r>t&&e>n}function Kq(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function Zq(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const Qq=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=Kq(),[s,c]=Kq(),[l,u]=Kq(),[f,h]=Kq();for(const e of t){const{min:t,max:n}=Zq(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),h(e,[r,o])}for(let o=0;o<e;o++){t.sort((t,e)=>Fn(s(t),s(e)));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let o,a=n+1;for(;(o=t[a])&&!Xq(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function Jq(t){return"object"==typeof t?t:_h(t)}function tV(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function eV(t,e,n){return.2126*tV(t)+.7152*tV(e)+.0722*tV(n)}function nV(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=eV(n,r,i),l=eV(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function rV(t,e){const n=wr(e,e=>nV(t,Jq(e)));return e[n]}const iV=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach(t=>{const r=t.attr("dependentElement").parsedStyle.fill;nV(t.parsedStyle.fill,r)<e&&t.attr("fill",rV(r,n))}),t)},oV=()=>t=>(t.forEach(t=>{mG(t);const e=t.attr("bounds");Vq(Yq(t.getLocalBounds()),e)&&vG(t)}),t),aV=(t={})=>(e,{canvas:n,layout:r})=>{const{bounds:i="view",offsetX:o=0,offsetY:a=0}=t,s=(()=>{if("main"===i){const{x:t=0,y:e=0,width:n=0,height:i=0,marginLeft:s=0,marginRight:c=0,marginTop:l=0,marginBottom:u=0,paddingLeft:f=0,paddingRight:h=0,paddingTop:d=0,paddingBottom:p=0}=r;return[[t+s+f+o,e+l+d+a],[t+n-c-h-o,e+i-u-p-a]]}{const{x:t=0,y:e=0,width:n=0,height:i=0}=r;return[[t+o,e+a],[t+n-o,e+i-a]]}})();return e.forEach(t=>{mG(t);const{max:e,min:n}=((t,e)=>({min:[Math.min(t.min[0],e.min[0]),Math.min(t.min[1],e.min[1])],max:[Math.max(t.max[0],e.max[0]),Math.max(t.max[1],e.max[1])]}))(t.getRenderBounds(),t.getBounds()),[r,i]=e,[o,a]=n,c=((t,e)=>{const[[n,r],[i,o]]=e,[[a,s],[c,l]]=t;let u=0,f=0;return a<n?u=n-a:c>i&&(u=i-c),s<r?f=r-s:l>o&&(f=o-l),[u,f]})([[o,a],[r,i]],s);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]}),e};function sV(t){var e;const n=t.getAnimations();if(!n||0===n.length)return kG(t);const r=t.cloneNode(!0);r.style.visibility="hidden",n.forEach(t=>{const e=t.effect.getKeyframes();e&&e.length>0&&r.attr(e[e.length-1])}),null===(e=t.parentNode)||void 0===e||e.appendChild(r);const i=kG(r);return r.destroy(),i}const cV=t=>{const{palette:e=["#000","#fff"],threshold:n=2}=t;return t=>(t.forEach(t=>{var r,i;const o=t.attr("dependentElement"),a=null!==(i=null!==(r=t.attributes.fill)&&void 0!==r?r:t.parsedStyle.fill)&&void 0!==i?i:"#fff";if(Vq(Yq(sV(t)),Yq(sV(o)),n)){const n=rV(Jq(a),e);t.attr("stroke",n)}else t.removeAttribute("stroke")}),t)};function lV(){return{"data.fetch":IY,"data.inline":HY,"data.sortBy":GY,"data.sort":zY,"data.filter":FY,"data.pick":$Y,"data.rename":WY,"data.fold":DY,"data.slice":mq,"data.custom":YY,"data.map":qY,"data.join":vq,"data.kde":wq,"data.log":Gq,"data.wordCloud":pq,"data.ema":Hq,"transform.stackY":Sa,"transform.binX":Ys,"transform.bin":Hs,"transform.dodgeX":Ka,"transform.jitter":es,"transform.jitterX":ns,"transform.jitterY":rs,"transform.symmetryY":is,"transform.diffY":os,"transform.stackEnter":Za,"transform.normalizeY":Qa,"transform.select":us,"transform.selectX":fs,"transform.selectY":hs,"transform.groupX":Os,"transform.groupY":Es,"transform.groupColor":Ss,"transform.group":Ms,"transform.sortX":As,"transform.sortY":Ps,"transform.sortColor":Ts,"transform.flexX":Cs,"transform.pack":$s,"transform.sample":Vs,"transform.filter":Us,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":o,"coordinate.theta":a,"coordinate.parallel":l,"coordinate.fisheye":u,"coordinate.radial":c,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":h,"encode.field":p,"encode.transform":d,"encode.column":g,"mark.interval":tE,"mark.rect":nE,"mark.line":aE,"mark.point":cE,"mark.text":uE,"mark.cell":hE,"mark.area":pE,"mark.link":vE,"mark.image":yE,"mark.polygon":xE,"mark.box":kE,"mark.vector":OE,"mark.lineX":AE,"mark.lineY":SE,"mark.connector":PE,"mark.range":jE,"mark.rangeX":IE,"mark.rangeY":BE,"mark.path":xS,"mark.shape":G_,"mark.density":ZA,"mark.heatmap":JA,"mark.wordCloud":GA,"palette.category10":rT,"palette.category20":iT,"scale.linear":aT,"scale.ordinal":sT,"scale.band":oT,"scale.identity":cT,"scale.point":lT,"scale.time":uT,"scale.log":fT,"scale.pow":hT,"scale.sqrt":vT,"scale.threshold":dT,"scale.quantile":pT,"scale.quantize":gT,"scale.sequential":mT,"scale.constant":yT,"theme.classic":kT,"theme.classicDark":ET,"theme.academy":_T,"theme.light":wT,"theme.dark":OT,"component.axisX":oP,"component.axisY":aP,"component.legendCategory":pP,"component.legendContinuous":bP,"component.legends":FP,"component.title":SP,"component.sliderX":jP,"component.sliderY":RP,"component.scrollbarX":DP,"component.scrollbarY":BP,"animation.scaleInX":zP,"animation.scaleOutX":$P,"animation.scaleInY":WP,"animation.scaleOutY":GP,"animation.waveIn":oC,"animation.fadeIn":HP,"animation.fadeOut":YP,"animation.zoomIn":aC,"animation.zoomOut":sC,"animation.pathIn":cC,"animation.morphing":iC,"animation.growInX":lC,"animation.growInY":uC,"interaction.elementHighlight":UG,"interaction.elementHighlightByX":XG,"interaction.elementHighlightByColor":KG,"interaction.elementSelect":QG,"interaction.elementSelectByX":JG,"interaction.elementSelectByColor":tH,"interaction.fisheye":nH,"interaction.chartIndex":eH,"interaction.tooltip":OH,"interaction.legendFilter":RH,"interaction.legendHighlight":IH,"interaction.brushHighlight":YH,"interaction.brushXHighlight":VH,"interaction.brushYHighlight":XH,"interaction.brushAxisHighlight":nY,"interaction.brushFilter":rY,"interaction.brushXFilter":iY,"interaction.brushYFilter":oY,"interaction.sliderFilter":lY,"interaction.scrollbarFilter":fY,"interaction.poptip":gY,"interaction.treemapDrillDown":mY,"interaction.elementPointMove":SY,"composition.spaceLayer":rR,"composition.spaceFlex":iR,"composition.facetRect":xR,"composition.repeatMatrix":SR,"composition.facetCircle":NR,"composition.timingKeyframe":jR,"labelTransform.overlapHide":Uq,"labelTransform.overlapDodgeY":Qq,"labelTransform.overflowHide":oV,"labelTransform.contrastReverse":iV,"labelTransform.overflowStroke":cV,"labelTransform.exceedAdjust":aV}}function uV(){return{"composition.geoView":IB,"composition.geoPath":RR}}function fV(){return{"data.arc":dS,"data.cluster":IA,"mark.forceGraph":jA,"mark.tree":WA,"mark.pack":L_,"mark.sankey":lS,"mark.chord":yS,"mark.treemap":P_}}function hV(){return{"data.venn":Wq,"mark.boxplot":W_,"mark.gauge":XA,"mark.wordCloud":GA,"mark.liquid":nT}}function dV(){return Object.assign(Object.assign(Object.assign(Object.assign({},uV()),fV()),hV()),lV())}function pV(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const gV={};const vV=t=>t?parseInt(t):0;function mV(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class yV{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map(n=>(n[t]=e,n))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex(t=>t===this);e.splice(n,1)}return this}getNodeByKey(t){let e=null;return mV(this,n=>{t===n.attr("key")&&(e=n)}),e}getNodesByType(t){const e=[];return mV(this,n=>{t===n.type&&e.push(n)}),e}getNodeByType(t){let e=null;return mV(this,n=>{e||t===n.type&&(e=n)}),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const bV=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],xV="__remove__",wV="__callback__";function kV(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function MV(t,e){const{width:n,height:r,autoFit:i,depth:o=0}=t;let a=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||vV(e.width),r=t.clientHeight||vV(e.height);return{width:n-(vV(e.paddingLeft)+vV(e.paddingRight)),height:r-(vV(e.paddingTop)+vV(e.paddingBottom))}}(e);a=t||a,s=n||s}return a=n||a,s=r||s,{width:Math.max(I(a)?a:1,1),height:Math.max(I(s)?s:1,1),depth:o}}function OV(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of bV)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,kV(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===wV)e.children=t.value;else{const i=kV(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function EV(t,e,n,r,i){const{type:o}=t,{type:a=n||o}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(a,i)){for(const n of bV)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(a,r)){const t={type:"view"},n=Object.assign({},e);for(const e of bV)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function SV(t,e,n){if("function"==typeof t){const e=new yV;return e.value=t,e.type=wV,e}const{type:r,children:i}=t,o=Ie(t,["type","children"]),a=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new a;return s.value=o,s.type=r,s}function _V(t,e){const{type:n,children:r}=e,i=Ie(e,["type","children"]);t.type===n||void 0===n?ua(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function AV(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=SV(e,n,r);Array.isArray(t.children)&&t.push(o);const{children:a}=e;if(Array.isArray(a))for(const t of a)i.push([o,t]);else"function"==typeof a&&i.push([o,a])}}function TV(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function PV(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function CV(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function NV(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(ca(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function LV(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function jV(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function RV(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?TV(e,n,r):"array"===t?PV(e,n,r):"object"===t?CV(e,n,r):"node"===t?LV(e,n,r):"container"===t?jV(e,n,r):"mix"===t&&NV(e,n)}return e}}function IV(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{type:"node",ctor:e}]))}const DV={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},BV=Object.assign(Object.assign({},DV),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),FV=Object.assign(Object.assign({},DV),{labelTransform:{type:"array"}});let zV=class extends yV{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach(e=>{e.attr("data",t)}),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find(t=>t.key===this._key)}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&mG(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&vG(t)}};zV=De([RV(FV)],zV);let $V=class extends yV{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find(t=>t.key===this.attr("key"));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};$V=De([RV(BV)],$V);const WV="G2_CHART_KEY";class GV extends zV{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o,createCanvas:a}=t;super(Ie(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailingClear=null,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=K(()=>{this.forceFit()},300),this._renderer=r||new ON,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[xV]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new AN,this._context={library:Object.assign(Object.assign({},o),gV),emitter:this._emitter,canvas:n,createCanvas:a},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise((t,e)=>uG(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let t,e;return[new Promise((n,r)=>{e=n,t=r}),e,t]}();return t.then(n).then(()=>{if(this._trailingClear){const t=this.options();this._trailingClear(),this._trailing&&this.options(t)}}).catch(r).then(()=>{this._trailingClear=null,this._renderTrailing()}),e}options(t){if(0===arguments.length)return OV(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,EV(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){_V(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],a=r[i];o.push([e,a,n])}}else"function"==typeof t&&o.push([e,null,t])}else e.remove();else AV(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(t=!0){if(this._rendering)return this._trailingClear=()=>{this.clear(t)},void this._reset();this.options();this.emit(TN.BEFORE_CLEAR),this._reset(),fG(0,this._context,!1,t),this.emit(TN.AFTER_CLEAR)}destroy(){this.options();this.emit(TN.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),fG(0,this._context,!0),this._container[xV]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(TN.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=MV(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(TN.BEFORE_CHANGE_SIZE);const n=this.render();return n.then(()=>{this.emit(TN.AFTER_CHANGE_SIZE)}),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(TN.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then(()=>{this.emit(TN.AFTER_CHANGE_SIZE)}),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:o=0,startY:a=0}=e,{canvas:s,views:c}=this._context,{document:l}=s,{x:u,y:f}=t,{coordinate:h,scale:d,markState:p,data:g,key:v}=c[0],m=l.getElementsByClassName(zO),y=n?t=>t.__data__.x:t=>t,b=rr(m,y),x=wG(l.getElementsByClassName($O)[0]),w=t=>Array.from(t.values()).some(t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some(t=>"series"===t.name&&void 0!==t.values))}),k=bH(r,w(p)),M=t=>ot(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=kH({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,startX:o,startY:a}),e=g.get(`${v}-0`);return t.map(({index:t})=>e[t])}const t=wH({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,shared:n});if(Uo(t))return Xo(t,g.get(v));const e=y(t),r=b.get(e);return r?r.map(M):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?M(e):[]}}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter(t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t)];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends $V{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter(t=>t.startsWith("composition.")&&"composition.mark"!==t)];this._compositions=Object.fromEntries(n.map(t=>{const e=t.split(".").pop();let n=class extends zV{constructor(){super({},e)}};return n=De([RV(IV(this._marks))],n),[e,n]}));for(const t of Object.values(this._compositions))RV(IV(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=WV}=t,{width:n,height:r,depth:i}=MV(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=MV(this.options(),this._container);this._plugins.push(new SN),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new Nv({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e})}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const HV=pV(GV,Object.assign({},dV()));t.AREA_CLASS_NAME=YO,t.Academy=_T,t.Bin=Hs,t.BinX=Ys,t.COMPONENT_CLASS_NAME=GO,t.Chart=HV,t.ChartEvent=TN,t.Classic=kT,t.ClassicDark=ET,t.Dark=OT,t.DiffY=os,t.DodgeX=Ka,t.ELEMENT_CLASS_NAME=zO,t.Filter=Us,t.FlexX=Cs,t.Group=Ms,t.GroupColor=Ss,t.GroupX=Os,t.GroupY=Es,t.Jitter=es,t.JitterX=ns,t.JitterY=rs,t.LABEL_CLASS_NAME=HO,t.LABEL_LAYER_CLASS_NAME=FO,t.Light=wT,t.LinearAxis=rP,t.MAIN_LAYER_CLASS_NAME=BO,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Wa,t.MaybeDefaultY=Ga,t.MaybeFunctionAttribute=Va,t.MaybeGradient=Xa,t.MaybeIdentityX=$a,t.MaybeIdentityY=za,t.MaybeKey=Ia,t.MaybeSeries=Da,t.MaybeSize=Ra,t.MaybeStackY=Aa,t.MaybeTitle=Ca,t.MaybeTooltip=Ha,t.MaybeTuple=Ua,t.MaybeTupleX=Fa,t.MaybeTupleY=Ba,t.MaybeVisualPosition=qa,t.MaybeZeroPadding=Ya,t.MaybeZeroX=Na,t.MaybeZeroY=La,t.MaybeZeroY1=Bn,t.MaybeZeroZ=ja,t.NormalizeY=Qa,t.PLOT_CLASS_NAME=WO,t.Pack=$s,t.Runtime=GV,t.Sample=Vs,t.Select=us,t.SelectX=fs,t.SelectY=hs,t.Selection=Nm,t.SortColor=Ts,t.SortX=As,t.SortY=Ps,t.StackEnter=Za,t.StackY=Sa,t.SymmetryY=is,t.VIEW_CLASS_NAME=$O,t.corelib=lV,t.dataOf=Xo,t.extend=pV,t.geolib=uV,t.graphlib=fV,t.plotlib=hV,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,jy.set(n,r)):Object.assign(gV,{[t]:e})},t.render=uG,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:o=640,height:a=480}=t,s=cG(t),{group:c=new rv,emitter:l=new AN,library:u}=e;(null==c?void 0:c.parentElement)||ta("renderToMountedElement can't render chart to unmounted group.");const f=Cm(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(TN.BEFORE_RENDER),CW(Object.assign(Object.assign({},s),{width:o,height:a}),f,e).then(()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame(()=>{l.emit(TN.AFTER_RENDER),null==n||n()})}).catch(t=>{null==r||r(t)}),c},t.select=Cm,t.selectG2Elements=yG,t.selectPlotArea=wG,t.seriesOf=function(t){const e=Vo(t).__data__,{scale:n}=e;return Ko(n,t.__data__)},t.stdlib=dV,Object.defineProperty(t,"__esModule",{value:!0})});
69
+ */AN.tag="Dragndrop";var TN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yl(this,e),(t=_l(this,e)).name="dragndrop",t.options=n,t}return Tl(e,t),xl(e,[{key:"init",value:function(){this.addRenderingPlugin(new AN(ml({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(vu),PN=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),CN=PN;const NN={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},LN={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class jN extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var RN;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(RN||(RN={}));const IN=new Set([32,9,10,13]),DN=new Set([43,45,42,47,37,33,38,124,61,60,62]),BN=new Map([["true",RN.BOOLEAN],["false",RN.BOOLEAN],["null",RN.NULL]]),FN=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),zN=new Map([[46,RN.DOT],[91,RN.BRACKET_LEFT],[93,RN.BRACKET_RIGHT],[40,RN.PAREN_LEFT],[41,RN.PAREN_RIGHT],[44,RN.COMMA],[63,RN.QUESTION],[58,RN.COLON],[36,RN.DOLLAR]]),$N=new Map;for(const[t,e]of zN.entries())$N.set(t,{type:e,value:String.fromCharCode(t)});function WN(t){return t>=48&&t<=57}function GN(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function HN(t){return GN(t)||WN(t)}function YN(t){return DN.has(t)}var qN;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(qN||(qN={}));const VN=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),UN={type:qN.Literal,value:null},XN={type:qN.Literal,value:!0},KN={type:qN.Literal,value:!1},ZN=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],o=t=>{const e=r();return null!==e&&e.type===t},a=t=>t.type===RN.OPERATOR?VN.get(t.value)||-1:t.type===RN.DOT||t.type===RN.BRACKET_LEFT?9:t.type===RN.QUESTION?1:-1,s=t=>{let n,a;if(i().type===RN.DOT){if(!o(RN.IDENTIFIER)){const t=r();throw new jN("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:qN.Identifier,name:t.value},a=!1}else{if(n=l(0),!o(RN.BRACKET_RIGHT)){const t=r();throw new jN("Expected closing bracket",e,t?t.value:"<end of input>")}i(),a=!0}return{type:qN.MemberExpression,object:t,property:n,computed:a}},c=()=>{const t=r();if(!t)throw new jN("Unexpected end of input",e,"<end of input>");if(t.type===RN.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=c();return{type:qN.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case RN.NUMBER:return i(),{type:qN.Literal,value:Number(t.value)};case RN.STRING:return i(),{type:qN.Literal,value:t.value};case RN.BOOLEAN:return i(),"true"===t.value?XN:KN;case RN.NULL:return i(),UN;case RN.IDENTIFIER:return i(),{type:qN.Identifier,name:t.value};case RN.FUNCTION:return(()=>{const t=i(),n=[];if(!o(RN.PAREN_LEFT)){const t=r();throw new jN("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(o(RN.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new jN("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!o(RN.COMMA)){const t=r();throw new jN("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=l(0);n.push(t)}return{type:qN.CallExpression,callee:{type:qN.Identifier,name:t.value},arguments:n}})();case RN.PAREN_LEFT:{i();const t=l(0);if(!o(RN.PAREN_RIGHT)){const t=r();throw new jN("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new jN(`Unexpected token: ${t.type}`,e,t.value)}},l=(u=0)=>{let f=c();for(;e<n;){const n=t[e],c=a(n);if(c<=u)break;if(n.type!==RN.QUESTION)if(n.type!==RN.OPERATOR){if(n.type!==RN.DOT&&n.type!==RN.BRACKET_LEFT)break;f=s(f)}else{i();const t=l(c);f={type:qN.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=l(0);if(!o(RN.COLON)){const t=r();throw new jN("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=l(0);f={type:qN.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=l();return{type:qN.Program,body:u}},QN=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case qN.Literal:return(t=>t.value)(t);case qN.Identifier:return(t=>{if(!(t.name in r.context))throw new jN(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case qN.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new jN("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case qN.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new jN(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map(t=>i(t)))})(t);case qN.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new jN(`Unknown operator: ${t.operator}`)}})(t);case qN.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new jN(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new jN(`Unknown operator: ${t.operator}`)}throw new jN(`Postfix operators are not supported: ${t.operator}`)})(t);case qN.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new jN(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const JN=["style","encode","labels","children"],tL=_O(t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,o=0;function a(t){const r=o+1;o++;let i="",a=!1;for(;o<n;){const n=e.charCodeAt(o);if(n===t)return a||(i=e.substring(r,o)),o++,{type:RN.STRING,value:i};92===n?(a||(i=e.substring(r,o),a=!0),o++,i+=e[o]):a&&(i+=e[o]),o++}throw new jN(`Unterminated string starting with ${String.fromCharCode(t)}`,o,e.substring(Math.max(0,o-10),o))}function s(){const t=o;for(45===e.charCodeAt(o)&&o++;o<n&&WN(e.charCodeAt(o));)o++;if(o<n&&46===e.charCodeAt(o))for(o++;o<n&&WN(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:RN.NUMBER,value:r}}function c(){o++;const t=o;if(o<n&&GN(e.charCodeAt(o)))for(o++;o<n&&HN(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:RN.FUNCTION,value:r}}function l(){const t=o++;for(;o<n&&HN(e.charCodeAt(o));)o++;const r=e.slice(t,o),i=BN.get(r);return i?{type:i,value:r}:{type:RN.IDENTIFIER,value:r}}function u(){if(o+2<n){const t=e.substring(o,o+3);if(FN.has(t))return o+=3,{type:RN.OPERATOR,value:t}}if(o+1<n){const t=e.substring(o,o+2);if(FN.has(t))return o+=2,{type:RN.OPERATOR,value:t}}const t=e[o];if(FN.has(t))return o++,{type:RN.OPERATOR,value:t};throw new jN(`Unknown operator at position ${o}: ${e.substring(o,o+1)}`,o,e.substring(Math.max(0,o-10),o))}for(;o<n;){const t=e.charCodeAt(o);if(f=t,IN.has(f)){o++;continue}const h=$N.get(t);if(h)r[i++]=h,o++;else if(34!==t&&39!==t)if(WN(t)||45===t&&o+1<n&&WN(e.charCodeAt(o+1)))r[i++]=s();else if(64!==t)if(GN(t))r[i++]=l();else{if(!YN(t))throw new jN(`Unexpected character: ${e[o]}`,o,e.substring(Math.max(0,o-10),o));r[i++]=u()}else r[i++]=c();else r[i++]=a(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=ZN(e),r=((t={},e={})=>({context:t,functions:e}))({},LN);return(t={})=>QN(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},(t,e)=>String.fromCharCode(97+e)),r=Object.fromEntries(t.map((t,e)=>[n[e],t]));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}},t=>t,128);function eL(t,e=!0){if(Array.isArray(t))return t.map((n,r)=>eL(t[r],e));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=it);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach(function(r){n[r]=e(t[r],r)}),n}(t,(t,n)=>e&&JN.includes(n)?eL(t,"children"===n):e?t:eL(t,!1));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return tL(e.slice(1,-1))}return t}const nL=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var rL={}.toString,iL=function(t,e){return rL.call(t)==="[object "+e+"]"},oL=function(t){return Array.isArray?Array.isArray(t):iL(t,"Array")},aL=function(t){return"object"==typeof t&&null!==t},sL=function(t){if(!aL(t)||!iL(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function cL(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&sL(o)?(sL(t[i])||(t[i]={}),n<r?cL(t[i],o,n+1,r):t[i]=e[i]):oL(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var lL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)cL(t,e[r]);return t},uL=function(t){return t};function fL(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(t,e){return function(n){return e(t(n))}},t):uL}function hL(t){return t instanceof Float32Array||t instanceof Array}var dL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},pL=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function gL(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var vL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},mL=function(t,e,n,r,i){var o,a,s=vL(t,2),c=s[0],l=s[1],u=gt();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o},yL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},bL=function(t,e,n,r,i){var o=new Jx({range:[e,e+r]}),a=new Jx({range:[n,n+i]});return{transform:function(t){var e=yL(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=yL(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},xL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},wL=function(t,e,n,r,i){return(0,xL(t,1)[0])(e,n,r,i)},kL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ML=function(t,e,n,r,i){return kL(t,1)[0]},OL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},EL=function(t,e,n,r,i){var o=OL(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new Jx({range:[c,l]}),f=new Jx({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=OL(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*d)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=OL(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=gL(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},SL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_L=function(t,e,n,r,i){return{transform:function(t){var e=SL(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=SL(t,2),n=e[0];return[e[1],n]}}},AL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},TL=function(t,e,n,r,i){var o,a,s=AL(t,2),c=s[0],l=s[1],u=gt();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},PL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},CL=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},NL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return TL.apply(void 0,CL([[-1,-1]],PL(e),!1))},LL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return TL.apply(void 0,CL([[-1,1]],PL(e),!1))},jL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return TL.apply(void 0,CL([[1,-1]],PL(e),!1))},RL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},IL=function(t,e,n,r,i){var o=RL(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(gt(),o)},DL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},BL=function(t,e,n,r,i){var o=DL(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new Jx({range:[c,c+.99*l]}),h=new Jx({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=DL(t,2),n=e[0],r=e[1],i=h.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=DL(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),d=gL(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},FL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},zL=function(t,e,n,r,i){var o=FL(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new Jx({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new tw({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},$L=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function WL(t){return 1/Math.tan(t)}var GL=function(t,e,n,r,i){var o=WL($L(t,1)[0]);return{transform:function(t){var e=$L(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=$L(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},HL=function(t,e,n,r,i){var o=WL($L(t,1)[0]);return{transform:function(t){var e=$L(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=$L(t,2),n=e[0];return[n,e[1]-n*o]}}},YL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function qL(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function VL(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function UL(t,e,n){return n?new Jx({range:[0,1],domain:[0,e]}).map(t):t}var XL=function(t,e,n,r,i){var o=YL(t,3),a=o[0],s=o[1],c=o[2],l=UL(a,r,void 0!==c&&c);return{transform:function(t){var e=YL(t,2),n=e[0],r=e[1];return[qL(n,l,s,0,1),r]},untransform:function(t){var e=YL(t,2),n=e[0],r=e[1];return[VL(n,l,s,0,1),r]}}},KL=function(t,e,n,r,i){var o=YL(t,3),a=o[0],s=o[1],c=o[2],l=UL(a,i,void 0!==c&&c);return{transform:function(t){var e=YL(t,2);return[e[0],qL(e[1],l,s,0,1)]},untransform:function(t){var e=YL(t,2);return[e[0],VL(e[1],l,s,0,1)]}}},ZL=function(t,e,n,r,i){var o=YL(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=UL(a,r,f),d=UL(s,i,f);return{transform:function(t){var e=YL(t,2),n=e[0],r=e[1];return[qL(n,h,c,0,1),qL(r,d,l,0,1)]},untransform:function(t){var e=YL(t,2),n=e[0],r=e[1];return[VL(n,h,c,0,1),VL(r,d,l,0,1)]}}},QL=function(t,e,n,r,i){var o=YL(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new Jx({range:[0,r]}),d=new Jx({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=YL(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=qL(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=YL(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=VL(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},JL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},tj=function(t,e,n,r,i,o,a){var s=new Jx({range:[e,e+i]}),c=new Jx({range:[n,n+o]}),l=new Jx({range:[r,r+a]});return{transform:function(t){var e=JL(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=JL(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},ej=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},nj=function(t,e,n,r,i,o,a){var s=ej(t,3),c=s[0],l=s[1],u=s[2];return Ct(mt(),[c,l,u])},rj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ij=function(t,e,n,r,i,o,a){return{transform:function(t){var e=rj(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=rj(t,3),n=e[0];return[e[1],n,e[2]]}}},oj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},aj=function(t,e,n,r,i,o,a){var s=oj(t,3),c=s[0],l=s[1],u=s[2];return Nt(mt(),[c,l,u])},sj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},cj=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},lj=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},uj=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:bL,translate:mL,custom:wL,matrix:ML,polar:EL,transpose:_L,scale:TL,"shear.x":GL,"shear.y":HL,reflect:NL,"reflect.x":LL,"reflect.y":jL,rotate:IL,helix:BL,parallel:zL,fisheye:ZL,"fisheye.x":XL,"fisheye.y":KL,"fisheye.circular":QL},this.update(t)}return t.prototype.update=function(t){this.options=lL({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:cj(cj([],sj(n),!1),[cj([],sj(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?cj([],sj(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,pL([],dL(o),!1))}return n}}(t):t)};try{for(var c=lj(r),l=c.next();!l.done;l=c.next()){var u=sj(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=d(cj([],sj(h),!1),g,v,m,y);if(hL(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||uL,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return fL.apply(void 0,cj([],sj(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=gt();return e&&t.reverse(),t.forEach(function(t){return vt(n,n,t)}),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,h=-u*o+s*c,d=l*o-a*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(n,function(t){var e=new pt(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}(n)),function(t){var e=[t[0],t[1],1];return pe(e,e,n),[e[0],e[1]]}},t}(),fj=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},hj=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},dj=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pj=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:tj,translate3D:nj,scale3D:aj,transpose3D:ij},this.update(t)}return t.prototype.update=function(t){this.options=lL({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:hj(hj([],fj(n),!1),[hj([],fj(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?hj([],fj(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,pL([],dL(o),!1))}return n}}(t):t)};try{for(var c=dj(r),l=c.next();!l.done;l=c.next()){var u=fj(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,w=d(hj([],fj(h),!1),g,v,m,y,b,x);if(hL(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||uL,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return fL.apply(void 0,hj([],fj(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=mt();return e&&t.reverse(),t.forEach(function(t){return Zt(n,n,t)}),e&&Ot(n,yt(n)),function(t){var e=[t[0],t[1],t[2],1];return we(e,e,n),[e[0],e[1],e[2]]}},t}();function gj(t){return(e,...n)=>tt({},t(e,...n),e)}function vj(t){return(e,...n)=>tt({},e,t(e,...n))}function mj(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Ie(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const yj=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map(t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=Ie(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:mj(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})})};yj.props={};const bj=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map(()=>1),padding:i=0,data:o}=t,[a,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce((t,e)=>t+e),f=t[s]-i*(e.length-1),h=r.map(t=>f*(t/u)),d=[];let p=t[a]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=Ie(r,["data"]),g=mj(u,o);d.push(Object.assign({[a]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};bj.props={};const xj=()=>t=>{const{children:e}=t,n=Ie(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Ie(n,["data","scale","axis","legend","encode","transform"]),u=e.map(t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=Ie(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:mj(e,r),scale:tt({},i,n),encode:tt({},s,f),transform:[...c,...h],axis:!(!l||!o)&&tt({},o,l),legend:!(!u||!a)&&tt({},a,u)},d)});return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};xj.props={};const wj=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:w,theme:k,component:M,interaction:O,x:E,y:S,z:_,key:A,frame:T,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=Ie(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:S,z:_,key:A,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:k,coordinate:w,component:M,interaction:O,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${A}-0`,data:x}),t&&{title:j})]})]};wj.props={};class kj{constructor(t){this.$value=t}static of(t){return new kj(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const Mj=gj(t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=rr(n,e=>e[t]),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),c=s.map(t=>a.has(t)?a.get(t).length:1);return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}}),Oj=vj(t=>{const{data:e,scale:n,legend:r}=t,i=[t];let o,a,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(o=l),void 0!==u&&(a=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof o?o:"",[l,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===o)return[void 0];const i="function"==typeof o?o:t=>t[o],a=e.map(i);return a.some(t=>"number"==typeof t)?[Zn(a)]:[Array.from(new Set(a)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:tt({},a,{domain:l,type:u})}},void 0===r&&{legend:{color:tt({title:c},s)}})}),Ej=gj(()=>({animate:{enterType:"fadeIn"}})),Sj=vj(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),_j=vj(()=>({type:"cell"})),Aj=vj(t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map(t=>t[r]))):[],a=i?Array.from(new Set(e.map(t=>t[i]))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map(t=>({[r]:t})):a.length?a.map(t=>({[i]:t})):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}}),Tj=vj((t,e=Pj,n=Nj,r=Lj,i={})=>{const{data:o,encode:a,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=o,{x:p,y:g}=a,{color:v}=c,{domain:m}=v;return{children:(t,o,a)=>{const{x:c,y:v}=o,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:k}=c.getOptions(),{domain:M}=v.getOptions(),O=ha(t),E=t.map(e),S=t.map(({x:t,y:e})=>[c.invert(t),v.invert(e)]),_=S.map(([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)}),A=_.map(t=>d.filter(t)),T=f?xr(A,t=>t.length):void 0,P=S.map(([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length})),C=P.map(t=>Array.isArray(s)?s:[s(t)].flat(1));return O.flatMap(t=>{const[e,o,a,s]=E[t],c=P[t],f=A[t];return C[t].map(v=>{var k,M,{scale:O,key:E,facet:S=!0,axis:_={},legend:A={}}=v,P=Ie(v,["scale","key","facet","axis","legend"]);const C=(null===(k=null==O?void 0:O.y)||void 0===k?void 0:k.guide)||_.y,N=(null===(M=null==O?void 0:O.x)||void 0===M?void 0:M.guide)||_.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:m}},I={x:jj(N,n)(c,j),y:jj(C,r)(c,j)};return Object.assign(Object.assign({key:`${E}-${t}`,data:j,margin:0,x:e+y+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:tt(L,O,R),axis:tt({},_,I),legend:!1},P),i)})})}}});function Pj(t){const{points:e}=t;return Bs(e)}function Cj(t,e){return e.length?tt({title:!1,tick:null,label:null},t):tt({title:!1,tick:null,label:null,grid:null},t)}function Nj(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return Cj(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return tt({title:s,grid:c},t)}}function Lj(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return Cj(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return tt({title:o,grid:a},t)}}function jj(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const Rj=()=>t=>[kj.of(t).call(_j).call(Oj).call(Ej).call(Mj).call(Sj).call(Aj).call(Tj).value()];Rj.props={};const Ij=gj(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),Dj=vj(t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(t,a,s)=>{const{x:c,y:l}=a,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),v=ha(t),m=t.map(({points:t})=>Bs(t)),y=t.map(({x:t,y:e})=>[c.invert(t),l.invert(e)]),b=y.map(([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length})),x=b.map(t=>Array.isArray(n)?n:[n(t)].flat(1));return v.flatMap(t=>{const[n,a,s,c]=m[t],[l,p]=y[t],g=b[t];return x[t].map(v=>{var m,y;const{scale:b,key:x,encode:w,axis:k,interaction:M}=v,O=Ie(v,["scale","key","encode","axis","interaction"]),E=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:Fj(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:zj(E)(g,e)};return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+h,y:a+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:tt({x:{facet:!1},y:{facet:!1}},b),axis:tt({x:{tickCount:5},y:{tickCount:5}},k,S),legend:!1,encode:tt({},w,{x:l,y:p}),interaction:tt({},M,{legendFilter:!1})},O)})})}}}),Bj=vj(t=>{const{encode:e}=t,n=Ie(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Ie(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[o].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[o].flat(1).length&&{y:{paddingInner:0}})})});function Fj(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return Cj(t,n)}}function zj(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return Cj(t,n)}}const $j=()=>t=>[kj.of(t).call(_j).call(Oj).call(Dj).call(Bj).call(Ej).call(Sj).call(Ij).value()],Wj=gj(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),Gj=gj(t=>({coordinate:{type:"polar"}})),Hj=t=>{const{encode:e}=t,n=Ie(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function Yj(t){return t=>null}function qj(t){const{points:e}=t,[n,r,i,o]=e,a=js(n,o),s=Ns(n,o),c=Ds(s,Ns(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Is(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const Vj=()=>t=>[kj.of(t).call(_j).call(Hj).call(Oj).call(Gj).call(Aj).call(Tj,qj,Yj,Yj,{frame:!1}).call(Ej).call(Sj).call(Wj).value()];function Uj(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const Xj=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map(t=>Object.assign(Object.assign({},t),{key:s})).map(t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=tt({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=Uj(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};Xj.props={};const Kj=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:c,tooltip:l}=t,u=Ie(t,["type","data","scale","encode","style","animate","key","state","tooltip"]);return[Object.assign(Object.assign({type:"geoView"},u),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:o,animate:a,state:c,tooltip:l}]})]};Kj.props={};var Zj=1e-6,Qj=Math.PI,Jj=Qj/2,tR=Qj/4,eR=2*Qj,nR=180/Qj,rR=Qj/180,iR=Math.abs,oR=Math.atan,aR=Math.atan2,sR=Math.cos,cR=Math.ceil,lR=Math.exp,uR=Math.log,fR=Math.pow,hR=Math.sin,dR=Math.sign||function(t){return t>0?1:t<0?-1:0},pR=Math.sqrt,gR=Math.tan;function vR(t){return t>1?0:t<-1?Qj:Math.acos(t)}function mR(t){return t>1?Jj:t<-1?-Jj:Math.asin(t)}function yR(){}function bR(t,e){t&&wR.hasOwnProperty(t.type)&&wR[t.type](t,e)}var xR={Feature:function(t,e){bR(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)bR(n[r].geometry,e)}},wR={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){kR(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)kR(n[r],e,0)},Polygon:function(t,e){MR(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)MR(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)bR(n[r],e)}};function kR(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function MR(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)kR(t[n],e,1);e.polygonEnd()}function OR(t,e){t&&xR.hasOwnProperty(t.type)?xR[t.type](t,e):bR(t,e)}function ER(t){return[aR(t[1],t[0]),mR(t[2])]}function SR(t){var e=t[0],n=t[1],r=sR(n);return[r*sR(e),r*hR(e),hR(n)]}function _R(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function AR(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function TR(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function PR(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function CR(t){var e=pR(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function NR(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function LR(t,e){return iR(t)>Qj&&(t-=Math.round(t/eR)*eR),[t,e]}function jR(t,e,n){return(t%=eR)?e||n?NR(IR(t),DR(e,n)):IR(t):e||n?DR(e,n):LR}function RR(t){return function(e,n){return iR(e+=t)>Qj&&(e-=Math.round(e/eR)*eR),[e,n]}}function IR(t){var e=RR(t);return e.invert=RR(-t),e}function DR(t,e){var n=sR(t),r=hR(t),i=sR(e),o=hR(e);function a(t,e){var a=sR(e),s=sR(t)*a,c=hR(t)*a,l=hR(e),u=l*n+s*r;return[aR(c*i-u*o,s*n-l*r),mR(u*i+c*o)]}return a.invert=function(t,e){var a=sR(e),s=sR(t)*a,c=hR(t)*a,l=hR(e),u=l*i-c*o;return[aR(c*i+l*o,s*n+u*r),mR(u*n-s*r)]},a}function BR(t,e){(e=SR(e))[0]-=t,CR(e);var n=vR(-e[1]);return((-e[2]<0?-n:n)+eR-Zj)%eR}function FR(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:yR,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function zR(t,e){return iR(t[0]-e[0])<Zj&&iR(t[1]-e[1])<Zj}function $R(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function WR(t,e,n,r,i){var o,a,s=[],c=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(zR(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new $R(r,t,null,!0)),c.push(n.o=new $R(r,null,n,!1)),s.push(n=new $R(a,t,null,!1)),c.push(n.o=new $R(a,null,n,!0))}}),s.length){for(c.sort(e),GR(s),GR(c),o=0,a=c.length;o<a;++o)c[o].e=n=!n;for(var l,u,f=s[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(o=0,a=l.length;o<a;++o)i.point((u=l[o])[0],u[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,o=l.length-1;o>=0;--o)i.point((u=l[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function GR(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function HR(t){return iR(t[0])<=Qj?t[0]:dR(t[0])*((iR(t[0])+Qj)%eR-Qj)}function YR(t,e,n,r){return function(i){var o,a,s,c=e(i),l=FR(),u=e(l),f=!1,h={point:d,lineStart:g,lineEnd:v,polygonStart:function(){h.point=m,h.lineStart=y,h.lineEnd=b,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=v,a=Cr(a);var t=function(t,e){var n=HR(e),r=e[1],i=hR(r),o=[hR(n),-sR(n),0],a=0,s=0,c=new Qn;1===i?r=Jj+Zj:-1===i&&(r=-Jj-Zj);for(var l=0,u=t.length;l<u;++l)if(h=(f=t[l]).length)for(var f,h,d=f[h-1],p=HR(d),g=d[1]/2+tR,v=hR(g),m=sR(g),y=0;y<h;++y,p=x,v=k,m=M,d=b){var b=f[y],x=HR(b),w=b[1]/2+tR,k=hR(w),M=sR(w),O=x-p,E=O>=0?1:-1,S=E*O,_=S>Qj,A=v*k;if(c.add(aR(A*E*hR(S),m*M+A*sR(S))),a+=_?O+E*eR:O,_^p>=n^x>=n){var T=AR(SR(d),SR(b));CR(T);var P=AR(o,T);CR(P);var C=(_^O>=0?-1:1)*mR(P[2]);(r>C||r===C&&(T[0]||T[1]))&&(s+=_^O>=0?1:-1)}}return(a<-Zj||a<Zj&&c<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),WR(a,VR,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){c.point(t,e)}function g(){h.point=p,c.lineStart()}function v(){h.point=d,c.lineEnd()}function m(t,e){s.push([t,e]),u.point(t,e)}function y(){u.lineStart(),s=[]}function b(){m(s[0][0],s[0][1]),u.lineEnd();var t,e,n,r,c=u.clean(),h=l.result(),d=h.length;if(s.pop(),o.push(s),s=null,d)if(1&c){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(qR))}return h}}function qR(t){return t.length>1}function VR(t,e){return((t=t.x)[0]<0?t[1]-Jj-Zj:Jj-t[1])-((e=e.x)[0]<0?e[1]-Jj-Zj:Jj-e[1])}LR.invert=LR;var UR=YR(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Qj:-Qj,c=iR(o-n);iR(c-Qj)<Zj?(t.point(n,r=(r+a)/2>0?Jj:-Jj),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&c>=Qj&&(iR(n-i)<Zj&&(n-=i*Zj),iR(o-s)<Zj&&(o-=s*Zj),r=function(t,e,n,r){var i,o,a=hR(t-n);return iR(a)>Zj?oR((hR(e)*(o=sR(r))*hR(n)-hR(r)*(i=sR(e))*hR(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Jj,r.point(-Qj,i),r.point(0,i),r.point(Qj,i),r.point(Qj,0),r.point(Qj,-i),r.point(0,-i),r.point(-Qj,-i),r.point(-Qj,0),r.point(-Qj,i);else if(iR(t[0]-e[0])>Zj){var o=t[0]<e[0]?Qj:-Qj;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-Qj,-Jj]);function XR(t){var e=sR(t),n=2*rR,r=e>0,i=iR(e)>Zj;function o(t,n){return sR(t)*sR(n)>e}function a(t,n,r){var i=[1,0,0],o=AR(SR(t),SR(n)),a=_R(o,o),s=o[0],c=a-s*s;if(!c)return!r&&t;var l=e*a/c,u=-e*s/c,f=AR(i,o),h=PR(i,l);TR(h,PR(o,u));var d=f,p=_R(h,d),g=_R(d,d),v=p*p-g*(_R(h,h)-1);if(!(v<0)){var m=pR(v),y=PR(d,(-p-m)/g);if(TR(y,h),y=ER(y),!r)return y;var b,x=t[0],w=n[0],k=t[1],M=n[1];w<x&&(b=x,x=w,w=b);var O=w-x,E=iR(O-Qj)<Zj;if(!E&&M<k&&(b=k,k=M,M=b),E||O<Zj?E?k+M>0^y[1]<(iR(y[0]-x)<Zj?k:M):k<=y[1]&&y[1]<=M:O>Qj^(x<=y[0]&&y[0]<=w)){var S=PR(d,(-p+m)/g);return TR(S,h),[y,ER(S)]}}}function s(e,n){var i=r?t:Qj-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return YR(o,function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(f,h){var d,p=[f,h],g=o(f,h),v=r?g?0:s(f,h):g?s(f+(f<0?Qj:-Qj),h):0;if(!e&&(l=c=g)&&t.lineStart(),g!==c&&(!(d=a(e,p))||zR(e,d)||zR(p,d))&&(p[2]=1),g!==c)u=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var m;v&n||!(m=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||e&&zR(e,p)||t.point(p[0],p[1]),e=p,c=g,n=v},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}},function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var a=sR(e),s=hR(e),c=r*n;null==i?(i=e+r*eR,o=e-c/2):(i=BR(a,i),o=BR(a,o),(r>0?i<o:i>o)&&(i+=r*eR));for(var l,u=i;r>0?u>o:u<o;u-=c)l=ER([a,-s*sR(u),-s*hR(u)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)},r?[0,-t]:[-Qj,t-Qj])}var KR=1e9,ZR=-KR;function QR(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var u=0,f=0;if(null==i||(u=a(i,s))!==(f=a(o,s))||c(i,o)<0^s>0)do{l.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return iR(r[0]-t)<Zj?i>0?0:3:iR(r[0]-n)<Zj?i>0?2:1:iR(r[1]-e)<Zj?i>0?1:0:i>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,l,u,f,h,d,p,g,v,m,y,b=a,x=FR(),w={point:k,lineStart:function(){w.point=M,l&&l.push(u=[]);m=!0,v=!1,p=g=NaN},lineEnd:function(){c&&(M(f,h),d&&v&&x.rejoin(),c.push(x.result()));w.point=k,v&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,s=l[n],c=1,u=s.length,f=s[0],h=f[0],d=f[1];c<u;++c)o=h,a=d,h=(f=s[c])[0],d=f[1],a<=r?d>r&&(h-o)*(r-a)>(d-a)*(t-o)&&++e:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--e;return e}(),n=y&&e,i=(c=Cr(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&WR(c,s,e,o,a),a.polygonEnd());b=a,c=l=u=null}};function k(t,e){i(t,e)&&b.point(t,e)}function M(o,a){var s=i(o,a);if(l&&u.push([o,a]),m)f=o,h=a,d=s,m=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&v)b.point(o,a);else{var c=[p=Math.max(ZR,Math.min(KR,p)),g=Math.max(ZR,Math.min(KR,g))],x=[o=Math.max(ZR,Math.min(KR,o)),a=Math.max(ZR,Math.min(KR,a))];!function(t,e,n,r,i,o){var a,s=t[0],c=t[1],l=0,u=1,f=e[0]-s,h=e[1]-c;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<u&&(u=a)}else if(f>0){if(a>u)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>u)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<u&&(u=a)}if(a=r-c,h||!(a>0)){if(a/=h,h<0){if(a<l)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>l&&(l=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>l&&(l=a)}else if(h>0){if(a<l)return;a<u&&(u=a)}return l>0&&(t[0]=s+l*f,t[1]=c+l*h),u<1&&(e[0]=s+u*f,e[1]=c+u*h),!0}}}}}(c,x,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),y=!1):(v||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),y=!1)}p=o,g=a,v=s}return w}}function JR(t,e,n){var r=Nr(t,e-Zj,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function tI(t,e,n){var r=Nr(t,e-Zj,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function eI(){return function(){var t,e,n,r,i,o,a,s,c,l,u,f,h=10,d=h,p=90,g=360,v=2.5;function m(){return{type:"MultiLineString",coordinates:y()}}function y(){return Nr(cR(r/p)*p,n,p).map(u).concat(Nr(cR(s/g)*g,a,g).map(f)).concat(Nr(cR(e/h)*h,t,h).filter(function(t){return iR(t%p)>Zj}).map(c)).concat(Nr(cR(o/d)*d,i,d).filter(function(t){return iR(t%g)>Zj}).map(l))}return m.lines=function(){return y().map(function(t){return{type:"LineString",coordinates:t}})},m.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),m.precision(v)):[[r,s],[n,a]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),m.precision(v)):[[e,o],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],m):[p,g]},m.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],m):[h,d]},m.precision=function(h){return arguments.length?(v=+h,c=JR(o,i,90),l=tI(e,t,v),u=JR(s,a,90),f=tI(r,n,v),m):v},m.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}var nI,rI,iI,oI,aI=t=>t,sI=new Qn,cI=new Qn,lI={point:yR,lineStart:yR,lineEnd:yR,polygonStart:function(){lI.lineStart=uI,lI.lineEnd=dI},polygonEnd:function(){lI.lineStart=lI.lineEnd=lI.point=yR,sI.add(iR(cI)),cI=new Qn},result:function(){var t=sI/2;return sI=new Qn,t}};function uI(){lI.point=fI}function fI(t,e){lI.point=hI,nI=iI=t,rI=oI=e}function hI(t,e){cI.add(oI*t-iI*e),iI=t,oI=e}function dI(){hI(nI,rI)}var pI=lI,gI=1/0,vI=gI,mI=-gI,yI=mI,bI={point:function(t,e){t<gI&&(gI=t);t>mI&&(mI=t);e<vI&&(vI=e);e>yI&&(yI=e)},lineStart:yR,lineEnd:yR,polygonStart:yR,polygonEnd:yR,result:function(){var t=[[gI,vI],[mI,yI]];return mI=yI=-(vI=gI=1/0),t}};var xI,wI,kI,MI,OI=bI,EI=0,SI=0,_I=0,AI=0,TI=0,PI=0,CI=0,NI=0,LI=0,jI={point:RI,lineStart:II,lineEnd:FI,polygonStart:function(){jI.lineStart=zI,jI.lineEnd=$I},polygonEnd:function(){jI.point=RI,jI.lineStart=II,jI.lineEnd=FI},result:function(){var t=LI?[CI/LI,NI/LI]:PI?[AI/PI,TI/PI]:_I?[EI/_I,SI/_I]:[NaN,NaN];return EI=SI=_I=AI=TI=PI=CI=NI=LI=0,t}};function RI(t,e){EI+=t,SI+=e,++_I}function II(){jI.point=DI}function DI(t,e){jI.point=BI,RI(kI=t,MI=e)}function BI(t,e){var n=t-kI,r=e-MI,i=pR(n*n+r*r);AI+=i*(kI+t)/2,TI+=i*(MI+e)/2,PI+=i,RI(kI=t,MI=e)}function FI(){jI.point=RI}function zI(){jI.point=WI}function $I(){GI(xI,wI)}function WI(t,e){jI.point=GI,RI(xI=kI=t,wI=MI=e)}function GI(t,e){var n=t-kI,r=e-MI,i=pR(n*n+r*r);AI+=i*(kI+t)/2,TI+=i*(MI+e)/2,PI+=i,CI+=(i=MI*t-kI*e)*(kI+t),NI+=i*(MI+e),LI+=3*i,RI(kI=t,MI=e)}var HI=jI;function YI(t){this._context=t}YI.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,eR)}},result:yR};var qI,VI,UI,XI,KI,ZI=new Qn,QI={point:yR,lineStart:function(){QI.point=JI},lineEnd:function(){qI&&tD(VI,UI),QI.point=yR},polygonStart:function(){qI=!0},polygonEnd:function(){qI=null},result:function(){var t=+ZI;return ZI=new Qn,t}};function JI(t,e){QI.point=tD,VI=XI=t,UI=KI=e}function tD(t,e){XI-=t,KI-=e,ZI.add(pR(XI*XI+KI*KI)),XI=t,KI=e}var eD=QI;let nD,rD,iD,oD;class aD{constructor(t){this._append=null==t?sD:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return sD;if(e!==nD){const t=10**e;nD=e,rD=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return rD}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==iD||this._append!==rD){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,iD=t,rD=this._append,oD=this._,this._=e}this._+=oD}}result(){const t=this._;return this._="",t.length?t:null}}function sD(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function cD(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),OR(t,n(r))),r.result()}return a.area=function(t){return OR(t,n(pI)),pI.result()},a.measure=function(t){return OR(t,n(eD)),eD.result()},a.bounds=function(t){return OR(t,n(OI)),OI.result()},a.centroid=function(t){return OR(t,n(HI)),HI.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,aI):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new aD(i)):new YI(e=t),"function"!=typeof o&&r.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new aD(i)),a},a.projection(t).digits(i).context(e)}function lD(t){return function(e){var n=new uD;for(var r in t)n[r]=t[r];return n.stream=e,n}}function uD(){}function fD(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),OR(n,t.stream(OI)),e(OI.result()),null!=r&&t.clipExtent(r),t}function hD(t,e,n){return fD(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])},n)}function dD(t,e,n){return hD(t,[[0,0],e],n)}function pD(t,e,n){return fD(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])},n)}function gD(t,e,n){return fD(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])},n)}uD.prototype={constructor:uD,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var vD=sR(30*rR);function mD(t,e){return+e?function(t,e){function n(r,i,o,a,s,c,l,u,f,h,d,p,g,v){var m=l-r,y=u-i,b=m*m+y*y;if(b>4*e&&g--){var x=a+h,w=s+d,k=c+p,M=pR(x*x+w*w+k*k),O=mR(k/=M),E=iR(iR(k)-1)<Zj||iR(o-f)<Zj?(o+f)/2:aR(w,x),S=t(E,O),_=S[0],A=S[1],T=_-r,P=A-i,C=y*T-m*P;(C*C/b>e||iR((m*T+y*P)/b-.5)>.3||a*h+s*d+c*p<vD)&&(n(r,i,o,a,s,c,_,A,E,x/=M,w/=M,k,g,v),v.point(_,A),n(_,A,E,x,w,k,l,u,f,h,d,p,g,v))}}return function(e){var r,i,o,a,s,c,l,u,f,h,d,p,g={point:v,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=m}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){u=NaN,g.point=y,e.lineStart()}function y(r,i){var o=SR([r,i]),a=t(r,i);n(u,f,l,h,d,p,u=a[0],f=a[1],l=r,h=o[0],d=o[1],p=o[2],16,e),e.point(u,f)}function b(){g.point=v,e.lineEnd()}function x(){m(),g.point=w,g.lineEnd=k}function w(t,e){y(r=t,e),i=u,o=f,a=h,s=d,c=p,g.point=y}function k(){n(u,f,l,h,d,p,i,o,r,a,s,c,16,e),g.lineEnd=b,b()}return g}}(t,e):function(t){return lD({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var yD=lD({point:function(t,e){this.stream.point(t*rR,e*rR)}});function bD(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=sR(o),s=hR(o),c=a*t,l=s*t,u=a/t,f=s/t,h=(s*n-a*e)/t,d=(s*e+a*n)/t;function p(t,o){return[c*(t*=r)-l*(o*=i)+e,n-l*t-c*o]}return p.invert=function(t,e){return[r*(u*t-f*e+h),i*(d-f*t-u*e)]},p}function xD(t){return wD(function(){return t})()}function wD(t){var e,n,r,i,o,a,s,c,l,u,f=150,h=480,d=250,p=0,g=0,v=0,m=0,y=0,b=0,x=1,w=1,k=null,M=UR,O=null,E=aI,S=.5;function _(t){return c(t[0]*rR,t[1]*rR)}function A(t){return(t=c.invert(t[0],t[1]))&&[t[0]*nR,t[1]*nR]}function T(){var t=bD(f,0,0,x,w,b).apply(null,e(p,g)),r=bD(f,h-t[0],d-t[1],x,w,b);return n=jR(v,m,y),s=NR(e,r),c=NR(n,s),a=mD(s,S),P()}function P(){return l=u=null,_}return _.stream=function(t){return l&&u===t?l:l=yD(function(t){return lD({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(a(E(u=t)))))},_.preclip=function(t){return arguments.length?(M=t,k=void 0,P()):M},_.postclip=function(t){return arguments.length?(E=t,O=r=i=o=null,P()):E},_.clipAngle=function(t){return arguments.length?(M=+t?XR(k=t*rR):(k=null,UR),P()):k*nR},_.clipExtent=function(t){return arguments.length?(E=null==t?(O=r=i=o=null,aI):QR(O=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==O?null:[[O,r],[i,o]]},_.scale=function(t){return arguments.length?(f=+t,T()):f},_.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],T()):[h,d]},_.center=function(t){return arguments.length?(p=t[0]%360*rR,g=t[1]%360*rR,T()):[p*nR,g*nR]},_.rotate=function(t){return arguments.length?(v=t[0]%360*rR,m=t[1]%360*rR,y=t.length>2?t[2]%360*rR:0,T()):[v*nR,m*nR,y*nR]},_.angle=function(t){return arguments.length?(b=t%360*rR,T()):b*nR},_.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},_.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},_.precision=function(t){return arguments.length?(a=mD(s,S=t*t),P()):pR(S)},_.fitExtent=function(t,e){return hD(_,t,e)},_.fitSize=function(t,e){return dD(_,t,e)},_.fitWidth=function(t,e){return pD(_,t,e)},_.fitHeight=function(t,e){return gD(_,t,e)},function(){return e=t.apply(this,arguments),_.invert=e.invert&&A,T()}}function kD(t){var e=0,n=Qj/3,r=wD(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*rR,n=t[1]*rR):[e*nR,n*nR]},i}function MD(t,e){var n=hR(t),r=(n+hR(e))/2;if(iR(r)<Zj)return function(t){var e=sR(t);function n(t,n){return[t*e,hR(n)/e]}return n.invert=function(t,n){return[t/e,mR(n*e)]},n}(t);var i=1+n*(2*r-n),o=pR(i)/r;function a(t,e){var n=pR(i-2*r*hR(e))/r;return[n*hR(t*=r),o-n*sR(t)]}return a.invert=function(t,e){var n=o-e,a=aR(t,iR(n))*dR(n);return n*r<0&&(a-=Qj*dR(t)*dR(n)),[a/r,mR((i-(t*t+n*n)*r*r)/(2*r))]},a}function OD(){return kD(MD).scale(155.424).center([0,33.6442])}function ED(){return OD().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function SD(t){return function(e,n){var r=sR(e),i=sR(n),o=t(r*i);return o===1/0?[2,0]:[o*i*hR(e),o*hR(n)]}}function _D(t){return function(e,n){var r=pR(e*e+n*n),i=t(r),o=hR(i),a=sR(i);return[aR(e*o,r*a),mR(r&&n*o/r)]}}var AD=SD(function(t){return pR(2/(1+t))});AD.invert=_D(function(t){return 2*mR(t/2)});var TD=SD(function(t){return(t=vR(t))&&t/hR(t)});function PD(t,e){return[t,uR(gR((Jj+e)/2))]}function CD(t){var e,n,r,i=xD(t),o=i.center,a=i.scale,s=i.translate,c=i.clipExtent,l=null;function u(){var o=Qj*a(),s=i(function(t){function e(e){return(e=t(e[0]*rR,e[1]*rR))[0]*=nR,e[1]*=nR,e}return t=jR(t[0]*rR,t[1]*rR,t.length>2?t[2]*rR:0),e.invert=function(e){return(e=t.invert(e[0]*rR,e[1]*rR))[0]*=nR,e[1]*=nR,e},e}(i.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===PD?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),u()):a()},i.translate=function(t){return arguments.length?(s(t),u()):s()},i.center=function(t){return arguments.length?(o(t),u()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),u()):null==l?null:[[l,e],[n,r]]},u()}function ND(t){return gR((Jj+t)/2)}function LD(t,e){var n=sR(t),r=t===e?hR(t):uR(n/sR(e))/uR(ND(e)/ND(t)),i=n*fR(ND(t),r)/r;if(!r)return PD;function o(t,e){i>0?e<-Jj+Zj&&(e=-Jj+Zj):e>Jj-Zj&&(e=Jj-Zj);var n=i/fR(ND(e),r);return[n*hR(r*t),i-n*sR(r*t)]}return o.invert=function(t,e){var n=i-e,o=dR(r)*pR(t*t+n*n),a=aR(t,iR(n))*dR(n);return n*r<0&&(a-=Qj*dR(t)*dR(n)),[a/r,2*oR(fR(i/o,1/r))-Jj]},o}function jD(t,e){return[t,e]}function RD(t,e){var n=sR(t),r=t===e?hR(t):(n-sR(e))/(e-t),i=n/r+t;if(iR(r)<Zj)return jD;function o(t,e){var n=i-e,o=r*t;return[n*hR(o),i-n*sR(o)]}return o.invert=function(t,e){var n=i-e,o=aR(t,iR(n))*dR(n);return n*r<0&&(o-=Qj*dR(t)*dR(n)),[o/r,i-dR(r)*pR(t*t+n*n)]},o}TD.invert=_D(function(t){return t}),PD.invert=function(t,e){return[t,2*oR(lR(e))-Jj]},jD.invert=jD;var ID=1.340264,DD=-.081106,BD=893e-6,FD=.003796,zD=pR(3)/2;function $D(t,e){var n=mR(zD*hR(e)),r=n*n,i=r*r*r;return[t*sR(n)/(zD*(ID+3*DD*r+i*(7*BD+9*FD*r))),n*(ID+DD*r+i*(BD+FD*r))]}function WD(t,e){var n=sR(e),r=sR(t)*n;return[n*hR(t)/r,hR(e)/r]}function GD(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function HD(t,e){return[sR(e)*hR(t),hR(e)]}function YD(t,e){var n=sR(e),r=1+sR(t)*n;return[n*hR(t)/r,hR(e)/r]}function qD(t,e){return[uR(gR((Jj+e)/2)),-t]}$D.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(ID+DD*i+o*(BD+FD*i))-e)/(ID+3*DD*i+o*(7*BD+9*FD*i)))*r)*i*i,!(iR(n)<1e-12));++a);return[zD*t*(ID+3*DD*i+o*(7*BD+9*FD*i))/sR(r),mR(hR(r)/zD)]},WD.invert=_D(oR),GD.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(iR(n)>Zj&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},HD.invert=_D(mR),YD.invert=_D(function(t){return 2*oR(t)}),qD.invert=function(t,e){return[-e,2*oR(lR(t))-Jj]};var VD=Object.freeze({__proto__:null,geoAlbersUsa:function(){var t,e,n,r,i,o,a=ED(),s=OD().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=OD().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),s.stream(n),c.stream(n)])},u.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),c.precision(t),f()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),c.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(l),r=s.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+Zj,u+.12*e+Zj],[o-.214*e-Zj,u+.234*e-Zj]]).stream(l),i=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+Zj,u+.166*e+Zj],[o-.115*e-Zj,u+.234*e-Zj]]).stream(l),f()},u.fitExtent=function(t,e){return hD(u,t,e)},u.fitSize=function(t,e){return dD(u,t,e)},u.fitWidth=function(t,e){return pD(u,t,e)},u.fitHeight=function(t,e){return gD(u,t,e)},u.scale(1070)},geoAlbers:ED,geoAzimuthalEqualArea:function(){return xD(AD).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:AD,geoAzimuthalEquidistant:function(){return xD(TD).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:TD,geoConicConformal:function(){return kD(LD).scale(109.5).parallels([30,30])},geoConicConformalRaw:LD,geoConicEqualArea:OD,geoConicEqualAreaRaw:MD,geoConicEquidistant:function(){return kD(RD).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:RD,geoEqualEarth:function(){return xD($D).scale(177.158)},geoEqualEarthRaw:$D,geoEquirectangular:function(){return xD(jD).scale(152.63)},geoEquirectangularRaw:jD,geoGnomonic:function(){return xD(WD).scale(144.049).clipAngle(60)},geoGnomonicRaw:WD,geoIdentity:function(){var t,e,n,r,i,o,a,s=1,c=0,l=0,u=1,f=1,h=0,d=null,p=1,g=1,v=lD({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),m=aI;function y(){return p=s*u,g=s*f,o=a=null,b}function b(n){var r=n[0]*p,i=n[1]*g;if(h){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+c,i+l]}return b.invert=function(n){var r=n[0]-c,i=n[1]-l;if(h){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/g]},b.stream=function(t){return o&&a===t?o:o=v(m(a=t))},b.postclip=function(t){return arguments.length?(m=t,d=n=r=i=null,y()):m},b.clipExtent=function(t){return arguments.length?(m=null==t?(d=n=r=i=null,aI):QR(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),y()):null==d?null:[[d,n],[r,i]]},b.scale=function(t){return arguments.length?(s=+t,y()):s},b.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],y()):[c,l]},b.angle=function(n){return arguments.length?(e=hR(h=n%360*rR),t=sR(h),y()):h*nR},b.reflectX=function(t){return arguments.length?(u=t?-1:1,y()):u<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,y()):f<0},b.fitExtent=function(t,e){return hD(b,t,e)},b.fitSize=function(t,e){return dD(b,t,e)},b.fitWidth=function(t,e){return pD(b,t,e)},b.fitHeight=function(t,e){return gD(b,t,e)},b},geoProjection:xD,geoProjectionMutator:wD,geoMercator:function(){return CD(PD).scale(961/eR)},geoMercatorRaw:PD,geoNaturalEarth1:function(){return xD(GD).scale(175.295)},geoNaturalEarth1Raw:GD,geoOrthographic:function(){return xD(HD).scale(249.5).clipAngle(90.000001)},geoOrthographicRaw:HD,geoStereographic:function(){return xD(YD).scale(250).clipAngle(142)},geoStereographicRaw:YD,geoTransverseMercator:function(){var t=CD(qD),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:qD});function UD(t,e,n,r){const i=()=>{const t=e.filter(KD),n=t.find(t=>t.sphere);return n?{type:"Sphere"}:(r=t.filter(t=>!t.sphere).flatMap(t=>t.data.value),{type:"FeatureCollection",features:r.flatMap(t=>function(t){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];return n?"geometry"===n?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===n?{type:"FeatureCollection",features:[t]}:"featureCollection"===n?t:void 0:null}(t).features)});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;return"fitExtent"===a?function(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}(t,o,n):"fitWidth"===a?function(t,e,n){const{width:r,height:i}=n,[[o,a],[s,c]]=cD(t.fitWidth(r,e)).bounds(e),l=Math.ceil(c-a),u=Math.min(Math.ceil(s-o),l),f=t.scale()*(u-1)/u,[h,d]=t.translate(),p=d+(i-l)/2;t.scale(f).translate([h,p]).precision(.2)}(t,o,n):void 0}function XD(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return"graticule10"===n?Object.assign(Object.assign({},t),{data:{value:[eI()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function KD(t){return"geoPath"===t.type}const ZD=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=Ie(n,["type"]),o=function(t){if("function"==typeof t)return t;const e=`geo${G(t)}`,n=VD[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}(r),a=e.map(e=>Object.assign(Object.assign({},e),{data:mj(e.data,t.data)})).map(XD);let s;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const c=o();UD(c,a,{x:t,y:e,width:n,height:r},i),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(c,i),s=cD(c);const l=new bo({domain:[t,t+n]}),u=new bo({domain:[e,e+r]});return{transform:t=>(t=>{const e=c(t);if(!e)return[null,null];const[n,r]=e;return[l.map(n),u.map(r)]})(t),untransform:t=>(t=>{if(!t)return null;const[e,n]=t,r=[l.invert(e),u.invert(n)];return c.invert(r)})(t)}}]]}},children:a.flatMap(t=>KD(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:iS(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>s(t)||[]})})}(t):t)})]};function QD(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=aG(o,t=>"element"===t.className);const c=function(t){return aG(t,t=>"component"===t.className)}(o),l=function(t){return aG(t,t=>"label"===t.className)}(o),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:Xo(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${a}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${a}:${t}`,d))}}function JD(){return(t,e,n)=>{const{container:r,view:i}=t,o=QD(NN.CLICK,i,n,t=>1===t.detail),a=QD(NN.DBLCLICK,i,n,t=>2===t.detail),s=QD(NN.POINTER_TAP,i,n),c=QD(NN.POINTER_DOWN,i,n),l=QD(NN.POINTER_UP,i,n),u=QD(NN.POINTER_OVER,i,n),f=QD(NN.POINTER_OUT,i,n),h=QD(NN.POINTER_MOVE,i,n),d=QD(NN.POINTER_ENTER,i,n),p=QD(NN.POINTER_LEAVE,i,n),g=QD(NN.POINTER_UPOUTSIDE,i,n),v=QD(NN.DRAG_START,i,n),m=QD(NN.DRAG,i,n),y=QD(NN.DRAG_END,i,n),b=QD(NN.DRAG_ENTER,i,n),x=QD(NN.DRAG_LEAVE,i,n),w=QD(NN.DRAG_OVER,i,n),k=QD(NN.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function tB(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":uP,"component.axisLinear":oP,"component.axisArc":aP,"component.legendContinuousBlock":kP,"component.legendContinuousBlockSize":OP,"component.legendContinuousSize":MP,"interaction.event":JD,"composition.mark":wj,"composition.view":xj,"shape.label.label":wO,"shape.break":JO}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||ta(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Ie(t,["type"]);n||ta("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function eB(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||ta("Cannot find library document")}function nB(t,e){const{coordinate:n={},coordinates:r}=t,i=Ie(t,["coordinate","coordinates"]);if(r)return t;const{type:o,transform:a=[]}=n,s=Ie(n,["type","transform"]);if(!o)return Object.assign(Object.assign({},i),{coordinates:a});const[,c]=tB("coordinate",e),{transform:l=!1}=c(o).props||{};if(l)throw new Error(`Unknown coordinate: ${o}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:o},s),...a]})}function rB(t,e){return t.filter(t=>t.type===e)}function iB(t){return rB(t,"polar").length>0}function oB(t){return rB(t,"transpose").length%2==1}function aB(t){return rB(t,"theta").length>0}function sB(t){return rB(t,"radial").length>0}function cB(t){return rB(t,"radar").length>0}function lB(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}ZD.props={},JD.props={reapplyWhenUpdate:!0};var uB=lB("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),fB=lB("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),hB=lB("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),dB=lB("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),pB=lB("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),gB=lB("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),vB=lB("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),mB=lB("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),yB=lB("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),bB=lB("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),xB=lB("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function wB(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function kB(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function MB(){}var OB=.7,EB=1/OB,SB="\\s*([+-]?\\d+)\\s*",_B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",AB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TB=/^#([0-9a-f]{3,8})$/,PB=new RegExp(`^rgb\\(${SB},${SB},${SB}\\)$`),CB=new RegExp(`^rgb\\(${AB},${AB},${AB}\\)$`),NB=new RegExp(`^rgba\\(${SB},${SB},${SB},${_B}\\)$`),LB=new RegExp(`^rgba\\(${AB},${AB},${AB},${_B}\\)$`),jB=new RegExp(`^hsl\\(${_B},${AB},${AB}\\)$`),RB=new RegExp(`^hsla\\(${_B},${AB},${AB},${_B}\\)$`),IB={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function DB(){return this.rgb().formatHex()}function BB(){return this.rgb().formatRgb()}function FB(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=TB.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?zB(e):3===n?new HB(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?$B(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?$B(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=PB.exec(t))?new HB(e[1],e[2],e[3],1):(e=CB.exec(t))?new HB(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=NB.exec(t))?$B(e[1],e[2],e[3],e[4]):(e=LB.exec(t))?$B(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=jB.exec(t))?KB(e[1],e[2]/100,e[3]/100,1):(e=RB.exec(t))?KB(e[1],e[2]/100,e[3]/100,e[4]):IB.hasOwnProperty(t)?zB(IB[t]):"transparent"===t?new HB(NaN,NaN,NaN,0):null}function zB(t){return new HB(t>>16&255,t>>8&255,255&t,1)}function $B(t,e,n,r){return r<=0&&(t=e=n=NaN),new HB(t,e,n,r)}function WB(t){return t instanceof MB||(t=FB(t)),t?new HB((t=t.rgb()).r,t.g,t.b,t.opacity):new HB}function GB(t,e,n,r){return 1===arguments.length?WB(t):new HB(t,e,n,null==r?1:r)}function HB(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function YB(){return`#${XB(this.r)}${XB(this.g)}${XB(this.b)}`}function qB(){const t=VB(this.opacity);return`${1===t?"rgb(":"rgba("}${UB(this.r)}, ${UB(this.g)}, ${UB(this.b)}${1===t?")":`, ${t})`}`}function VB(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function UB(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function XB(t){return((t=UB(t))<16?"0":"")+t.toString(16)}function KB(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new QB(t,e,n,r)}function ZB(t){if(t instanceof QB)return new QB(t.h,t.s,t.l,t.opacity);if(t instanceof MB||(t=FB(t)),!t)return new QB;if(t instanceof QB)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new QB(a,s,c,t.opacity)}function QB(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function JB(t){return(t=(t||0)%360)<0?t+360:t}function tF(t){return Math.max(0,Math.min(1,t||0))}function eF(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}wB(MB,FB,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:DB,formatHex:DB,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ZB(this).formatHsl()},formatRgb:BB,toString:BB}),wB(HB,GB,kB(MB,{brighter(t){return t=null==t?EB:Math.pow(EB,t),new HB(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?OB:Math.pow(OB,t),new HB(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new HB(UB(this.r),UB(this.g),UB(this.b),VB(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:YB,formatHex:YB,formatHex8:function(){return`#${XB(this.r)}${XB(this.g)}${XB(this.b)}${XB(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:qB,toString:qB})),wB(QB,function(t,e,n,r){return 1===arguments.length?ZB(t):new QB(t,e,n,null==r?1:r)},kB(MB,{brighter(t){return t=null==t?EB:Math.pow(EB,t),new QB(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?OB:Math.pow(OB,t),new QB(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new HB(eF(t>=240?t-240:t+120,i,r),eF(t,i,r),eF(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new QB(JB(this.h),tF(this.s),tF(this.l),VB(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=VB(this.opacity);return`${1===t?"hsl(":"hsla("}${JB(this.h)}, ${100*tF(this.s)}%, ${100*tF(this.l)}%${1===t?")":`, ${t})`}`}}));const nF=Math.PI/180,rF=180/Math.PI;var iF=-.14861,oF=1.78277,aF=-.29227,sF=-.90649,cF=1.97294,lF=cF*sF,uF=cF*oF,fF=oF*aF-sF*iF;function hF(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof dF)return new dF(t.h,t.s,t.l,t.opacity);t instanceof HB||(t=WB(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(fF*r+lF*e-uF*n)/(fF+lF-uF),o=r-i,a=(cF*(n-i)-aF*o)/sF,s=Math.sqrt(a*a+o*o)/(cF*i*(1-i)),c=s?Math.atan2(a,o)*rF-120:NaN;return new dF(c<0?c+360:c,s,i,t.opacity)}(t):new dF(t,e,n,null==r?1:r)}function dF(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}wB(dF,hF,kB(MB,{brighter(t){return t=null==t?EB:Math.pow(EB,t),new dF(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?OB:Math.pow(OB,t),new dF(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*nF,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new HB(255*(e+n*(iF*r+oF*i)),255*(e+n*(aF*r+sF*i)),255*(e+n*(cF*r)),this.opacity)}}));var pF=t=>()=>t;function gF(t,e){return function(n){return t+n*e}}function vF(t){return 1===(t=+t)?mF:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):pF(isNaN(e)?n:e)}}function mF(t,e){var n=e-t;return n?gF(t,n):pF(isNaN(t)?e:t)}!function t(e){var n=vF(e);function r(t,e){var r=n((t=GB(t)).r,(e=GB(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=mF(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var yF,bF=(yF=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=GB(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=yF(i),o=yF(o),a=yF(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function xF(t){return function e(n){function r(e,r){var i=t((e=hF(e)).h,(r=hF(r)).h),o=mF(e.s,r.s),a=mF(e.l,r.l),s=mF(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}xF(function(t,e){var n=e-t;return n?gF(t,n>180||n<-180?n-360*Math.round(n/360):n):pF(isNaN(t)?e:t)});var wF=xF(mF),kF=t=>bF(t[t.length-1]),MF=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(lB),OF=kF(MF),EF=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(lB),SF=kF(EF),_F=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(lB),AF=kF(_F),TF=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(lB),PF=kF(TF),CF=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(lB),NF=kF(CF),LF=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(lB),jF=kF(LF),RF=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(lB),IF=kF(RF),DF=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(lB),BF=kF(DF),FF=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(lB),zF=kF(FF),$F=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(lB),WF=kF($F),GF=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(lB),HF=kF(GF),YF=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(lB),qF=kF(YF),VF=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(lB),UF=kF(VF),XF=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(lB),KF=kF(XF),ZF=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(lB),QF=kF(ZF),JF=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(lB),tz=kF(JF),ez=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(lB),nz=kF(ez),rz=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(lB),iz=kF(rz),oz=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(lB),az=kF(oz),sz=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(lB),cz=kF(sz),lz=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(lB),uz=kF(lz),fz=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(lB),hz=kF(fz),dz=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(lB),pz=kF(dz),gz=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(lB),vz=kF(gz),mz=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(lB),yz=kF(mz),bz=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(lB),xz=kF(bz),wz=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(lB),kz=kF(wz);var Mz=wF(hF(300,.5,0),hF(-240,.5,1)),Oz=wF(hF(-100,.75,.35),hF(80,1.5,.8)),Ez=wF(hF(260,.75,.35),hF(80,1.5,.8)),Sz=hF();var _z=GB(),Az=Math.PI/3,Tz=2*Math.PI/3;function Pz(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Cz=Pz(lB("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Nz=Pz(lB("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Lz=Pz(lB("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),jz=Pz(lB("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Rz=Object.freeze({__proto__:null,schemeCategory10:uB,schemeAccent:fB,schemeDark2:hB,schemeObservable10:dB,schemePaired:pB,schemePastel1:gB,schemePastel2:vB,schemeSet1:mB,schemeSet2:yB,schemeSet3:bB,schemeTableau10:xB,interpolateBrBG:OF,schemeBrBG:MF,interpolatePRGn:SF,schemePRGn:EF,interpolatePiYG:AF,schemePiYG:_F,interpolatePuOr:PF,schemePuOr:TF,interpolateRdBu:NF,schemeRdBu:CF,interpolateRdGy:jF,schemeRdGy:LF,interpolateRdYlBu:IF,schemeRdYlBu:RF,interpolateRdYlGn:BF,schemeRdYlGn:DF,interpolateSpectral:zF,schemeSpectral:FF,interpolateBuGn:WF,schemeBuGn:$F,interpolateBuPu:HF,schemeBuPu:GF,interpolateGnBu:qF,schemeGnBu:YF,interpolateOrRd:UF,schemeOrRd:VF,interpolatePuBuGn:KF,schemePuBuGn:XF,interpolatePuBu:QF,schemePuBu:ZF,interpolatePuRd:tz,schemePuRd:JF,interpolateRdPu:nz,schemeRdPu:ez,interpolateYlGnBu:iz,schemeYlGnBu:rz,interpolateYlGn:az,schemeYlGn:oz,interpolateYlOrBr:cz,schemeYlOrBr:sz,interpolateYlOrRd:uz,schemeYlOrRd:lz,interpolateBlues:hz,schemeBlues:fz,interpolateGreens:pz,schemeGreens:dz,interpolateGreys:vz,schemeGreys:gz,interpolatePurples:yz,schemePurples:mz,interpolateReds:xz,schemeReds:bz,interpolateOranges:kz,schemeOranges:wz,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:Mz,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Sz.h=360*t-100,Sz.s=1.5-1.5*e,Sz.l=.8-.9*e,Sz+""},interpolateWarm:Oz,interpolateCool:Ez,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,_z.r=255*(e=Math.sin(t))*e,_z.g=255*(e=Math.sin(t+Az))*e,_z.b=255*(e=Math.sin(t+Tz))*e,_z+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:Cz,interpolateMagma:Nz,interpolateInferno:Lz,interpolatePlasma:jz});function Iz(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return Qz(t,ca)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return Vz(t,s);if(void 0!==i)return Kz([i])?Vz(t,s):Zz(e)?"time":Uz(t,o,a);return Kz(e)?Vz(t,s):Zz(e)?"time":Uz(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return Xz(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)na(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return Xz(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)na(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(Gz({type:t}))return function(t,e,n){const r=t.map(Number),i=new bo({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map(t=>new Date(i.map(t))):t.map(t=>i.map(t))}(e,r,t);return Hz({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=zi,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?aB(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=G(e),i=Rz[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:Yz(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function Dz(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map(t=>o.map(t))}}return n}function Bz(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter(t=>t.startsWith(e)).map(t=>+(t.replace(e,"")||0)),o=xr(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function Fz(t,e){const[n]=tB("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Zo,Zo];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter(([t])=>"function"==typeof t),a=t.filter(([t])=>"function"!=typeof t),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(a.map(([t,e])=>[e,t])),l=new Map(o.map(([t,e])=>[e,t]));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function zz(t){const e=t.flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale));Wz(e,"x"),Wz(e,"y")}function $z(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter(t=>i.includes(t)):[]}function Wz(t,e){const n=t.filter(({name:t,facet:n=!0})=>n&&t===e),r=n.flatMap(t=>t.domain),i=n.every(Gz)?Zn(r):n.every(Hz)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function Gz(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function Hz(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function Yz(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=qz(n,r,i,o,a),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[da(e),pa(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return qz(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function qz(t,e,n,r,i){const[o]=tB("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=G(t),i=Rz[`scheme${r}`],o=Rz[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map((t,r)=>o(n(r/e.length)))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function Vz(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function Uz(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function Xz(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function Kz(t){return Qz(t,t=>{const e=typeof t;return"string"===e||"boolean"===e})}function Zz(t){return Qz(t,t=>t instanceof Date)}function Qz(t,e){for(const n of t)if(n.some(e))return!0;return!1}const Jz={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},t$={threshold:"threshold",quantize:"quantize",quantile:"quantile"},e$={ordinal:"ordinal",band:"band",point:"point"},n$={constant:"constant"};function r$(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=tB("component",n),a=t.filter(({guide:t})=>null!==t),s=[],c=function(t,e,n){const[,r]=tB("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?oB(n)?`${e}Y`:`${e}X`:"y"===t?oB(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter(t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t));return[...a$(n),...c$(n,e)]}(a,r);return l.forEach(([t,e])=>{const{props:n}=o(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=tt({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[o,g]=f$(t,i,l,n,e,a,r);if(!o&&!g)continue;const v="left"===o||"right"===o,y=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=h,padding:M=y,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:k,position:o,plane:c,orientation:g,padding:M,order:w,crossPadding:O,size:x,type:t,scales:e}))}}),s}function i$(t,e,n,r,i){const[o]=tB("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Ie(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function o$(t,e){const n=["left","right","bottom","top"],r=ir(t,({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent"));return r.flatMap(([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=Lr(n);if(r>e)return t.forEach(t=>t.group=Symbol("independent")),t;const i=(e-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=i)})}const n=xr(t,t=>t.size),r=xr(t,t=>t.order),i=xr(t,t=>t.crossPadding);return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}})}function a$(t,e){const n=["shape","size","color","opacity"],r=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e)),i=r.filter(({type:t})=>"constant"===t),o=ir(r.filter(({type:t})=>"constant"!==t),t=>t.field?t.field:Symbol("independent")).map(([t,e])=>[t,[...e,...i]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),a=new Map(o);if(0===a.size)return[];const s=t=>t.sort(([t],[e])=>t.localeCompare(e)),c=Array.from(a).map(([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...va(t,n));return e}(t).sort((t,e)=>e.length-t.length),n=e.map(t=>({combination:t,option:t.map(t=>[t.name,s$(t)])}));for(const{option:t,combination:e}of n)if(!t.every(t=>"constant"===t[1])&&t.every(t=>"discrete"===t[1]||"constant"===t[1]))return["legendCategory",e];for(const[t,e]of nL)for(const{option:r,combination:i}of n)if(e.some(t=>rt(s(t),s(r))))return[t,i];return null}).filter(na);return c}function s$(t){const{type:e}=t;return"string"!=typeof e?null:e in Jz?"continuous":e in e$?"discrete":e in t$?"distribution":e in n$?"constant":null}function c$(t,e){return t.map(t=>{const{name:n}=t;if(function(t){return rB(t,"helix").length>0}(e)||aB(e))return null;if(oB(e)&&(iB(e)||sB(e)))return null;if(n.startsWith("x"))return iB(e)?["axisArc",[t]]:sB(e)?["axisLinear",[t]]:[oB(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return iB(e)?["axisLinear",[t]]:sB(e)?["axisArc",[t]]:[oB(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(cB(e))return["axisRadar",[t]];if(!iB(e))return["axisY",[t]]}return null}).filter(na)}function l$(t){const e=rB(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=rB(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function u$(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter(t=>t.name.startsWith("position")),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(null===e)return[null,null];const[n,a]=l$(i);return["center",(a-n)/(cB(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return rB(t,"parallel").length>0}(i))return oB(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=l$(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:iB(i)||sB(i)?["center",null]:"axisX"===t&&function(t){return rB(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return rB(t,"reflectY").length>0}(i)?["top",null]:e}function f$(t,e,n,r,i,o,a){const[s]=l$(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?u$(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&iB(a)&&"center"===r.position?["center","vertical"]:c}function h$(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?m$:s.startsWith("group")?d$:s.startsWith("legendContinuous")?y$:"legendCategory"===s?b$:s.startsWith("slider")?v$:"title"===s?g$:s.startsWith("scrollbar")?p$:()=>{})(t,e,n,r,i,o)}function d$(t,e,n,r,i,o){const{children:a}=t,s=xr(a,t=>t.crossPadding);a.forEach(t=>t.crossPadding=s),a.forEach(t=>h$(t,e,n,r,i,o));const c=xr(a,t=>t.size);t.size=c,a.forEach(t=>t.size=c)}function p$(t,e,n,r,i,o){const{trackSize:a=6}=tt({},i.scrollbar,t);t.size=a}function g$(t,e,n,r,i,o){const a=tt({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Ie(a,["title","subtitle","spacing"]);if(s){const e=E$(s,ia(u,"title"));t.size=e.height}if(c){const e=E$(c,ia(u,"subtitle"));t.size+=l+e.height}}function v$(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return tt({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function m$(t,e,n,r,i,o){var a,s;t.transform=t.transform||[{type:"hide"}];const c="left"===r||"right"===r,l=M$(t,r,i),{tickLength:u=0,labelSpacing:f=0,titleSpacing:h=0,labelAutoRotate:d}=l,p=Ie(l,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),g=x$(t,o),v=w$(p,g);let m=u;if("function"==typeof t.tickLength){const e=((null===(a=g.getTicks)||void 0===a?void 0:a.call(g))||g.getOptions().domain).map((e,n,r)=>t.tickLength(e,n,r));m=Math.max(...e,0)}const y=m+f;if(v&&v.length){const r=xr(v,t=>t.width),i=xr(v,t=>t.height);if(c)t.size=r+y;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=Lr(e,t=>t.width);if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=O$(t,i),c=s.map(t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t)),l=s.map((t,e)=>e),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const o=c[t+1];if(o){const[n]=h(o,e[t+1]);if(i>n)return!0}}return!1}(g,v,e,n,o)||a||!1===d||null===d?(t.labelTransform=null!==(s=t.labelTransform)&&void 0!==s?s:"rotate(0)",t.size=i+y):(t.labelTransform="rotate(90)",t.size=r+y)}}else t.size=m;const b=k$(p);b&&(t.size+=c?h+b.width:h+b.height)}function y$(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return tt({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Ie(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=ia(l,"ribbon"),{size:h}=f,d=ia(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=w$(l,x$(t,o));if(v){const e=u?"width":"height",n=xr(v,t=>t[e]);t.size+=n+s}const m=k$(l);m&&(u?t.size=Math.max(t.size,m.width):t.size+=c+m.height)}function b$(t,e,n,r,i,o){const a=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,o]=Array.isArray(n)?[n,void 0]:[void 0,n];return tt({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{focus:s,itemSpacing:c,focusMarkerSize:l,itemMarkerSize:u,titleSpacing:f,rowPadding:h,colPadding:d,maxCols:p=1/0,maxRows:g=1/0}=a,v=Ie(a,["focus","itemSpacing","focusMarkerSize","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:m,length:y}=t,b=t=>Math.min(t,g),x=t=>Math.min(t,p),w="left"===r||"right"===r,k=void 0===y?e+(w?0:n[0]+n[1]):y,M=k$(v),O=w$(v,x$(t,o),"itemLabel"),E=Math.max(O[0].height,u)+h,S=(t,e=0)=>u+t+c[0]+e+(s?l+c[2]:0);w?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=M?M.height:0,c=k-s;for(const{width:t}of O){const s=S(t,d);e=Math.max(e,s),n+E>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=E):(n+=E,i++)}r<=1&&(o=i,a=n),t.size=e*x(r),t.length=a+s,tt(t,{cols:x(r),gridRow:o})})():"number"==typeof m?(()=>{const e=Math.ceil(O.length/m),n=xr(O,t=>S(t.width))*m;t.size=E*b(e)-h,t.length=Math.min(n,k)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of O){const i=S(t,d);n+i>k?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*b(e)-h,t.length=r})(),M&&(w?t.size=Math.max(t.size,M.width):t.size+=f+M.height)}function x$(t,e){const[n]=tB("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==i&&(a.tickCount=i),void 0!==o&&(a.tickMethod=o),n(a)}function w$(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Ie(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=O$(t,n),i=r.map(t=>"number"==typeof t?jm(t):t),o=e?"string"==typeof e?FT(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=ia(a,n),l=s.map((t,e)=>Object.fromEntries(Object.entries(c).map(([n,r])=>[n,"function"==typeof r?r(t,e):r]))),u=s.map((t,e)=>E$(t,l[e])),f=l.some(t=>t.transform);if(!f){const e=s.map((t,e)=>e);t.indexBBox=new Map(e.map(t=>[t,[s[t],u[t]]]))}return u}function k$(t){const{title:e}=t,n=Ie(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=ia(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return E$(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function M$(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${Jo(e)}`]:s}=n;return tt({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function O$(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function E$(t,e){const n=function(t){return t instanceof Qg?t:new mv({style:{text:`${t}`}})}(t),r=Ie(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function S$(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:v=h,margin:m=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:y=m,marginBottom:b=m,marginTop:x=m,marginRight:w=m,padding:k=n.padding,paddingBottom:M=k,paddingLeft:O=k,paddingRight:E=k,paddingTop:S=k}=function(t,e,n,r){const{coordinates:i}=e;if(!iB(i)&&!sB(i))return e;const o=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===o.length)return e;const a=o.map(t=>M$(t,"axisArc"===t.type?"arc":"linear",n)),s=xr(a,t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0}),c=o.flatMap((t,e)=>w$(a[e],x$(t,r))).filter(na),l=xr(c,t=>t.height)+s,u=o.flatMap((t,e)=>k$(a[e])).filter(t=>null!==t),f=0===u.length?0:xr(u,t=>t.height),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),_=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},A=t=>"auto"===t?20:null!=t?t:20,T=A(S),P=A(M),C=_$(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-y-w,[R,I]=_(j,O,E,N,L),D=j-R-I,B=_$(t,D,[R+y,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,$=s-b-x,[W,G]=_($,M,S,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:$-W-G,paddingLeft:R,paddingRight:I,paddingTop:G,paddingBottom:W,marginLeft:y,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function _$(t,e,n,r,i,o,a){const s=rr(t,t=>t.position),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${Jo(Ry(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=xr(t.children,t=>t.size)):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(h$(r,e,n,t,o,a),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=kr(i,t=>t.order),v=i.filter(t=>t.type.startsWith("axis")&&t.order==g);if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=o$(i,p?e+n[0]+n[1]:e);t.forEach(f);const o=t.reduce((t,{size:e,crossPadding:n=12})=>t+e+n,0);d[r]=o}}return d}function A$({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const v=n+a,m=i+s,y=r+l,b=o+c,x=t-a-l,w=[v+d,m+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,m,"vertical",!0,Fn,a,x],right:[t-y,m,y,u,"horizontal",!1,Fn],bottom:[v,e-b,f,b,"vertical",!1,Fn,a,x],left:[0,m,v,u,"horizontal",!0,Fn],"top-left":[v,0,f,m,"vertical",!0,Fn],"top-right":[v,0,f,m,"vertical",!0,Fn],"bottom-left":[v,e-b,f,b,"vertical",!1,Fn],"bottom-right":[v,e-b,f,b,"vertical",!1,Fn],center:w,inner:w,outer:w}}function T$(t,e,n,r){const[i,o]=ga(t,t=>!("string"!=typeof t.type||!t.type.startsWith("axis")));!function(t,e,n,r){"center"===r?function(t){return sl(t)&&il(t)}(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):il(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):sl(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=ul(e),l=o/2,u=c*l,f=a-u,h=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+h,width:2*u,height:2*u}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=ul(e),c=a/2*s/Math.sqrt(2),l=r+o/2,u=i+a/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(o,e,n)}function P$(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort((t,e)=>null==l?void 0:l(t.order,e.order));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+m:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:o}=r,{size:a}=r;r.bbox={[h]:c?n-a-i:n+i,[p]:k(o,g,u),[v]:a,[y]:w(o,b,f)},n+=(a+i)*(c?-1:1)}const M=t.filter(t=>"group"===t.type);for(const t of M){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,o=n.reduce((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t},"flex-start"),a=n.map((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)}),s=r-Lr(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[v]:e[v],[h]:e[h],[p]:r,[y]:a[t]-c},tt(i,{layout:{justifyContent:o}}),r+=a[t]}}}const C$=Symbol("CALLBACK_ITEM");function N$(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Ie(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function L$(t,e,n){return Be(this,void 0,void 0,function*(){const{library:t}=n,{data:r}=e,[i]=tB("data",t),o=function(t){if(I(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=Ie(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Ie(o,["transform"]),...a].map(t=>i(t,n)),c=yield function(t){return t.reduce((t,e)=>n=>Be(this,void 0,void 0,function*(){const r=yield t(n);return e(r)}),Zo)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?ha(c):[],Object.assign(Object.assign({},e),{data:l})]})}function j$(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function R$(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=fa(r,t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return na(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some(t=>void 0!==t[e])}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}});return[t,Object.assign(Object.assign({},e),{encode:o})]}function I$(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=fa(r,(t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function D$(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=tB("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:Y$(n)})}(o),s=fa(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:s})]}function B$(t,e,n){const{tooltip:r={}}=e;return la(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:ca(r)&&oS(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function F$(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(la(o))return[t,e];const a=e=>{if(!e)return e;if("string"==typeof e)return t.map(t=>({name:e,value:r[t][e]}));if(ca(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?FT(c):c,u=o&&i[o],f=u&&i[o].field,h=s||f||o,d=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;d[e]={name:h,color:a,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);ca(t)?n[o]=Object.assign(Object.assign({},t),{[C$]:!0}):n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Ie(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(c)?c.map(a):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function z$(t,e,n){const{encode:r}=e,i=Ie(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter(([,t])=>{const{value:e}=t;return Array.isArray(e[0])}).flatMap(([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,o=Ie(n,["value"]);for(let n=0;n<i.length;n++){const o=i[n];if(Array.isArray(o))for(let i=0;i<o.length;i++){const a=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];a[1][n]=o[i],r[i]=a}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},o)])}),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function $$(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return tt(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map(t=>{const e=s(a,t);return[t,Object.assign({guide:s(r,t),slider:s(o,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function W$(t,e,n){const{animate:r}=e;return r||void 0===r||tt(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function G$(t,e,n){var r,i;return tt(e,{scale:{series:Object.assign({key:`DEFAULT_${e.type}_SERIES_KEY`},null!==(i=null===(r=null==e?void 0:e.scale)||void 0===r?void 0:r.series)&&void 0!==i?i:{})}}),[t,e]}function H$(t,e,n){return Be(this,void 0,void 0,function*(){const[r,i]=yield function(t,e,n){return Be(this,void 0,void 0,function*(){const{library:r}=n,[i]=tB("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[N$,L$,j$,R$,I$,D$,z$,W$,$$,B$,G$,...o.map(i),...s.map(i),...a.map(i),F$];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]})}(t,e,n),{encode:o,scale:a,data:s,tooltip:c,key:l}=i;if(!1===Array.isArray(s))return null;const{channels:u}=e,f=ar(Object.entries(o).filter(([,t])=>na(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=u.find(t=>t.name===n);return(null==r?void 0:r.independent)?t:n}),h=u.filter(t=>{const{name:e,required:n}=t;if(f.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:s}=t;return f.filter(([t])=>t.startsWith(e)).map(([t,e],c)=>{const u=e.some(t=>t.visual),f=e.some(t=>t.constant),h=a[t]||{},{independent:d=!1,key:p=r||t,type:g=(f?"constant":u?"identity":n)}=h,v=Ie(h,["independent","key","type"]),m="constant"===g,y=m?void 0:i;return{name:t,values:e,scaleKey:d||m?Symbol("independent"):p,scale:Object.assign(Object.assign({type:g,markerKey:l,range:y},v),{quantitative:o,ordinal:s})}})});return[i,Object.assign(Object.assign({},e),{index:r,channels:h,tooltip:c})]})}function Y$(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function q$(t,e,n){var r;return Be(this,void 0,void 0,function*(){const{library:i}=n,[o]=tB("composition",i),[a]=tB("interaction",i),s=new Set(Object.keys(i).map(t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(na)),c=new Set(Object.keys(i).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(na)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return o({type:e,static:h(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,o]=e?Q$(e,t,i):yield X$(t,n);g.set(r,t),p.push(r);const a=o.flatMap(d).map(t=>nB(t,i));if(m.push(...a),a.every(f)){const t=yield Promise.all(a.map(t=>K$(t,n)));zz(t);for(let e=0;e<a.length;e++){const n=a[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield dW(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(NN.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(mW(GO)).data(p,t=>t.key).join(t=>t.append("g").attr("className",GO).attr("id",t=>t.key).call(V$).each(function(t,e,r){J$(t,Cm(r),k,n),b.set(t,r)}),t=>t.call(V$).each(function(t,e,r){J$(t,Cm(r),k,n),w.set(t,r)}),t=>t.each(function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()}).remove());const M=(t,e,r)=>Array.from(t.entries()).map(([i,o])=>{const a=r||new Map,s=(t,e=t=>t)=>a.set(t,e),c=g.get(i),l=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=tB("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=hW(e),s=a.map(i).filter(o).map(t=>t[0]);return(e,r,i)=>Be(this,void 0,void 0,function*(){const o=[],[a,c]=yield X$(e,n);J$(a,t,o,n);for(const i of s.filter(t=>t!==r))U$(i,t,e,a,n);for(const e of c)q$(e,t,n);return i(),{options:e,view:a}})}(Cm(o),c,n),u={view:i,container:o,options:c,setState:s,update:(n,r)=>Be(this,void 0,void 0,function*(){const i=Qo(Array.from(a.values()))(c);return yield l(i,n,()=>{x(r)&&e(t,r,a)})})};return n.externals.update=u.update,n.externals.setState=s,u}),O=(t=w,e,r)=>{var i;const o=M(t,O,r);for(const t of o){const{options:r,container:s}=t,c=s.nameInteraction;let l=hW(r);e&&(l=l.filter(t=>e.includes(t[0])));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=Z$(t.view,r,s,a)(t,o,n.emitter);c.set(r,{destroy:e})}}}},E=M(b,O);for(const t of E){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of hW(e)){const[e,o]=i;if(o){const i=Z$(t.view,e,o,a)(t,E,n.emitter);r.set(e,{destroy:i})}}}O();const{width:S,height:_}=t,A=[];for(const t of y){const r=new Promise(r=>Be(this,void 0,void 0,function*(){for(const r of t){const t=Object.assign({width:S,height:_},r);yield q$(t,e,n)}r()}));A.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach(t=>null==t?void 0:t.cancel()),n.animations=k,n.emitter.emit(NN.AFTER_PAINT);const T=k.filter(na).map(cW).map(t=>t.finished);return Promise.all([...T,...A])})}function V$(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function U$(t,e,n,r,i){var o;const{library:a}=i,[s]=tB("interaction",a),c=e.node().nameInteraction,l=hW(n).find(([e])=>e===t),u=c.get(t);if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=Z$(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function X$(t,e){return Be(this,void 0,void 0,function*(){const{library:n}=e,r=yield function(t,e){return Be(this,void 0,void 0,function*(){const{library:n}=e,[r,i]=tB("mark",n),o=new Set(Object.keys(n).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(na)),{marks:a}=t,s=[],c=[],l=[...a],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:m=d}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(o)-l-u-p-g,height:e-y(a)-y(s)-f-h-v-m}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield dW(t,e),{type:a=ta("G2Mark type is required."),key:u}=n;if(o.has(a))c.push(n);else{const{props:t={}}=i(a),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),o=Array.isArray(i)?i:[i];l.unshift(...o.map((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`})))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})})}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Ie(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),s=i.map(t=>t.interaction||{}),c=i.map(t=>t.viewStyle||{}),l=[...a,e].reduceRight((t,e)=>tt(t,e),{}),u=[n,...s].reduce((t,e)=>tt(t,e),{}),f=[...c,r].reduce((t,e)=>tt(t,e),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const o=nB(i,n);return Q$(yield K$(o,e),o,n)})}function K$(t,e){return Be(this,void 0,void 0,function*(){const{library:n}=e,[r]=tB("theme",n),[,i]=tB("mark",n),{theme:o,marks:a,coordinates:s=[]}=t,c=r(fW(o)),l=new Map;for(const t of a){const{type:n}=t,{props:r={}}=i(n),o=yield H$(t,r,e);if(o){const[t,e]=o;l.set(t,e)}}const u=rr(Array.from(l.values()).flatMap(t=>t.channels),({scaleKey:t})=>t);for(const t of u.values()){const e=t.reduce((t,{scale:e})=>tt(t,e),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map(t=>t.field).filter(na))),a=tt({guide:{title:0===o.length?void 0:o},field:o[0]},e),{name:l}=t[0],u=t.flatMap(({values:t})=>t.map(t=>t.value)),f=Object.assign(Object.assign({},Iz(l,u,a,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach(t=>t.scale=f)}return l})}function Z$(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(tt(o,Object.assign({type:e},n)))}function Q$(t,e,n){var r;const[i]=tB("mark",n),[o]=tB("theme",n),[a]=tB("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=o(fW(l)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),a=new Map(o.map(t=>[t.name,t]));for(const t of r){const e=$z(t);for(const r of e){const e=a.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=tt({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:ct(t,i)});o.push(e)}}}return o}(p,e),v=function(t){return t.map(t=>{const e=tt(t,t.style);return delete e.style,e})}(r$(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find(t=>"color"===t.name))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=S$(v,e,d,n),y=function(t,e,n){const[r]=tB("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find(t=>"cartesian"===t.type||"cartesian3D"===t.type)?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-c,height:i-l-s,transformations:f.flatMap(r)});return d?new pj(p):new uj(p)}(m,e,n),b=c?tt({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=rr(t,t=>`${t.plane||"xy"}-${t.position}`),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,w={xy:A$({width:b,height:y,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:A$({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:A$({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=ga(n,t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i))));a.length&&T$(a,e,o,i),s.length&&P$(n,0,o)}}(o$(v),y,m),function(t){const e=t.find(({type:t})=>"axisX"===t),n=t.find(({type:t})=>"axisY"===t),r=t.find(({type:t})=>"axisZ"===t);e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap(t=>{const{channels:e}=t;return e.map(({scale:t})=>[t.uid,Fz(t,n)])}));!function(t,e){const n=Array.from(t.values()).flatMap(t=>t.channels),r=ar(n,t=>t.map(t=>e.get(t.scale.uid)),t=>t.name).filter(([,t])=>t.some(t=>"function"==typeof t.getOptions().groupTransform)&&t.every(t=>t.getTicks)).map(t=>t[1]);r.forEach(t=>{const e=t.map(t=>t.getOptions().groupTransform)[0];e(t)})}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:o}=t,a=null!==(r=x.get(o))&&void 0!==r?r:Fz(t,n);i.push(a),"y"===e&&a.update(Object.assign(Object.assign({},a.getOptions()),{xScale:w.x})),Bz(w,{[e]:a})}t.scaleInstances=i}const k=[],M=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:o,key:a,data:c}=e;M.set(a,c);const{index:l,channels:u,tooltip:f}=n,h=Object.fromEntries(u.map(({name:t,scale:e})=>[t,e])),d=fa(h,({uid:t})=>x.get(t));Bz(w,d);const p=Dz(u,d),g=i(e),[v,b,O]=tW(g(l,d,p,y)),E=r||v.length,S=o?o(b,E,m):[],_=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},A=t=>f.items.map(e=>e[t]),T=v.map((t,e)=>{const n=Object.assign({points:b[e],transform:S[e],index:t,markKey:a,viewKey:s,data:c[t]},f&&{title:_(t),items:A(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],O&&(n[`series${G(r)}`]=O[e].map(t=>i[t]));return O&&(n.seriesIndex=O[e]),O&&f&&(n.seriesItems=O[e].map(t=>A(t)),n.seriesTitle=O[e].map(t=>_(t))),n});n.data=T,n.index=v;const P=null==t?void 0:t(T,d,m);k.push(...P||[])}return[{layout:m,theme:d,coordinate:y,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:M,options:e,labelTransform:Qo(h.map(a))},k]}function J$(t,e,n,r){return Be(this,void 0,void 0,function*(){const{library:i}=r,{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:m}=s,y=Ie(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map((t,e)=>e),w=b.map(t=>oa(Object.assign({},a.view,f),t)),k=["a","margin","padding","inset"].map(t=>ia(y,t)),M=t=>t.style("x",t=>A[t].x).style("y",t=>A[t].y).style("width",t=>A[t].width).style("height",t=>A[t].height).each(function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Cm(n),w[t])});let O=0,E=0,S=v,_=m;const A=x.map(t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return O+=n,E+=r,S-=n+o,_-=r+i,{x:O,y:E,width:S,height:_}});e.selectAll(mW(VO)).data(x.filter(t=>na(w[t])),t=>b[t]).join(t=>t.append("rect").attr("className",VO).style("zIndex",-2).call(M),t=>t.call(M),t=>t.remove());const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:v=300,delay:m=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of ir(o,t=>`${t.type}-${t.position}`))t.forEach((t,e)=>t.index=e);const C=e.selectAll(mW(YO)).data(o,t=>`${t.type}-${t.position}-${t.index}`).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",YO).append(t=>i$(tt({animate:P,scale:d},t),l,a,i,c)),t=>t.transition(function(t,e,n){const{preserve:r=!1}=t;if(r)return;const o=i$(tt({animate:P,scale:d},t),l,a,i,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})).transitions();n.push(...C.flat().filter(na));const N=e.selectAll(mW(HO)).data([s],()=>u).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",HO).call(pW).call(vW,Array.from(c.keys())).call(yW,h),t=>t.call(vW,Array.from(c.keys())).call(pW).call(yW,h)).transitions();n.push(...N.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=iW(o,a,t,r),d=sW(o,a,t,i),p=lW(o,a,t,i),g=uW(o,a,t,i),v=nW(e,f,l,"element"),m=f.selectAll(mW(WO)).selectFacetAll(v).data(s,t=>t.key,t=>t.groupKey).join(t=>t.append(h).attr("className",WO).attr("markType",u).transition(function(t,e,n){return d(t,[n])}),t=>t.call(t=>{const e=t.parent(),n=ra(t=>{const[e,n]=t.getBounds().min;return[e,n]});t.transition(function(t,r,i){rW(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return(null==a?void 0:a.length)||(i.nodeName===o.nodeName&&"g"!==o.nodeName?ea(i,o):(i.parentNode.replaceChild(o,i),o.className=WO,o.markType=u,o.__data__=i.__data__)),a}).each(function(t,e,n){n.__removed__&&(n.__removed__=!1)}).attr("markType",u).attr("className",WO)}),t=>t.each(function(t,e,n){n.__removed__=!0}).transition(function(t,e,n){return g(t,[n])}).remove(),t=>t.append(h).attr("className",WO).attr("markType",u).transition(function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Nm(r,null,n.parentNode).transition(i).remove(),i}),t=>t.transition(function(t,e,n){const r=new Nm([],n.__toData__,n.parentNode).append(h).attr("className",WO).attr("markType",u).nodes();return p(t,[n],r)}).remove()).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[o]=tB("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(mW($O)).node(),l=new Map,u=new Map,f=Array.from(a.entries()).flatMap(([n,o])=>{const{labels:a=[],key:s}=n,c=function(t,e,n,r,i){const[o]=tB("shape",r),{data:a,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map(t=>t.points),f=fa(s,t=>t.value),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:eB(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,m=Ie(t,["formatter","transform","style","render","selector","element"]),y=fa(Object.assign(Object.assign({},m),c),t=>eW(t,r,e,a,{channel:f,element:v})),{shape:b=l,text:x}=y,w=Ie(y,["shape","text"]),k="string"==typeof i?FT(i):i,M=Object.assign(Object.assign({},w),{text:k(x,r,e,a),datum:r}),O=Object.assign({type:`label.${b}`,render:d},w);return o(O,p)(n,M,oW(h,"label",b,"label"),u)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(mW(WO)).nodes().filter(t=>!t.__removed__);return a.flatMap((t,e)=>{const n=Ie(t,["transform"]);return f.flatMap(r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach(t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])}),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n}));return l?l(u):u}(n,e,r);return i.forEach(e=>{l.set(e,t=>c(Object.assign(Object.assign({},t),{element:r}))),u.set(e,t)}),i})})}),h=Cm(c).selectAll(mW(qO)).data(f,t=>t.key).join(t=>t.append(t=>l.get(t)(t)).attr("className",qO),t=>t.each(function(t,e,n){ea(n,l.get(t)(t))}),t=>t.remove()).nodes(),d=rr(h,t=>u.get(t.__data__)),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;Qo(n.map(o))(e,v)}s&&s(h,v)}(t,e,0,i,r),function(t,e,n,r){const i=t.scale,o=ot(i,"y.options.breaks",[]),{document:a}=r.canvas;if([UO,XO].forEach(t=>{a.getElementsByClassName(t).forEach(t=>{t.remove()})}),!o.length)return;const s=e.select(mW(HO)).node(),[c]=tB("shape",n),l=new Map;o.forEach((n,i)=>{l.set(n,c({type:"break"},{view:t,selection:e,context:r}))}),Cm(s).selectAll(mW(UO)).data(o,t=>t.key).join(t=>t.append((t,e)=>l.get(t)(t,e)).attr("className",UO),t=>t.each(function(t,e,n){ea(n,l.get(t)(t,e))}),t=>t.remove()).nodes()}(t,e,i,r)})}function tW([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const o=t[n],a=e[n];a.every(([t,e])=>na(t)&&na(e))&&(r.push(o),i.push(a))}return[r,i]}function eW(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:ca(e)&&void 0!==e[t]?e[t]:t}function nW(t,e,n,r){const i=t.node().parentElement;return i&&"function"==typeof i.findAll?i.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r)):[]}function rW(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-c})`),e.append(t)}function iW(t,e,n,r){const{library:i}=r,[o]=tB("shape",i),{data:a,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=fa(s,t=>t.value),h=l.map(t=>t.points),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:eB(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Ie(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:l}),b=s?s.map(t=>a[t]):a[l],x=s||l,w=fa(v,t=>eW(t,b,x,a,{channel:f}));return(u[r]?u[r](w,m):o(Object.assign(Object.assign({},w),{type:gW(t,r)}),m))(i,y,oW(d,g,r,c),h)}}function oW(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function aW(t,e,n,r,i){var o,a;const[,s]=tB("shape",i),[c]=tB("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${G(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(gW(e,l)).props,{[t]:g={}}=f,v=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},m={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},v);if(!l.type)return null;const u=c(l,m)(n,r,tt(g,{delay:o,duration:a,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function sW(t,e,n,r){return aW("enter",t,e,n,r)}function cW(t){return t.finished.then(()=>{t.cancel()}),t}function lW(t,e,n,r){return aW("update",t,e,n,r)}function uW(t,e,n,r){return aW("exit",t,e,n,r)}function fW(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Ie(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function hW(t){const{interaction:e={}}=t;return Object.entries(tt({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function dW(t,e){return Be(this,void 0,void 0,function*(){const{data:n}=t,r=Ie(t,["data"]);if(null==n)return t;const[,{data:i}]=yield L$(0,{data:n},e);return Object.assign({data:i},r)})}function pW(t){t.style("transform",t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function gW(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function vW(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(mW(zO)).data(e,t=>t.key).join(t=>t.append("g").attr("className",zO).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.remove());t.select(mW($O)).node()||t.append("g").attr("className",$O).style("zIndex",0)}function mW(...t){return t.map(t=>`.${t}`).join("")}function yW(t,e){t.node()&&t.style("clipPath",t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new gv({style:{x:r+i,y:n+o,width:a,height:s}})})}function bW(t){const{style:e,scale:n,type:r}=t,i={},o=ot(e,"columnWidthRatio");return o&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-o})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}const xW=t=>{if(!t||"string"!=typeof t)return t;const e=t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t);if(isNaN(e)||e<0||e>1)throw new Error(`Invalid gap value: ${t}. It should be between 0 and 1.`);return e};function wW(t){const{axis:e}=t,n=ot(e,"y.breaks");return n&&at(t,"scale.y.breaks",n.map(t=>Object.assign(Object.assign({key:`break-${t.start}-${t.end}`},t),{gap:xW(t.gap)}))),t}function kW(t){const e=function(t){return function(...t){return e=>t.reduce((t,e)=>e(t),e)}(bW,wW)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map(t=>kW(t))),e}function MW(t){const e=tt({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o<e.length;o++){const a=tt({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function OW(t,e){const n=new _N;return n.registerPlugin(new TN),new Nv({width:t,height:e,container:document.createElement("div"),renderer:n})}function EW(t,e={},n=()=>{},r=t=>{throw t}){const i=eL(t),{width:o=640,height:a=480,depth:s=0}=i,c=MW(kW(i)),{canvas:l=OW(o,a),emitter:u=new CN,library:f}=e;e.canvas=l,e.emitter=u,e.externals={};const{width:h,height:d}=l.getConfig();h===o&&d===a||l.resize(o,a),u.emit(NN.BEFORE_RENDER);const p=Cm(l.document.documentElement);return l.ready.then(()=>q$(Object.assign(Object.assign({},c),{width:o,height:a,depth:s}),p,e)).then(()=>{if(s){const[t,e]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(t,e,-s/2)}l.requestAnimationFrame(()=>{l.requestAnimationFrame(()=>{u.emit(NN.AFTER_RENDER),null==n||n()})})}).catch(t=>{null==r||r(t)}),"string"==typeof(g=l.getConfig().container)?document.getElementById(g):g;var g}function SW(t,e={},n=!1,r=!0){const{canvas:i,emitter:o}=e;i&&(!function(t){const e=t.getRoot().querySelectorAll(`.${GO}`);null==e||e.forEach(t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach(t=>{null==t||t.destroy()})})}(i),n?i.destroy():i.destroyChildren()),r&&o.off()}function _W(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(_W(t,e))return!0}return!1}const AW={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function TW(t,e){let n;return _W(t,t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)}),null!=n?n:AW[e]}function PW(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>PW(t,e,n,r))}function CW(t){PW(t,"visibility","hidden",!0)}function NW(t){PW(t,"visibility","visible",!0)}function LW(t){return Cm(t).selectAll(`.${WO}`).nodes().filter(t=>!t.__removed__)}function jW(t,e){return RW(t,e).flatMap(({container:t})=>LW(t))}function RW(t,e){return e.filter(e=>e!==t&&e.options.parentKey===t.options.key)}function IW(t){return Cm(t).select(`.${HO}`).node()}function DW(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new Ou;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function BW(t,e){const{offsetX:n,offsetY:r}=e,i=DW(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function FW(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function zW(t){return t=>t.__data__.color}function $W(t){return t=>t.__data__.x}function WW(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap(t=>Array.from(t.markState.keys()).map(e=>[UW(t.key,e.key),e.data])));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(UW(i,r))[e]}}const GW={selected:3,unselected:3,active:2,inactive:2,default:1},HW={selection:["selected","unselected"],highlight:["active","inactive"]},YW=(t,e,n)=>{_W(t,t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)})};function qW(t,e){return e.forEach(e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t}),(t=(t,e)=>t,e=YW)=>VW(void 0,t,e)}function VW(t,e=(t,e)=>t,n=YW){const r="__states__",i="__ordinal__",o=t=>GW[t]||GW.default,a=t=>{var e;return null===(e=Object.entries(HW).find(([e,n])=>n.includes(t)))||void 0===e?void 0:e[0]},s=a=>{var s;const{[r]:c=[],[i]:l={}}=a,u=[...c].sort((t,e)=>o(e)-o(t)),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:a.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const h=Object.assign({},l);for(const[t,e]of f.entries())h[t]=e;if(0!==Object.keys(h).length){for(const[t,r]of Object.entries(h)){const i=TW(a,t),o=e(r,a);n(a,t,o),t in l||(l[t]=i)}a[i]=l}},c=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{c(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{c(t);const n=t[r],i=new Set(e.map(t=>a(t)).filter(t=>void 0!==t)),o=n.filter(t=>!i.has(a(t)));t[r]=[...o,...e],s(t)},removeState:(t,...e)=>{c(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(c(t),-1!==t[r].indexOf(e))}}function UW(t,e){return`${t},${e}`}function XW(t,e){const n=(Array.isArray(t)?t:[t]).flatMap(t=>t.marks.map(e=>[UW(t.key,e.key),e.state])),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=UW(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t},{})}return r}function KW(t,e){const n=new Map(t.map((t,e)=>[t,e])),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function ZW(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Ie(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const o=t=>t.__data__.points,a=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=cr(t,(t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r});for(let t=1;t<r.length;t++){const s=pc(),c=r[t-1],l=r[t],[u,f,h,d]=a(o(c),o(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=fa(i,t=>n(t,c)),{fill:g=c.getAttribute("fill")}=p,v=Ie(p,["fill"]),m=new uv({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(m),c.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function QW(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(il(n)){const{points:i}=t.__data__,[o,a]=rl(n)?Bm(i):i,s=n.getCenter(),c=Ns(o,s),l=Ns(a,s),u=Rs(c)+Ds(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return rl(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function JW(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Ie(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},l=(t,n)=>{const{padding:o}=n,[a,s]=((t,e)=>{const{x:n}=r;if(!TP(n))return[0,1];const{__data__:i}=t,{x:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),[l,u]=((t,e)=>{const{y:n}=r;if(!TP(n))return[0,1];const{__data__:i}=t,{y:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),f=[[a,l],[s,l],[s,u],[a,u]].map(t=>i.map(t)),{__data__:h}=t,{y:d,y1:p}=h;return Gm(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=Ie(e,["transform","transformOrigin","stroke"]),a=Object.assign({transform:n,transformOrigin:r,stroke:i},o),s=t.cloneNode(!0);for(const[t,e]of Object.entries(a))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=fa(a,e=>o(e,t)),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Ie(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(TP)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function tG(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function eG(t){tG(t,t.cursor)}function nG(t,e,n){return t.find(t=>Object.entries(e).every(([e,r])=>n(t)[e]===r))}function rG(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function iG(t,e=!1){const n=m(t,t=>!!t).map((t,e)=>[0===e?"M":"L",...t]);return e&&n.push(["Z"]),n}function oG(t){return t.querySelectorAll(".element")}function aG(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const sG=["interval","point","density"];function cG({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=sG}){var o,a;let s=t(e);const c=t=>i.includes(t.markType);if(s.find(c)){s=s.filter(c);const t=r.x,i=r.series,l=null!==(a=null===(o=null==t?void 0:t.getBandWidth)||void 0===o?void 0:o.call(t))&&void 0!==a?a:0,u=i?t=>{var e,n;const r=Math.round(1/(null!==(e=i.valueBandWidth)&&void 0!==e?e:1));return t.__data__.x+(null!==(n=t.__data__.series)&&void 0!==n?n:0)*l+l/(2*r)}:t=>t.__data__.x+l/2;return s.sort((t,e)=>u(t)-u(e)),t=>{const r=BW(e,t);if(!r)return;const[i]=n.invert(r),o=(0,$n(u).center)(s,i);return s[o]}}return t=>{const{target:e}=t;return aG(e,t=>!!t.classList&&t.classList.includes("element"))}}function lG(t){const e=.01/Math.max(t,1e-4);return Math.max(.1,Math.min(100,e))}function uG(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:o=!1}=t,a=Ie(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,c)=>{const{container:l,view:u,options:f}=t,{scale:h,coordinate:d}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,background:a=!1,delay:s=60,scale:c,coordinate:l,emitter:u,state:f={},region:h=!1,regionEleFilter:d=t=>sG.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],m=h?v.filter(d):v,y=new Set(m),b=h?i:r,x=rr(m,b),w=cG({elementsof:e,root:t,coordinate:l,scale:c}),k=KW(m,n),[M,O]=ZW(Object.assign({elements:m,valueof:k,link:o,coordinate:l},ia(f.active,"link"))),[E,S,_]=JW(Object.assign({document:t.ownerDocument,scale:c,coordinate:l,background:a,valueof:k},ia(f.active,"background"))),A=tt(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return QW(m[n],e,l)}})}),T=qW(A,m),{updateState:P,removeState:C,hasState:N}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(h&&(r=w(t)),!y.has(r))return;L&&clearTimeout(L);const i=b(r),o=x.get(i),a=new Set(o);for(const t of m)a.has(t)?N(t,"active")||P(t,"active"):(P(t,"inactive"),O(t)),t!==r&&S(t);E(r),M(o),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:o.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout(()=>{I(),L=null},s)},I=(t=!0)=>{for(const t of m)C(t,"active","inactive"),S(t),O(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;h&&(e=w(t)),e?a&&!_(e)||(a||y.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=nG(m,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of m)S(t),O(t)}}(IW(l),Object.assign({elements:LW,datum:WW(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:d,scale:h,state:XW(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:o,delay:e,emitter:c},a))}}function fG(t){return uG(Object.assign(Object.assign({},t),{createGroup:$W}))}function hG(t){return uG(Object.assign(Object.assign({},t),{createGroup:zW}))}function dG(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,single:a=!1,multipleSelectHotkey:s,coordinate:c,background:l=!1,scale:u,emitter:f,state:h={},region:d=!1,regionEleFilter:p=t=>sG.includes(t.markType)}){var g;const v=e(t),m=new Set(v),y=cG({elementsof:e,root:t,coordinate:c,scale:u}),b=rr(v,r),x=rr(v,i),w=KW(v,n),[k,M]=ZW(Object.assign({link:o,elements:v,valueof:w,coordinate:c},ia(h.selected,"link"))),[O,E]=JW(Object.assign({document:t.ownerDocument,background:l,coordinate:c,scale:u,valueof:w},ia(h.selected,"background"))),S=tt(h,{selected:Object.assign({},(null===(g=h.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=h.selected.offset(...t),[,n]=t;return QW(v[n],e,c)}})}),_=qW(S,v),{updateState:A,removeState:T,hasState:P}=_(w);let C=!a,N=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),M(t),E(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:a=r,groupMap:s=b})=>{const c=v.filter(o);if(P(e,"selected"))L();else{const r=a(e),o=s.get(r),l=new Set(o);for(const t of c)l.has(t)?A(t,"selected"):(A(t,"unselected"),M(t)),t!==e&&E(t);if(k(o),O(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...o.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:s=r,groupMap:c=b})=>{const l=s(e),u=c.get(l),h=new Set(u),d=v.filter(a);if(P(e,"selected")){const t=v.some(t=>!h.has(t)&&P(t,"selected"));if(!t)return L();for(const t of u)A(t,"unselected"),M(t),E(t)}else{const t=u.some(t=>P(t,"selected"));for(const t of d)h.has(t)?A(t,"selected"):P(t,"selected")||A(t,"unselected");!t&&o&&k(u),O(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter(t=>P(t,"selected")).map(n)}}))},I=t=>{if(m.has(t))return t;for(const e of m){let n=null;if(_W(e,r=>{r===t&&(n=e)}),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,o=C?R:j;let a=e;const s=(t=>{if(m.has(t))return!0;for(const e of m)if(_W(e,e=>e===t))return!0;return!1})(e);return!d||s?s?o({event:t,element:I(a),nativeEvent:n,groupBy:r}):L():(a=y(t),m.has(a)?o({event:t,element:a,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!N&&(N=t.code,C=!0)},z=t=>{t.code===N&&(N=null,C=!1)};t.addEventListener("click",D),s&&(C=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const $=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=C?r.data:r.data.slice(0,1);for(const t of i){const e=nG(v,t,n);D({target:e,nativeEvent:!1})}},W=()=>{L(!1)};return f.on("element:select",$),f.on("element:unselect",W),()=>{for(const t of v)M(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",$),f.off("element:unselect",W)}}function pG(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,o=Ie(t,["createGroup","createRegionGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{coordinate:f,scale:h}=l;return dG(IW(c),Object.assign({elements:LW,datum:WW(l),groupKey:e?e(l):void 0,regionGroupKey:n?n(l):t=>t.__data__.x,coordinate:f,scale:h,state:XW(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},o))}}function gG(t){return pG(Object.assign(Object.assign({},t),{createGroup:$W}))}function vG(t){return pG(Object.assign(Object.assign({},t),{createGroup:zW}))}function mG(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,o=Ie(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:a,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=a,d=function(t,e,n){const[r]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const{encode:e}=t;return Object.fromEntries(n.map(t=>{const n=e[t];return[t,n?n.value:void 0]}))});return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,m=p.map((t,e)=>e),y=cr(m.map(t=>g[t])),b=IW(s),x=s.getElementsByClassName(WO),w=rr(s.getElementsByClassName(qO),t=>t.__data__.key.split("-")[0]),k=new cv({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ia(o,"rule"))}),M=new mv({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ia(o,"label"))});k.append(M),b.appendChild(k);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[Vn(y,i)]},E=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let S;const _=lt(t=>{const e=BW(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=O(n,r,t);E(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[$n(t=>g[+t]).center(e,o)],s=[0,i.map(1)],c=[0,i.map(p[a]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)},e,{leading:n,trailing:r});return(t=>{Be(this,void 0,void 0,function*(){const{x:e}=f,n=O(h,e,t);E(t,n),l("chartIndex",t=>{const e=tt({},t),r=e.marks.find(t=>"line"===t.type),i=xr(or(m,t=>xr(t,t=>+p[t])/kr(t,t=>+p[t]),t=>v[t]).values());tt(r,{scale:{y:{domain:[1/i,i]}}});const o=function(t){const{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);o.groupBy="color",o.basis=(t,e)=>e[t[$n(t=>g[+t]).center(t,n)]];for(const t of e.marks)t.animate=!1;return e});const r=yield c("chartIndex");S=r.view})})([0,0]),b.addEventListener("pointerenter",_),b.addEventListener("pointermove",_),b.addEventListener("pointerleave",_),()=>{k.remove(),b.removeEventListener("pointerenter",_),b.removeEventListener("pointermove",_),b.removeEventListener("pointerleave",_)}}}function yG({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=IW(s),l=lt(t=>{const e=BW(c,t);if(!e)return a("fisheye"),void o();a("fisheye",t=>{const n=tt({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n}),o()},t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function bG(t,e){var n;if(e)return"string"==typeof e?document.querySelector(e):e;const r=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;return r.getContextService().getDomElement().parentElement}function xG(t,e,n,r,i,o,a,s={},c=[10,10]){const l=new pM({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:tt({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function wG({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=bG(t,u),p=bG(t),g=a?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:y=xG(d,n,r,s,c,v,m,l,h)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:m},void 0!==i&&{content:i(o,{items:b,title:x})})),g.tooltipElement=y}function kG({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=bG(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),CG(t),NG(t),LG(t)}function MG({root:t,single:e}){const n=bG(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),CG(t),NG(t),LG(t)}function OG(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function EG(t){const{__data__:e}=t;if(Uo(t))return function(t){var e,n,r,i,o,a,s;const{__data__:c}=t,{title:l,items:u=[]}=c;if(u.some(t=>C$ in t)){const e=u.filter(na).map(e=>{var{color:n=SG(t)}=e,r=Ie(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(OG);return Object.assign(Object.assign({},l&&{title:l}),{items:e})}const f=null!==(n=null===(e=null==c?void 0:c.normalized)||void 0===e?void 0:e.x)&&void 0!==n?n:0,h=null===(r=t.parentNode)||void 0===r?void 0:r.__data__,d=null!==(i=null==h?void 0:h.encode)&&void 0!==i?i:{},{x:p={},y:g={},color:v={}}=d,{value:m=[]}=p,{value:y=[]}=g,{value:b=[]}=v,x=Math.min(Math.round(m.length*f),m.length-1);return{title:`${m[x]}, ${y[x]}`,items:[{name:null!==(o=v.field)&&void 0!==o?o:"value",value:b[x],color:(null===(a=t.style)||void 0===a?void 0:a.fill)||(null===(s=t.getAttribute)||void 0===s?void 0:s.call(t,"color"))||"#000"}]}}(t);const{title:n,items:r=[]}=e,i=r.filter(na).map(e=>{var{color:n=SG(t)}=e,r=Ie(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(OG);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}function SG(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function _G(t,e=t=>t){const n=new Map(t.map(t=>[e(t),t]));return Array.from(n.values())}function AG(t,e,n,r=t.map(t=>t.__data__),i={}){const o=t=>t instanceof Date?+t:t,a=_G(r.map(t=>t.title),o).filter(na),s=r.flatMap((r,o)=>{const a=r.element||t[o],{items:s=[],title:c}=r,l=s.filter(na),u=void 0!==n?n:s.length<=1;return l.map(t=>{var{color:n=SG(a)||i.color,name:o}=t,s=Ie(t,["color","name"]);const l=Ko(e,r),f=u&&!(C$ in s)?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})})}).map(OG);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:_G(s,t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`)})}function TG(t,e,n,r){var{plotWidth:i,plotHeight:o,mainWidth:a,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Ie(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map(e=>js(e,t)),r=Mr(n,t=>t);return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+a/2,e=l+d+s/2;return[t,e,js([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Jg({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,a]=u?[c+v[0],c+v[0],l,l+o]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const o=new cv({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(o),o})(e,n,r,a);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=a,t.ruleX=s}}function PG(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=Ie(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map(t=>t[1]),v=e.map(t=>t[0]),m=Ar(g),y=Ar(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=Rs(Ns([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,m+c,m+c]:[y+s,y+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new cv({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function CG(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function NG(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function LG(t){t.markers&&(t.markers.forEach(t=>t.remove()),t.markers=[])}function jG(t,e){return Array.from(t.values()).some(t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]})}function RG(t,e){return void 0===t?e:t}function IG(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function DG({root:t,event:e,elements:n=[],coordinate:r,scale:i,shared:o}){var a,s;const c=n.every(t=>"interval"===t.markType)&&!il(r),l=i.x,u=function(t){const{x:e}=t;if(!e||!e.valueBandWidth)return!0;const{valueBandWidth:n}=e;return!!I(n)||1===new Set(n.values()).size}(i),f=i.series,h=null!==(s=null===(a=null==l?void 0:l.getBandWidth)||void 0===a?void 0:a.call(l))&&void 0!==s?s:0,d=f&&f.valueBandWidth?t=>{const e=Math.round(1/f.valueBandWidth);return t.__data__.x+t.__data__.series*h+h/(2*e)}:t=>t.__data__.x+h/2;c&&n.sort((t,e)=>d(t)-d(e));const p=t=>{const{target:e=j(n)}=t;return aG(e,e=>!!e.classList&&(Uo(e)&&at(e,"__data__.normalized",function(t,e){const{innerWidth:n,innerHeight:r,marginLeft:i,paddingLeft:o,insetLeft:a,marginTop:s,paddingTop:c,insetTop:l}=t.getOptions();return{x:(e.x-i-o-a)/n,y:(e.y-s-c-l)/r}}(r,{x:t.offsetX,y:t.offsetY})),e.classList.includes("element")))},g=c?e=>{const i=BW(t,e);if(!i)return;const[a]=r.invert(i),s=$n(d).center,c=u?s(n,a):function(t,e){const{adjustedRange:n,valueBandWidth:r,valueStep:i}=t,o=Array.from(r.values()),a=Array.from(i.values()),s=n.map((t,e)=>{const n=(a[e]-o[e])/2;return[t-n,t+o[e]+n]}),c=s.findIndex(([t,n])=>t<=e&&e<=n);return-1!==c?c:e>.5?n.length-1:0}(l,a),f=n[c];if(!o){const t=n.find(t=>t!==f&&d(t)===d(f));if(t)return p(e)||t}return f}:p;return g(e)}function BG({root:t,event:e,elements:n,coordinate:r,scale:i,startX:o,startY:a}){const s=rl(r),c=[],l=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?c.push(t):(r||i)&&l.push(t)}const u=l.length&&l.every(t=>"interval"===t.markType)&&!il(r),f=t=>t.__data__.x,h=!!i.x.getBandWidth&&l.length>0;c.sort((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)});const d=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return cr([n[e],r[e]])};u?n.sort((t,e)=>f(t)-f(e)):l.sort((t,e)=>{const[n,r]=d(t),[i,o]=d(e),a=(n+r)/2,c=(i+o)/2;return s?c-a:a-c});const p=new Map(c.map(t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map((t,e)=>e),i=cr(r,t=>n[+t]);return[t,[i,n]]})),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,m=t=>{const[e]=r.invert(t);return e-v},y=(t,e,n,r)=>{const{_x:i}=t,o=void 0!==i?g.map(i):m(e),a=r.filter(na),[s,c]=cr([a[0],a[a.length-1]]);if(!h&&(o<s||o>c)&&!(s===c))return null;const l=$n(t=>r[+t]).center;return n[l(n,o)]},b=u?(t,e)=>{const n=e[(0,$n(f).center)(e,m(t))];return rr(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter(t=>{const[e,r]=d(t);return n>=e&&n<=r});if(!h||r.length>0)return r;const i=$n(t=>{const[e,n]=d(t);return(e+n)/2}).center;return[e[i(e,n)]].filter(na)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,n])=>{const r=n[e];return[W(t.replace("series","")),r]}))},w=BW(t,e);if(!w)return;const k=[w[0]-o,w[1]-a];if(!k)return;const M=b(k,l),O=[],E=[];for(const t of c){const[n,i]=p.get(t),o=y(e,k,n,i);if(null!==o){O.push(t);const e=x(t,o),{x:n,y:i}=e,a=r.map([(n||0)+v,i||0]);E.push([Object.assign(Object.assign({},e),{element:t}),a])}}const S=Array.from(new Set(E.map(t=>t[0].x))),_=S[Mr(S,t=>Math.abs(t-m(k)))],A=E.filter(t=>t[0].x===_),T=[...A.map(t=>t[0]),...M.map(t=>t.__data__)];return{selectedElements:[...O,...M],selectedData:T,filteredSeriesData:A,abstractX:m}}function FG(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:M,theme:O,offset:E,disableNative:S=!1,marker:_=!0,preserve:A=!1,style:T={},css:P={}}=e,C=Ie(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const N=n(t),L=tt(T,C),j=il(a),R=rl(a),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:$}=a.getOptions(),W=lt(e=>{var n;const d=BW(t,e);if(!d)return;const p=DW(t),g=p.min[0],S=p.min[1],{selectedElements:A,selectedData:T,filteredSeriesData:C,abstractX:W}=BG({root:t,event:e,elements:N,coordinate:a,scale:o,startX:v,startY:m}),H=AG(A,o,f,T,O);if(r&&H.items.sort((t,e)=>r(t)-r(e)),i&&(H.items=H.items.filter(i)),0===A.length||IG(H))return void G(e);if(y&&wG({root:t,data:H,x:d[0]+g,y:d[1]+S,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:M,css:P,offset:E}),s||c||l){const e=ia(L,"crosshairs"),n=Object.assign(Object.assign({},e),ia(L,"crosshairsX")),r=Object.assign(Object.assign({},e),ia(L,"crosshairsY")),i=C.map(t=>t[1]);c&&TG(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:m,transposed:R,polar:j})),l&&PG(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:m,transposed:R,polar:j}))}if(_){const e=ia(L,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach(t=>t.remove());const{type:i=""}=n,o=e.filter(t=>{const[{x:e,y:n}]=t;return na(e)&&na(n)}).map(t=>{const[{color:e,element:o},a]=t,s=e||o.style.fill||o.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Jg({className:"g2-tooltip-marker",style:Object.assign({cx:a[0],cy:a[1],fill:c,r:4,stroke:l,lineWidth:2,pointerEvents:"none"},n)})});for(const e of o)t.appendChild(e);t.markers=o}(t,{data:C,style:e,theme:O})}const Y=null===(n=C[0])||void 0===n?void 0:n[0].x,q=null!=Y?Y:W(focus);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},H),{data:{x:PP(o.x,q,!0)}})}))},d,{leading:p,trailing:g}),G=e=>{kG({root:t,single:b,emitter:h,event:e})},H=()=>{MG({root:t,single:b})},Y=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Ie(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=o.x.map(u),[h,d]=a.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];W(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},q=()=>{kG({root:t,single:b,emitter:h,nativeEvent:!1})},V=()=>{Z(),H()},U=e=>{BW(t,e)||G(e)},X=()=>{K()},K=()=>{S||(t.addEventListener("pointerdown",W),t.addEventListener("pointerenter",W),t.addEventListener("pointermove",W),t.addEventListener("pointerleave",U),t.addEventListener("pointerup",G))},Z=()=>{S||(t.removeEventListener("pointerdown",W),t.removeEventListener("pointerenter",W),t.removeEventListener("pointermove",W),t.removeEventListener("pointerleave",U),t.removeEventListener("pointerup",G))};return K(),h.on("tooltip:show",Y),h.on("tooltip:hide",q),h.on("tooltip:disable",V),h.on("tooltip:enable",X),()=>{Z(),h.off("tooltip:show",Y),h.off("tooltip:hide",q),h.off("tooltip:disable",V),h.off("tooltip:enable",X),A?kG({root:t,single:b,emitter:h,nativeEvent:!1}):H()}}function zG(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:o,name:a,item:s=()=>({}),facet:c=!1}=t,l=Ie(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,a,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,m=jG(p,"seriesTooltip"),y=jG(p,"crosshairs"),b=IW(f),x=RG(o,m),w=RG(n,y);if(x&&function(t){return Array.from(t.values()).some(t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip})}(p)&&!c)return FG(b,Object.assign(Object.assign({},l),{theme:v,elements:LW,scale:d,coordinate:g,crosshairs:w,crosshairsX:RG(RG(r,n),!1),crosshairsY:RG(i,w),item:s,emitter:u}));if(x&&c){const e=a.filter(e=>e!==t&&e.options.parentKey===t.options.key),o=jW(t,a),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),FG(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>o,scale:c,coordinate:g,crosshairs:RG(n,y),crosshairsX:RG(RG(r,n),!1),crosshairsY:RG(i,w),item:s,startX:h,startY:d,emitter:u}))}return function(t,{elements:e,coordinate:n,scale:r,render:i,groupName:o,sort:a,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:w,shared:k=!1,body:M=!0,disableNative:O=!1,preserve:E=!1,css:S={}}){const _=e(t),A=rr(_,h),T=lt(e=>{const l=DG({root:t,event:e,elements:_,coordinate:n,scale:r,shared:k});if(!l)return void kG({root:t,single:d,emitter:c,event:e});const u=h(l),f=A.get(u);if(!f)return;const v=1!==f.length||k?AG(f,r,o,void 0,x):EG(f[0]);if(a&&v.items.sort((t,e)=>a(t)-a(e)),s&&(v.items=v.items.filter(s)),IG(v))return void kG({root:t,single:d,emitter:c,event:e});const{offsetX:O,offsetY:E}=e;M&&wG({root:t,data:v,x:O,y:E,render:i,event:e,single:d,position:p,enterable:g,mount:y,bounding:b,css:S,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Xo(l,m)})}))},l,{leading:u,trailing:f}),P=e=>{kG({root:t,single:d,emitter:c,event:e})},C=()=>{O||(t.addEventListener("pointerdown",T),t.addEventListener("pointermove",T),t.addEventListener("pointerleave",P),t.addEventListener("pointerup",P))},N=()=>{O||(t.removeEventListener("pointerdown",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerleave",P),t.removeEventListener("pointerup",P))},L=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:o}=i,a=nG(_,o,v);if(!a)return;const s=a.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();T({target:a,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},j=({nativeEvent:e}={})=>{e||kG({root:t,single:d,emitter:c,nativeEvent:!1})},R=()=>{N(),MG({root:t,single:d})},I=()=>{C()};return c.on("tooltip:show",L),c.on("tooltip:hide",j),c.on("tooltip:enable",I),c.on("tooltip:disable",R),C(),()=>{N(),c.off("tooltip:show",L),c.off("tooltip:hide",j),c.off("tooltip:enable",I),c.off("tooltip:disable",R),E?kG({root:t,single:d,emitter:c,nativeEvent:!1}):MG({root:t,single:d})}}(b,Object.assign(Object.assign({},l),{datum:WW(h),elements:LW,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}uG.props={reapplyWhenUpdate:!0},fG.props={reapplyWhenUpdate:!0},hG.props={reapplyWhenUpdate:!0},pG.props={reapplyWhenUpdate:!0},gG.props={reapplyWhenUpdate:!0},vG.props={reapplyWhenUpdate:!0},mG.props={reapplyWhenUpdate:!0},zG.props={reapplyWhenUpdate:!0};const $G="legend-category";function WG(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function GG(t){return t.getElementsByClassName("legend-category-item-label")[0]}function HG(t){return t.getElementsByClassName("legend-category-item-focus-group")[0]}function YG(t){return t.getElementsByClassName("items-item")}function qG(t){return t.getElementsByClassName($G)}function VG(t){return t.getElementsByClassName("legend-continuous")}function UG(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function XG(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return Be(this,void 0,void 0,function*(){const{view:c,update:l,setState:u}=t;u(e,t=>{const{marks:e}=t,l=e.map(t=>{if("legends"===t.type)return t;const{transform:e=[],data:l=[]}=t,u=e.findIndex(({type:t})=>t.startsWith("group")||t.startsWith("bin")),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(o.map(t=>[t,{domain:c.scale[t].getOptions().domain}]));return tt({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map(t=>[t,{preserve:!0}]))}))});return Object.assign(Object.assign({},t),{marks:l})}),yield l()})}function KG(t,e){for(const n of t)XG(n,Object.assign(Object.assign({},e),{facet:!0}))}function ZG(){return(t,e,n)=>{const{container:r}=t,i=e.filter(e=>e!==t),o=i.length>0,a=t=>UG(t).scales.map(t=>t.name),s=[...qG(r),...VG(r)],c=s.flatMap(a),l=lt(o?KG:XG,50,{trailing:!0}),u=s.map(e=>{const{name:s,domain:u}=UG(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===$G?function(t,{legends:e,marker:n,label:r,datum:i,filter:o,defaultSelect:a,emitter:s,channel:c,state:l={}}){const u=new Map,f=new Map,h=new Map,d=new Map,{unselected:p={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=l,g={unselected:ia(p,"marker")},v={unselected:ia(p,"label")},{setState:m,removeState:y}=VW(g,void 0),{setState:b,removeState:x}=VW(v,void 0),w=Array.from(e(t));let k=w.map(i);const M=()=>{for(const t of w){const e=i(t),o=n(t),a=r(t);k.includes(e)?(y(o,"unselected"),x(a,"unselected")):(m(o,"unselected"),b(a,"unselected"))}};for(const e of w){const n=()=>{tG(t,"pointer")},r=()=>{eG(t)},a=t=>Be(this,void 0,void 0,function*(){const n=i(e),r=k.indexOf(n);-1===r?k.push(n):k.splice(r,1),yield o(k),M();const{nativeEvent:a=!0}=t;a&&(k.length===w.length?s.emit("legend:reset",{nativeEvent:a}):s.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:a,data:{channel:c,values:k}})))});e.addEventListener("click",a),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),u.set(e,a),f.set(e,n),h.set(e,r);const l=HG(e);if(l){const t=t=>Be(this,void 0,void 0,function*(){t.stopPropagation();const n=i(e),r=k.indexOf(n),{nativeEvent:a=!0}=t;if(-1!==r&&1===k.length){if(!a)return;k=w.map(i),yield o(k),M(),s.emit("legend:reset",{nativeEvent:a})}else{if(k=[n],yield o(k),M(),!a)return;s.emit("legend:focus",Object.assign(Object.assign({},t),{nativeEvent:a,data:{channel:c,value:n}}))}});l.addEventListener("click",t),d.set(e,t)}}const O=t=>Be(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,value:i}=n;r===c&&(k=[i],yield o(k),M())}),E=t=>Be(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===c&&(k=i,yield o(k),M())}),S=t=>Be(this,void 0,void 0,function*(){const{nativeEvent:e}=t;e||(k=w.map(i),yield o(k),M())});return s.on("legend:filter",E),s.on("legend:focus",O),s.on("legend:reset",S),a&&s.emit("legend:filter",{data:{channel:c,values:a}}),()=>{for(const t of w){t.removeEventListener("click",u.get(t)),t.removeEventListener("pointerenter",f.get(t)),t.removeEventListener("pointerout",h.get(t));const e=HG(t);e&&e.removeEventListener("click",d.get(t)),s.on("legend:focus",O),s.off("legend:filter",E),s.off("legend:reset",S)}}}(r,{legends:YG,marker:WG,label:GG,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,defaultSelect:e.attributes.defaultSelect,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})});return()=>{u.forEach(t=>t())}}}function QG(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=qG(r),s=LW(r),c=t=>UG(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=XW(o,["active","inactive"]),f=KW(s,WW(i)),h=[];for(const t of a){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=YG(t),o=l(r),a=rr(s,t=>o.invert(t.__data__[r])),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=VW(u,f),m={inactive:ia(p,"marker")},y={inactive:ia(p,"label")},{setState:b,removeState:x}=VW(m),{setState:w,removeState:k}=VW(y),M=t=>{for(const e of i){const n=WG(e),r=GG(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},O=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},E=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),E.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},_=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find(t=>e(t)===s);c&&O({nativeEvent:!1},c)},A=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",_),n.on("legend:unhighlight",A);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",_),n.off("legend:unhighlight",A);for(const[t,e]of E)t.removeEventListener(e)};h.push(T)}return()=>h.forEach(t=>t())}}function JG(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function tH(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function eH(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const nH=Zm(t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Ie(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=ia(aa(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Ie(d,["render"]),v=ia(u,"handleE"),{render:m=h}=v,y=Ie(v,["render"]),b=ia(aa(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=Ie(b,["render"]),k=ia(u,"handleW"),{render:M=h}=k,O=Ie(k,["render"]),E=ia(u,"handleNW"),{render:S=h}=E,_=Ie(E,["render"]),A=ia(u,"handleNE"),{render:T=h}=A,P=Ie(A,["render"]),C=ia(u,"handleSE"),{render:N=h}=C,L=Ie(C,["render"]),j=ia(u,"handleSW"),{render:R=h}=j,I=Ie(j,["render"]),D=t=>()=>{const e=Zm(e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t));return new e({})},B=Cm(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(eH,Object.assign(Object.assign({width:i,height:o},aa(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(eH,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(eH,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(eH,w),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(eH,O),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(eH,_),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(eH,P),B.maybeAppend("handle-se",D(N)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(eH,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(eH,I)});function rH(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:o=()=>{},brushupdated:a=()=>{},extent:s=tH(t),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Ie(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[w,k,M,O]=s;tG(t,"crosshair"),t.style.draggable=!0;const E=(t,e,n)=>{if(o(n),y&&y.remove(),b&&b.remove(),g=[t,e],l)return S();_()},S=()=>{b=new uv({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),y=new nH({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},_=()=>{y=new nH({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(y)},A=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${M},${k}L${M},${O}L${w},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=FW(t,e);if(!y||!L(n))return E(r,i,e),void(x=!0);L(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=FW(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],w,M),o=e(r,g[1],v[1],k,O),a=[g[0]+i,g[1]+o],s=[v[0]+i,v[1]+o];T(a,s)})(r);const[i,o]=[r[0]-m[0],r[1]-m[1]],{id:a}=n;if(N[a]){const[t,e,n,r]=N[a].vector;return T([g[0]+i*t,g[1]+o*e],[v[0]+i*n,v[1]+o*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void a(t,n,t+r,n+i,e)}v=FW(t,e);const[n,r,o,s]=T(g,v);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;y&&!L(e)&&A()},z=e=>{const{target:n}=e;y&&L(n)&&!x?R(n)?tG(t,"move"):j(n)&&tG(t,N[n.id].cursor):tG(t,"crosshair")},$=()=>{tG(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",$),{mask:y,move(t,e,n,r,i=!0){y||E(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&A(t)},destroy(){y&&A(!1),tG(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",$)}}}function iH(t,e,n){return e.filter(e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find(t=>t.brushKey===n)})}function oH(t,e,n){return iH(t,e,n).map(t=>t.options)}function aH(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:o,brushRegion:a,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=t=>t,bboxOf:d=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=Ie(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=KW(m,o),w=ia(v,"mask"),{setState:k,removeState:M}=VW(p,x),O=new Map,{width:E,height:S,x:_=0,y:A=0}=d(t),T=s||[0,0,E,S],P=()=>{for(const t of[...m,...b])M(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of m){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;JG([c,l,u,f],[t,e,n,r])?(k(i,"active"),o.add(h(i))):k(i,"inactive")}for(const t of b)o.has(h(t))?k(t,"active"):k(t,"inactive")},N=()=>{for(const t of m)M(t,"inactive");for(const t of O.values())t.remove();O.clear()},L=(e,n,r,i)=>{const o=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e},a=new gv({style:{x:e+_,y:n+A,width:r-e,height:i-n}});t.appendChild(a);for(const t of m){const e=O.get(t)||o(t);e.style.clipPath=a,k(t,"inactive"),k(e,"active")}},j=rH(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=NP(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=NP(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushupdated:(t,e,n,r,i)=>{const o=NP(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const{x:r,y:i}=e,[o,a]=t,s=LP(o,r),c=LP(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function sH(t){var{facet:e,brushKey:n}=t,r=Ie(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=IW(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return aH(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>jW(t,i),datum:WW(RW(t,i).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:XW(RW(t,i).map(t=>t.options),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=aH(l,Object.assign(Object.assign({elements:LW,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return iH(t,e,n).map(t=>IW(t.container))}(t,i,n),datum:WW([s,...iH(t,i,n).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:XW([c,...oH(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function cH(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function lH(t){return sH(Object.assign(Object.assign({},t),{brushRegion:cH,selectedHandles:["handle-e","handle-w"]}))}function uH(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function fH(t){return sH(Object.assign(Object.assign({},t),{brushRegion:uH,selectedHandles:["handle-n","handle-s"]}))}sH.props={reapplyWhenUpdate:!0};const hH="axis-hot-area";function dH(t){return t.getElementsByClassName("axis")}function pH(t){return t.getElementsByClassName("axis-line")[0]}function gH(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function vH(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Ie(e,["cross","offsetX","offsetY"]);const a=gH(t),s=pH(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:uH,hotZone:new gv({className:hH,style:Object.assign({width:n?d/2:d,transform:`translate(${(n?l:c-d/2).toFixed(2)}, ${u})`,height:h-u},o)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function mH(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Ie(e,["offsetY","offsetX","cross"]);const a=gH(t),s=pH(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:cH,hotZone:new gv({className:hH,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},o)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function yH(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=IW(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=o;return function(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=Ie(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=KW(p,a),{setState:m,removeState:y}=VW(u,v),b=new Map,x=ia(d,"mask"),w=t=>Array.from(b.values()).every(([e,n,r,i])=>t.some(([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)),k=g.map(t=>t.attributes.scale),M=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,E=()=>{O.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();O.set(t,M(n))}};E();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}O.set(t,A(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},_=t=>{for(const t of p)y(t,"active","inactive");E(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},A=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return M(CP(n,i))},T=g.some(o)&&g.some(t=>!o(t)),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?mH:vH,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=rH(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?_(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach(t=>t.remove(!1))},N=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=k[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach(t=>t.destroy()),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:LW,axes:dH,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:WW(o),state:XW(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function bH(t){var{hideX:e=!0,hideY:n=!0}=t,r=Ie(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=IW(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=ia(Ie(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=rH(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){t===r&&e===i||(o.nativeEvent=!0,n(u(t,e,r,i),o),m.remove())}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return NP(t,e,n,r,i,o)},filter:(t,r)=>Be(this,void 0,void 0,function*(){if(d)return;d=!0;const[i,a]=t;u("brushFilter",t=>{const{marks:r}=t,o=r.map(t=>tt({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:a,nice:!1}}}));return Object.assign(Object.assign({},c),{marks:o,clip:!0})}),o.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,a]}}));const s=yield l();p=s.view,d=!1,h=!0}),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,a=r.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,a]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:o,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function xH(t){return bH(Object.assign(Object.assign({hideX:!0},t),{brushRegion:cH}))}function wH(t){return bH(Object.assign(Object.assign({hideY:!0},t),{brushRegion:uH}))}const kH="slider";function MH(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map(t=>{var a,s;return tt({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(a=t[n])||void 0===a?void 0:a[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function OH(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return CP(e,[PP(e,o(r),!0),PP(e,o(i),!1)])}function EH(t){return[t[0],t[t.length-1]]}function SH({initDomain:t={},className:e=kH,prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1,getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(l,u,f)=>{const{container:h,view:d,update:p,setState:g}=l,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let m=!1;const{scale:y,coordinate:b,layout:x}=d,{x:w,y:k}=y,M=rl(b),O=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return M?[n,e]:[e,n]},E=new Map,S=new Set,_={x:t.x||w.getOptions().domain,y:t.y||k.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=O(e),h=`${n}${G(l)}:filter`,d="x"===l,{ratio:v}=w.getOptions(),{ratio:b}=k.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=EH(_.x),r=EH(_.y)]=e;return d?[CP(w,n,v),CP(k,r,b)]:[CP(k,r,b),CP(w,n,v)]}const{value:n}=t.detail;return[OH(n,y[l],M&&"horizontal"===e),_[u]]},A=lt(e=>Be(this,void 0,void 0,function*(){const{initValue:r=!1}=e;if(m&&!r)return;m=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(_[l]=a,_[u]=s,o){const t=d?a:s,n=d?s:a;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[EH(t),EH(n)]}}))}g(t,t=>Object.assign({},MH(t,{[l]:{domain:a,nice:!1}},n,i,l,u))),yield p(),m=!1}),o,{leading:a,trailing:s}),T=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new Jp("valuechange",{data:i,nativeEvent:!1}));const c=d?jP(a,w):jP(s,k);r(t,c)};f.on(h,T),t.addEventListener("valuechange",A),E.set(t,A),S.add([h,T]);const P=c(t);P&&t.dispatchEvent(new Jp("valuechange",{detail:{value:P},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of E)t.removeEventListener("valuechange",e);for(const[t,e]of S)f.off(t,e)}}}function _H({className:t=kH,setValue:e=(t,e)=>t.setValues(e),minRange:n=.01,wheelSensitivity:r=.05,x:i=!0,y:o=!0}={}){return a=>{const{container:s,view:c}=a,{coordinate:l}=c,u=rl(l),f=Math.max(1e-6,Math.min(1,n)),h=s.getElementsByClassName(t);if(!h.length)return()=>{};const d=(t,e)=>!0===t||!1!==t&&("shift"===t?e.shiftKey&&!e.ctrlKey&&!e.altKey:"ctrl"===t?e.ctrlKey&&!e.shiftKey&&!e.altKey:"alt"===t&&(e.altKey&&!e.shiftKey&&!e.ctrlKey)),p=(t,n)=>{e(t,n),t.dispatchEvent(new Jp("valuechange",{detail:{value:n},nativeEvent:!0}))},g=t=>{t.preventDefault(),t.stopPropagation();for(const e of h){const{values:n,orientation:a}=e.attributes;if(!n)continue;const s="horizontal"===a;if(!d("x"===(u?s?"y":"x":s?"x":"y")?i:o,t))continue;const[c,l]=n,h=l-c,g=(c+l)/2,v=r*lG(h),m=1+t.deltaY*v,y=Math.max(f,Math.min(1,h*m)),b=y/2;let x=g-b,w=g+b;x<0?(x=0,w=Math.min(1,y)):w>1&&(w=1,x=Math.max(0,1-y)),p(e,[x,w])}};return s.addEventListener("wheel",g,{passive:!1}),()=>{s.removeEventListener("wheel",g)}}}_H.props={reapplyWhenUpdate:!0};const AH="g2-scrollbar";function TH(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(AH).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return SH(Object.assign({initDomain:l,className:AH,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0]||1!==e[1])return e}},t))(e,n,r)}}function PH(t,e,n){return`<${t} style="${Object.entries(n).map(([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`).join(";")}">${e}</${t}>`}const CH={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function NH(t){return"text"===t.nodeName&&!!t.isOverflowing()}function LH(t){var{offsetX:e=8,offsetY:n=8}=t,r=Ie(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=ia(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!NH(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,h=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new ov({className:"poptip",style:{innerHTML:PH("div",d,Object.assign(Object.assign({},CH),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;NH(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach(t=>t.remove())}}}LH.props={reapplyWhenUpdate:!0};const jH={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function RH(t={}){const{originData:e=[],layout:n}=t,r=Ie(t,["originData","layout"]),i=tt({},jH,r),o=ia(i,"breadCrumb"),a=ia(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return Cm(t).select(`.${HO}`).node()}(s),u=c.marks[0],{state:f}=u,h=new rv;l.appendChild(h);const d=(t,c)=>Be(this,void 0,void 0,function*(){if(h.removeChildren(),c){let e="",n=o.y,r=0;const i=[],s=l.getBBox().width,c=t.map((a,c)=>{e=`${e}${a}/`,i.push(a);const l=new mv({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:a,x:r,path:[...i],depth:c},o),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new mv({style:Object.assign(Object.assign({x:r,text:" / "},o),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.getBBox().height+o.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===ht(t)-1&&u.remove(),l});c.forEach((t,e)=>{if(e===ht(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",()=>{t.attr(a)}),t.addEventListener("mouseleave",()=>{t.attr(n)}),t.addEventListener("click",()=>{d(ot(t,["style","path"]),ot(t,["style","depth"]))})})}!function(t,e){[...qG(t),...VG(t)].forEach(t=>{e(t,t=>t)})}(s,i),i("treemapDrillDown",r=>{const{marks:i}=r,o=t.join("/"),a=i.map(t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter(t=>{const e=ot(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))}).map(t=>({value:0===t.height?ot(t,["value"]):void 0,name:ot(t,["id"])})),{paddingLeft:i,paddingBottom:a,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:a/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=A_(t,l,{value:"value"})[0]}else r=e.filter(t=>1===t.depth);const i=[];return r.forEach(({path:t})=>{i.push(j(t))}),tt({},t,{data:r,scale:{color:{domain:i}}})});return Object.assign(Object.assign({},r),{marks:a})}),yield r(void 0,["legendFilter"])}),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:o}=n||{};if("rect"!==r&&i!==pu.TEXT)return;const a=i===pu.TEXT&&!0===ot(o,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>ot(t,["__data__","key"]))(n),s=A(e,t=>t.id===a);ot(s,"height")&&d(ot(s,"path"),ot(s,"depth"))};l.addEventListener("click",p);const g=M(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{oG(l).forEach(t=>{const n=ot(t,["style","cursor"]),r=A(e,e=>e.id===ot(t,["__data__","key"]));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=function(t,e){if(null===t||!_(t))return{};var n={};return k(e,function(e){st.call(t,e)&&(n[e]=t[e])}),n}(t.attributes,g);t.addEventListener("mouseenter",()=>{t.attr(f.active)}),t.addEventListener("mouseleave",()=>{t.attr(tt(e,f.inactive))})}})};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const IH={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},DH="movePoint",BH=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},FH=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},zH=(t,e,n)=>{t.forEach((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)})},$H=(t,e,n,r)=>{const i=new uv({style:n}),o=new mv({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},WH=(t,e)=>{if(!ot(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},GH=(t,e,n)=>{const r=rG(t,e),i=rG(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function HH(t={}){const{selection:e=[],precision:n=2}=t,r=Ie(t,["selection","precision"]),i=Object.assign(Object.assign({},IH),r||{}),o=ia(i,"path"),a=ia(i,"label"),s=ia(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=IW(u);let g,v=oG(p),m=e;const{transform:y=[],type:b}=d,x=!!A(y,({type:t})=>"transpose"===t),w="polar"===b,k="theta"===b,M=!!A(v,({markType:t})=>"area"===t);M&&(v=v.filter(({markType:t})=>"area"===t));const O=new rv({style:{zIndex:2}});p.appendChild(O);const E=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],E(),T(e)},_=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=ot(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:_,y1:P}=d;if(x&&"interval"!==r)return;const{scale:C,coordinate:N}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=C,I=N.getCenter();let D;O.removeChildren();const B=(t,e,n,r)=>Be(this,void 0,void 0,function*(){return l("elementPointMove",o=>{var a;const s=((null===(a=null==g?void 0:g.options)||void 0===a?void 0:a.marks)||h).map(o=>{if(!r.includes(o.type))return o;const{data:a,encode:s}=o,c=Object.keys(s).reduce((r,i)=>{const o=s[i];return"x"===i&&(r[o]=t),"y"===i&&(r[o]=e),"color"===i&&(r[o]=n),r},{}),l=((t,e,n)=>e.map(e=>{const r=["x","color"].reduce((r,i)=>{const o=n[i];return o?e[o]===t[o]&&r:r},!0);return r?Object.assign(Object.assign({},e),t):e}))(c,a,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),tt({},o,{data:l,animate:!1})});return Object.assign(Object.assign({},o),{marks:s})}),yield c("elementPointMove")});if(["line","area"].includes(r))v.forEach((e,r)=>{const i=R.invert(_[r]);if(!i)return;const c=new Jg({name:DH,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=ot(t,["__data__","seriesItems",e,"0","value"]),r=ot(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=A(a,({type:t})=>"normalizeY"===t),c=ot(o,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",f=>{const h=N.output([_[r],0]),d=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,E()),zH(O.childNodes,m,s);const[p,x]=$H(O,c,o,a),k=t=>{const i=e[1]+t.clientY-D[1];if(M)if(w){const o=e[0]+t.clientX-D[0],[a,s]=GH(I,h,[o,i]),[,u]=N.output([1,j.output(0)]),[,f]=N.invert([a,u-(v[r+d][1]-s)]),g=(r+1)%d,m=iG([v[(r-1+d)%d],[a,s],y[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",m),c.attr("cx",a),c.attr("cy",s)}else{const[,t]=N.output([1,j.output(0)]),[,o]=N.invert([e[0],t-(v[r+d][1]-i)]),a=iG([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",l(j.invert(o)).toFixed(n)),p.attr("d",a),c.attr("cy",i)}else{const[,t]=N.invert([e[0],i]),o=iG([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",o),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const S=()=>Be(this,void 0,void 0,function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",S),q(x.attr("text")))return;const e=Number(x.attr("text")),n=WH(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)});u.addEventListener("mouseup",S)}),O.appendChild(c)}),zH(O.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=ot(t,["__data__","y"]),n=ot(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=A(o,({type:t})=>"normalizeY"===t),c=ot(i,["y","field"]),l=r[a.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new Jg({name:DH,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",s=>{u.attr("cursor","move");const l=WH(L,b),[f,h]=$H(O,c,o,a),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[o]=N.output([j.output(0),j.output(0)]),[,a]=N.invert([o+(r-v[2][0]),e[1]]),s=iG([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],o=e[0]+t.clientX-D[0],[a,s]=GH(I,[o,r],e),[l,u]=GH(I,[o,r],v[1]),d=N.invert([a,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=rG(t,e[1]),o=rG(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]),r}(I,[[a,s],[l,u],v[2],v[3]],p>.5?1:0);h.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),c.attr("cx",a),c.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,o]=N.output([1,j.output(0)]),[,a]=N.invert([e[0],o-(v[2][1]-r)]),s=iG([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Be(this,void 0,void 0,function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),q(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(S,e,l,[r]),h.remove(),f.remove(),T(t)});u.addEventListener("mouseup",p)}),O.appendChild(c)}};v.forEach((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",BH),t.addEventListener("mouseleave",FH)});const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===DH||v.includes(e))||(m=[],E(),O.removeChildren())};return i.on("element-point:select",_),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{O.remove(),i.off("element-point:select",_),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach(t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",BH),t.removeEventListener("mouseleave",FH)})}}}var YH={},qH={};function VH(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function UH(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var r in t)r in e||n.push(e[r]=r)}),n}function XH(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function KH(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+XH(-t,6):t>9999?"+"+XH(t,6):XH(t,4)}(t.getUTCFullYear())+"-"+XH(t.getUTCMonth()+1,2)+"-"+XH(t.getUTCDate(),2)+(i?"T"+XH(e,2)+":"+XH(n,2)+":"+XH(r,2)+"."+XH(i,3)+"Z":r?"T"+XH(e,2)+":"+XH(n,2)+":"+XH(r,2)+"Z":n||e?"T"+XH(e,2)+":"+XH(n,2)+"Z":"")}function ZH(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return qH;if(l)return l=!1,YH;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=u())!==qH;){for(var f=[];r!==YH&&r!==qH;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map(function(e){return n.map(function(t){return a(e[t])}).join(t)})}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?KH(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=VH(t);return function(r,i){return e(n(r),i,t)}}(t,e):VH(t)});return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=UH(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=UH(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function QH(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;JH&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const JH=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),tY=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Be(void 0,void 0,void 0,function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return ZH(r).parse(e,i?QH:Zo)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)})};tY.props={};const eY=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap(t=>e.map(e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))):t;var i}};function nY(t){return null!=t&&!Number.isNaN(t)}eY.props={};const rY=t=>{const{callback:e=nY}=t;return t=>t.filter(e)};rY.props={};const iY=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};iY.props={};const oY=t=>{const{fields:e}=t;return t=>t.map(t=>function(t,e=[]){return e.reduce((e,n)=>(n in t&&(e[n]=t[n]),e),{})}(t,e))};oY.props={};const aY=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map(e=>Object.entries(e).reduce((e,[n,r])=>(e[t[n]||n]=r,e),{}))};aY.props={};const sY=t=>{const{fields:e=[]}=t,n=(r=!0,e.map(t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]}));var r;return t=>[...t].sort((t,e)=>n.reduce((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r]),0))};sY.props={};const cY=t=>{const{value:e}=t;return()=>e};cY.props={};const lY=t=>{const{callback:e=Zo}=t;return t=>e(t)};lY.props={};const uY=t=>{const{callback:e=Zo}=t;return t=>Array.isArray(t)?t.map(e):t};uY.props={};const fY=Math.PI/180,hY=2048;function dY(t){return t.text}function pY(){return"serif"}function gY(){return"normal"}function vY(t){return t.value}function mY(){return 90*~~(2*Math.random())}function yY(){return 1}function bY(){}function xY(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,hY/o);let a=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font;let t=i.measureText(e.text+"m").width*o,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*fY),r=Math.cos(e.rotate*fY),i=t*r,o=t*n,a=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(o+a),Math.abs(o-a))}else t=t+31>>5<<5;if(l>c&&(c=l),a+t>=2048&&(a=0,s+=c,c=0),s+l>=hY)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*fY),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=a,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const u=i.getImageData(0,0,2048/o,hY/o).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let o=e.y1-e.y0;for(let t=0;t<o*i;t++)f[t]=0;if(a=e.xoff,null==a)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<o;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(a+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,o--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function wY(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,o=t.x-(i<<4),a=127&o,s=32-a,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(o>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>a:0))&e[u+n])return!0;u+=n}return!1}function kY(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function MY(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function OY(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function EY(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function SY(){return document.createElement("canvas")}function _Y(t){return"function"==typeof t?t:function(){return t}}const AY={archimedean:OY,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function TY(){let t=[256,256],e=dY,n=pY,r=vY,i=gY,o=mY,a=yY,s=OY,c=Math.random,l=bY,u=[],f=null,h=1/0,d=SY;const p=gY,g={};function v(e,n,r){const i=n.x,o=n.y,a=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,h,d,p=-u;for(;(f=l(p+=u))&&(h=~~f[0],d=~~f[1],!(Math.min(Math.abs(h),Math.abs(d))>=a));)if(n.x=i+h,n.y=o+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!wY(n,e,t[0]))&&(!r||MY(n,r))){const r=n.sprite,i=n.width>>5,o=t[0]>>5,a=n.x-(i<<4),s=127&a,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*o+(a>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=o}return delete n.sprite,!0}return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=hY/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:EY((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map(function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=o.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=a.call(this,t,s,c),t}).sort(function(t,e){return e.size-t.size});let M=-1,O=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function E(){const e=Date.now();for(;Date.now()-e<h&&++M<x;){const e=k[M];e.x=s*(c()+.5)>>1,e.y=m*(c()+.5)>>1,xY(y,e,k,M),e.hasText&&v(b,e,O)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),O?g.hasImage||kY(O,e):O=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=O,M>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:w,bounds:O}))}return f&&clearInterval(f),f=setInterval(E,0),E(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const o=r>>5,a=EY((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=o*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;a[n]|=s}g.board=a,g.hasImage=!0},g.timeInterval=function(t){h=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=_Y(t)},g.font=function(t){n=_Y(t)},g.fontWeight=function(t){i=_Y(t)},g.rotate=function(t){o=_Y(t)},g.canvas=function(t){d=_Y(t)},g.spiral=function(t){s=AY[t]||t},g.fontSize=function(t){r=_Y(t)},g.padding=function(t){a=_Y(t)},g.random=function(t){c=_Y(t)},g.on=function(t){l=_Y(t)},g}const PY={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function CY(t){return new Promise((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}})}const NY=(t,e)=>n=>Be(void 0,void 0,void 0,function*(){const r=Object.assign({},PY,t,{canvas:e.createCanvas}),i=TY();var o,a;yield(o=i,a=r,{set(t,e,n){if(void 0===a[t])return this;const r=e?e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this},setAsync(t,e,n){return Be(this,void 0,void 0,function*(){if(void 0===a[t])return this;const r=e?yield e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this})}}).set("fontSize",t=>{const e=n.map(t=>t.value);return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[kr(e),xr(e)])}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",CY,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map(t=>{var{x:e,y:n,font:r}=t,i=Ie(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})}),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:m,y:d?l:y})),p});function LY(t){return"string"==typeof t?e=>e[t]:t}NY.props={};const jY=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=LY(s),l=LY(a),u=or(e,([t])=>t,t=>c(t));return t=>t.map(t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce((t,n,r)=>(t[i[r]]=e?e[n]:o,t),{}))})};jY.props={};const RY=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};RY.props={};var IY={exports:{}},DY={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(DY),function(t){var e=Math.log(2),n=t.exports,r=DY.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<o;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,a),p=d[a],g=d[a-1]-d[a-2],v=0;t.forEach(function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,m=d[-a-1+l]||0,y=p/(p-h-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*y*g)}});var m=v,y=0,b=0;return f.forEach(function(t){y+=t.y,m+=y,t.y=m,b+=m}),b>0&&f.forEach(function(t){t.y/=b}),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach(function(t){e+=t.x*t.y}),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/e,Math.pow(2,n)}}}(IY);var BY=IY.exports;const FY=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(rr(t,t=>n.map(e=>t[e]).join("-")).values());return r.map(t=>{const n=BY.create(t.map(t=>t[e]),{min:i,max:o,size:a,width:s}),r=n.map(t=>t.x),u=n.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})})}};function zY(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function $Y(t,e){return zY(t).map(()=>zY(e))}function WY(t,e){let n=0;for(let r=0;r<t.length;++r)n+=t[r]*e[r];return n}function GY(t){return Math.sqrt(WY(t,t))}function HY(t,e,n){for(let r=0;r<e.length;++r)t[r]=e[r]*n}function YY(t,e,n,r,i){for(let o=0;o<t.length;++o)t[o]=e*n[o]+r*i[o]}function qY(t,e,n,r,i,o,a){const s=n.fx,c=WY(n.fxprime,e);let l=s,u=s,f=c,h=0;function d(u,h,d){for(let p=0;p<16;++p)if(i=(u+h)/2,YY(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=WY(r.fxprime,e),l>s+o*i*c||l>=d)h=i;else{if(Math.abs(f)<=-a*c)return i;f*(h-u)>=0&&(h=u),u=i,d=l}return 0}i=i||1,o=o||1e-6,a=a||.1;for(let p=0;p<10;++p){if(YY(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=WY(r.fxprime,e),l>s+o*i*c||p&&l>=u)return d(h,i,u);if(Math.abs(f)<=-a*c)return i;if(f>=0)return d(i,h,l);u=l,h=i,i*=2}return i}function VY(t,e,n){let r={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const o=e.slice();let a,s=1;const c=(n=n||{}).maxIterations||20*e.length;r.fx=t(r.x,r.fxprime);const l=r.fxprime.slice();HY(l,r.fxprime,-1);for(let e=0;e<c;++e){if(s=qY(t,l,r,i,s),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),s){YY(o,1,i.fxprime,-1,r.fxprime);const t=WY(r.fxprime,r.fxprime);YY(l,Math.max(0,WY(o,i.fxprime)/t),l,-1,i.fxprime),a=r,r=i,i=a}else HY(l,r.fxprime,-1);if(GY(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),r}FY.props={};const UY=1e-10;function XY(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let r=n+1;r<t.length;++r){const i=JY(t[n],t[r]);for(let t=0;t<i.length;++t){const o=i[t];o.parentIndex=[n,r],e.push(o)}}return e}(t),r=n.filter(function(e){return function(t,e){for(let n=0;n<e.length;++n)if(ZY(t,e[n])>e[n].radius+UY)return!1;return!0}(e,t)});let i,o=0,a=0;const s=[];if(r.length>1){const e=function(t){const e={x:0,y:0};for(let n=0;n<t.length;++n)e.x+=t[n].x,e.y+=t[n].y;return e.x/=t.length,e.y/=t.length,e}(r);for(i=0;i<r.length;++i){const t=r[i];t.angle=Math.atan2(t.x-e.x,t.y-e.y)}r.sort(function(t,e){return e.angle-t.angle});let n=r[r.length-1];for(i=0;i<r.length;++i){const e=r[i];a+=(n.x+e.x)*(e.y-n.y);const c={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let l=null;for(let r=0;r<e.parentIndex.length;++r)if(n.parentIndex.indexOf(e.parentIndex[r])>-1){const i=t[e.parentIndex[r]],o=Math.atan2(e.x-i.x,e.y-i.y),a=Math.atan2(n.x-i.x,n.y-i.y);let s=a-o;s<0&&(s+=2*Math.PI);const u=a-s/2;let f=ZY(c,{x:i.x+i.radius*Math.sin(u),y:i.y+i.radius*Math.cos(u)});f>2*i.radius&&(f=2*i.radius),(null===l||l.width>f)&&(l={circle:i,width:f,p1:e,p2:n})}null!==l&&(s.push(l),o+=KY(l.circle.radius,l.width),n=e)}}else{let e=t[0];for(i=1;i<t.length;++i)t[i].radius<e.radius&&(e=t[i]);let n=!1;for(i=0;i<t.length;++i)if(ZY(t[i],e)>Math.abs(e.radius-t[i].radius)){n=!0;break}n?o=a=0:(o=e.radius*e.radius*Math.PI,s.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-UY,y:e.y+e.radius},width:2*e.radius}))}return a/=2,e&&(e.area=o+a,e.arcArea=o,e.polygonArea=a,e.arcs=s,e.innerPoints=r,e.intersectionPoints=n),o+a}function KY(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function ZY(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function QY(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const r=e-(n*n-t*t+e*e)/(2*n);return KY(t,t-(n*n-e*e+t*t)/(2*n))+KY(e,r)}function JY(t,e){const n=ZY(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];const o=(r*r-i*i+n*n)/(2*n),a=Math.sqrt(r*r-o*o),s=t.x+o*(e.x-t.x)/n,c=t.y+o*(e.y-t.y)/n,l=-(e.y-t.y)*(a/n),u=-(e.x-t.x)*(a/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function tq(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const n=e.initialLayout||rq,r=e.lossFunction||iq;t=function(t){t=t.slice();const e=[],n={};let r,i,o,a;for(r=0;r<t.length;++r){const i=t[r];1==i.sets.length?e.push(i.sets[0]):2==i.sets.length&&(o=i.sets[0],a=i.sets[1],n[[o,a]]=!0,n[[a,o]]=!0)}for(e.sort((t,e)=>t>e?1:-1),r=0;r<e.length;++r)for(o=e[r],i=r+1;i<e.length;++i)a=e[i],[o,a]in n||t.push({sets:[o,a],size:0});return t}(t);const i=n(t,e),o=[],a=[];let s;for(s in i)i.hasOwnProperty(s)&&(o.push(i[s].x),o.push(i[s].y),a.push(s));const c=function(t,e,n){const r=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,a=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,l=void 0!==n.chi?n.chi:2,u=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5;let h;const d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e),p[0].id=0;for(let n=0;n<d;++n){const r=e.slice();r[n]=r[n]?r[n]*i:o,p[n+1]=r,p[n+1].fx=t(r),p[n+1].id=n+1}function g(t){for(let e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}const v=(t,e)=>t.fx-e.fx,m=e.slice(),y=e.slice(),b=e.slice(),x=e.slice();for(let e=0;e<r;++e){if(p.sort(v),n.history){const t=p.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:t})}h=0;for(let t=0;t<d;++t)h=Math.max(h,Math.abs(p[0][t]-p[1][t]));if(Math.abs(p[0].fx-p[d].fx)<a&&h<s)break;for(let t=0;t<d;++t){m[t]=0;for(let e=0;e<d;++e)m[t]+=p[e][t];m[t]/=d}const e=p[d];if(YY(y,1+c,m,-c,e),y.fx=t(y),y.fx<p[0].fx)YY(x,1+l,m,-l,e),x.fx=t(x),x.fx<y.fx?g(x):g(y);else if(y.fx>=p[d-1].fx){let n=!1;if(y.fx>e.fx?(YY(b,1+u,m,-u,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(YY(b,1-u*c,m,u*c,e),b.fx=t(b),b.fx<y.fx?g(b):n=!0),n){if(f>=1)break;for(let e=1;e<p.length;++e)YY(p[e],1-f,p[0],f,p[e]),p[e].fx=t(p[e])}}else g(y)}return p.sort(v),{fx:p[0].fx,x:p[0]}}(function(e){const n={};for(let t=0;t<a.length;++t){const r=a[t];n[r]={x:e[2*t],y:e[2*t+1],radius:i[r].radius}}return r(n,t)},o,e),l=c.x;for(let t=0;t<a.length;++t)s=a[t],i[s].x=l[2*t],i[s].y=l[2*t+1];return i}const eq=1e-10;function nq(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+eq?Math.abs(t-e):function(t,e,n,r){const i=(r=r||{}).maxIterations||100,o=r.tolerance||1e-10,a=t(e),s=t(n);let c=n-e;if(a*s>0)throw"Initial bisect points must have opposite signs";if(0===a)return e;if(0===s)return n;for(let n=0;n<i;++n){c/=2;const n=e+c,r=t(n);if(r*a>=0&&(e=n),Math.abs(c)<o||0===r)return n}return e+c}(function(r){return QY(t,e,r)-n},0,t+e)}function rq(t,e){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:iq,r={},i={};let o;for(let e=0;e<t.length;++e){const n=t[e];1==n.sets.length&&(o=n.sets[0],r[o]={x:1e10,y:1e10,rowid:Object.keys(r).length,size:n.size,radius:Math.sqrt(n.size/Math.PI)},i[o]=[])}t=t.filter(function(t){return 2==t.sets.length});for(let e=0;e<t.length;++e){const n=t[e];let o=n.hasOwnProperty("weight")?n.weight:1;const a=n.sets[0],s=n.sets[1];n.size+eq>=Math.min(r[a].size,r[s].size)&&(o=0),i[a].push({set:s,size:n.size,weight:o}),i[s].push({set:a,size:n.size,weight:o})}const a=[];for(o in i)if(i.hasOwnProperty(o)){let t=0;for(let e=0;e<i[o].length;++e)t+=i[o][e].size*i[o][e].weight;a.push({set:o,size:t})}function s(t,e){return e.size-t.size}a.sort(s);const c={};function l(t){return t.set in c}function u(t,e){r[e].x=t.x,r[e].y=t.y,c[e]=!0}u({x:0,y:0},a[0].set);for(let e=1;e<a.length;++e){const c=a[e].set,f=i[c].filter(l);if(o=r[c],f.sort(s),0===f.length)throw"ERROR: missing pairwise overlap information";const h=[];for(let t=0;t<f.length;++t){const e=r[f[t].set],n=nq(o.radius,e.radius,f[t].size);h.push({x:e.x+n,y:e.y}),h.push({x:e.x-n,y:e.y}),h.push({y:e.y+n,x:e.x}),h.push({y:e.y-n,x:e.x});for(let i=t+1;i<f.length;++i){const t=r[f[i].set],a=nq(o.radius,t.radius,f[i].size),s=JY({x:e.x,y:e.y,radius:n},{x:t.x,y:t.y,radius:a});for(let t=0;t<s.length;++t)h.push(s[t])}}let d=1e50,p=h[0];for(let e=0;e<h.length;++e){r[c].x=h[e].x,r[c].y=h[e].y;const i=n(r,t);i<d&&(d=i,p=h[e])}u(p,c)}return r}(t,e);const r=e.lossFunction||iq;if(t.length>=8){const i=function(t,e){e=e||{};const n=e.restarts||10,r=[],i={};let o;for(o=0;o<t.length;++o){const e=t[o];1==e.sets.length&&(i[e.sets[0]]=r.length,r.push(e))}const a=function(t,e,n){const r=$Y(e.length,e.length),i=$Y(e.length,e.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){const o=n[t.sets[0]],a=n[t.sets[1]],s=nq(Math.sqrt(e[o].size/Math.PI),Math.sqrt(e[a].size/Math.PI),t.size);r[o][a]=r[a][o]=s;let c=0;t.size+1e-10>=Math.min(e[o].size,e[a].size)?c=1:t.size<=1e-10&&(c=-1),i[o][a]=i[a][o]=c}),{distances:r,constraints:i}}(t,r,i);let s=a.distances;const c=a.constraints,l=GY(s.map(GY))/s.length;s=s.map(function(t){return t.map(function(t){return t/l})});const u=function(t,e){return function(t,e,n,r){let i,o=0;for(i=0;i<e.length;++i)e[i]=0;for(i=0;i<n.length;++i){const a=t[2*i],s=t[2*i+1];for(let c=i+1;c<n.length;++c){const l=t[2*c],u=t[2*c+1],f=n[i][c],h=r[i][c],d=(l-a)*(l-a)+(u-s)*(u-s),p=Math.sqrt(d),g=d-f*f;h>0&&p<=f||h<0&&p>=f||(o+=2*g*g,e[2*i]+=4*g*(a-l),e[2*i+1]+=4*g*(s-u),e[2*c]+=4*g*(l-a),e[2*c+1]+=4*g*(u-s))}}return o}(t,e,s,c)};let f,h;for(o=0;o<n;++o){h=VY(u,zY(2*s.length).map(Math.random),e),(!f||h.fx<f.fx)&&(f=h)}const d=f.x,p={};for(o=0;o<r.length;++o){const t=r[o];p[t.sets[0]]={x:d[2*o]*l,y:d[2*o+1]*l,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(o=0;o<e.history.length;++o)HY(e.history[o].x,l);return p}(t,e);r(i,t)+1e-8<r(n,t)&&(n=i)}return n}function iq(t,e){let n=0;function r(e){return e.map(function(e){return t[e]})}for(let i=0;i<e.length;++i){const o=e[i];let a;if(1==o.sets.length)continue;if(2==o.sets.length){const e=t[o.sets[0]],n=t[o.sets[1]];a=QY(e.radius,n.radius,ZY(e,n))}else a=XY(r(o.sets));n+=(o.hasOwnProperty("weight")?o.weight:1)*(a-o.size)*(a-o.size)}return n}function oq(t,e,n,r){const i=[],o=[];for(const e in t)t.hasOwnProperty(e)&&(o.push(e),i.push(t[e]));e-=2*r,n-=2*r;const a=function(t){const e=function(e){const n=Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),r=Math.min.apply(null,t.map(function(t){return t[e]-t.radius}));return{max:n,min:r}};return{xRange:e("x"),yRange:e("y")}}(i),s=a.xRange,c=a.yRange;if(s.max==s.min||c.max==c.min)return console.log("not scaling solution: zero size detected"),t;const l=e/(s.max-s.min),u=n/(c.max-c.min),f=Math.min(u,l),h=(e-(s.max-s.min)*f)/2,d=(n-(c.max-c.min)*f)/2,p={};for(let t=0;t<i.length;++t){const e=i[t];p[o[t]]={radius:f*e.radius,x:r+h+(e.x-s.min)*f,y:r+d+(e.y-c.min)*f}}return p}const aq=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:i=0}=t,[o,a]=r;return t=>{const r=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[o]:t.sets.join("&")}));r.sort((t,e)=>t.sets.length-e.sets.length);const s=tq(r);let c;return r.map(t=>{const n=t[e];return Object.assign(Object.assign({},t),{[a]:({width:t,height:e})=>{c=c||oq(s,t,e,i);const r=n.map(t=>c[t]);let o=function(t){const e={};XY(t,e);const n=e.arcs;if(0===n.length)return"M 0 0";if(1==n.length){const t=n[0].circle;return function(t,e,n){const r=[],i=t-n,o=e;return r.push("M",i,o),r.push("A",n,n,0,1,0,i+2*n,o),r.push("A",n,n,0,1,0,i,o),r.join(" ")}(t.x,t.y,t.radius)}{const t=["\nM",n[0].p2.x,n[0].p2.y];for(let e=0;e<n.length;++e){const r=n[e],i=r.circle.radius,o=r.width>i;t.push("\nA",i,i,0,o?1:0,1,r.p1.x,r.p1.y)}return t.join(" ")}}(r);return/[zZ]$/.test(o)||(o+=" Z"),o}})})}};aq.props={};const sq=()=>t=>(console.log("G2 data section:",t),t);sq.props={};const cq=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map(t=>t[e]),o=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const o=n*e+(1-e)*i;r.push(o),n=o}return r}(i,n);return t.map((t,e)=>Object.assign(Object.assign({},t),{[r]:o[e]}))}};cq.props={};function lq(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function uq(t,e,n=.01){const[r,i]=t,[o,a]=e;return r>=o[0]-n&&r<=a[0]+n&&i>=o[1]-n&&i<=a[1]+n}function fq(t,e,n=.01){const[r,i]=t;return!(uq(r,e,n)&&uq(i,e,n))}const hq=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach(t=>{NW(t);const e=t.getLocalBounds(),r=n.some(t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}(lq(e),lq(t.getLocalBounds())));r?CW(t):n.push(t)}),t}};function dq([t,e],[n,r]){return r>t&&e>n}function pq(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function gq(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const vq=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=pq(),[s,c]=pq(),[l,u]=pq(),[f,h]=pq();for(const e of t){const{min:t,max:n}=gq(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),h(e,[r,o])}for(let o=0;o<e;o++){t.sort((t,e)=>Fn(s(t),s(e)));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let o,a=n+1;for(;(o=t[a])&&!dq(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function mq(t){return"object"==typeof t?t:_h(t)}function yq(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function bq(t,e,n){return.2126*yq(t)+.7152*yq(e)+.0722*yq(n)}function xq(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=bq(n,r,i),l=bq(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function wq(t,e){const n=wr(e,e=>xq(t,mq(e)));return e[n]}const kq=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach(t=>{const r=t.attr("dependentElement").parsedStyle.fill;xq(t.parsedStyle.fill,r)<e&&t.attr("fill",wq(r,n))}),t)},Mq=()=>t=>(t.forEach(t=>{NW(t);const e=t.attr("bounds");fq(lq(t.getLocalBounds()),e)&&CW(t)}),t),Oq=(t={})=>(e,{canvas:n,layout:r})=>{const{bounds:i="view",offsetX:o=0,offsetY:a=0}=t,s=(()=>{if("main"===i){const{x:t=0,y:e=0,width:n=0,height:i=0,marginLeft:s=0,marginRight:c=0,marginTop:l=0,marginBottom:u=0,paddingLeft:f=0,paddingRight:h=0,paddingTop:d=0,paddingBottom:p=0}=r;return[[t+s+f+o,e+l+d+a],[t+n-c-h-o,e+i-u-p-a]]}{const{x:t=0,y:e=0,width:n=0,height:i=0}=r;return[[t+o,e+a],[t+n-o,e+i-a]]}})();return e.forEach(t=>{NW(t);const{max:e,min:n}=((t,e)=>({min:[Math.min(t.min[0],e.min[0]),Math.min(t.min[1],e.min[1])],max:[Math.max(t.max[0],e.max[0]),Math.max(t.max[1],e.max[1])]}))(t.getRenderBounds(),t.getBounds()),[r,i]=e,[o,a]=n,c=((t,e)=>{const[[n,r],[i,o]]=e,[[a,s],[c,l]]=t;let u=0,f=0;return a<n?u=n-a:c>i&&(u=i-c),s<r?f=r-s:l>o&&(f=o-l),[u,f]})([[o,a],[r,i]],s);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]}),e};function Eq(t){var e;const n=t.getAnimations();if(!n||0===n.length)return DW(t);const r=t.cloneNode(!0);r.style.visibility="hidden",n.forEach(t=>{const e=t.effect.getKeyframes();e&&e.length>0&&r.attr(e[e.length-1])}),null===(e=t.parentNode)||void 0===e||e.appendChild(r);const i=DW(r);return r.destroy(),i}const Sq=t=>{const{palette:e=["#000","#fff"],threshold:n=2}=t;return t=>(t.forEach(t=>{var r,i;const o=t.attr("dependentElement"),a=null!==(i=null!==(r=t.attributes.fill)&&void 0!==r?r:t.parsedStyle.fill)&&void 0!==i?i:"#fff";if(fq(lq(Eq(t)),lq(Eq(o)),n)){const n=wq(mq(a),e);t.attr("stroke",n)}else t.removeAttribute("stroke")}),t)};function _q(){return{"data.fetch":tY,"data.inline":cY,"data.sortBy":sY,"data.sort":iY,"data.filter":rY,"data.pick":oY,"data.rename":aY,"data.fold":eY,"data.slice":RY,"data.custom":lY,"data.map":uY,"data.join":jY,"data.kde":FY,"data.log":sq,"data.wordCloud":NY,"data.ema":cq,"transform.stackY":Sa,"transform.binX":Ys,"transform.bin":Hs,"transform.dodgeX":Ka,"transform.jitter":es,"transform.jitterX":ns,"transform.jitterY":rs,"transform.symmetryY":is,"transform.diffY":os,"transform.stackEnter":Za,"transform.normalizeY":Qa,"transform.select":us,"transform.selectX":fs,"transform.selectY":hs,"transform.groupX":Os,"transform.groupY":Es,"transform.groupColor":Ss,"transform.group":Ms,"transform.sortX":As,"transform.sortY":Ps,"transform.sortColor":Ts,"transform.flexX":Cs,"transform.pack":$s,"transform.sample":Vs,"transform.filter":Us,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":o,"coordinate.theta":a,"coordinate.parallel":l,"coordinate.fisheye":u,"coordinate.radial":c,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":h,"encode.field":p,"encode.transform":d,"encode.column":g,"mark.interval":nE,"mark.rect":iE,"mark.line":cE,"mark.point":uE,"mark.text":hE,"mark.cell":pE,"mark.area":vE,"mark.link":yE,"mark.image":xE,"mark.polygon":kE,"mark.box":OE,"mark.vector":SE,"mark.lineX":PE,"mark.lineY":AE,"mark.connector":NE,"mark.range":IE,"mark.rangeX":BE,"mark.rangeY":zE,"mark.path":kS,"mark.shape":Y_,"mark.density":JA,"mark.heatmap":eT,"mark.wordCloud":YA,"palette.category10":oT,"palette.category20":aT,"scale.linear":cT,"scale.ordinal":lT,"scale.band":sT,"scale.identity":uT,"scale.point":fT,"scale.time":hT,"scale.log":dT,"scale.pow":pT,"scale.sqrt":yT,"scale.threshold":gT,"scale.quantile":vT,"scale.quantize":mT,"scale.sequential":bT,"scale.constant":xT,"theme.classic":OT,"theme.classicDark":_T,"theme.academy":TT,"theme.light":MT,"theme.dark":ST,"component.axisX":sP,"component.axisY":cP,"component.legendCategory":vP,"component.legendContinuous":wP,"component.legends":WP,"component.title":AP,"component.sliderX":DP,"component.sliderY":BP,"component.scrollbarX":zP,"component.scrollbarY":$P,"animation.scaleInX":GP,"animation.scaleOutX":HP,"animation.scaleInY":YP,"animation.scaleOutY":qP,"animation.waveIn":cC,"animation.fadeIn":VP,"animation.fadeOut":UP,"animation.zoomIn":lC,"animation.zoomOut":uC,"animation.pathIn":fC,"animation.morphing":sC,"animation.growInX":hC,"animation.growInY":dC,"interaction.elementHighlight":uG,"interaction.elementHighlightByX":fG,"interaction.elementHighlightByColor":hG,"interaction.elementSelect":pG,"interaction.elementSelectByX":gG,"interaction.elementSelectByColor":vG,"interaction.fisheye":yG,"interaction.chartIndex":mG,"interaction.tooltip":zG,"interaction.legendFilter":ZG,"interaction.legendHighlight":QG,"interaction.brushHighlight":sH,"interaction.brushXHighlight":lH,"interaction.brushYHighlight":fH,"interaction.brushAxisHighlight":yH,"interaction.brushFilter":bH,"interaction.brushXFilter":xH,"interaction.brushYFilter":wH,"interaction.sliderFilter":SH,"interaction.sliderWheel":_H,"interaction.scrollbarFilter":TH,"interaction.poptip":LH,"interaction.treemapDrillDown":RH,"interaction.elementPointMove":HH,"composition.spaceLayer":yj,"composition.spaceFlex":bj,"composition.facetRect":Rj,"composition.repeatMatrix":$j,"composition.facetCircle":Vj,"composition.timingKeyframe":Xj,"labelTransform.overlapHide":hq,"labelTransform.overlapDodgeY":vq,"labelTransform.overflowHide":Mq,"labelTransform.contrastReverse":kq,"labelTransform.overflowStroke":Sq,"labelTransform.exceedAdjust":Oq}}function Aq(){return{"composition.geoView":ZD,"composition.geoPath":Kj}}function Tq(){return{"data.arc":gS,"data.cluster":BA,"mark.forceGraph":IA,"mark.tree":HA,"mark.pack":R_,"mark.sankey":fS,"mark.chord":xS,"mark.treemap":N_}}function Pq(){return{"data.venn":aq,"mark.boxplot":H_,"mark.gauge":ZA,"mark.wordCloud":YA,"mark.liquid":iT}}function Cq(){return Object.assign(Object.assign(Object.assign(Object.assign({},Aq()),Tq()),Pq()),_q())}function Nq(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const Lq={};const jq=t=>t?parseInt(t):0;function Rq(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class Iq{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map(n=>(n[t]=e,n))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex(t=>t===this);e.splice(n,1)}return this}getNodeByKey(t){let e=null;return Rq(this,n=>{t===n.attr("key")&&(e=n)}),e}getNodesByType(t){const e=[];return Rq(this,n=>{t===n.type&&e.push(n)}),e}getNodeByType(t){let e=null;return Rq(this,n=>{e||t===n.type&&(e=n)}),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const Dq=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],Bq="__remove__",Fq="__callback__";function zq(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function $q(t,e){const{width:n,height:r,autoFit:i,depth:o=0}=t;let a=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||jq(e.width),r=t.clientHeight||jq(e.height);return{width:n-(jq(e.paddingLeft)+jq(e.paddingRight)),height:r-(jq(e.paddingTop)+jq(e.paddingBottom))}}(e);a=t||a,s=n||s}return a=n||a,s=r||s,{width:Math.max(I(a)?a:1,1),height:Math.max(I(s)?s:1,1),depth:o}}function Wq(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of Dq)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,zq(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===Fq)e.children=t.value;else{const i=zq(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function Gq(t,e,n,r,i){const{type:o}=t,{type:a=n||o}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(a,i)){for(const n of Dq)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(a,r)){const t={type:"view"},n=Object.assign({},e);for(const e of Dq)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function Hq(t,e,n){if("function"==typeof t){const e=new Iq;return e.value=t,e.type=Fq,e}const{type:r,children:i}=t,o=Ie(t,["type","children"]),a=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new a;return s.value=o,s.type=r,s}function Yq(t,e){const{type:n,children:r}=e,i=Ie(e,["type","children"]);t.type===n||void 0===n?ua(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function qq(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=Hq(e,n,r);Array.isArray(t.children)&&t.push(o);const{children:a}=e;if(Array.isArray(a))for(const t of a)i.push([o,t]);else"function"==typeof a&&i.push([o,a])}}function Vq(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function Uq(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function Xq(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function Kq(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(ca(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function Zq(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function Qq(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function Jq(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?Vq(e,n,r):"array"===t?Uq(e,n,r):"object"===t?Xq(e,n,r):"node"===t?Zq(e,n,r):"container"===t?Qq(e,n,r):"mix"===t&&Kq(e,n)}return e}}function tV(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{type:"node",ctor:e}]))}const eV={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},nV=Object.assign(Object.assign({},eV),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),rV=Object.assign(Object.assign({},eV),{labelTransform:{type:"array"}});let iV=class extends Iq{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach(e=>{e.attr("data",t)}),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find(t=>t.key===this._key)}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&NW(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&CW(t)}};iV=De([Jq(rV)],iV);let oV=class extends Iq{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find(t=>t.key===this.attr("key"));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};oV=De([Jq(nV)],oV);const aV="G2_CHART_KEY";class sV extends iV{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o,createCanvas:a}=t;super(Ie(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailingClear=null,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=K(()=>{this.forceFit()},300),this._renderer=r||new _N,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[Bq]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new CN,this._context={library:Object.assign(Object.assign({},o),Lq),emitter:this._emitter,canvas:n,createCanvas:a},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise((t,e)=>EW(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let t,e;return[new Promise((n,r)=>{e=n,t=r}),e,t]}();return t.then(n).then(()=>{if(this._trailingClear){const t=this.options();this._trailingClear(),this._trailing&&this.options(t)}}).catch(r).then(()=>{this._trailingClear=null,this._renderTrailing()}),e}options(t){if(0===arguments.length)return Wq(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,Gq(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){Yq(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],a=r[i];o.push([e,a,n])}}else"function"==typeof t&&o.push([e,null,t])}else e.remove();else qq(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(t=!0){if(this._rendering)return this._trailingClear=()=>{this.clear(t)},void this._reset();this.options();this.emit(NN.BEFORE_CLEAR),this._reset(),SW(0,this._context,!1,t),this.emit(NN.AFTER_CLEAR)}destroy(){this.options();this.emit(NN.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),SW(0,this._context,!0),this._container[Bq]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(NN.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=$q(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(NN.BEFORE_CHANGE_SIZE);const n=this.render();return n.then(()=>{this.emit(NN.AFTER_CHANGE_SIZE)}),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(NN.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then(()=>{this.emit(NN.AFTER_CHANGE_SIZE)}),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:o=0,startY:a=0}=e,{canvas:s,views:c}=this._context,{document:l}=s,{x:u,y:f}=t,{coordinate:h,scale:d,markState:p,data:g,key:v}=c[0],m=l.getElementsByClassName(WO),y=n?t=>t.__data__.x:t=>t,b=rr(m,y),x=IW(l.getElementsByClassName(GO)[0]),w=t=>Array.from(t.values()).some(t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some(t=>"series"===t.name&&void 0!==t.values))}),k=RG(r,w(p)),M=t=>ot(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=BG({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,startX:o,startY:a}),e=g.get(`${v}-0`);return t.map(({index:t})=>e[t])}const t=DG({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,shared:n});if(Uo(t))return Xo(t,g.get(v));const e=y(t),r=b.get(e);return r?r.map(M):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?M(e):[]}}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter(t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t)];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends oV{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter(t=>t.startsWith("composition.")&&"composition.mark"!==t)];this._compositions=Object.fromEntries(n.map(t=>{const e=t.split(".").pop();let n=class extends iV{constructor(){super({},e)}};return n=De([Jq(tV(this._marks))],n),[e,n]}));for(const t of Object.values(this._compositions))Jq(tV(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=aV}=t,{width:n,height:r,depth:i}=$q(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=$q(this.options(),this._container);this._plugins.push(new TN),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new Nv({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e})}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const cV=Nq(sV,Object.assign({},Cq()));t.AREA_CLASS_NAME=VO,t.Academy=TT,t.Bin=Hs,t.BinX=Ys,t.COMPONENT_CLASS_NAME=YO,t.Chart=cV,t.ChartEvent=NN,t.Classic=OT,t.ClassicDark=_T,t.Dark=ST,t.DiffY=os,t.DodgeX=Ka,t.ELEMENT_CLASS_NAME=WO,t.Filter=Us,t.FlexX=Cs,t.Group=Ms,t.GroupColor=Ss,t.GroupX=Os,t.GroupY=Es,t.Jitter=es,t.JitterX=ns,t.JitterY=rs,t.LABEL_CLASS_NAME=qO,t.LABEL_LAYER_CLASS_NAME=$O,t.Light=MT,t.LinearAxis=oP,t.MAIN_LAYER_CLASS_NAME=zO,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Wa,t.MaybeDefaultY=Ga,t.MaybeFunctionAttribute=Va,t.MaybeGradient=Xa,t.MaybeIdentityX=$a,t.MaybeIdentityY=za,t.MaybeKey=Ia,t.MaybeSeries=Da,t.MaybeSize=Ra,t.MaybeStackY=Aa,t.MaybeTitle=Ca,t.MaybeTooltip=Ha,t.MaybeTuple=Ua,t.MaybeTupleX=Fa,t.MaybeTupleY=Ba,t.MaybeVisualPosition=qa,t.MaybeZeroPadding=Ya,t.MaybeZeroX=Na,t.MaybeZeroY=La,t.MaybeZeroY1=Bn,t.MaybeZeroZ=ja,t.NormalizeY=Qa,t.PLOT_CLASS_NAME=HO,t.Pack=$s,t.Runtime=sV,t.Sample=Vs,t.Select=us,t.SelectX=fs,t.SelectY=hs,t.Selection=Nm,t.SortColor=Ts,t.SortX=As,t.SortY=Ps,t.StackEnter=Za,t.StackY=Sa,t.SymmetryY=is,t.VIEW_CLASS_NAME=GO,t.corelib=_q,t.dataOf=Xo,t.extend=Nq,t.geolib=Aq,t.graphlib=Tq,t.plotlib=Pq,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,jy.set(n,r)):Object.assign(Lq,{[t]:e})},t.render=EW,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:o=640,height:a=480}=t,s=MW(t),{group:c=new rv,emitter:l=new CN,library:u}=e;(null==c?void 0:c.parentElement)||ta("renderToMountedElement can't render chart to unmounted group.");const f=Cm(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(NN.BEFORE_RENDER),q$(Object.assign(Object.assign({},s),{width:o,height:a}),f,e).then(()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame(()=>{l.emit(NN.AFTER_RENDER),null==n||n()})}).catch(t=>{null==r||r(t)}),c},t.select=Cm,t.selectG2Elements=LW,t.selectPlotArea=IW,t.seriesOf=function(t){const e=Vo(t).__data__,{scale:n}=e;return Ko(n,t.__data__)},t.stdlib=Cq,Object.defineProperty(t,"__esModule",{value:!0})});